]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
Replace some C string operations with the + operator.
[user/henk/code/inspircd.git] / configure
index ccb487372685bd4697dfa3c1640ace8f3f6a89ba..5bad741c66dfac665cf3397fc73880a9ebd09745 100755 (executable)
--- a/configure
+++ b/configure
@@ -54,7 +54,7 @@ use make::configure;
 ###############################################################################################
 
 our ($opt_use_gnutls, $opt_use_openssl, $opt_nointeractive, $opt_ports, $opt_epoll, $opt_kqueue,
-     $opt_noports, $opt_noepoll, $opt_nokqueue, $opt_maxbuf, $opt_freebsd_port, $opt_system, $opt_uid);
+     $opt_noports, $opt_noepoll, $opt_nokqueue, $opt_freebsd_port, $opt_system, $opt_uid);
 
 our ($opt_cc, $opt_base_dir, $opt_config_dir, $opt_module_dir, $opt_binary_dir, $opt_data_dir, $opt_log_dir);
 
@@ -80,7 +80,6 @@ GetOptions (
        'disable-epoll' => \$opt_noepoll,
        'disable-kqueue' => \$opt_nokqueue,
        'with-cc=s' => \$opt_cc,
-       'with-maxbuf=i' => \$opt_maxbuf,
        'enable-freebsd-ports-openssl' => \$opt_freebsd_port,
        'prefix=s' => \$opt_base_dir,
        'config-dir=s' => \$opt_config_dir,
@@ -123,7 +122,6 @@ our $interactive = !(
        (defined $opt_nokqueue) ||
        (defined $opt_noepoll) ||
        (defined $opt_noports) ||
-       (defined $opt_maxbuf) ||
        (defined $opt_system) ||
        (defined $opt_uid) ||
        (defined $opt_use_gnutls) ||
@@ -178,7 +176,7 @@ if (defined $opt_data_dir) {
 if (defined $opt_log_dir) {
        $config{LOG_DIR} = $opt_log_dir;
 }
-chomp($config{HAS_GNUTLS}   = `pkg-config --modversion gnutls 2>/dev/null | cut -c 1,2,3`); # GNUTLS Version.
+chomp($config{HAS_GNUTLS}   = `pkg-config --modversion gnutls 2>/dev/null`); # GNUTLS Version.
 
 if (defined $opt_freebsd_port)
 {
@@ -250,7 +248,6 @@ our $exec = $config{CC} . " -dumpversion | cut -c 1";
 chomp($config{GCCVER}          = `$exec`);                             # Major GCC Version
 $exec = $config{CC} . " -dumpversion | cut -c 3";
 chomp($config{GCCMINOR}                = `$exec`);
-$config{MAXBUF}                        = "512";                                # Max buffer size
 
 if ($config{HAS_OPENSSL} =~ /^([-[:digit:].]+)(?:[a-z])?(?:\-[a-z][0-9])?/) {
        $config{HAS_OPENSSL} = $1;
@@ -346,6 +343,18 @@ if (test_file($config{CC}, "eventfd.cpp")) {
        print "no\n";
 }
 
+printf "Checking if a TCP deferring mechanism is available... ";
+if (test_file($config{CC}, "tcp_defer_accept.cpp")) {
+       $config{HAS_DEFER} = "TCP_DEFER_ACCEPT";
+       print "yes (TCP_DEFER_ACCEPT)\n";
+} elsif (test_file($config{CC}, "so_acceptfilter.cpp")) {
+       $config{HAS_DEFER} = "SO_ACCEPTFILTER";
+       print "yes (SO_ACCEPTFILTER)\n";
+} else {
+       $config{HAS_DEFER} = "false";
+       print "no\n";
+}
+
 print "Checking whether epoll is available... ";
 $has_epoll = test_header($config{CC}, "sys/epoll.h");
 print $has_epoll ? "yes\n" : "no\n";
@@ -824,7 +833,7 @@ sub writefiles {
 #define MOD_PATH "$config{MODULE_DIR}"
 
 EOF
-print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n";
+print FILEHANDLE "#define MAXBUF 514\n";
 
                if ($config{OSNAME} =~ /SunOS/i) {
                        print FILEHANDLE "#define IS_SOLARIS\n";
@@ -875,6 +884,13 @@ print FILEHANDLE "#define MAXBUF " . ($config{MAXBUF}+2) . "\n";
                                $config{SOCKETENGINE} = "socketengine_select";
                        }
                }
+
+               if ($config{HAS_DEFER} eq "TCP_DEFER_ACCEPT") {
+                       print FILEHANDLE "#define USE_TCP_DEFER_ACCEPT";
+               } elsif ($config{HAS_DEFER} eq "SO_ACCEPTFILTER") {
+                       print FILEHANDLE "#define USE_SO_ACCEPTFILTER"
+               }
+
                print FILEHANDLE "\n#include \"threadengines/threadengine_pthread.h\"\n";
                close(FILEHANDLE);