[3.10] bpo-45881: Use CC from env first for cross building (GH-29752). (GH-29753) by tiran · Pull Request #29753 · python/cpython
SUMMARY = """
def build_extensions(self): self.set_srcdir() self.set_compiler_executables() self.configure_compiler() self.init_inc_lib_dirs()
# Detect which modules should be compiled self.detect_modules()
self.update_sources_depends() mods_built, mods_disabled = self.remove_configured_extensions() self.set_compiler_executables()
if LIST_MODULE_NAMES: for ext in self.extensions:
cc = sysconfig.get_config_var('CC') tmpfile = os.path.join(self.build_temp, 'wrccpaths') os.makedirs(self.build_temp, exist_ok=True) try: ret = run_command('%s --print-search-dirs >%s' % (cc, tmpfile)) ret = run_command('%s --print-search-dirs >%s' % (CC, tmpfile)) if ret: return with open(tmpfile) as fp:
def add_cross_compiling_paths(self): cc = sysconfig.get_config_var('CC') tmpfile = os.path.join(self.build_temp, 'ccpaths') if not os.path.exists(self.build_temp): os.makedirs(self.build_temp) ret = run_command('%s -E -v - </dev/null 2>%s 1>/dev/null' % (cc, tmpfile)) ret = run_command('%s -E -v - </dev/null 2>%s 1>/dev/null' % (CC, tmpfile)) is_gcc = False is_clang = False in_incdirs = False
def detect_modules(self): self.configure_compiler() self.init_inc_lib_dirs()
self.detect_simple_extensions() if TEST_EXTENSIONS: self.detect_test_extensions()