X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=configure;h=996edc98132151ab1ff1e7bfa9735503fe2793f4;hb=4934648e234538a7324c0a47836350a9be8b1fc0;hp=72713d42069383e79b8030d29dfffede75325c8a;hpb=677b784ce8d870e9e6364144fc5dfed5e0e8e715;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/configure b/configure index 72713d420..996edc981 100755 --- a/configure +++ b/configure @@ -6,6 +6,9 @@ # # # +# Licensed under GPL, please see the COPYING file +# for more information +# # [14:21] Brain: i know perl-fu! # # $Id$ @@ -21,6 +24,7 @@ use Getopt::Long; # Utility functions for our buildsystem use make::utilities; use make::configure; +use make::gnutlscert; GetOptions ( 'enable-gnutls' => \$opt_use_gnutls, @@ -30,8 +34,10 @@ GetOptions ( 'with-nick-length=i' => \$opt_nick_length, 'with-channel-length=i' => \$opt_chan_length, 'with-max-clients=i' => \$opt_maxclients, + 'enable-ports' => \$opt_ports, 'enable-epoll' => \$opt_epoll, 'enable-kqueue' => \$opt_kqueue, + 'disable-ports' => \$opt_noports, 'disable-epoll' => \$opt_noepoll, 'disable-kqueue' => \$opt_nokqueue, 'enable-ipv6' => \$opt_ipv6, @@ -80,6 +86,7 @@ my $non_interactive = ( (defined $opt_noipv6links) || (defined $opt_kqueue) || (defined $opt_epoll) || + (defined $opt_ports) || (defined $opt_maxchans) || (defined $opt_opermaxchans) || (defined $opt_chan_length) || @@ -87,6 +94,7 @@ my $non_interactive = ( (defined $opt_use_openssl) || (defined $opt_nokqueue) || (defined $opt_noepoll) || + (defined $opt_noports) || (defined $opt_use_gnutls) ); my $interactive = !$non_interactive; @@ -187,6 +195,15 @@ if (defined $opt_noepoll) { $config{USE_EPOLL} = "n"; } +$config{USE_PORTS} = "y"; # epoll enabled +if (defined $opt_ports) +{ + $config{USE_PORTS} = "y"; +} +if (defined $opt_noports) +{ + $config{USE_PORTS} = "n"; +} $config{IPV6} = "n"; # IPv6 support (experimental) if (defined $opt_ipv6) { @@ -304,6 +321,7 @@ sub update getosflags(); } $has_epoll = $config{HAS_EPOLL}; + $has_ports = $config{HAS_PORTS}; $has_kqueue = $config{HAS_KQUEUE}; writefiles(1); makecache(); @@ -334,6 +352,7 @@ sub modupdate print "Updating Files..\n"; getosflags(); $has_epoll = $config{HAS_EPOLL}; + $has_ports = $config{HAS_PORTS}; $has_kqueue = $config{HAS_KQUEUE}; writefiles(0); makecache(); @@ -453,6 +472,22 @@ if ($has_epoll) { print "yes\n" if $has_epoll == 1; print "no\n" if $has_epoll == 0; +printf "Checking if Solaris I/O completion ports are available... "; +$has_ports = 0; +my $system = `uname -s`; +chomp ($system); +$has_ports = 1 if ($system eq "SunOS"); + +if ($has_ports) { + my $kernel = `uname -r`; + chomp($kernel); + if (($kernel !~ /^5\.10/)) { + $has_ports = 0; + } +} +print "yes\n" if $has_ports == 1; +print "no\n" if $has_ports == 0; + if (($config{OSNAME} =~ /CYGWIN/) || ($config{OSNAME} eq "CYG-STATIC")) { $config{HAS_STRLCPY} = "true"; } @@ -563,7 +598,11 @@ should NOT be used. You should probably specify a newer compiler.\n\n"; yesno(USE_EPOLL,"You are running a Linux 2.6+ operating system, and epoll\nwas detected. Would you like to enable epoll support?\nThis is likely to increase performance.\nIf you are unsure, answer yes.\n\nEnable epoll?"); print "\n"; } - $chose_hiperf = (($config{USE_EPOLL} eq "y") || ($config{USE_KQUEUE} eq "y")); + if ($has_ports) { + yesno(USE_PORTS,"You are running Solaris 10.\nWould you like to enable I/O completion ports support?\nThis is likely to increase performance.\nIf you are unsure, answer yes.\n\nEnable support for I/O completion ports?"); + print "\n"; + } + $chose_hiperf = (($config{USE_EPOLL} eq "y") || ($config{USE_KQUEUE} eq "y") || ($config{USE_PORTS} eq "y")); if (!$chose_hiperf) { print "No high-performance socket engines are available, or you chose\n"; print "not to enable one. Defaulting to select() engine.\n\n"; @@ -665,11 +704,10 @@ if ($config{USE_GNUTLS} eq "y") { * Generating the Private Key may take some time, go grab a * * Coffee. Even better, to generate some more entropy if it * * is taking a while, open another console and type du / a * -* few times and get that HD going :) Then answer the * +* few times and get that HD going :) Then answer the * * Questions which follow. If you are unsure, just hit enter * *************************************************************\n\n"; - system("certtool --generate-privkey --outfile key.pem"); - system("certtool --generate-self-signed --load-privkey key.pem --outfile cert.pem"); + make_gnutls_cert(); print "\nCertificate generation complete, copying to config directory... "; system("mv key.pem $config{CONFIG_DIR}/key.pem"); system("mv cert.pem $config{CONFIG_DIR}/cert.pem"); @@ -704,7 +742,7 @@ if ($config{USE_GNUTLS} eq "y") { print "SSL Certificates Not found, Generating.. \n\n ************************************************************* * Generating the certificates may take some time, go grab a * -* coffee, or something. * +* coffee, or something. * *************************************************************\n\n"; system("openssl req -x509 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem"); system("openssl dhparam -out dhparams.pem 1024"); @@ -989,6 +1027,11 @@ EOF $se = "socketengine_epoll"; $use_hiperf = 1; } + if (($has_ports) && ($config{USE_PORTS} eq "y")) { + print FILEHANDLE "#define USE_PORTS\n"; + $se = "socketengine_ports"; + $use_hiperf = 1; + } # user didn't choose either epoll or select for their OS. # default them to USE_SELECT (ewwy puke puke) if (!$use_hiperf) { @@ -1367,6 +1410,9 @@ if (($has_kqueue) && ($config{USE_KQUEUE} eq "y")) { elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) { $se = "socketengine_epoll"; } +elsif (($has_ports) && ($config{USE_PORTS} eq "y")) { + $se = "socketengine_ports"; +} ### # This next section is for cygwin dynamic module builds. @@ -1501,6 +1547,9 @@ sub write_dynamic_makefile { elsif (($has_epoll) && ($config{USE_EPOLL} eq "y")) { $se = "socketengine_epoll"; } + elsif (($has_ports) && ($config{USE_PORTS} eq "y")) { + $se = "socketengine_ports"; + } open(FH,">src/Makefile") or die("Could not write src/Makefile"); print FH <