summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorFlorian Wilkemeyer <fw@f-ws.de>2016-01-10 10:56:22 +0100
committerAndrei Karas <akaras@inbox.ru>2016-07-08 19:57:11 +0300
commitc6f05662899417ad22c4fa3217e6c2ba2d27b5a3 (patch)
tree112a35960141c206025e41abd672b284d4495afe /configure
parentc7b95260fa3f4d77138fa34710f60365f4c86c87 (diff)
downloadhercules-c6f05662899417ad22c4fa3217e6c2ba2d27b5a3.tar.gz
hercules-c6f05662899417ad22c4fa3217e6c2ba2d27b5a3.tar.bz2
hercules-c6f05662899417ad22c4fa3217e6c2ba2d27b5a3.tar.xz
hercules-c6f05662899417ad22c4fa3217e6c2ba2d27b5a3.zip
Added epoll as event-dispatcher on linux (instead of select())
Note: It will be enabled by default if configure detects that the system has support for epoll To enforce usage of select run configure with --enable-epoll=no
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure62
1 files changed, 61 insertions, 1 deletions
diff --git a/configure b/configure
index 053dc0df2..eb928cad1 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac 1a78266.
+# From configure.ac 7f3fd6d.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
@@ -692,6 +692,7 @@ enable_option_checking
enable_manager
enable_packetver
enable_packetver_re
+enable_epoll
with_key1
with_key2
with_key3
@@ -1342,6 +1343,7 @@ Optional Features:
--enable-packetver=ARG Sets the PACKETVER define. (see src/common/mmo.h)
--enable-packetver-re Sets or unsets the PACKETVER_RE define - see
src/common/mmo.h (currently disabled by default)
+ --enable-epoll use epoll(4) on Linux
--enable-debug[=ARG] Compiles extra debug code. (yes by default)
(available options: yes, no, gdb)
--enable-buildbot[=ARG] (available options: yes, no)
@@ -3547,6 +3549,52 @@ fi
#
+# EPOLL (Linux Only)
+#
+# Check whether --enable-epoll was given.
+if test "${enable_epoll+set}" = set; then :
+ enableval=$enable_epoll; enable_epoll=$enableval
+else
+ enable_epoll=auto
+fi
+
+if test x$enable_epoll = xno; then
+ have_linux_epoll=no
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux epoll(4)" >&5
+$as_echo_n "checking for Linux epoll(4)... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #ifndef __linux__
+ #error This is not Linux
+ #endif
+ #include <sys/epoll.h>
+
+int
+main ()
+{
+epoll_create1 (EPOLL_CLOEXEC);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ have_linux_epoll=yes
+else
+ have_linux_epoll=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_linux_epoll" >&5
+$as_echo "$have_linux_epoll" >&6; }
+fi
+if test x$enable_epoll,$have_linux_epoll = xyes,no; then
+ as_fn_error $? "epoll support explicitly enabled but not available" "$LINENO" 5
+fi
+
+
+#
# Obfuscation keys
#
@@ -8134,6 +8182,18 @@ case $enable_packetver_re in
esac
#
+# Epoll
+#
+case $have_linux_epoll in
+ "yes")
+ CPPFLAGS="$CPPFLAGS -DSOCKET_EPOLL"
+ ;;
+ "no")
+ # default value
+ ;;
+esac
+
+#
# Obfuscation keys
#
if test -n "$obfuscationkey1" -a -n "$obfuscationkey2" -a -n "$obfuscationkey3"; then