]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
m_sasl: really abort sasl session on register
[user/henk/code/inspircd.git] / configure
index 103e072a50fee2ffd7c1d9d4c916c160a2b8bcf8..e8c3deb0d168dd60cae77ca41a228c5bd3f1de00 100755 (executable)
--- a/configure
+++ b/configure
@@ -257,7 +257,8 @@ if ($config{OSNAME} =~ /darwin/i)
 elsif ($config{OSNAME} =~ /freebsd/i)
 {
        chomp(my $fbsd_version = `uname -r`);
-       $config{CC} = $fbsd_version ge '10.0' ? 'clang++' : 'g++';
+       $fbsd_version =~ s/^(\d+\.\d+).*/$1/g;
+       $config{CC} = $fbsd_version >= 10.0 ? 'clang++' : 'g++';
 }
 else
 {
@@ -352,51 +353,16 @@ $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... ";
-# Perform the strlcpy() test..
-$config{HAS_STRLCPY} = "false";
-$fail = 0;
-open(STRLCPY, "</usr/include/string.h") or $fail = 1;
-if (!$fail) {
-       while (defined(my $line = <STRLCPY>)) {
-               chomp($line);
-               # try and find the delcaration of:
-               # size_t strlcpy(...)
-               if ($line =~ /size_t(\0x9|\s)+strlcpy/) {
-                       $config{HAS_STRLCPY} = "true";
-               }
-       }
-       close(STRLCPY);
-}
-print "yes\n" if $config{HAS_STRLCPY} eq "true";
-print "no\n" if $config{HAS_STRLCPY} eq "false";
+$config{HAS_STRLCPY} = test_compile('strlcpy');
+print $config{HAS_STRLCPY} ? "yes\n" : "no\n";
 
 printf "Checking if kqueue exists... ";
-$has_kqueue = 0;
-$fail = 0;
-open(KQUEUE, "</usr/include/sys/event.h") or $fail = 1;
-if (!$fail) {
-       while (defined(my $line = <KQUEUE>)) {
-               chomp($line);
-               # try and find the delcaration of:
-               # int kqueue(void);
-               if ($line =~ /int(\0x9|\s)+kqueue/) {
-                       $has_kqueue = 1;
-               }
-       }
-       close(KQUEUE);
-}
-print "yes\n" if $has_kqueue == 1;
-print "no\n" if $has_kqueue == 0;
+$has_kqueue = test_compile('kqueue');
+print $has_kqueue ? "yes\n" : "no\n";
 
 printf "Checking for epoll support... ";
 $has_epoll = test_compile('epoll');
@@ -999,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>;
@@ -1008,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
+                       STARTSCRIPT DESTINATION SOCKETENGINE LOG_DIR GCC6
                )) {
                        s/\@$var\@/$config{$var}/g;
                }