@@ -1054,8 +1054,9 @@ def generate_target(self, target):
10541054 #In AIX, we archive shared libraries. If the instance is a shared library, we add a command to archive the shared library
10551055 #object and create the build element.
10561056 if isinstance (target , build .SharedLibrary ) and self .environment .machines [target .for_machine ].is_aix ():
1057- elem = NinjaBuildElement (self .all_outputs , linker .get_archive_name (outname ), 'AIX_LINKER' , [outname ])
1058- self .add_build (elem )
1057+ if target .aix_so_archive :
1058+ elem = NinjaBuildElement (self .all_outputs , linker .get_archive_name (outname ), 'AIX_LINKER' , [outname ])
1059+ self .add_build (elem )
10591060
10601061 def should_use_dyndeps_for_target (self , target : 'build.BuildTarget' ) -> bool :
10611062 if mesonlib .version_compare (self .ninja_version , '<1.10.0' ):
@@ -3505,11 +3506,6 @@ def generate_link(self, target: build.BuildTarget, outname, obj_list, linker: T.
35053506 else :
35063507 dependencies = target .get_dependencies ()
35073508 internal = self .build_target_link_arguments (linker , dependencies )
3508- #In AIX since shared libraries are archived the dependencies must
3509- #depend on .a file with the .so and not directly on the .so file.
3510- if self .environment .machines [target .for_machine ].is_aix ():
3511- for i , val in enumerate (internal ):
3512- internal [i ] = linker .get_archive_name (val )
35133509 commands += internal
35143510 # Only non-static built targets need link args and link dependencies
35153511 if not isinstance (target , build .StaticLibrary ):
@@ -3714,7 +3710,7 @@ def generate_ending(self):
37143710 # Add the first output of each target to the 'all' target so that
37153711 # they are all built
37163712 #Add archive file if shared library in AIX for build all.
3717- if isinstance (t , build .SharedLibrary ):
3713+ if isinstance (t , build .SharedLibrary ) and t . aix_so_archive :
37183714 if self .environment .machines [t .for_machine ].is_aix ():
37193715 linker , stdlib_args = self .determine_linker_and_stdlib_args (t )
37203716 t .get_outputs ()[0 ] = linker .get_archive_name (t .get_outputs ()[0 ])
0 commit comments