]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Fix checking whether kqueue is available.
[user/henk/code/inspircd.git] / configure
index 68d03a29c646913bfc9bf2dd0f1105bd603dc1ca..bdbcf6afe8c41df8648a7456cadd0c78580df866 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
 {
@@ -381,22 +382,8 @@ print "yes\n" if $config{HAS_STRLCPY} eq "true";
 print "no\n" if $config{HAS_STRLCPY} eq "false";
 
 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');