View | Details | Raw Unified
Collapse All | Expand All

(-) Python-2.5.2.old1/Lib/distutils/unixccompiler.py (-5 / +9 lines)
 Lines 689-700   class CCompiler: Link Here 
                                    depends, extra_postargs)
                                    depends, extra_postargs)
        cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
        cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
        lang = self.detect_language(sources)
        for obj in objects:
        for obj in objects:
            try:
            try:
                src, ext = build[obj]
                src, ext = build[obj]
            except KeyError:
            except KeyError:
                continue
                continue
            self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
            self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts,
                          lang=lang)
        # Return *all* object filenames, not just the ones we just built.
        # Return *all* object filenames, not just the ones we just built.
        return objects
        return objects
 Lines 166-181   class UnixCCompiler(CCompiler): Link Here 
            except DistutilsExecError, msg:
            except DistutilsExecError, msg:
                raise CompileError, msg
                raise CompileError, msg
    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts,
                 lang='c'):
        compiler_so = self.compiler_so
        compiler_so = self.compiler_so
        compiler_cxx_so = self.compiler_cxx_so
        compiler_cxx_so = self.compiler_cxx_so
        if sys.platform == 'darwin':
        if sys.platform == 'darwin':
            compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
            compiler_so = _darwin_compiler_fixup(compiler_so, cc_args + extra_postargs)
        try:
        try:
            if ext == '.c' or ext == '.m':
            if lang == 'c++':
                cc = compiler_so + cc_args
            else:
                cc = compiler_cxx_so + cc_args
                cc = compiler_cxx_so + cc_args
            else:
                cc = compiler_so + cc_args
            self.spawn(cc + cc_args + [src, '-o', obj] +
            self.spawn(cc + cc_args + [src, '-o', obj] +
                       extra_postargs)
                       extra_postargs)
        except DistutilsExecError, msg:
        except DistutilsExecError, msg: