diff options
author | lloyd <[email protected]> | 2010-05-20 14:48:02 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-05-20 14:48:02 +0000 |
commit | d3d0a5d3872653f71529bb546c8116f663ae8b32 (patch) | |
tree | 087bf50aa178a9392c73acc04a8e8c6a6ec5fc9c /configure.py | |
parent | a5963cd67f92ab9c1ee34d0c797cbcc8bd447b31 (diff) |
Use -dumpversion instead of -v for detecting the GCC version. This
work at least as far back as 3.2.3. And GCC's manual for -dumpversion
says "Print the compiler version (for example, `3.0')", which suggests
it works at least that far back, which is good enough (almost
certainly GCC 2.95 can't compile botan, in any case).
Also print the detected version.
Make an error (being unable to executed GCC) a warning instead of a
info message.
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/configure.py b/configure.py index d81096d00..5b0334378 100755 --- a/configure.py +++ b/configure.py @@ -1511,18 +1511,19 @@ def main(argv = None): if not is_64bit_arch(options.arch) and not options.dumb_gcc: try: - matching_version = '(4\.[01234]\.)|(3\.[34]\.)|(2\.95\.[0-4])' - gcc_version = ''.join( - subprocess.Popen(['g++', '-v'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE).communicate()) + gcc_version = ''.join(subprocess.Popen( + ['g++', '-dumpversion'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE).communicate()).strip() + + logging.info('Detected GCC version %s' % (gcc_version)) if re.search(matching_version, gcc_version): options.dumb_gcc = True - except OSError, e: - logging.info('Could not execute GCC for version check') + except OSError: + logging.warning('Could not execute GCC for version check') if options.dumb_gcc is True: logging.info('Setting -fpermissive to work around gcc bug') |