From dd0b36ab03d0fd966f694f5152220987d84b2c5d Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Thu, 25 Sep 2003 03:25:17 +0000 Subject: [PATCH] update build stuff svn:r76 --- Makefile.am | 14 ++++++++---- configure.in | 63 +++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 65 insertions(+), 12 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8a3f151f..ab7a2671 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,15 +1,21 @@ AUTOMAKE_OPTIONS = foreign no-dependencies -CFLAGS += -Wall -g -O2 +CFLAGS = -Wall -Werror @CFLAGS@ SUBDIRS = . sample test -EXTRA_DIST = acconfig.h epoll.c err.c event.h kqueue.c select.c \ - epoll_sub.c evsignal.h poll.c signal.c event.3 \ +EXTRA_DIST = acconfig.h err.c event.h evsignal.h event.3 \ sample/Makefile.am sample/Makefile.in sample/event-test.c \ sample/signal-test.c sample/time-test.c \ test/Makefile.am test/Makefile.in test/bench.c test/regress.c \ test/test-eof.c test/test-weof.c test/test-time.c \ - compat/err.h compat/sys/queue.h compat/sys/tree.h compat/sys/_time.h + compat/err.h compat/sys/queue.h compat/sys/tree.h compat/sys/_time.h \ + WIN32-Code WIN32-Code/config.h WIN32-Code/win32.c~ WIN32-Code/misc.c \ + WIN32-Code/win32.c WIN32-Code/misc.h \ + WIN32-Prj WIN32-Prj/event_test WIN32-Prj/event_test/event_test.dsp \ + WIN32-Prj/event_test/test.txt WIN32-Prj/libevent.dsp \ + WIN32-Prj/libevent.dsw WIN32-Prj/signal_test \ + WIN32-Prj/signal_test/signal_test.dsp WIN32-Prj/time_test \ + WIN32-Prj/time_test/time_test.dsp lib_LIBRARIES = libevent.a diff --git a/configure.in b/configure.in index f5443842..d5e77511 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,9 @@ dnl configure.in for libevent dnl Dug Song AC_INIT(event.c) -AM_INIT_AUTOMAKE(libevent,0.7a) +AM_INIT_AUTOMAKE(libevent,0.7b) AM_CONFIG_HEADER(config.h) +AM_MAINTAINER_MODE dnl Initialize prefix. if test "$prefix" = "NONE"; then @@ -61,15 +62,61 @@ needsignal=no haveselect=no AC_CHECK_FUNCS(select, [haveselect=yes], ) if test "x$haveselect" = "xyes" ; then - AC_LIBOBJ([select]) + AC_LIBOBJ(select) needsignal=yes fi havepoll=no +havertsig=no AC_CHECK_FUNCS(poll, [havepoll=yes], ) if test "x$havepoll" = "xyes" ; then - AC_LIBOBJ([poll]) + AC_LIBOBJ(poll) needsignal=yes + + AC_CHECK_FUNCS(sigtimedwait, [havertsig=yes], ) +fi +if test "x$havertsig" = "xyes" ; then + AC_MSG_CHECKING(for F_SETSIG in fcntl.h) + AC_EGREP_CPP(yes, +[ +#define _GNU_SOURCE +#include +#ifdef F_SETSIG +yes +#endif +], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no); havertsig=no]) +fi +if test "x$havertsig" = "xyes" ; then + AC_DEFINE(HAVE_RTSIG, 1, [Define if your system supports POSIX realtime signals]) + AC_LIBOBJ(rtsig) + AC_MSG_CHECKING(for working rtsig on pipes) + AC_TRY_RUN( +[ +#define _GNU_SOURCE +#include +#include +#include + +int sigio() +{ + exit(0); +} + +int main() +{ + int fd[2]; + + pipe(fd); + signal(SIGIO, sigio); + fcntl(fd[0], F_SETOWN, getpid()); + fcntl(fd[0], F_SETSIG, SIGIO); + fcntl(fd[0], F_SETFL, fcntl(fd[0], F_GETFL) | O_ASYNC); + write(fd[1], "", 1); + return 1; +} +], [ AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_WORKING_RTSIG, 1, [Define if realtime signals work on pipes])], + AC_MSG_RESULT(no)) fi haveepoll=no @@ -77,7 +124,7 @@ AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], ) if test "x$haveepoll" = "xyes" ; then AC_DEFINE(HAVE_EPOLL, 1, [Define if your system supports the epoll system calls]) - AC_LIBOBJ([epoll]) + AC_LIBOBJ(epoll) needsignal=yes fi @@ -134,7 +181,7 @@ main(int argc, char **argv) }, [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_WORKING_KQUEUE, 1, [Define if kqueue works correctly with pipes]) - AC_LIBOBJ([kqueue])], AC_MSG_RESULT(no), AC_MSG_RESULT(no)) + AC_LIBOBJ(kqueue)], AC_MSG_RESULT(no), AC_MSG_RESULT(no)) fi fi @@ -167,13 +214,13 @@ main(int argc, char **argv) AC_DEFINE(HAVE_EPOLL, 1, [Define if your system supports the epoll system calls]) needsignal=yes - AC_LIBOBJ([epoll_sub]) - AC_LIBOBJ([epoll])], AC_MSG_RESULT(no), AC_MSG_RESULT(no)) + AC_LIBOBJ(epoll_sub) + AC_LIBOBJ(epoll)], AC_MSG_RESULT(no), AC_MSG_RESULT(no)) fi fi if test "x$needsignal" = "xyes" ; then - AC_LIBOBJ([signal]) + AC_LIBOBJ(signal) fi AC_REPLACE_FUNCS(err) -- 2.40.0