X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=39968db6e6932954db2535c28606a2480602d9d8;hb=1b88e86f970124cb5c143fcd6ea85249d91ff3ad;hp=fd00ff89c04ace244a996c09f27d0463a2f0fe0f;hpb=4c751dbbe8945e5efc230a59b0ed51c2ba10cf92;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index fd00ff89c..39968db6e 100755 --- a/configure +++ b/configure @@ -28,6 +28,7 @@ BEGIN { require 5.8.0; + push @INC, '.'; } use strict; @@ -268,10 +269,9 @@ if (defined $opt_cc) { $config{CC} = $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{CC} -dumpversion` =~ /^(\d+)(?:\.(\d+))?/; +$config{GCCVER} = defined $1 ? $1 : ''; +$config{GCCMINOR} = defined $2 ? $2 : '0'; $config{MAXBUF} = "512"; # Max buffer size if ($config{HAS_OPENSSL} =~ /^([-[:digit:].]+)(?:[a-z])?(?:\-[a-z][0-9])?/) { @@ -347,10 +347,9 @@ 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`); +`$config{CC} -dumpversion` =~ /^(\d+)(?:\.(\d+))?/; +$config{GCCVER} = defined $1 ? $1 : ''; +$config{GCCMINOR} = defined $2 ? $2 : '0'; printf "Checking if stdint.h exists... "; $config{HAS_STDINT} = test_compile('stdint'); @@ -488,8 +487,9 @@ 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 - chomp($config{GCCMINOR} = `$config{CC} -dumpversion | cut -c 3`); + `$config{CC} -dumpversion` =~ /^(\d+)(?:\.(\d+))?/; + $config{GCCVER} = defined $1 ? $1 : ''; + $config{GCCMINOR} = defined $2 ? $2 : '0'; 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"; @@ -716,7 +716,7 @@ if (($config{USE_GNUTLS} eq "y") || ($config{USE_OPENSSL} eq "y")) { print "Please note: for \e[1;32mSSL support\e[0m you will need to load required\n"; print "modules in your config. This configure script has added those modules to the\n"; print "build process. For more info, please refer to:\n"; - print "\e[1;32mhttp://wiki.inspircd.org/Installation_From_Tarball\e[0m\n"; + print "\e[1;32mhttps://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++")) { @@ -733,6 +733,14 @@ to a newer 3.x or 4.x (or whatever is available currently) version. FOO2 } +if ($^O eq 'openbsd') { + print <<__OPENBSD_WARNING__; +\e[1;32mWARNING!\e[0m OpenBSD 6.5 changed Make to no longer look for BSDmakefile when +searching for the makefile. If the version of OpenBSD you are using is 6.5 or +newer then you will need to run '\e[1;32mmake -f BSDmakefile\e[0m' or '\e[1;32mgmake\e[0m' instead. +__OPENBSD_WARNING__ +} + ################################################################################ # HELPER FUNCTIONS # ################################################################################ @@ -839,8 +847,8 @@ sub writefiles { open(FILEHANDLE, ">include/inspircd_config.h.tmp"); print FILEHANDLE </dev/null` =~ /gcc/i && $config{GCCVER} ge "6" ? "true" : "false"; + foreach my $file (@dotfiles) { open(FILEHANDLE, "make/template/$file") or die "Can't open make/template/$file: $!"; $_ = join '', ; @@ -974,7 +989,7 @@ EOF for my $var (qw( CC SYSTEM BASE_DIR CONFIG_DIR MODULE_DIR BINARY_DIR BUILD_DIR DATA_DIR UID - STARTSCRIPT DESTINATION SOCKETENGINE LOG_DIR + STARTSCRIPT DESTINATION SOCKETENGINE LOG_DIR GCC6 )) { s/\@$var\@/$config{$var}/g; }