]> granicus.if.org Git - python/commitdiff
Issue #6163: Fixed HP-UX runtime library dir options in distutils.unixcompiler
authorTarek Ziadé <ziade.tarek@gmail.com>
Wed, 9 Sep 2009 08:14:20 +0000 (08:14 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Wed, 9 Sep 2009 08:14:20 +0000 (08:14 +0000)
Lib/distutils/tests/test_unixccompiler.py
Lib/distutils/unixccompiler.py
Misc/NEWS

index 96f5454e3ec74520ad283091a965f31668a8a364..1b7dd4cd645f36d6a98f5f4a6fd947e212674206 100644 (file)
@@ -36,7 +36,23 @@ class UnixCCompilerTestCase(unittest.TestCase):
 
         # hp-ux
         sys.platform = 'hp-ux'
-        self.assertEqual(self.cc.rpath_foo(), '+s -L/foo')
+        old_gcv = sysconfig.get_config_var
+        def gcv(v):
+            return 'xxx'
+        sysconfig.get_config_var = gcv
+        self.assertEqual(self.cc.rpath_foo(), ['+s', '-L/foo'])
+
+        def gcv(v):
+            return 'gcc'
+        sysconfig.get_config_var = gcv
+        self.assertEqual(self.cc.rpath_foo(), ['-Wl,+s', '-L/foo'])
+
+        def gcv(v):
+            return 'g++'
+        sysconfig.get_config_var = gcv
+        self.assertEqual(self.cc.rpath_foo(), ['-Wl,+s', '-L/foo'])
+
+        sysconfig.get_config_var = old_gcv
 
         # irix646
         sys.platform = 'irix646'
index 129ac8cf11889ea2976c89c22f331d09bc4ce291..2083f829829cb8d96a3234ca12d8e08161b37648 100644 (file)
@@ -285,7 +285,9 @@ class UnixCCompiler(CCompiler):
             # MacOSX's linker doesn't understand the -R flag at all
             return "-L" + dir
         elif sys.platform[:5] == "hp-ux":
-            return "+s -L" + dir
+            if "gcc" in compiler or "g++" in compiler:
+                return ["-Wl,+s", "-L" + dir]
+            return ["+s", "-L" + dir]
         elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5":
             return ["-rpath", dir]
         elif compiler[:3] == "gcc" or compiler[:3] == "g++":
index 5b167460613a2df8b6929e4cecd2b2e3efa00bd0..4c382181483b04af000ad9f31df10d7b08046ee9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -366,6 +366,10 @@ Core and Builtins
 Library
 -------
 
+- Issue #6163: Fixed HP-UX runtime library dir options in
+  distutils.unixcompiler. Initial patch by Sridhar Ratnakumar and
+  Michael Haubenwallner.
+
 - Issue #6857: Default format() alignment should be '>' for Decimal
   instances.