summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-09-09 08:48:07 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-09-09 08:48:07 (GMT)
commit165581cb3601f1754ce0e8e89953b896f3f1f281 (patch)
tree098de7976cb577fe74b72822b2ee2aeda17fdecd
parent46ab5d09518286aabdd57f67bfd2ae7a6451afa2 (diff)
downloadcpython-165581cb3601f1754ce0e8e89953b896f3f1f281.zip
cpython-165581cb3601f1754ce0e8e89953b896f3f1f281.tar.gz
cpython-165581cb3601f1754ce0e8e89953b896f3f1f281.tar.bz2
Merged revisions 74728 via svnmerge from
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 ........
-rw-r--r--Lib/distutils/tests/test_unixccompiler.py18
-rw-r--r--Lib/distutils/unixccompiler.py4
-rw-r--r--Misc/NEWS4
3 files changed, 24 insertions, 2 deletions
diff --git a/Lib/distutils/tests/test_unixccompiler.py b/Lib/distutils/tests/test_unixccompiler.py
index 96f5454..1b7dd4c 100644
--- a/Lib/distutils/tests/test_unixccompiler.py
+++ b/Lib/distutils/tests/test_unixccompiler.py
@@ -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'
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index 26d2856..da85c89 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -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++":
diff --git a/Misc/NEWS b/Misc/NEWS
index a1def5c..54dcbca 100644
--- 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