diff options
author | Peter Powell <petpow@saberuk.com> | 2014-10-01 19:52:27 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2014-12-07 22:36:42 +0000 |
commit | 2adb94db3032332ad2235aa032bb195aba89687c (patch) | |
tree | ab92430738fa6f652df6d4a02da9e685e37cee5e /configure | |
parent | 133b110534ec3386d8735020e8679236002b6ed1 (diff) |
Improve build system compiler detection.
- Check the CXX environment variable inside find_compiler instead
of doing it separately.
- Use a test file instead of checking for version output. This
ensures we are using a working compiler.
- Pipe the output through run_test which makes debugging problems
considerably easier.
- Detect Xcode versions of Clang properly by returning the LLVM
version number instead of the Xcode one.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -131,19 +131,13 @@ if ($interactive) { } } -$config{CXX} = defined $ENV{CXX} && !system("$ENV{CXX} -v > /dev/null 2>&1") ? $ENV{CXX} : find_compiler(); -if ($config{CXX} eq "") { - print "A C++ compiler could not be detected on your system!\n"; - print "Set the CXX environment variable to the full path if this is incorrect.\n"; +$config{CXX} = find_compiler($config{CXX} || $ENV{CXX}); +unless ($config{CXX}) { + print "A suitable C++ compiler could not be detected on your system!\n"; + print "Set the CXX environment variable to the compiler binary path if this is incorrect.\n"; exit 1; } - my %compiler = get_compiler_info($config{CXX}); -if ($compiler{UNSUPPORTED}) { - print "Your C++ compiler is too old to build InspIRCd!\n"; - print "Reason: $compiler{REASON}\n"; - exit 1; -} $config{HAS_CLOCK_GETTIME} = run_test 'clock_gettime()', test_file($config{CXX}, 'clock_gettime.cpp', '-lrt'); $config{HAS_EVENTFD} = run_test 'eventfd()', test_file($config{CXX}, 'eventfd.cpp'); |