mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 05:14:46 -04:00
Switch to using AM conditionals in place of AC_LIBOBJ
AC_LIBOBJ is really only meant for defining missing library functions, not conditional code compilation. Sticking our conditionally compiled modules in SYS_SRC should make stuff easier to maintain.
This commit is contained in:
parent
b660edf9db
commit
2e898f542b
34
Makefile.am
34
Makefile.am
@ -37,17 +37,16 @@ bin_SCRIPTS = event_rpcgen.py
|
|||||||
pkgconfigdir=$(libdir)/pkgconfig
|
pkgconfigdir=$(libdir)/pkgconfig
|
||||||
pkgconfig_DATA=libevent.pc
|
pkgconfig_DATA=libevent.pc
|
||||||
|
|
||||||
# These sources are conditionally added to SYS_SRC by configure.in
|
# These sources are conditionally added by configure.in or conditionally
|
||||||
|
# included from other files.
|
||||||
PLATFORM_DEPENDENT_SRC = \
|
PLATFORM_DEPENDENT_SRC = \
|
||||||
kqueue.c epoll_sub.c epoll.c select.c poll.c signal.c \
|
epoll_sub.c \
|
||||||
evport.c devpoll.c
|
arc4random.c
|
||||||
arc4random.c \
|
|
||||||
evthread_pthread.c
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
evdns.3 event.3 \
|
evdns.3 event.3 \
|
||||||
LICENSE \
|
LICENSE \
|
||||||
autogen.sh
|
autogen.sh \
|
||||||
libevent.pc.in \
|
libevent.pc.in \
|
||||||
Doxyfile \
|
Doxyfile \
|
||||||
whatsnew-2.0.txt \
|
whatsnew-2.0.txt \
|
||||||
@ -80,6 +79,28 @@ SYS_INCLUDES =
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if SELECT_BACKEND
|
||||||
|
SYS_SRC += select.c
|
||||||
|
endif
|
||||||
|
if POLL_BACKEND
|
||||||
|
SYS_SRC += poll.c
|
||||||
|
endif
|
||||||
|
if DEVPOLL_BACKEND
|
||||||
|
SYS_SRC += devpoll.c
|
||||||
|
endif
|
||||||
|
if KQUEUE_BACKEND
|
||||||
|
SYS_SRC += kqueue.c
|
||||||
|
endif
|
||||||
|
if EPOLL_BACKEND
|
||||||
|
SYS_SRC += epoll.c
|
||||||
|
endif
|
||||||
|
if EVPORT_BACKEND
|
||||||
|
SYS_SRC += evport.c
|
||||||
|
endif
|
||||||
|
if SIGNAL_SUPPORT
|
||||||
|
SYS_SRC += signal.c
|
||||||
|
endif
|
||||||
|
|
||||||
BUILT_SOURCES = event-config.h
|
BUILT_SOURCES = event-config.h
|
||||||
|
|
||||||
event-config.h: config.h
|
event-config.h: config.h
|
||||||
@ -106,7 +127,6 @@ CORE_SRC = event.c evthread.c buffer.c \
|
|||||||
evmap.c log.c evutil.c evutil_rand.c strlcpy.c $(SYS_SRC)
|
evmap.c log.c evutil.c evutil_rand.c strlcpy.c $(SYS_SRC)
|
||||||
EXTRA_SRC = event_tagging.c http.c evdns.c evrpc.c
|
EXTRA_SRC = event_tagging.c http.c evdns.c evrpc.c
|
||||||
|
|
||||||
|
|
||||||
libevent_la_SOURCES = $(CORE_SRC) $(EXTRA_SRC)
|
libevent_la_SOURCES = $(CORE_SRC) $(EXTRA_SRC)
|
||||||
libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
|
libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS)
|
||||||
libevent_la_LDFLAGS = -version-info $(VERSION_INFO)
|
libevent_la_LDFLAGS = -version-info $(VERSION_INFO)
|
||||||
|
41
configure.in
41
configure.in
@ -260,32 +260,23 @@ needsignal=no
|
|||||||
haveselect=no
|
haveselect=no
|
||||||
AC_CHECK_FUNCS(select, [haveselect=yes], )
|
AC_CHECK_FUNCS(select, [haveselect=yes], )
|
||||||
if test "x$haveselect" = "xyes" ; then
|
if test "x$haveselect" = "xyes" ; then
|
||||||
AC_LIBOBJ(select)
|
|
||||||
needsignal=yes
|
needsignal=yes
|
||||||
fi
|
fi
|
||||||
|
AM_CONDITIONAL(SELECT_BACKEND, [test "x$haveselect" = "xyes"])
|
||||||
|
|
||||||
havepoll=no
|
havepoll=no
|
||||||
AC_CHECK_FUNCS(poll, [havepoll=yes], )
|
AC_CHECK_FUNCS(poll, [havepoll=yes], )
|
||||||
if test "x$havepoll" = "xyes" ; then
|
if test "x$havepoll" = "xyes" ; then
|
||||||
AC_LIBOBJ(poll)
|
|
||||||
needsignal=yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
haveepoll=no
|
|
||||||
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)
|
|
||||||
needsignal=yes
|
needsignal=yes
|
||||||
fi
|
fi
|
||||||
|
AM_CONDITIONAL(POLL_BACKEND, [test "x$havepoll" = "xyes"])
|
||||||
|
|
||||||
havedevpoll=no
|
havedevpoll=no
|
||||||
if test "x$ac_cv_header_sys_devpoll_h" = "xyes"; then
|
if test "x$ac_cv_header_sys_devpoll_h" = "xyes"; then
|
||||||
AC_DEFINE(HAVE_DEVPOLL, 1,
|
AC_DEFINE(HAVE_DEVPOLL, 1,
|
||||||
[Define if /dev/poll is available])
|
[Define if /dev/poll is available])
|
||||||
AC_LIBOBJ(devpoll)
|
|
||||||
fi
|
fi
|
||||||
|
AM_CONDITIONAL(DEVPOLL_BACKEND, [test "ac_cv_header_sys_devpoll_h" = "xyes"])
|
||||||
|
|
||||||
havekqueue=no
|
havekqueue=no
|
||||||
if test "x$ac_cv_header_sys_event_h" = "xyes"; then
|
if test "x$ac_cv_header_sys_event_h" = "xyes"; then
|
||||||
@ -340,11 +331,20 @@ main(int argc, char **argv)
|
|||||||
}, [AC_MSG_RESULT(yes)
|
}, [AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
|
AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
|
||||||
[Define if kqueue works correctly with pipes])
|
[Define if kqueue works correctly with pipes])
|
||||||
AC_LIBOBJ(kqueue)], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
havekqueue=yes
|
||||||
|
], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
AM_CONDITIONAL(KQUEUE_BACKEND, [test "x$havekqueue" = "xyes"])
|
||||||
|
|
||||||
haveepollsyscall=no
|
haveepollsyscall=no
|
||||||
|
haveepoll=no
|
||||||
|
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])
|
||||||
|
needsignal=yes
|
||||||
|
fi
|
||||||
if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
|
if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
|
||||||
if test "x$haveepoll" = "xno" ; then
|
if test "x$haveepoll" = "xno" ; then
|
||||||
AC_MSG_CHECKING(for epoll system call)
|
AC_MSG_CHECKING(for epoll system call)
|
||||||
@ -373,28 +373,27 @@ main(int argc, char **argv)
|
|||||||
AC_DEFINE(HAVE_EPOLL, 1,
|
AC_DEFINE(HAVE_EPOLL, 1,
|
||||||
[Define if your system supports the epoll system calls])
|
[Define if your system supports the epoll system calls])
|
||||||
needsignal=yes
|
needsignal=yes
|
||||||
|
have_epoll=yes
|
||||||
AC_LIBOBJ(epoll_sub)
|
AC_LIBOBJ(epoll_sub)
|
||||||
AC_LIBOBJ(epoll)], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
], AC_MSG_RESULT(no), AC_MSG_RESULT(no))
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
AM_CONDITIONAL(EPOLL_BACKEND, [test "x$haveepoll" = "xyes"])
|
||||||
|
|
||||||
haveeventports=no
|
haveeventports=no
|
||||||
AC_CHECK_FUNCS(port_create, [haveeventports=yes], )
|
AC_CHECK_FUNCS(port_create, [haveeventports=yes], )
|
||||||
if test "x$haveeventports" = "xyes" ; then
|
if test "x$haveeventports" = "xyes" ; then
|
||||||
AC_DEFINE(HAVE_EVENT_PORTS, 1,
|
AC_DEFINE(HAVE_EVENT_PORTS, 1,
|
||||||
[Define if your system supports event ports])
|
[Define if your system supports event ports])
|
||||||
AC_LIBOBJ(evport)
|
|
||||||
needsignal=yes
|
needsignal=yes
|
||||||
fi
|
fi
|
||||||
|
AM_CONDITIONAL(EVPORT_BACKEND, [test "x$haveeventports" = "xyes"])
|
||||||
|
|
||||||
if test "x$bwin32" = "xtrue"; then
|
if test "x$bwin32" = "xtrue"; then
|
||||||
needsignal=yes
|
needsignal=yes
|
||||||
fi
|
fi
|
||||||
if test "x$bwin32" = "xtrue"; then
|
|
||||||
needsignal=yes
|
AM_CONDITIONAL(SIGNAL_SUPPORT, [test "x$needsignal" = "xyes"])
|
||||||
fi
|
|
||||||
if test "x$needsignal" = "xyes" ; then
|
|
||||||
AC_LIBOBJ(signal)
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_TYPE_PID_T
|
AC_TYPE_PID_T
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
|
Loading…
x
Reference in New Issue
Block a user