* released 1.2.5-pre4
* made epoll() support a compile-time option : ENABLE_EPOLL
* provided a very little libc replacement for a possibly missing epoll()
implementation which can be enabled by -DUSE_MY_EPOLL
* implemented the poll() poller, which can be enabled with -DENABLE_POLL.
The equivalent runtime argument becomes '-P'. A few tests show that it
performs like select() with many fds, but slightly slower (certainly
because of the higher amount of memory involved).
* separated the 3 polling methods and the tasks scheduler into 4 distinct
functions which makes the code a lot more modular.
* moved some event tables to private static declarations inside the poller
functions.
* the poller functions can now initialize themselves, run, and cleanup.
* changed the runtime argument to enable epoll() to '-E'.
* removed buggy epoll_ctl() code in the client_retnclose() function. This
function was never meant to remove anything.
* fixed a typo which caused glibc to yell about a double free on exit.
* removed error checking after epoll_ctl(DEL) because we can never know if
the fd is still active or already closed.
* added a few entries in the makefile
diff --git a/Makefile b/Makefile
index 70a21fe..3991baa 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@
# Select target OS. TARGET must match a system for which COPTS and LIBS are
# correctly defined below.
+#TARGET = linux26
TARGET = linux24
#TARGET = linux22
#TARGET = solaris
@@ -27,20 +28,24 @@
PCREDIR := $(shell pcre-config --prefix 2>/dev/null || :)
#PCREDIR=/usr/local
+# This is for Linux 2.6 with netfilter and EPOLL
+COPTS.linux26 = -DNETFILTER -DENABLE_POLL -DENABLE_EPOLL
+LIBS.linux26 =
+
# This is for Linux 2.4 with netfilter
-COPTS.linux24 = -DNETFILTER
+COPTS.linux24 = -DNETFILTER -DENABLE_POLL
LIBS.linux24 =
# This is for Linux 2.2
-COPTS.linux22 = -DUSE_GETSOCKNAME
+COPTS.linux22 = -DUSE_GETSOCKNAME -DENABLE_POLL
LIBS.linux22 =
# This is for Solaris 8
-COPTS.solaris = -fomit-frame-pointer -DSOLARIS
+COPTS.solaris = -fomit-frame-pointer -DSOLARIS -DENABLE_POLL
LIBS.solaris = -lnsl -lsocket
# This is for OpenBSD 3.0
-COPTS.openbsd =
+COPTS.openbsd = -DENABLE_POLL
LIBS.openbsd =
# CPU dependant optimizations
@@ -67,13 +72,20 @@
#SMALL_OPTS = -DBUFSIZE=8192 -DMAXREWRITE=1024
SMALL_OPTS =
+# redefine this if you want to add some special PATH to include/libs
+ADDINC =
+ADDLIB =
+
+# set some defines when needed.
+# Known ones are -DENABLE_POLL, -DENABLE_EPOLL, and -DUSE_MY_EPOLL
+DEFINE =
# global options
TARGET_OPTS=$(COPTS.$(TARGET))
REGEX_OPTS=$(COPTS.$(REGEX))
CPU_OPTS=$(COPTS.$(CPU))
-COPTS=-I. $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) $(REGEX_OPTS) $(SMALL_OPTS)
+COPTS=-I. $(ADDINC) $(CPU_OPTS) $(TARGET_OPTS) $(REGEX_OPTS) $(SMALL_OPTS) $(DEFINE)
LIBS=$(LIBS.$(TARGET)) $(LIBS.$(REGEX)) $(ADDLIB)
# - use -DSTATTIME=0 to disable statistics, else specify an interval in