diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-03-05 00:16:02 +0000 |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-03-05 00:16:02 +0000 |
commit | dd7bef9bf56933851e68094ffc70f8f20bc6b036 (patch) | |
tree | fc0fa4408ec4561140c4a9a4c4290e5d4eb6def6 /Lib/distutils/unixccompiler.py | |
parent | ab5e17f8964bfb9b73566180e27410520d2391d4 (diff) | |
download | cpython-git-dd7bef9bf56933851e68094ffc70f8f20bc6b036.tar.gz |
reverting partially distutils to its 2.6.x state so 2.7a4 looks more like the 2.7b1 in this. the whole revert will occur after a4 is tagged
Diffstat (limited to 'Lib/distutils/unixccompiler.py')
-rw-r--r-- | Lib/distutils/unixccompiler.py | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index 8fe1a6a13a..783d4dca84 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -18,6 +18,7 @@ __revision__ = "$Id$" import os, sys from types import StringType, NoneType +from distutils import sysconfig from distutils.dep_util import newer from distutils.ccompiler import \ CCompiler, gen_preprocess_options, gen_lib_options @@ -25,7 +26,6 @@ from distutils.errors import \ DistutilsExecError, CompileError, LibError, LinkError from distutils import log - # XXX Things not currently handled: # * optimization/debug/warning flags; we just use whatever's in Python's # Makefile and live with it. Is this adequate? If not, we might @@ -75,7 +75,7 @@ def _darwin_compiler_fixup(compiler_so, cc_args): if 'ARCHFLAGS' in os.environ and not stripArch: # User specified different -arch flags in the environ, - # see also the sysconfig + # see also distutils.sysconfig compiler_so = compiler_so + os.environ['ARCHFLAGS'].split() if stripSysroot: @@ -276,16 +276,13 @@ class UnixCCompiler(CCompiler): # Linkers on different platforms need different options to # specify that directories need to be added to the list of # directories searched for dependencies when a dynamic library - # is sought. GCC on GNU systems (Linux, FreeBSD, ...) has to - # be told to pass the -R option through to the linker, whereas - # other compilers and gcc on other systems just know this. + # is sought. GCC has to be told to pass the -R option through + # to the linker, whereas other compilers just know this. # Other compilers may need something slightly different. At # this time, there's no way to determine this information from # the configuration data stored in the Python installation, so # we use this hack. - _sysconfig = __import__('sysconfig') - - compiler = os.path.basename(_sysconfig.get_config_var("CC")) + compiler = os.path.basename(sysconfig.get_config_var("CC")) if sys.platform[:6] == "darwin": # MacOSX's linker doesn't understand the -R flag at all return "-L" + dir @@ -296,22 +293,8 @@ class UnixCCompiler(CCompiler): elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5": return ["-rpath", dir] elif self._is_gcc(compiler): - # 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 sys.platform[:3] == "aix": - return "-blibpath:" + dir + return "-Wl,-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 def library_option(self, lib): |