diff options
author | Peter Powell <petpow@saberuk.com> | 2013-07-04 09:27:12 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-07-05 07:12:02 +0100 |
commit | 77a08e490c340ffeca089fb15043490f1ce4b7de (patch) | |
tree | 40f3586d7e8736cda75a5530c837a60fc2cc2748 /configure | |
parent | 2677d12f20f2921b9724dc198f5e232fa9217d6a (diff) |
Correctly detect the compiler version and whether it is acceptable.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 63 |
1 files changed, 7 insertions, 56 deletions
@@ -241,10 +241,12 @@ if ($config{CC} eq "") { exit 1; } -our $exec = $config{CC} . " -dumpversion | cut -c 1"; -chomp($config{GCCVER} = `$exec`); # Major GCC Version -$exec = $config{CC} . " -dumpversion | cut -c 3"; -chomp($config{GCCMINOR} = `$exec`); +our %cxx = get_compiler_info($config{CC}); +if ($cxx{UNSUPPORTED}) { + print "Your C++ compiler is too old to build InspIRCd!\n"; + print "Reason: $cxx{REASON}\n"; + exit 1; +} if ($config{HAS_OPENSSL} =~ /^([-[:digit:].]+)(?:[a-z])?(?:\-[a-z][0-9])?/) { $config{HAS_OPENSSL} = $1; @@ -298,12 +300,6 @@ print ($cache_loaded ? "found\n" : "not found\n"); $config{SYSTEM} = lc $^O; print "Checking operating system version... $config{SYSTEM}\n"; -$exec = $config{CC} . " -dumpversion | cut -c 1"; -chomp($config{GCCVER} = `$exec`); # Major GCC Version -$exec = $config{CC} . " -dumpversion | cut -c 3"; -chomp($config{GCCMINOR} = `$exec`); - - print "Checking whether <stdint.h> exists... "; if (test_header($config{CC}, "stdint.h")) { $config{HAS_STDINT} = "true"; @@ -439,36 +435,7 @@ STOP } print ".\n\n"; - $config{CHANGE_COMPILER} = "n"; - print "I have detected the following compiler: \e[1;32m$config{CC}\e[0m (version \e[1;32m$config{GCCVER}.$config{GCCMINOR}\e[0m)\n"; - - while (($config{GCCVER} < 3) || ($config{GCCVER} eq "")) { - print "\e[1;32mIMPORTANT!\e[0m A GCC 2.x compiler has been detected, and -should NOT be used. You should probably specify a newer compiler.\n\n"; - yesno('CHANGE_COMPILER',"Do you want to change the compiler?"); - if ($config{CHANGE_COMPILER} =~ /y/i) { - print "What command do you want to use to invoke your compiler?\n"; - print "[\e[1;32m$config{CC}\e[0m] -> "; - chomp($config{CC} = <STDIN>); - if ($config{CC} eq "") { - $config{CC} = "g++"; - } - chomp(my $foo = `$config{CC} -dumpversion | cut -c 1`); - if ($foo ne "") { - chomp($config{GCCVER} = `$config{CC} -dumpversion | cut -c 1`); # we must redo these if we change compilers - chomp($config{GCCMINOR} = `$config{CC} -dumpversion | cut -c 3`); - print "Queried compiler: \e[1;32m$config{CC}\e[0m (version \e[1;32m$config{GCCVER}.$config{GCCMINOR}\e[0m)\n"; - if ($config{GCCVER} < 4 || $config{GCCVER} == 4 && $config{GCCMINOR} < 1) { - print "\e[1;32mGCC 4.1 and earlier WILL NOT WORK!\e[0m. Let's try that again, shall we?\n"; - } - } - else { - print "\e[1;32mWARNING!\e[0m Could not execute the compiler you specified. You may want to try again.\n"; - } - } - } - - print "\n"; + print "I have detected the following compiler: \e[1;32m$cxx{NAME}\e[0m (version \e[1;32m$cxx{VERSION}\e[0m)\n\n"; # Directory Settings.. my $tmpbase = $config{BASE_DIR}; @@ -688,19 +655,6 @@ if (($config{USE_GNUTLS} eq "y") || ($config{USE_OPENSSL} eq "y")) { print "\e[1;32mhttp://wiki.inspircd.org/Installation_From_Tarball\e[0m\n"; } print "*** \e[1;32mRemember to edit your configuration files!!!\e[0m ***\n\n\n"; -if (($config{OSNAME} eq "OpenBSD") && ($config{CC} ne "eg++")) { - print "\e[1;32mWARNING!\e[0m You are running OpenBSD but you are using the base gcc package\nrather than eg++. This compile will most likely fail, but i'm letting you\ngo ahead with it anyway, just in case i'm wrong :-)\n"; -} - -if ($config{GCCVER} < "3") { - print <<FOO2; -\e[1;32mWARNING!\e[0m You are attempting to compile InspIRCd on GCC 2.x! -GCC 2.x series compilers only had partial (read as broken) C++ support, and -your compile will most likely fail horribly! If you have any problems, do NOT -report them to the bugtracker or forums without first upgrading your compiler -to a newer 3.x or 4.x (or whatever is available currently) version. -FOO2 -} ################################################################################ # HELPER FUNCTIONS # @@ -828,9 +782,6 @@ EOF if ($config{OSNAME} =~ /MINGW32/i) { print FILEHANDLE "#define IS_MINGW\n"; } - if ($config{GCCVER} >= 3) { - print FILEHANDLE "#define GCC3\n"; - } if ($config{HAS_STDINT} eq "true") { print FILEHANDLE "#define HAS_STDINT\n"; } |