summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-07-08 20:05:58 +0200
committerGitHub <noreply@github.com>2016-07-08 20:05:58 +0200
commit4a44345474d7badbb19045c11d62f0d3ee973790 (patch)
tree347b28259b08be61d8c21d827f5cb0a7e6d203b2 /configure.ac
parentc7b95260fa3f4d77138fa34710f60365f4c86c87 (diff)
parent154e6b085ef4715f04b9597035b9a5e83962b545 (diff)
downloadhercules-4a44345474d7badbb19045c11d62f0d3ee973790.tar.gz
hercules-4a44345474d7badbb19045c11d62f0d3ee973790.tar.bz2
hercules-4a44345474d7badbb19045c11d62f0d3ee973790.tar.xz
hercules-4a44345474d7badbb19045c11d62f0d3ee973790.zip
Merge pull request #1347 from 4144/epoll
Based on https://github.com/HerculesWS/Hercules/pull/1089 and add some fixes to it
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac42
1 files changed, 42 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7b7590813..0a86ffb58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -143,6 +143,36 @@ AC_ARG_ENABLE(
#
+# Epoll
+#
+AC_ARG_ENABLE([epoll],
+ [AS_HELP_STRING([--enable-epoll],[use epoll(4) on Linux])],
+ [enable_epoll=$enableval],
+ [enable_epoll=no]
+)
+if test x$enable_epoll = xno; then
+ have_linux_epoll=no
+else
+ AC_MSG_CHECKING([for Linux epoll(4)])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(
+ [
+ #ifndef __linux__
+ #error This is not Linux
+ #endif
+ #include <sys/epoll.h>
+ ],
+ [epoll_create1 (EPOLL_CLOEXEC);])],
+ [have_linux_epoll=yes],
+ [have_linux_epoll=no]
+ )
+ AC_MSG_RESULT([$have_linux_epoll])
+fi
+if test x$enable_epoll,$have_linux_epoll = xyes,no; then
+ AC_MSG_ERROR([epoll support explicitly enabled but not available])
+fi
+
+
+#
# Obfuscation keys
#
AC_ARG_WITH(
@@ -1139,6 +1169,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