diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-06-12 17:07:23 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-06-12 17:07:23 +0000 |
commit | 04b09e3b2cfd929b42dccc40626b07679c7eff09 (patch) | |
tree | a9f3d028e8b3a067b541ed512001c72e911a0392 | |
parent | 5a4d9ac6957530438ca3eaa21436c1fdf3bf463e (diff) |
Extra configure detection for the gcc minor version (we took this out when we removed support for gcc < 3, but now we need it back for gcc 4.3 :p
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9891 e03df62e-2008-0410-955e-edbf42e46eb7
-rwxr-xr-x | configure | 28 | ||||
-rw-r--r-- | make/configure.pm | 2 |
2 files changed, 21 insertions, 9 deletions
@@ -309,6 +309,7 @@ if (defined $opt_noipv6links) $config{SUPPORT_IP6LINKS} = "n"; } chomp($config{GCCVER} = `g++ -dumpversion | cut -c 1`); # Major GCC Version +chomp($config{GCCMINOR} = `g++ -dumpversion | cut -c 3`); $config{_SOMAXCONN} = SOMAXCONN; # Max connections in accept queue $config{OSNAME} = $^O; # Operating System Name $config{IS_DARWIN} = "NO"; # Is OSX? @@ -329,6 +330,8 @@ if (defined $opt_cc) } 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`); $config{MAKEORDER} = "ircd mods"; # build order $config{MAXBUF} = "512"; # Max buffer size @@ -338,7 +341,7 @@ if ($config{HAS_OPENSSL} =~ /^([-[:digit:].]+)([a-z])?(\-[a-z][0-9])?$/) { $config{HAS_OPENSSL} = ""; } -if ($config{GCCVER} eq "") { +if (($config{GCCVER} eq "") || ($config{GCCMINOR} eq "")) { print $config{CC} . " was not found! You require g++ (the GNU C++ compiler, part of GCC) to build InspIRCd!\n"; exit; } @@ -744,7 +747,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}.x\e[0m)\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 @@ -760,7 +763,8 @@ should NOT be used. You should probably specify a newer compiler.\n\n"; 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 - print "Queried compiler: \e[1;32m$config{CC}\e[0m (version \e[1;32m$config{GCCVER}.x\e[0m)\n"; + 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} < 3) { print "\e[1;32mGCC 2.x WILL NOT WORK!\e[0m. Let's try that again, shall we?\n"; } @@ -1086,6 +1090,7 @@ sub getosflags { if ($foo ne "") { $config{CC} = "eg++"; chomp($config{GCCVER} = `eg++ -dumpversion | cut -c 1`); # we must redo these if we change the compiler path + chomp($config{GCCMINOR} = `eg++ -dumpversion | cut -c 3`); } return "OpenBSD"; } @@ -1168,6 +1173,13 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n"; if ($config{GCCVER} >= 3) { print FILEHANDLE "#define GCC3\n"; } + if ( + (($config{GCCVER} == 4) && ($config{GCCMINOR} >= 3)) + || + ($config{GCCVER} > 4) + ) { + print FILEHANDLE "#define HASHMAP_DEPRECATED\n"; + } if ($config{HAS_STRLCPY} eq "true") { print FILEHANDLE "#define HAS_STRLCPY\n"; } @@ -1231,12 +1243,12 @@ EOF chomp($modules); # Remove Redundant whitespace.. opendir(DIRHANDLE, "src/modules"); - foreach my $name (sort readdir(DIRHANDLE)) { - if ($name =~ /^m_(.+?)$/) { - if (defined(opendir(MDIRHANDLE, "src/modules/$name"))) { + foreach my $name2 (sort readdir(DIRHANDLE)) { + if ($name2 =~ /^m_(.+?)$/) { + if (defined(opendir(MDIRHANDLE, "src/modules/$name2"))) { closedir(MDIRHANDLE); - $modules .= "$name.so "; - $uninstall_list = $uninstall_list . " -rm \$(MODULES)/$name.so\n"; + $modules .= "$name2.so "; + $uninstall_list = $uninstall_list . " -rm \$(MODULES)/$name2.so\n"; } } } diff --git a/make/configure.pm b/make/configure.pm index ab440f07f..e9c1a04c3 100644 --- a/make/configure.pm +++ b/make/configure.pm @@ -193,7 +193,7 @@ sub dumphash() print "\e[0mConfig path:\e[1;32m\t\t\t$main::config{CONFIG_DIR}\e[0m\n"; print "\e[0mModule path:\e[1;32m\t\t\t$main::config{MODULE_DIR}\e[0m\n"; print "\e[0mLibrary path:\e[1;32m\t\t\t$main::config{LIBRARY_DIR}\e[0m\n"; - print "\e[0mGCC Version Found:\e[1;32m\t\t$main::config{GCCVER}.x\e[0m\n"; + print "\e[0mGCC Version Found:\e[1;32m\t\t$main::config{GCCVER}.$main::config{GCCMINOR}\e[0m\n"; print "\e[0mCompiler program:\e[1;32m\t\t$main::config{CC}\e[0m\n"; print "\e[0mIPv6 Support:\e[1;32m\t\t\t$main::config{IPV6}\e[0m\n"; print "\e[0mIPv6 to IPv4 Links:\e[1;32m\t\t$main::config{SUPPORT_IP6LINKS}\e[0m\n"; |