From fa8fe0047479257d5ab30db14f5c718844feb0a1 Mon Sep 17 00:00:00 2001 From: lloyd Date: Fri, 31 Jul 2009 13:46:16 +0000 Subject: If GCC was not installed configure.py would attempt to execute it on 32-bit machines (for the version check if -fpermissive is needed) and then fail with an uncaught exception when subprocess.Popen signaled the problem. Instead note the failure and carry on. --- configure.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/configure.py b/configure.py index a1cacb6c8..c92850cda 100755 --- a/configure.py +++ b/configure.py @@ -1038,14 +1038,19 @@ def main(argv = None): return False if not is_64bit_arch(options.arch) and not options.dumb_gcc: - gcc_version = ''.join( - subprocess.Popen(['g++', '-v'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE).communicate()) - - if re.search('(4\.[01234]\.)|(3\.[34]\.)|(2\.95\.[0-4])', - gcc_version): - options.dumb_gcc = True + 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()) + + if re.search(matching_version, gcc_version): + options.dumb_gcc = True + except OSError, e: + logging.info('Could not execute GCC for version check') if options.dumb_gcc is True: logging.info('Setting -fpermissive to work around gcc bug') -- cgit v1.2.3