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/ccompiler.py (-1 / +4 lines)
Lines 689-700 class CCompiler: Link Here
689
                                    depends, extra_postargs)
689
                                    depends, extra_postargs)
690
        cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
690
        cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
691
691
692
        lang = self.detect_language(sources)
693
692
        for obj in objects:
694
        for obj in objects:
693
            try:
695
            try:
694
                src, ext = build[obj]
696
                src, ext = build[obj]
695
            except KeyError:
697
            except KeyError:
696
                continue
698
                continue
697
            self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
699
            self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts,
700
                          lang=lang)
698
701
699
        # Return *all* object filenames, not just the ones we just built.
702
        # Return *all* object filenames, not just the ones we just built.
700
        return objects
703
        return objects
(-)Python-2.5.2/Lib/distutils/sysconfig.py (-4 / +9 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, ccshared, ldshared, so_ext, cxxflags) = (
150
            get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
150
            get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', 'CCSHARED',
151
                            'CCSHARED', 'LDSHARED', 'SO')
151
                            'LDSHARED', 'SO', 'CXXFLAGS'))
152
152
153
        if os.environ.has_key('CC'):
153
        if os.environ.has_key('CC'):
154
            cc = os.environ['CC']
154
            cc = os.environ['CC']
Lines 169-181 def customize_compiler(compiler): Link Here
169
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
169
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
170
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
170
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
171
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
171
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
172
        if os.environ.has_key('CXXFLAGS'):
173
            cxxflags = opt + ' ' + os.environ['CXXFLAGS']
172
174
173
        cc_cmd = cc + ' ' + cflags
175
        cc_cmd = cc + ' ' + cflags
176
        cxx_cmd = cxx + ' ' + cxxflags
174
        compiler.set_executables(
177
        compiler.set_executables(
175
            preprocessor=cpp,
178
            preprocessor=cpp,
176
            compiler=cc_cmd,
179
            compiler=cc_cmd,
177
            compiler_so=cc_cmd + ' ' + ccshared,
180
            compiler_so=cc_cmd + ' ' + ccshared,
178
            compiler_cxx=cxx,
181
            compiler_cxx=cxx_cmd,
182
            compiler_cxx_so=cxx_cmd + ' ' + ccshared,
179
            linker_so=ldshared,
183
            linker_so=ldshared,
180
            linker_exe=cc)
184
            linker_exe=cc)
181
185
Lines 512-517 def get_config_vars(*args): Link Here
512
                for key in ('LDFLAGS', 'BASECFLAGS',
516
                for key in ('LDFLAGS', 'BASECFLAGS',
513
                        # a number of derived variables. These need to be
517
                        # a number of derived variables. These need to be
514
                        # patched up as well.
518
                        # patched up as well.
519
                        'CXXFLAGS',
515
                        'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
520
                        'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'):
516
521
517
                    flags = _config_vars[key]
522
                    flags = _config_vars[key]
(-)Python-2.5.2/Lib/distutils/unixccompiler.py (-2 / +9 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 165-176 class UnixCCompiler(CCompiler): Link Here
165
            except DistutilsExecError, msg:
166
            except DistutilsExecError, msg:
166
                raise CompileError, msg
167
                raise CompileError, msg
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,
170
                 lang='c'):
169
        compiler_so = self.compiler_so
171
        compiler_so = self.compiler_so
172
        compiler_cxx_so = self.compiler_cxx_so
170
        if sys.platform == 'darwin':
173
        if sys.platform == 'darwin':
171
            compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
174
            compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
172
        try:
175
        try:
173
            self.spawn(compiler_so + cc_args + [src, '-o', obj] +
176
            if lang == 'c++':
177
                cc = compiler_cxx_so + cc_args
178
            else:
179
                cc = compiler_so + cc_args
180
            self.spawn(cc + cc_args + [src, '-o', obj] +
174
                       extra_postargs)
181
                       extra_postargs)
175
        except DistutilsExecError, msg:
182
        except DistutilsExecError, msg:
176
            raise CompileError, msg
183
            raise CompileError, msg

Return to bug 145206