diff options
author | Greg Ward <gward@python.net> | 2000-06-25 02:09:14 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-06-25 02:09:14 (GMT) |
commit | bb7baa793dc8dbfa00ee6253dd61c35457736fb8 (patch) | |
tree | ad86a3621818e2c7bceda1114601f065a52cae6a /Lib/distutils | |
parent | e5c62bf6e872730388265932ca042ae7df0684f2 (diff) | |
download | cpython-bb7baa793dc8dbfa00ee6253dd61c35457736fb8.zip cpython-bb7baa793dc8dbfa00ee6253dd61c35457736fb8.tar.gz cpython-bb7baa793dc8dbfa00ee6253dd61c35457736fb8.tar.bz2 |
Added the 'customize_compiler()' function, which plugs in the essential
information about building Python extensions that we discovered in
Python's makefile. Currently only needed on Unix, so does nothing on
other systems.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/sysconfig.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 53da482..330d3b3 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -97,6 +97,23 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): # get_python_lib() +def customize_compiler (compiler): + """Do any platform-specific customization of the CCompiler instance + 'compiler'. Mainly needed on Unix, so we can plug in the information + that varies across Unices and is stored in Python's Makefile. + """ + if compiler.compiler_type == "unix": + cc_cmd = CC + ' ' + OPT + compiler.set_executables( + preprocessor=CC + " -E", # not always! + compiler=cc_cmd, + compiler_so=cc_cmd + ' ' + CCSHARED, + linker_so=LDSHARED, + linker_exe=CC) + + compiler.shared_lib_extension = SO + + def get_config_h_filename(): """Return full pathname of installed config.h file.""" inc_dir = get_python_inc(plat_specific=1) @@ -260,6 +277,9 @@ def _init_nt(): # Windows. UnixCCompiler expects to find these values in sysconfig, so # here they are. The fact that other Windows compilers don't need # these values is pure luck (hmmm). + + # XXX I think these are now unnecessary... + g['CC'] = "cc" # not gcc? g['RANLIB'] = "ranlib" g['AR'] = "ar" |