From 1fa7dbe1e84f659f295652858b1a9d76cb4c074a Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Wed, 22 Dec 2010 22:11:26 -0700 Subject: [PATCH 01/19] Add AC_USE_SYSTEM_EXTENSIONS to configure.in. Requires follow on patches for correctness and robustness. --- configure.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.in b/configure.in index 9678be81..7eaefb92 100644 --- a/configure.in +++ b/configure.in @@ -14,6 +14,14 @@ if test "$prefix" = "NONE"; then prefix="/usr/local" fi +dnl Try and get a full POSIX environment on obscure systems +ifdef([AC_USE_SYSTEM_EXTENSIONS], [ +AC_USE_SYSTEM_EXTENSIONS +], [ +AC_AIX +AC_MINIX +]) + dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL From 321b558793db13ed3e57bb615d7811add6e10d6a Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Wed, 22 Dec 2010 22:53:03 -0700 Subject: [PATCH 02/19] Filter '# define' statements from autoconf and generate event-private.h --- Makefile.am | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index ab8df26e..b5c1a139 100644 --- a/Makefile.am +++ b/Makefile.am @@ -125,7 +125,10 @@ if SIGNAL_SUPPORT SYS_SRC += signal.c endif -BUILT_SOURCES = ./include/event2/event-config.h +BUILT_SOURCES = ./include/event2/event-config.h event-private.h + +event-private.h: config.h + cp config.h $@ ./include/event2/event-config.h: config.h @MKDIR_P@ ./include/event2 @@ -143,6 +146,7 @@ BUILT_SOURCES = ./include/event2/event-config.h sed -e 's/#define /#define _EVENT_/' \ -e 's/#undef /#undef _EVENT_/' \ + -e 's/# define /# define _EVENT_/' \ -e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@ echo "#endif" >> $@ @@ -206,5 +210,5 @@ doxygen: FORCE doxygen $(srcdir)/Doxyfile FORCE: -DISTCLEANFILES = *~ libevent.pc ./include/event2/event-config.h +DISTCLEANFILES = *~ libevent.pc ./include/event2/event-config.h event-private.h From 2c5566a9c720e49a0c49ab5eded26bebb330783e Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Wed, 22 Dec 2010 23:00:59 -0700 Subject: [PATCH 03/19] Add event-private.h to noinst_HEADERS --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index b5c1a139..ad5e2df5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -196,6 +196,7 @@ noinst_HEADERS = util-internal.h mm-internal.h ipv6-internal.h \ minheap-internal.h log-internal.h evsignal-internal.h evmap-internal.h \ changelist-internal.h iocp-internal.h \ ratelim-internal.h \ + event-private.h \ WIN32-Code/event2/event-config.h \ WIN32-Code/tree.h \ compat/sys/queue.h From 3b265412b7fce5e2e56bf130224c38cfc6d3bed2 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Wed, 22 Dec 2010 23:08:10 -0700 Subject: [PATCH 04/19] Remove internal usage of _GNU_SOURCE --- evthread_pthread.c | 6 ++++-- kqueue.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/evthread_pthread.c b/evthread_pthread.c index 55495a6c..5a56359d 100644 --- a/evthread_pthread.c +++ b/evthread_pthread.c @@ -25,8 +25,10 @@ */ #include "event2/event-config.h" -/* With glibc we need to define this to get PTHREAD_MUTEX_RECURSIVE. */ -#define _GNU_SOURCE +/* With glibc we need to define this to get PTHREAD_MUTEX_RECURSIVE. + * _GNU_SOURCE, now from event-private + */ +#include "event-private.h" #include struct event_base; diff --git a/kqueue.c b/kqueue.c index 92012982..12d4c198 100644 --- a/kqueue.c +++ b/kqueue.c @@ -28,7 +28,7 @@ */ #include "event2/event-config.h" -#define _GNU_SOURCE +#include "event-private.h" #include #ifdef _EVENT_HAVE_SYS_TIME_H From c51ef9307ad04d8e98487d1331f1910941e50390 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Wed, 22 Dec 2010 23:24:01 -0700 Subject: [PATCH 05/19] Eliminate a couple more manual internal _GNU_SOURCE defines --- buffer.c | 6 ++++-- evutil.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/buffer.c b/buffer.c index 50908b19..94a30bc5 100644 --- a/buffer.c +++ b/buffer.c @@ -26,6 +26,7 @@ */ #include "event2/event-config.h" +#include "event-private.h" #ifdef WIN32 #include @@ -34,8 +35,9 @@ #endif #ifdef _EVENT_HAVE_VASPRINTF -/* If we have vasprintf, we need to define this before we include stdio.h. */ -#define _GNU_SOURCE +/* If we have vasprintf, we need to define _GNU_SOURCE before we include + * stdio.h. This comes from event-private.h. + */ #endif #include diff --git a/evutil.c b/evutil.c index 2cb33370..5c2e8395 100644 --- a/evutil.c +++ b/evutil.c @@ -26,7 +26,7 @@ #include "event2/event-config.h" -#define _GNU_SOURCE +#include "event-private.h" #ifdef WIN32 #include From ea8fa4cb231a674797ea8efe23f68951db505159 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Sun, 2 Jan 2011 05:14:41 -0700 Subject: [PATCH 06/19] Add AC_GNU_SOURCE to the fallback case. --- configure.in | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.in b/configure.in index 7eaefb92..bd9ad7fc 100644 --- a/configure.in +++ b/configure.in @@ -19,6 +19,7 @@ ifdef([AC_USE_SYSTEM_EXTENSIONS], [ AC_USE_SYSTEM_EXTENSIONS ], [ AC_AIX +AC_GNU_SOURCE AC_MINIX ]) From ed53d5ef8053af08186ef80dfc1647cff769fac8 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Sun, 2 Jan 2011 06:35:05 -0700 Subject: [PATCH 07/19] evconfig-private.h with recusive configure subdirs --- configure.in | 1 + evconfig-private/configure.in | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 evconfig-private/configure.in diff --git a/configure.in b/configure.in index bd9ad7fc..021eb0f7 100644 --- a/configure.in +++ b/configure.in @@ -608,5 +608,6 @@ if test x$enable_gcc_warnings = xyes; then fi +AC_CONFIG_SUBDIRS( [evconfig-private] ) AC_CONFIG_FILES( [libevent.pc libevent_openssl.pc libevent_pthreads.pc] ) AC_OUTPUT(Makefile include/Makefile test/Makefile sample/Makefile) diff --git a/evconfig-private/configure.in b/evconfig-private/configure.in new file mode 100644 index 00000000..a14e0945 --- /dev/null +++ b/evconfig-private/configure.in @@ -0,0 +1,17 @@ +dnl private configure.in for libevent +dnl Kevin Bowling +AC_PREREQ(2.59c) +AC_INIT(configure.in) + +AC_CONFIG_HEADER(config.h) + +dnl Try and get a full POSIX environment on obscure systems +ifdef([AC_USE_SYSTEM_EXTENSIONS], [ +AC_USE_SYSTEM_EXTENSIONS +], [ +AC_AIX +AC_GNU_SOURCE +AC_MINIX +]) + +AC_OUTPUT From edf62dddbc3b9ced06d10de041d682c18965413e Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Sun, 2 Jan 2011 07:29:45 -0700 Subject: [PATCH 08/19] Revert "evconfig-private.h with recusive configure subdirs" This reverts commit ed53d5ef8053af08186ef80dfc1647cff769fac8. --- configure.in | 1 - evconfig-private/configure.in | 17 ----------------- 2 files changed, 18 deletions(-) delete mode 100644 evconfig-private/configure.in diff --git a/configure.in b/configure.in index 021eb0f7..bd9ad7fc 100644 --- a/configure.in +++ b/configure.in @@ -608,6 +608,5 @@ if test x$enable_gcc_warnings = xyes; then fi -AC_CONFIG_SUBDIRS( [evconfig-private] ) AC_CONFIG_FILES( [libevent.pc libevent_openssl.pc libevent_pthreads.pc] ) AC_OUTPUT(Makefile include/Makefile test/Makefile sample/Makefile) diff --git a/evconfig-private/configure.in b/evconfig-private/configure.in deleted file mode 100644 index a14e0945..00000000 --- a/evconfig-private/configure.in +++ /dev/null @@ -1,17 +0,0 @@ -dnl private configure.in for libevent -dnl Kevin Bowling -AC_PREREQ(2.59c) -AC_INIT(configure.in) - -AC_CONFIG_HEADER(config.h) - -dnl Try and get a full POSIX environment on obscure systems -ifdef([AC_USE_SYSTEM_EXTENSIONS], [ -AC_USE_SYSTEM_EXTENSIONS -], [ -AC_AIX -AC_GNU_SOURCE -AC_MINIX -]) - -AC_OUTPUT From 868f88874ff0c14530368a3077462a92a47eae9f Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Sun, 2 Jan 2011 07:51:23 -0700 Subject: [PATCH 09/19] Use a Configuration Header Template for evconfig-private.h --- configure.in | 2 +- evconfig-private.h.in | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 evconfig-private.h.in diff --git a/configure.in b/configure.in index bd9ad7fc..919493a4 100644 --- a/configure.in +++ b/configure.in @@ -6,7 +6,7 @@ AC_INIT(event.c) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE(libevent,2.1.0-alpha-dev) -AM_CONFIG_HEADER(config.h) +AM_CONFIG_HEADER(config.h evconfig-private.h:evconfig-private.h.in) AC_DEFINE(NUMERIC_VERSION, 0x02010001, [Numeric representation of the version]) dnl Initialize prefix. diff --git a/evconfig-private.h.in b/evconfig-private.h.in new file mode 100644 index 00000000..270b8dd6 --- /dev/null +++ b/evconfig-private.h.in @@ -0,0 +1,39 @@ +/* evconfig-private.h template - see "Configuration Header Templates" +/* in AC manual. Kevin Bowling Date: Sun, 2 Jan 2011 08:04:12 -0700 Subject: [PATCH 10/19] Remove event-private.h and switch to evconfig-private.h --- Makefile.am | 9 +++------ buffer.c | 2 +- evthread_pthread.c | 2 +- evutil.c | 3 +-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index ad5e2df5..cab603d7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -125,10 +125,7 @@ if SIGNAL_SUPPORT SYS_SRC += signal.c endif -BUILT_SOURCES = ./include/event2/event-config.h event-private.h - -event-private.h: config.h - cp config.h $@ +BUILT_SOURCES = ./include/event2/event-config.h ./include/event2/event-config.h: config.h @MKDIR_P@ ./include/event2 @@ -196,7 +193,7 @@ noinst_HEADERS = util-internal.h mm-internal.h ipv6-internal.h \ minheap-internal.h log-internal.h evsignal-internal.h evmap-internal.h \ changelist-internal.h iocp-internal.h \ ratelim-internal.h \ - event-private.h \ + evconfig-private.h \ WIN32-Code/event2/event-config.h \ WIN32-Code/tree.h \ compat/sys/queue.h @@ -211,5 +208,5 @@ doxygen: FORCE doxygen $(srcdir)/Doxyfile FORCE: -DISTCLEANFILES = *~ libevent.pc ./include/event2/event-config.h event-private.h +DISTCLEANFILES = *~ libevent.pc ./include/event2/event-config.h diff --git a/buffer.c b/buffer.c index 94a30bc5..2482572e 100644 --- a/buffer.c +++ b/buffer.c @@ -26,7 +26,7 @@ */ #include "event2/event-config.h" -#include "event-private.h" +#include "evconfig-private.h" #ifdef WIN32 #include diff --git a/evthread_pthread.c b/evthread_pthread.c index 5a56359d..0eb363e9 100644 --- a/evthread_pthread.c +++ b/evthread_pthread.c @@ -28,7 +28,7 @@ /* With glibc we need to define this to get PTHREAD_MUTEX_RECURSIVE. * _GNU_SOURCE, now from event-private */ -#include "event-private.h" +#include "evconfig-private.h" #include struct event_base; diff --git a/evutil.c b/evutil.c index 5c2e8395..f610736c 100644 --- a/evutil.c +++ b/evutil.c @@ -25,8 +25,7 @@ */ #include "event2/event-config.h" - -#include "event-private.h" +#include "evconfig-private.h" #ifdef WIN32 #include From f6d66bc7167a5b1249cf5a82196547ebe1077d83 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Sun, 2 Jan 2011 08:05:33 -0700 Subject: [PATCH 11/19] Fix a comment warning and add evconfig-private.h to .gitignore --- .gitignore | 1 + evconfig-private.h.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6f43ea56..fae18eed 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,7 @@ libevent_openssl.pc /stamp-h1 /include/event2/event-config.h +/evconfig-private.h /sample/dns-example /sample/event-test diff --git a/evconfig-private.h.in b/evconfig-private.h.in index 270b8dd6..8d87927a 100644 --- a/evconfig-private.h.in +++ b/evconfig-private.h.in @@ -1,4 +1,4 @@ -/* evconfig-private.h template - see "Configuration Header Templates" +/* evconfig-private.h template - see "Configuration Header Templates" */ /* in AC manual. Kevin Bowling Date: Sun, 2 Jan 2011 08:43:45 -0700 Subject: [PATCH 12/19] Include evconfig-private.h in internal files for great good. --- .gitignore | 1 + buffer.c | 1 - buffer_iocp.c | 3 ++- bufferevent-internal.h | 1 + bufferevent.c | 5 +++-- bufferevent_async.c | 1 + bufferevent_openssl.c | 5 +++-- bufferevent_pair.c | 4 ++-- bufferevent_sock.c | 5 +++-- defer-internal.h | 2 ++ devpoll.c | 1 + epoll.c | 1 + evbuffer-internal.h | 1 + evdns.c | 4 +++- event-internal.h | 2 ++ event.c | 1 + event_tagging.c | 1 + evmap.c | 1 + evport.c | 1 + evrpc.c | 1 + evthread-internal.h | 4 +++- evthread.c | 1 + evthread_pthread.c | 8 ++++---- evthread_win32.c | 1 + evutil_rand.c | 1 + http.c | 1 + ipv6-internal.h | 4 +++- kqueue.c | 1 - listener.c | 5 +++-- log.c | 1 + minheap-internal.h | 1 + poll.c | 1 + select.c | 1 + signal.c | 1 + strlcpy-internal.h | 1 + strlcpy.c | 5 +++-- util-internal.h | 2 ++ win32select.c | 3 ++- 38 files changed, 61 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index fae18eed..d1f2496e 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,7 @@ libevent_openssl.pc /ltmain.sh /missing /stamp-h1 +/stamp-h2 /include/event2/event-config.h /evconfig-private.h diff --git a/buffer.c b/buffer.c index 2482572e..bef226d6 100644 --- a/buffer.c +++ b/buffer.c @@ -85,7 +85,6 @@ #include "event2/bufferevent_compat.h" #include "event2/bufferevent_struct.h" #include "event2/thread.h" -#include "event2/event-config.h" #include "log-internal.h" #include "mm-internal.h" #include "util-internal.h" diff --git a/buffer_iocp.c b/buffer_iocp.c index 67c89c2a..54289879 100644 --- a/buffer_iocp.c +++ b/buffer_iocp.c @@ -30,12 +30,13 @@ This module implements overlapped read and write functions for evbuffer objects on Windows. */ +#include "event2/event-config.h" +#include "evconfig-private.h" #include "event2/buffer.h" #include "event2/buffer_compat.h" #include "event2/util.h" #include "event2/thread.h" -#include "event2/event-config.h" #include "util-internal.h" #include "evthread-internal.h" #include "evbuffer-internal.h" diff --git a/bufferevent-internal.h b/bufferevent-internal.h index 9d84e739..8c45fe9c 100644 --- a/bufferevent-internal.h +++ b/bufferevent-internal.h @@ -31,6 +31,7 @@ extern "C" { #endif #include "event2/event-config.h" +#include "evconfig-private.h" #include "event2/util.h" #include "defer-internal.h" #include "evthread-internal.h" diff --git a/bufferevent.c b/bufferevent.c index 4c9e38fa..876a83f4 100644 --- a/bufferevent.c +++ b/bufferevent.c @@ -25,9 +25,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - #include "event2/event-config.h" +#include "evconfig-private.h" + +#include #ifdef _EVENT_HAVE_SYS_TIME_H #include diff --git a/bufferevent_async.c b/bufferevent_async.c index b7284fda..c00ade89 100644 --- a/bufferevent_async.c +++ b/bufferevent_async.c @@ -27,6 +27,7 @@ */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifdef _EVENT_HAVE_SYS_TIME_H #include diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index 3d9a7701..4c9047e5 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -24,9 +24,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - #include "event2/event-config.h" +#include "evconfig-private.h" + +#include #ifdef _EVENT_HAVE_SYS_TIME_H #include diff --git a/bufferevent_pair.c b/bufferevent_pair.c index 1e20f78b..bc1039b9 100644 --- a/bufferevent_pair.c +++ b/bufferevent_pair.c @@ -23,6 +23,8 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "event2/event-config.h" +#include "evconfig-private.h" #include @@ -30,8 +32,6 @@ #include #endif -#include "event2/event-config.h" - #include "event2/util.h" #include "event2/buffer.h" #include "event2/bufferevent.h" diff --git a/bufferevent_sock.c b/bufferevent_sock.c index 1d76ea14..7502736c 100644 --- a/bufferevent_sock.c +++ b/bufferevent_sock.c @@ -26,9 +26,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - #include "event2/event-config.h" +#include "evconfig-private.h" + +#include #ifdef _EVENT_HAVE_SYS_TIME_H #include diff --git a/defer-internal.h b/defer-internal.h index 8bfa8488..1892c556 100644 --- a/defer-internal.h +++ b/defer-internal.h @@ -31,6 +31,8 @@ extern "C" { #endif #include "event2/event-config.h" +#include "evconfig-private.h" + #include struct deferred_cb; diff --git a/devpoll.c b/devpoll.c index 55f89d28..2a6a0aa2 100644 --- a/devpoll.c +++ b/devpoll.c @@ -25,6 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" +#include "evconfig-private.h" #include #include diff --git a/epoll.c b/epoll.c index 0ea2349c..7253358b 100644 --- a/epoll.c +++ b/epoll.c @@ -25,6 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" +#include "evconfig-private.h" #include #include diff --git a/evbuffer-internal.h b/evbuffer-internal.h index 7fc8b914..31495a96 100644 --- a/evbuffer-internal.h +++ b/evbuffer-internal.h @@ -32,6 +32,7 @@ extern "C" { #endif #include "event2/event-config.h" +#include "evconfig-private.h" #include "event2/util.h" #include "util-internal.h" #include "defer-internal.h" diff --git a/evdns.c b/evdns.c index a1636a14..75e6b997 100644 --- a/evdns.c +++ b/evdns.c @@ -34,8 +34,10 @@ * Version: 0.1b */ -#include #include "event2/event-config.h" +#include "evconfig-private.h" + +#include #ifndef _FORTIFY_SOURCE #define _FORTIFY_SOURCE 3 diff --git a/event-internal.h b/event-internal.h index e3da33da..1171bd9e 100644 --- a/event-internal.h +++ b/event-internal.h @@ -32,6 +32,8 @@ extern "C" { #endif #include "event2/event-config.h" +#include "evconfig-private.h" + #include #include "event2/event_struct.h" #include "minheap-internal.h" diff --git a/event.c b/event.c index fedb9c73..fa8c722d 100644 --- a/event.c +++ b/event.c @@ -25,6 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifdef WIN32 #include diff --git a/event_tagging.c b/event_tagging.c index aaded70a..f3ba1d2e 100644 --- a/event_tagging.c +++ b/event_tagging.c @@ -26,6 +26,7 @@ */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifdef _EVENT_HAVE_SYS_TYPES_H #include diff --git a/evmap.c b/evmap.c index 3bcad117..77a53772 100644 --- a/evmap.c +++ b/evmap.c @@ -24,6 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifdef WIN32 #include diff --git a/evport.c b/evport.c index 4301a39c..082e20ab 100644 --- a/evport.c +++ b/evport.c @@ -51,6 +51,7 @@ */ #include "event2/event-config.h" +#include "evconfig-private.h" #include #include diff --git a/evrpc.c b/evrpc.c index 9d692994..22dd57ac 100644 --- a/evrpc.c +++ b/evrpc.c @@ -25,6 +25,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifdef WIN32 #define WIN32_LEAN_AND_MEAN diff --git a/evthread-internal.h b/evthread-internal.h index 9317fdf1..847006ed 100644 --- a/evthread-internal.h +++ b/evthread-internal.h @@ -30,8 +30,10 @@ extern "C" { #endif -#include "event2/thread.h" #include "event2/event-config.h" +#include "evconfig-private.h" + +#include "event2/thread.h" #include "util-internal.h" struct event_base; diff --git a/evthread.c b/evthread.c index 35f14b2b..c96c6fd9 100644 --- a/evthread.c +++ b/evthread.c @@ -25,6 +25,7 @@ */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifndef _EVENT_DISABLE_THREAD_SUPPORT diff --git a/evthread_pthread.c b/evthread_pthread.c index 0eb363e9..b806922a 100644 --- a/evthread_pthread.c +++ b/evthread_pthread.c @@ -24,11 +24,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" - -/* With glibc we need to define this to get PTHREAD_MUTEX_RECURSIVE. - * _GNU_SOURCE, now from event-private - */ #include "evconfig-private.h" + +/* With glibc we need to define _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE. + * This comes from evconfig-private.h + */ #include struct event_base; diff --git a/evthread_win32.c b/evthread_win32.c index bd72be15..73e545bf 100644 --- a/evthread_win32.c +++ b/evthread_win32.c @@ -24,6 +24,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifdef WIN32 #include diff --git a/evutil_rand.c b/evutil_rand.c index 07ad2ea6..85cd3e9c 100644 --- a/evutil_rand.c +++ b/evutil_rand.c @@ -33,6 +33,7 @@ */ #include "event2/event-config.h" +#include "evconfig-private.h" #include diff --git a/http.c b/http.c index f8de3b37..29ea8e99 100644 --- a/http.c +++ b/http.c @@ -26,6 +26,7 @@ */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifdef _EVENT_HAVE_SYS_PARAM_H #include diff --git a/ipv6-internal.h b/ipv6-internal.h index 7d6fb736..d5d1d3a3 100644 --- a/ipv6-internal.h +++ b/ipv6-internal.h @@ -30,11 +30,13 @@ #ifndef _EVENT_IPV6_INTERNAL_H #define _EVENT_IPV6_INTERNAL_H +#include "event2/event-config.h" +#include "evconfig-private.h" + #include #ifdef _EVENT_HAVE_SYS_SOCKET_H #include #endif -#include "event2/event-config.h" #include "event2/util.h" #ifdef __cplusplus diff --git a/kqueue.c b/kqueue.c index 12d4c198..0db64abb 100644 --- a/kqueue.c +++ b/kqueue.c @@ -27,7 +27,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" - #include "event-private.h" #include diff --git a/listener.c b/listener.c index d0911bdb..0f3cecf8 100644 --- a/listener.c +++ b/listener.c @@ -24,9 +24,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - #include "event2/event-config.h" +#include "evconfig-private.h" + +#include #ifdef WIN32 #include diff --git a/log.c b/log.c index f0cd4320..142719cc 100644 --- a/log.c +++ b/log.c @@ -38,6 +38,7 @@ */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifdef WIN32 #include diff --git a/minheap-internal.h b/minheap-internal.h index 9734a7c7..8055e903 100644 --- a/minheap-internal.h +++ b/minheap-internal.h @@ -29,6 +29,7 @@ #define _MIN_HEAP_H_ #include "event2/event-config.h" +#include "evconfig-private.h" #include "event2/event.h" #include "event2/event_struct.h" #include "event2/util.h" diff --git a/poll.c b/poll.c index 63f23886..540d3a13 100644 --- a/poll.c +++ b/poll.c @@ -27,6 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" +#include "evconfig-private.h" #include #ifdef _EVENT_HAVE_SYS_TIME_H diff --git a/select.c b/select.c index 527462ca..0ad04468 100644 --- a/select.c +++ b/select.c @@ -27,6 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" +#include "evconfig-private.h" #include #ifdef _EVENT_HAVE_SYS_TIME_H diff --git a/signal.c b/signal.c index ec27ea88..a700c128 100644 --- a/signal.c +++ b/signal.c @@ -27,6 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" +#include "evconfig-private.h" #ifdef WIN32 #define WIN32_LEAN_AND_MEAN diff --git a/strlcpy-internal.h b/strlcpy-internal.h index 1968c003..4152b7bd 100644 --- a/strlcpy-internal.h +++ b/strlcpy-internal.h @@ -6,6 +6,7 @@ extern "C" { #endif #include "event2/event-config.h" +#include "evconfig-private.h" #ifndef _EVENT_HAVE_STRLCPY #include diff --git a/strlcpy.c b/strlcpy.c index 11053c33..3656e9f0 100644 --- a/strlcpy.c +++ b/strlcpy.c @@ -31,9 +31,10 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ -#include - #include "event2/event-config.h" +#include "evconfig-private.h" + +#include #ifndef _EVENT_HAVE_STRLCPY #include "strlcpy-internal.h" diff --git a/util-internal.h b/util-internal.h index cb76ee4f..ba596fab 100644 --- a/util-internal.h +++ b/util-internal.h @@ -27,6 +27,8 @@ #define _EVENT_UTIL_INTERNAL_H #include "event2/event-config.h" +#include "evconfig-private.h" + #include /* For EVUTIL_ASSERT */ diff --git a/win32select.c b/win32select.c index 70e7e6e8..d1f121bf 100644 --- a/win32select.c +++ b/win32select.c @@ -25,6 +25,8 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "event2/event-config.h" +#include "evconfig-private.h" #include #include @@ -38,7 +40,6 @@ #include #include "event2/util.h" -#include "event2/event-config.h" #include "util-internal.h" #include "log-internal.h" #include "event2/event.h" From dc628c030469f8671943b5cb86ff8ec179f1a7b7 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Sun, 2 Jan 2011 08:47:46 -0700 Subject: [PATCH 13/19] Add an include guard --- evconfig-private.h.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/evconfig-private.h.in b/evconfig-private.h.in index 8d87927a..cffdf531 100644 --- a/evconfig-private.h.in +++ b/evconfig-private.h.in @@ -1,5 +1,7 @@ /* evconfig-private.h template - see "Configuration Header Templates" */ /* in AC manual. Kevin Bowling Date: Sun, 2 Jan 2011 08:48:12 -0700 Subject: [PATCH 14/19] Add an evconfig-private.h stub for Win32. --- Makefile.am | 1 + WIN32-Code/evconfig-private.h | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 WIN32-Code/evconfig-private.h diff --git a/Makefile.am b/Makefile.am index cab603d7..a103be14 100644 --- a/Makefile.am +++ b/Makefile.am @@ -195,6 +195,7 @@ noinst_HEADERS = util-internal.h mm-internal.h ipv6-internal.h \ ratelim-internal.h \ evconfig-private.h \ WIN32-Code/event2/event-config.h \ + WIN32-Code/evconfig-private.h \ WIN32-Code/tree.h \ compat/sys/queue.h diff --git a/WIN32-Code/evconfig-private.h b/WIN32-Code/evconfig-private.h new file mode 100644 index 00000000..72cd0973 --- /dev/null +++ b/WIN32-Code/evconfig-private.h @@ -0,0 +1,6 @@ +#ifndef _EVENT_EVCONFIG__PRIVATE_H +#define _EVENT_EVCONFIG__PRIVATE_H + +/* Nothing to see here. Move along. */ + +#endif From ad03952edfc2e08e2743c09389840412fcf81958 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Mon, 3 Jan 2011 15:09:21 -0700 Subject: [PATCH 15/19] Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) --- Makefile.am | 2 +- configure.in | 4 ++-- m4/ac_backport_259_ssizet.m4 | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 m4/ac_backport_259_ssizet.m4 diff --git a/Makefile.am b/Makefile.am index a103be14..57dff42d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -128,7 +128,7 @@ endif BUILT_SOURCES = ./include/event2/event-config.h ./include/event2/event-config.h: config.h - @MKDIR_P@ ./include/event2 + $(MKDIR_P) ./include/event2 echo '/* event2/event-config.h' > $@ echo ' *' >> $@ echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@ diff --git a/configure.in b/configure.in index 919493a4..bd893f37 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl configure.in for libevent dnl Dug Song -AC_PREREQ(2.59c) +AC_PREREQ(2.59) AC_INIT(event.c) AC_CONFIG_MACRO_DIR([m4]) @@ -27,7 +27,7 @@ dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S -AC_PROG_MKDIR_P +# AC_PROG_MKDIR_P - $(MKDIR_P) should be defined by AM_INIT_AUTOMAKE AC_PROG_GCC_TRADITIONAL diff --git a/m4/ac_backport_259_ssizet.m4 b/m4/ac_backport_259_ssizet.m4 new file mode 100644 index 00000000..75fde386 --- /dev/null +++ b/m4/ac_backport_259_ssizet.m4 @@ -0,0 +1,3 @@ +AN_IDENTIFIER([ssize_t], [AC_TYPE_SSIZE_T]) +AC_DEFUN([AC_TYPE_SSIZE_T], [AC_CHECK_TYPE(ssize_t, int)]) + From f964b7215ac2a3dc0edaef6c130f67e31576f738 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Mon, 3 Jan 2011 15:44:26 -0700 Subject: [PATCH 16/19] Prefer the ./configure evconfig-private.h in MinGW, just in case. --- WIN32-Code/evconfig-private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WIN32-Code/evconfig-private.h b/WIN32-Code/evconfig-private.h index 72cd0973..88b3f44f 100644 --- a/WIN32-Code/evconfig-private.h +++ b/WIN32-Code/evconfig-private.h @@ -1,4 +1,4 @@ -#ifndef _EVENT_EVCONFIG__PRIVATE_H +#if !defined(_EVENT_EVCONFIG__PRIVATE_H) && !defined(__MINGW32__) #define _EVENT_EVCONFIG__PRIVATE_H /* Nothing to see here. Move along. */ From c13e18591457ed8ea2042d8c92bca5e340cfd5df Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Fri, 7 Jan 2011 00:34:22 -0700 Subject: [PATCH 17/19] Remove use and reference to event-private.h --- buffer.c | 2 +- kqueue.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buffer.c b/buffer.c index bef226d6..180899cf 100644 --- a/buffer.c +++ b/buffer.c @@ -36,7 +36,7 @@ #ifdef _EVENT_HAVE_VASPRINTF /* If we have vasprintf, we need to define _GNU_SOURCE before we include - * stdio.h. This comes from event-private.h. + * stdio.h. This comes from evconfig-private.h. */ #endif diff --git a/kqueue.c b/kqueue.c index 0db64abb..64c25cdf 100644 --- a/kqueue.c +++ b/kqueue.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "event2/event-config.h" -#include "event-private.h" +#include "evconfig-private.h" #include #ifdef _EVENT_HAVE_SYS_TIME_H From fd7b5a81eb635dee2f48600fe3e96698b358c077 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Fri, 7 Jan 2011 00:37:05 -0700 Subject: [PATCH 18/19] Shell hack for weird mkdir -p commands --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 57dff42d..1a4d64ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -128,7 +128,7 @@ endif BUILT_SOURCES = ./include/event2/event-config.h ./include/event2/event-config.h: config.h - $(MKDIR_P) ./include/event2 + $(MKDIR_P) ./include/event2 || true echo '/* event2/event-config.h' > $@ echo ' *' >> $@ echo ' * This file was generated by autoconf when libevent was built, and post-' >> $@ From ded0a0907b5b49ba2ae4783edc24a465f1b66418 Mon Sep 17 00:00:00 2001 From: Kevin Bowling Date: Fri, 7 Jan 2011 00:41:37 -0700 Subject: [PATCH 19/19] Add evconfig-private to remaining files --- arc4random.c | 1 + bufferevent_filter.c | 2 ++ bufferevent_ratelim.c | 1 + epoll_sub.c | 1 + event_iocp.c | 1 + 5 files changed, 6 insertions(+) diff --git a/arc4random.c b/arc4random.c index b6d2c5b3..045b9d2a 100644 --- a/arc4random.c +++ b/arc4random.c @@ -49,6 +49,7 @@ #endif #ifndef ARC4RANDOM_NO_INCLUDES +#include "evconfig-private.h" #ifdef WIN32 #include #include diff --git a/bufferevent_filter.c b/bufferevent_filter.c index 6886aca0..ad8a316b 100644 --- a/bufferevent_filter.c +++ b/bufferevent_filter.c @@ -26,6 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "evconfig-private.h" + #include #include "event2/event-config.h" diff --git a/bufferevent_ratelim.c b/bufferevent_ratelim.c index 85904e82..7e51c2e5 100644 --- a/bufferevent_ratelim.c +++ b/bufferevent_ratelim.c @@ -25,6 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "evconfig-private.h" #include #include diff --git a/epoll_sub.c b/epoll_sub.c index 3a31e35a..57599362 100644 --- a/epoll_sub.c +++ b/epoll_sub.c @@ -24,6 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "evconfig-private.h" #include #include diff --git a/event_iocp.c b/event_iocp.c index 254ed90d..7fa39506 100644 --- a/event_iocp.c +++ b/event_iocp.c @@ -23,6 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "evconfig-private.h" #include #include