summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure b/configure
index ccb487372..5a0bbd4e9 100755
--- a/configure
+++ b/configure
@@ -346,6 +346,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";
@@ -875,6 +887,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);