summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-07-03 15:14:33 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2012-07-03 15:15:28 +0200
commita0add919873d6af805f3d70da57600f49a8f8cb3 (patch)
tree8ee9b29c88274bdac595cbf6f15dedc7a14c9938 /configure
parenta25a27817fc8796edd9181122e9aab7ab516751a (diff)
downloadnode-new-a0add919873d6af805f3d70da57600f49a8f8cb3.tar.gz
build: detect cc version with -dumpversion
The heuristic introduced in f78ce08 ("build: handle output of localized gcc or clang") does not handle "branded" versions of gcc, i.e. a gcc whose output has been customized by the distro vendor. Fixes #3601.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure14
1 files changed, 3 insertions, 11 deletions
diff --git a/configure b/configure
index 7bf4536e25..810d42309b 100755
--- a/configure
+++ b/configure
@@ -265,19 +265,11 @@ def target_arch():
def compiler_version():
proc = subprocess.Popen(CC.split() + ['--version'], stdout=subprocess.PIPE)
- version_line = proc.communicate()[0].split('\n')[0]
+ is_clang = 'clang' in proc.communicate()[0].split('\n')[0]
- if 'clang' in version_line:
- version, is_clang = version_line.split()[2], True
- elif 'gcc' in version_line:
- version, is_clang = version_line.split()[-1], False
- else:
- raise Exception(
- 'Unknown compiler. Please open an issue at ' +
- 'https://github.com/joyent/node/issues and ' +
- 'include the output of `%s --version`' % CC)
+ proc = subprocess.Popen(CC.split() + ['-dumpversion'], stdout=subprocess.PIPE)
+ version = tuple(map(int, proc.communicate()[0].split('.')))
- version = tuple(map(int, version.split('.')))
return (version, is_clang)