diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-01-23 09:23:15 +0000 |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-01-23 09:23:15 +0000 |
commit | 5633a8048fd8d59c9b23c98fb7e6419689b06316 (patch) | |
tree | e87ecd54a7197d6cd69ef0d82ae7dd7f8941c9a9 /Lib/distutils/unixccompiler.py | |
parent | c3b0cd75b22aa09bd849a74fb92e22ba831dfcd4 (diff) | |
download | cpython-git-5633a8048fd8d59c9b23c98fb7e6419689b06316.tar.gz |
taking sysconfig out of distutils
Diffstat (limited to 'Lib/distutils/unixccompiler.py')
-rw-r--r-- | Lib/distutils/unixccompiler.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index 67adcfcf97..8fe1a6a13a 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -18,7 +18,6 @@ __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 @@ -26,6 +25,7 @@ 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 distutils.sysconfig + # see also the sysconfig compiler_so = compiler_so + os.environ['ARCHFLAGS'].split() if stripSysroot: @@ -283,7 +283,9 @@ class UnixCCompiler(CCompiler): # this time, there's no way to determine this information from # the configuration data stored in the Python installation, so # we use this hack. - compiler = os.path.basename(sysconfig.get_config_var("CC")) + _sysconfig = __import__('sysconfig') + + 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 @@ -298,7 +300,7 @@ class UnixCCompiler(CCompiler): # 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": + 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 |