summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2013-01-17 11:49:34 (GMT)
committerStefan Krah <skrah@bytereef.org>2013-01-17 11:49:34 (GMT)
commit13fe6d1c466a7c73dea0c8019164d713c5d5d565 (patch)
treec17f498204f8b825bacd8f7f67e6d75449c10db5 /setup.py
parent897c3e994f7ae7a219c5956d304f75ba8dec1583 (diff)
downloadcpython-13fe6d1c466a7c73dea0c8019164d713c5d5d565.zip
cpython-13fe6d1c466a7c73dea0c8019164d713c5d5d565.tar.gz
cpython-13fe6d1c466a7c73dea0c8019164d713c5d5d565.tar.bz2
Fix build with 3.x gcc versions.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 3bbd623..4d69326 100644
--- a/setup.py
+++ b/setup.py
@@ -1997,8 +1997,12 @@ class PyBuildExt(build_ext):
# Increase warning level for gcc:
if 'gcc' in cc:
- extra_compile_args.extend(['-Wextra',
- '-Wno-missing-field-initializers'])
+ cmd = ("echo '' | gcc -Wextra -Wno-missing-field-initializers -E - "
+ "> /dev/null 2>&1")
+ ret = os.system(cmd)
+ if ret >> 8 == 0:
+ extra_compile_args.extend(['-Wextra',
+ '-Wno-missing-field-initializers'])
# Uncomment for extra functionality:
#define_macros.append(('EXTRA_FUNCTIONALITY', 1))