]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Check libc version for epoll then check that glibc is built against this kernel versi...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 19 Jul 2007 21:44:46 +0000 (21:44 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Thu, 19 Jul 2007 21:44:46 +0000 (21:44 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7475 e03df62e-2008-0410-955e-edbf42e46eb7

configure

index 1104d4209347ca34ea2d313c782050d129901255..a257efa4896fb1e55f8e951a3705a27ebac3b5e7 100755 (executable)
--- a/configure
+++ b/configure
@@ -474,6 +474,40 @@ if ($has_epoll) {
        if (($kernel =~ /^2\.0\./) || ($kernel =~ /^2\.2\./) || ($kernel =~ /^2\.4\./)) {
                $has_epoll = 0;
        }
+       else
+       {
+               # Suggestion from nenolod, weed out odd systems which have glibc built
+               # against 2.4 kernels (ick)
+
+               $libcv = 0.0;
+               $kernelv = 0.0;
+               open (FH,"/lib/libc.so.6|") or $has_epoll = 0;
+               if ($has_epoll)
+               {
+                       while (chomp($line = <FH>))
+                       {
+                               if ($line =~ /GNU C Library .* version (.*?) /)
+                               {
+                                       $libcv = $1;
+                               }
+                               elsif ($line =~ /Compiled on a Linux (.*?\..*?)\.* system/)
+                               {
+                                       $kernelv = $1;
+                               }
+                       }
+                       close FH;
+                       if ($libcv < 2.3)
+                       {
+                               $has_epoll = 0;
+                               printf "libc too old: $libcv... ";
+                       }
+                       if ($kernelv < 2.6)
+                       {
+                               $has_epoll = 0;
+                               printf "libc built against older kernel $kernelv... ";
+                       }
+               }
+       }
 }
 print "yes\n" if $has_epoll == 1;
 print "no\n" if $has_epoll == 0;