From ecc54f900fa6aaf1b97ef85b1101cf7badf33cec Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 May 2007 00:57:48 +0000 Subject: r22830: merged the latest lib/events updates from ctdb to Samba4. This includes a new EVENT_FD_AUTOCLOSE flag that prevents race conditions where code using fd events might close a fd before releasing the struct fd_event. That causes headaches for epoll. (This used to be commit f1ad216de13b154a1f8747a44b0970dcc47a784a) --- source4/lib/events/libevents.m4 | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 source4/lib/events/libevents.m4 (limited to 'source4/lib/events/libevents.m4') diff --git a/source4/lib/events/libevents.m4 b/source4/lib/events/libevents.m4 new file mode 100644 index 0000000000..99a47dcc54 --- /dev/null +++ b/source4/lib/events/libevents.m4 @@ -0,0 +1,11 @@ +EVENTS_OBJ="lib/events/events.o lib/events/events_select.o lib/events/events_signal.o lib/events/events_timed.o lib/events/events_standard.o" + +AC_CHECK_HEADERS(sys/epoll.h) +AC_CHECK_FUNCS(epoll_create) + +if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x"yes"; then + EVENTS_OBJ="$EVENTS_OBJ lib/events/events_epoll.o" + AC_DEFINE(HAVE_EVENTS_EPOLL, 1, [Whether epoll available]) +fi + +AC_SUBST(EVENTS_OBJ) -- cgit From 136f369b23946698c9fcfd217444ddc0614cde85 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 24 Apr 2008 17:28:30 -0400 Subject: Make it possible to build libevents standalone. (This used to be commit 10415bb738d51afdebbfeae976923e086805ae84) --- source4/lib/events/libevents.m4 | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'source4/lib/events/libevents.m4') diff --git a/source4/lib/events/libevents.m4 b/source4/lib/events/libevents.m4 index 99a47dcc54..483ab861fb 100644 --- a/source4/lib/events/libevents.m4 +++ b/source4/lib/events/libevents.m4 @@ -1,11 +1,28 @@ -EVENTS_OBJ="lib/events/events.o lib/events/events_select.o lib/events/events_signal.o lib/events/events_timed.o lib/events/events_standard.o" +dnl find the events sources. This is meant to work both for +dnl standalone builds, and builds of packages using libevents +eventsdir="" +eventspaths="$srcdir $srcdir/lib/events $srcdir/events $srcdir/../events" +for d in $eventspaths; do + if test -f "$d/events.c"; then + eventsdir="$d" + AC_SUBST(eventsdir) + break; + fi +done +if test x"$eventsdir" = "x"; then + AC_MSG_ERROR([cannot find libevents source in $eventspaths]) +fi + +EVENTS_OBJ="events.o events_select.o events_signal.o events_timed.o events_standard.o events_util.o" +AC_SUBST(LIBREPLACEOBJ) AC_CHECK_HEADERS(sys/epoll.h) AC_CHECK_FUNCS(epoll_create) if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x"yes"; then - EVENTS_OBJ="$EVENTS_OBJ lib/events/events_epoll.o" + EVENTS_OBJ="$EVENTS_OBJ events_epoll.o" AC_DEFINE(HAVE_EVENTS_EPOLL, 1, [Whether epoll available]) fi AC_SUBST(EVENTS_OBJ) + -- cgit From 2aba4107915611b223daa8c27c52352f57b25bbc Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 14 Jun 2008 11:23:31 -0400 Subject: This patch make it possible to build the events library completely standalone with no ties to internal samba4 functions Samba4 itself just uses the plain library, compatibility glue is in events_s4.c only (This used to be commit 7109b6a5a19eb2dbef4259104858b171298bad6e) --- source4/lib/events/libevents.m4 | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'source4/lib/events/libevents.m4') diff --git a/source4/lib/events/libevents.m4 b/source4/lib/events/libevents.m4 index 483ab861fb..be3f1bb638 100644 --- a/source4/lib/events/libevents.m4 +++ b/source4/lib/events/libevents.m4 @@ -13,16 +13,34 @@ if test x"$eventsdir" = "x"; then AC_MSG_ERROR([cannot find libevents source in $eventspaths]) fi -EVENTS_OBJ="events.o events_select.o events_signal.o events_timed.o events_standard.o events_util.o" -AC_SUBST(LIBREPLACEOBJ) +EVENTS_OBJ="events.o events_select.o events_signal.o events_timed.o events_standard.o events_debug.o events_util.o" +SMB_ENABLE(EVENTS_EPOLL, NO) +SMB_ENABLE(EVENTS_AIO, NO) AC_CHECK_HEADERS(sys/epoll.h) AC_CHECK_FUNCS(epoll_create) - if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x"yes"; then EVENTS_OBJ="$EVENTS_OBJ events_epoll.o" + SMB_ENABLE(EVENTS_EPOLL,YES) AC_DEFINE(HAVE_EVENTS_EPOLL, 1, [Whether epoll available]) + + # check for native Linux AIO interface + AC_CHECK_HEADERS(libaio.h) + AC_CHECK_LIB_EXT(aio, AIO_LIBS, io_getevents) + if test x"$ac_cv_header_libaio_h" = x"yes" -a x"$ac_cv_lib_ext_aio_io_getevents" = x"yes";then + EVENTS_OBJ="$EVENTS_OBJ events_aio.o" + SMB_ENABLE(EVENTS_AIO,YES) + AC_DEFINE(HAVE_LINUX_AIO, 1, [Whether Linux AIO is available]) + fi fi AC_SUBST(EVENTS_OBJ) +SMB_EXT_LIB(LIBAIO_LINUX, $AIO_LIBS) + +EVENTS_CFLAGS="-I$eventsdir" +AC_SUBST(EVENTS_CFLAGS) + +EVENTS_LIBS="" +AC_SUBST(EVENTS_LIBS) + -- cgit From 7cb41fde3c586daff0c9f52b2b214a8afc3a82a3 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 15 Jun 2008 19:16:35 +0200 Subject: Fix standalone ldb build. (This used to be commit 4ac91e301455721b76f7f456bc50c5c6e47c05d3) --- source4/lib/events/libevents.m4 | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/lib/events/libevents.m4') diff --git a/source4/lib/events/libevents.m4 b/source4/lib/events/libevents.m4 index be3f1bb638..552dc7c43e 100644 --- a/source4/lib/events/libevents.m4 +++ b/source4/lib/events/libevents.m4 @@ -14,6 +14,7 @@ if test x"$eventsdir" = "x"; then fi EVENTS_OBJ="events.o events_select.o events_signal.o events_timed.o events_standard.o events_debug.o events_util.o" +AC_LIBREPLACE_NETWORK_CHECKS SMB_ENABLE(EVENTS_EPOLL, NO) SMB_ENABLE(EVENTS_AIO, NO) -- cgit From 4f4949a8f4d729e189e873f8f5b0161e875d3501 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 26 Jun 2008 10:11:49 +0200 Subject: Only try to detect the events lib dir if it wasn't set earlier. (This used to be commit 3f48f68800176d992a1bd9b6349f22ec152fc34a) --- source4/lib/events/libevents.m4 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'source4/lib/events/libevents.m4') diff --git a/source4/lib/events/libevents.m4 b/source4/lib/events/libevents.m4 index 552dc7c43e..d17da64b32 100644 --- a/source4/lib/events/libevents.m4 +++ b/source4/lib/events/libevents.m4 @@ -1,16 +1,18 @@ dnl find the events sources. This is meant to work both for dnl standalone builds, and builds of packages using libevents -eventsdir="" -eventspaths="$srcdir $srcdir/lib/events $srcdir/events $srcdir/../events" -for d in $eventspaths; do - if test -f "$d/events.c"; then - eventsdir="$d" - AC_SUBST(eventsdir) - break; - fi -done if test x"$eventsdir" = "x"; then - AC_MSG_ERROR([cannot find libevents source in $eventspaths]) + eventsdir="" + eventspaths="$srcdir $srcdir/../samba4/source/lib/events $srcdir/lib/events $srcdir/events $srcdir/../events" + for d in $eventspaths; do + if test -f "$d/events.c"; then + eventsdir="$d" + AC_SUBST(eventsdir) + break; + fi + done + if test x"$eventsdir" = "x"; then + AC_MSG_ERROR([cannot find libevents source in $eventspaths]) + fi fi EVENTS_OBJ="events.o events_select.o events_signal.o events_timed.o events_standard.o events_debug.o events_util.o" -- cgit