]> granicus.if.org Git - python/commitdiff
Merged revisions 74728 via svnmerge from
authorTarek Ziadé <ziade.tarek@gmail.com>
Wed, 9 Sep 2009 08:48:07 +0000 (08:48 +0000)
committerTarek Ziadé <ziade.tarek@gmail.com>
Wed, 9 Sep 2009 08:48:07 +0000 (08:48 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74728 | tarek.ziade | 2009-09-09 10:14:20 +0200 (Wed, 09 Sep 2009) | 1 line

  Issue #6163: Fixed HP-UX runtime library dir options in distutils.unixcompiler
........

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 26d2856ad423e849c723f4f829ac3b82c25bd1aa..da85c89696b7880ca9c7c9dee039b4ab2e60a7a2 100644 (file)
@@ -283,7 +283,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 a1def5c565c2f33008311d1358672db5e60d349f..54dcbca79efc60665eb7b2786a0ad57a516dc64e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1046,6 +1046,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 #6693: New functions in site.py to get user/global site packages paths.
 
 - Issue #6511: ZipFile now raises BadZipfile (instead of an IOError) when