]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Release v2.0.23
[user/henk/code/inspircd.git] / configure
index 2eba9edb11b5f1b5f67a4ba79afe2c0927764ec5..e8c3deb0d168dd60cae77ca41a228c5bd3f1de00 100755 (executable)
--- a/configure
+++ b/configure
@@ -353,14 +353,8 @@ $exec = $config{CC} . " -dumpversion | cut -c 3";
 chomp($config{GCCMINOR}                = `$exec`);
 
 printf "Checking if stdint.h exists... ";
-$config{HAS_STDINT} = "true";
-our $fail = 0;
-open(STDINT, "</usr/include/stdint.h") or $config{HAS_STDINT} = "false";
-if ($config{HAS_STDINT} eq "true") {
-       close(STDINT);
-}
-print "yes\n" if $config{HAS_STDINT} eq "true";
-print "no\n" if $config{HAS_STDINT} eq "false";
+$config{HAS_STDINT} = test_compile('stdint');
+print $config{HAS_STDINT} ? "yes\n" : "no\n";
 
 printf "Checking if strlcpy exists... ";
 $config{HAS_STRLCPY} = test_compile('strlcpy');
@@ -971,6 +965,9 @@ EOF
        my @dotfiles = qw(main.mk inspircd);
        push @dotfiles, 'org.inspircd.plist' if $config{OSNAME} eq 'darwin';
 
+       # HACK: we need to know if we are on GCC6 to disable the omission of `this` null pointer checks.
+       $config{GCC6} = `$config{CC} --version 2>/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 '', <FILEHANDLE>;
@@ -980,7 +977,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;
                }