]> granicus.if.org Git - python/commitdiff
Merged revisions 73490 via svnmerge from
authorTarek Ziadé <ziade.tarek@gmail.com>
Sun, 28 Jun 2009 21:30:52 +0000 (21:30 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Sun, 28 Jun 2009 21:30:52 +0000 (21:30 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73490 | tarek.ziade | 2009-06-20 15:57:20 +0200 (Sat, 20 Jun 2009) | 1 line

  Fixed #6164 AIX specific linker argument in Distutils unixcompiler
........

Lib/distutils/tests/test_unixccompiler.py
Lib/distutils/unixccompiler.py
Misc/NEWS

index 94e9edfc094ef9998104d6f0e718a6c2923baa59..96f5454e3ec74520ad283091a965f31668a8a364 100644 (file)
@@ -86,6 +86,14 @@ class UnixCCompilerTestCase(unittest.TestCase):
         sysconfig.get_config_var = gcv
         self.assertEqual(self.cc.rpath_foo(), '-R/foo')
 
+        # AIX C/C++ linker
+        sys.platform = 'aix'
+        def gcv(v):
+            return 'xxx'
+        sysconfig.get_config_var = gcv
+        self.assertEqual(self.cc.rpath_foo(), '-blibpath:/foo')
+
+
 def test_suite():
     return unittest.makeSuite(UnixCCompilerTestCase)
 
index c11544d8283b1d4f40e46efc033fddff3c0073dd..26d2856ad423e849c723f4f829ac3b82c25bd1aa 100644 (file)
@@ -286,23 +286,24 @@ class UnixCCompiler(CCompiler):
             return "+s -L" + dir
         elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5":
             return ["-rpath", dir]
-        else:
-            if compiler[:3] == "gcc" or compiler[:3] == "g++":
-                # gcc on non-GNU systems does not need -Wl, but can
-                # use it anyway.  Since distutils has always passed in
-                # -Wl whenever gcc was used in the past it is probably
-                # safest to keep doing so.
-                if sysconfig.get_config_var("GNULD") == "yes":
-                    # GNU ld needs an extra option to get a RUNPATH
-                    # instead of just an RPATH.
-                    return "-Wl,--enable-new-dtags,-R" + dir
-                else:
-                    return "-Wl,-R" + dir
+        elif compiler[:3] == "gcc" or compiler[:3] == "g++":
+            # gcc on non-GNU systems does not need -Wl, but can
+            # use it anyway.  Since distutils has always passed in
+            # -Wl whenever gcc was used in the past it is probably
+            # safest to keep doing so.
+            if sysconfig.get_config_var("GNULD") == "yes":
+                # GNU ld needs an extra option to get a RUNPATH
+                # instead of just an RPATH.
+                return "-Wl,--enable-new-dtags,-R" + dir
             else:
-                # No idea how --enable-new-dtags would be passed on to
-                # ld if this system was using GNU ld.  Don't know if a
-                # system like this even exists.
-                return "-R" + dir
+                return "-Wl,-R" + dir
+        elif sys.platform[:3] == "aix":
+            return "-blibpath:" + dir
+        else:
+            # No idea how --enable-new-dtags would be passed on to
+            # ld if this system was using GNU ld.  Don't know if a
+            # system like this even exists.
+            return "-R" + dir
 
     def library_option(self, lib):
         return "-l" + lib
index 2ba1036fca441fcbdaf6514623779cf08aa676bb..91a47dac167755099252cb4f714119e353c3227e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -839,6 +839,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #6164: Added an AIX specific linker argument in Distutils 
+  unixcompiler. Original patch by Sridhar Ratnakumar.
+
 - Issue #6286: Now Distutils upload command is based on urllib2 instead of
   httplib, allowing the usage of http_proxy.