X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=7d16af9a309b4318233be49262fb5531cdca2811;hb=d2a71fd3447c8bac65cc26077e2b9fc3fb0b28a7;hp=c3ce62e3c3c866251de8bd91172df69f341025d9;hpb=e6a079abdf360588f6a2b38ecc8f899cc7b7da2d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index c3ce62e3c..7d16af9a3 100755 --- a/configure +++ b/configure @@ -3,7 +3,7 @@ # InspIRCd Configuration Script # # Copyright 2002-2009 The InspIRCd Development Team -# http://www.inspircd.org/wiki/index.php/Credits +# http://wiki.inspircd.org/Credits # # Licensed under GPL, please see the COPYING file # for more information @@ -144,6 +144,8 @@ GetOptions ( 'list-extras' => sub { list_extras; exit 0; }, # This, --enable-extras, and --disable-extras are for non-interactive managing. 'enable-extras=s@' => \@opt_enableextras, # ^ 'disable-extras=s@' => \@opt_disableextras, # ^ + 'generate-openssl-cert' => sub { make_openssl_cert(); exit(0); }, + 'generate-gnutls-cert' => sub { make_gnutls_cert(); exit(0); } ); if (scalar(@opt_enableextras) + scalar(@opt_disableextras) > 0) { @@ -529,6 +531,15 @@ sub svnupdate exit; } +sub test_compile { + my $feature = shift; + my $fail = 0; + $fail ||= system "$config{CC} -o test_$feature make/check_$feature.cpp >/dev/null 2>&1"; + $fail ||= system "./test_$feature"; + unlink "test_$feature"; + return !$fail; +} + print "Running non-interactive configure...\n" unless $interactive; print "Checking for cache from previous configure... "; print ((!getcache()) ? "not found\n" : "found\n"); @@ -582,69 +593,13 @@ if (!$fail) { print "yes\n" if $has_kqueue == 1; print "no\n" if $has_kqueue == 0; -printf "Checking if epoll exists... "; -$has_epoll = 0; -$fail = 0; -open(EPOLL, ")) - { - chomp($line); - if ($line =~ /GNU C Library .* version (.*?) /) - { - $libcv = $1; - $libcv =~ /(\d+\.\d+)/; - $libcv = $1; - } - elsif ($line =~ /Compiled on a Linux (.*?\..*?)\.* system/) - { - $kernelv = $1; - # Fix for some retarded libc builds, strip off >> and << etc. - $kernelv =~ /(\d+\.\d+)/; - $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; +printf "Checking for epoll support... "; +$has_epoll = test_compile('epoll'); +print $has_epoll ? "yes\n" : "no\n"; + +printf "Checking for eventfd support... "; +$config{HAS_EVENTFD} = test_compile('eventfd') ? 'true' : 'false'; +print $config{HAS_EVENTFD} eq 'true' ? "yes\n" : "no\n"; printf "Checking if Solaris I/O completion ports are available... "; $has_ports = 0; @@ -995,7 +950,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://www.inspircd.org/wiki/Installation_From_Tarball\e[0m\n"; + print "\e[1;32mhttp://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++")) { @@ -1228,6 +1183,9 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n"; if ($config{SUPPORT_IP6LINKS} =~ /y/i) { print FILEHANDLE "#define SUPPORT_IP6LINKS\n"; } + if ($config{HAS_EVENTFD} eq 'true') { + print FILEHANDLE "#define HAS_EVENTFD\n"; + } my $use_hiperf = 0; if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) { print FILEHANDLE "#define USE_KQUEUE\n"; @@ -1380,7 +1338,7 @@ sub write_dynamic_modules_makefile { print FILEHANDLE < # for assisting with making this work right.