diff -r 2ec9e65d94b4 Lib/distutils/sysconfig.py --- a/Lib/distutils/sysconfig.py Mon Aug 16 02:28:05 2010 +0200 +++ b/Lib/distutils/sysconfig.py Sat Aug 21 19:41:52 2010 +0200 @@ -160,8 +160,9 @@ def customize_compiler(compiler): varies across Unices and is stored in Python's Makefile. """ if compiler.compiler_type == "unix": - (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \ - get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', + (cc, cxx, opt, cflags, ldflags, + ccshared, ldshared, so_ext, ar, ar_flags) = \ + get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', 'LDFLAGS', 'CCSHARED', 'LDSHARED', 'SO', 'AR', 'ARFLAGS') if 'CC' in os.environ: @@ -175,14 +176,14 @@ def customize_compiler(compiler): else: cpp = cc + " -E" # not always if 'LDFLAGS' in os.environ: - ldshared = ldshared + ' ' + os.environ['LDFLAGS'] + ldflags = os.environ['LDFLAGS'] if 'CFLAGS' in os.environ: cflags = opt + ' ' + os.environ['CFLAGS'] - ldshared = ldshared + ' ' + os.environ['CFLAGS'] + ldflags = ldflags + ' ' + os.environ['CFLAGS'] # XXX why? if 'CPPFLAGS' in os.environ: cpp = cpp + ' ' + os.environ['CPPFLAGS'] - cflags = cflags + ' ' + os.environ['CPPFLAGS'] - ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] + cflags = cflags + ' ' + os.environ['CPPFLAGS'] # XXX why? + ldflags = ldflags + ' ' + os.environ['CPPFLAGS'] # XXX why? if 'AR' in os.environ: ar = os.environ['AR'] if 'ARFLAGS' in os.environ: @@ -191,13 +192,14 @@ def customize_compiler(compiler): archiver = ar + ' ' + ar_flags cc_cmd = cc + ' ' + cflags + ldshared_cmd = ldshared + ' ' + ldflags compiler.set_executables( preprocessor=cpp, compiler=cc_cmd, compiler_so=cc_cmd + ' ' + ccshared, compiler_cxx=cxx, - linker_so=ldshared, - linker_exe=cc, + linker_so=ldshared_cmd, + linker_exe=cc, # XXX doesn't inherit any flags? archiver=archiver) compiler.shared_lib_extension = so_ext