summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-01-26 23:22:04 (GMT)
committerGitHub <noreply@github.com>2022-01-26 23:22:04 (GMT)
commita9503ac39474a9cb1b1935ddf159c0d9672b04b6 (patch)
treedc4806f3cc90ea5fedc6bbf93c6ec9722708acf3 /setup.py
parent85483668647e7840c7b9a1877caaf2ef14a4443f (diff)
downloadcpython-a9503ac39474a9cb1b1935ddf159c0d9672b04b6.zip
cpython-a9503ac39474a9cb1b1935ddf159c0d9672b04b6.tar.gz
cpython-a9503ac39474a9cb1b1935ddf159c0d9672b04b6.tar.bz2
bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929)
Fix GCC detection in setup.py when cross-compiling. The C compiler is now run with LC_ALL=C. Previously, the detection failed with a German locale.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index e30674f..e47b2ab 100644
--- a/setup.py
+++ b/setup.py
@@ -848,7 +848,9 @@ class PyBuildExt(build_ext):
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))
+ # bpo-38472: With a German locale, GCC returns "gcc-Version 9.1.0
+ # (GCC)", whereas it returns "gcc version 9.1.0" with the C locale.
+ ret = run_command('LC_ALL=C %s -E -v - </dev/null 2>%s 1>/dev/null' % (CC, tmpfile))
is_gcc = False
is_clang = False
in_incdirs = False