Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 145206 | Differences between
and this patch

Collapse All | Expand All

(-)Python-2.5.2/Lib/distutils/sysconfig.py (-5 / +11 lines)
Lines 146-154 def customize_compiler(compiler): Link Here
146
    varies across Unices and is stored in Python's Makefile.
146
    varies across Unices and is stored in Python's Makefile.
147
    """
147
    """
148
    if compiler.compiler_type == "unix":
148
    if compiler.compiler_type == "unix":
149
        (cc, cxx, opt, cflags, ccshared, ldshared, so_ext) = \
149
        (cc, cxx, opt, cflags, basecflags, ccshared, ldshared, so_ext,
150
            get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
150
            cxxflags) = (
151
                            'CCSHARED', 'LDSHARED', 'SO')
151
            get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', 'BASECFLAGS',
152
                            'CCSHARED', 'LDSHARED', 'SO', 'CXXFLAGS'))
152
153
153
        if os.environ.has_key('CC'):
154
        if os.environ.has_key('CC'):
154
            cc = os.environ['CC']
155
            cc = os.environ['CC']
Lines 163-181 def customize_compiler(compiler): Link Here
163
        if os.environ.has_key('LDFLAGS'):
164
        if os.environ.has_key('LDFLAGS'):
164
            ldshared = ldshared + ' ' + os.environ['LDFLAGS']
165
            ldshared = ldshared + ' ' + os.environ['LDFLAGS']
165
        if os.environ.has_key('CFLAGS'):
166
        if os.environ.has_key('CFLAGS'):
166
            cflags = opt + ' ' + os.environ['CFLAGS']
167
            cflags = basecflags + ' ' + os.environ['CFLAGS']
167
            ldshared = ldshared + ' ' + os.environ['CFLAGS']
168
            ldshared = ldshared + ' ' + os.environ['CFLAGS']
168
        if os.environ.has_key('CPPFLAGS'):
169
        if os.environ.has_key('CPPFLAGS'):
169
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
170
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
170
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
171
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
171
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
172
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
173
        if os.environ.has_key('CXXFLAGS'):
174
            cxxflags = basecflags + ' ' + os.environ['CXXFLAGS']
172
175
173
        cc_cmd = cc + ' ' + cflags
176
        cc_cmd = cc + ' ' + cflags
177
        cxx_cmd = cxx + ' ' + cxxflags
174
        compiler.set_executables(
178
        compiler.set_executables(
175
            preprocessor=cpp,
179
            preprocessor=cpp,
176
            compiler=cc_cmd,
180
            compiler=cc_cmd,
177
            compiler_so=cc_cmd + ' ' + ccshared,
181
            compiler_so=cc_cmd + ' ' + ccshared,
178
            compiler_cxx=cxx,
182
            compiler_cxx=cxx_cmd,
183
            compiler_cxx_so=cxx_cmd + ' ' + ccshared,
179
            linker_so=ldshared,
184
            linker_so=ldshared,
180
            linker_exe=cc)
185
            linker_exe=cc)
181
186
Lines 512-517 def get_config_vars(*args): Link Here
512
                for key in ('LDFLAGS', 'BASECFLAGS',
517
                for key in ('LDFLAGS', 'BASECFLAGS',
513
                        # a number of derived variables. These need to be
518
                        # a number of derived variables. These need to be
514
                        # patched up as well.
519
                        # patched up as well.
520
                        'CXXFLAGS',
515
                        'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
521
                        'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
516
522
517
                    flags = _config_vars[key]
523
                    flags = _config_vars[key]
(-)Python-2.5.2/Lib/distutils/unixccompiler.py (-1 / +7 lines)
Lines 114-119 class UnixCCompiler(CCompiler): Link Here
114
                   'compiler'     : ["cc"],
114
                   'compiler'     : ["cc"],
115
                   'compiler_so'  : ["cc"],
115
                   'compiler_so'  : ["cc"],
116
                   'compiler_cxx' : ["cc"],
116
                   'compiler_cxx' : ["cc"],
117
		   'compiler_cxx_so' : ["cc"],
117
                   'linker_so'    : ["cc", "-shared"],
118
                   'linker_so'    : ["cc", "-shared"],
118
                   'linker_exe'   : ["cc"],
119
                   'linker_exe'   : ["cc"],
119
                   'archiver'     : ["ar", "-cr"],
120
                   'archiver'     : ["ar", "-cr"],
Lines 167-176 class UnixCCompiler(CCompiler): Link Here
167
168
168
    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
169
    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
169
        compiler_so = self.compiler_so
170
        compiler_so = self.compiler_so
171
        compiler_cxx_so = self.compiler_cxx_so
170
        if sys.platform == 'darwin':
172
        if sys.platform == 'darwin':
171
            compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
173
            compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
172
        try:
174
        try:
173
            self.spawn(compiler_so + cc_args + [src, '-o', obj] +
175
            if ext == '.c' or ext == '.m':
176
                cc = compiler_so + cc_args
177
            else:
178
                cc = compiler_cxx_so + cc_args
179
            self.spawn(cc + cc_args + [src, '-o', obj] +
174
                       extra_postargs)
180
                       extra_postargs)
175
        except DistutilsExecError, msg:
181
        except DistutilsExecError, msg:
176
            raise CompileError, msg
182
            raise CompileError, msg

Return to bug 145206