--- gobject-introspection-1.78.1.old/giscanner/ccompiler.py +++ gobject-introspection-1.78.1/giscanner/ccompiler.py @@ -26,9 +26,7 @@ import sys import distutils -from distutils.msvccompiler import MSVCCompiler from distutils.unixccompiler import UnixCCompiler -from distutils.cygwinccompiler import Mingw32CCompiler from distutils.sysconfig import get_config_vars from distutils.sysconfig import customize_compiler as orig_customize_compiler @@ -175,42 +173,6 @@ self.compiler = distutils.ccompiler.new_compiler(compiler=compiler_name) customize_compiler(self.compiler) - # customize_compiler() from distutils only does customization - # for 'unix' compiler type. Also, avoid linking to msvcrxx.dll - # for MinGW builds as the dumper binary does not link to the - # Python DLL, but link to msvcrt.dll if necessary. - if isinstance(self.compiler, Mingw32CCompiler): - if self.compiler.dll_libraries != ['msvcrt']: - self.compiler.dll_libraries = [] - if self.compiler.preprocessor is None: - self.compiler.preprocessor = self.compiler.compiler + ['-E'] - - if self.check_is_msvc(): - # We trick distutils to believe that we are (always) using a - # compiler supplied by a Windows SDK, so that we avoid launching - # a new build environment to detect the compiler that is used to - # build Python itself, which is not desirable, so that we use the - # compiler commands (and env) as-is. - os.environ['DISTUTILS_USE_SDK'] = '1' - if 'MSSdk' not in os.environ: - if 'WindowsSDKDir' in os.environ: - os.environ['MSSdk'] = os.environ.get('WindowsSDKDir') - elif os.environ.get('VCInstallDir'): - os.environ['MSSdk'] = os.environ.get('VCInstallDir') - - if self.compiler.check_is_clang_cl(): - self.compiler_cmd = os.environ.get('CC').split()[0] - else: - self.compiler_cmd = 'cl.exe' - self._cflags_no_deprecation_warnings = "-wd4996" - else: - if (isinstance(self.compiler, Mingw32CCompiler)): - self.compiler_cmd = self.compiler.compiler[0] - else: - self.compiler_cmd = ' '.join(self.compiler.compiler) - - self._cflags_no_deprecation_warnings = "-Wno-deprecated-declarations" - def get_internal_link_flags(self, args, libtool, libraries, extra_libraries, libpaths, lib_dirs_envvar): # An "internal" link is where the library to be introspected # is being built in the current directory. @@ -453,7 +415,7 @@ return self.compiler.linker_exe def check_is_msvc(self): - return isinstance(self.compiler, MSVCCompiler) + return 0 # Private APIs def _set_cpp_options(self, options): @@ -475,12 +437,6 @@ macro_name = macro[:macro_index] macro_value = macro[macro_index + 1:] - # Somehow the quotes used in defining - # macros for compiling using distutils - # get dropped for MSVC builds, so - # escape the escape character. - if isinstance(self.compiler, MSVCCompiler): - macro_value = macro_value.replace('\"', '\\\"') macros.append((macro_name, macro_value)) elif option.startswith('-U'): macros.append((option[len('-U'):],))