1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Add --with-libev, because libev is smaller.

When both --with-libev and --with-libevent are used, libev takes
precedence.
This commit is contained in:
Witold Filipczyk 2017-11-17 16:34:03 +01:00
parent f52e3187e3
commit 21d36fcbd1
3 changed files with 39 additions and 19 deletions

View File

@ -1217,30 +1217,36 @@ fi
# ========
# libevent
# ========
AC_ARG_WITH(libevent, [ --with-libevent compile with libevent],
AC_ARG_WITH(libev, [ --with-libev compile with libev (libevent compatibility mode)],
[if test "$withval" = yes; then enable_libev=yes; else enable_libev=no; fi])
cf_have_libev=no
if test "$enable_libev" = yes; then
AC_CHECK_HEADERS(event.h libev/event.h)
if test "$ac_cv_header_event_h" = yes -o "$ac_cv_header_libev_event_h"; then
AC_CHECK_LIB(ev, event_loop)
if test "$ac_cv_lib_ev_event_loop" = yes; then
cf_have_libev=yes
fi
fi
fi
AC_ARG_WITH(libevent, [ --with-libevent compile with libevent. Note that --with-libev has precedence],
[if test "$withval" = yes; then enable_libevent=yes; else enable_libevent=no; fi])
cf_have_libevent=no
if test "$enable_libevent" = yes; then
AC_CHECK_HEADERS(event.h ev-event.h libev/event.h)
if test "$enable_libevent" = yes -a "$cf_have_libev" = no; then
AC_CHECK_HEADERS(event.h ev-event.h)
if test "$ac_cv_header_event_h" = yes; then
AC_CHECK_LIB(event, event_loop)
if test "$ac_cv_lib_event_event_loop" = yes; then
cf_have_libevent=libevent
fi
fi
if test "$cf_have_libevent" = no; then
if test "$ac_cv_header_event_h" = yes -o "$ac_cv_header_ev_event_h" = yes -o "$ac_cv_header_libev_event_h"; then
AC_CHECK_LIB(ev, event_loop)
if test "$ac_cv_lib_ev_event_loop" = yes; then
cf_have_libevent=libev
fi
cf_have_libevent=yes
fi
fi
fi
if test "$cf_have_libevent" != no; then
if test "$cf_have_libev" = yes -o "$cf_have_libevent" = yes; then
AC_HAVE_FUNCS(event_base_set event_get_version event_get_method event_base_free event_base_new event_reinit event_base_get_method event_config_set_flag event_get_struct_event_size)
fi
EL_LOG_CONFIG([CONFIG_LIBEV], [[libev]], [[$cf_have_libev]])
EL_LOG_CONFIG([CONFIG_LIBEVENT], [[libevent]], [[$cf_have_libevent]])

View File

@ -31,13 +31,20 @@
#include <poll.h>
#endif
#if (defined(HAVE_EVENT_H) || defined(HAVE_EV_EVENT_H) || defined(HAVE_LIBEV_EVENT_H)) && (defined(HAVE_LIBEVENT) || defined(HAVE_LIBEV)) && !defined(OPENVMS) && !defined(DOS)
#if defined(HAVE_LIBEV) && !defined(OPENVMS) && !defined(DOS)
#ifdef HAVE_LIBEV_EVENT_H
#include <libev/event.h>
#elif defined(HAVE_EVENT_H)
#include <event.h>
#endif
#define USE_LIBEVENT
#endif
#if (defined(HAVE_EVENT_H) || defined(HAVE_EV_EVENT_H) || defined(HAVE_LIBEV_EVENT_H)) && defined(HAVE_LIBEVENT) && !defined(OPENVMS) && !defined(DOS)
#if defined(HAVE_EVENT_H)
#include <event.h>
#elif defined(HAVE_EV_EVENT_H)
#include <ev-event.h>
#else
#include <libev/event.h>
#endif
#define USE_LIBEVENT
#endif

View File

@ -6,13 +6,20 @@
#include <errno.h>
#if (defined(HAVE_EVENT_H) || defined(HAVE_EV_EVENT_H) || defined(HAVE_LIBEV_EVENT_H)) && (defined(HAVE_LIBEVENT) || defined(HAVE_LIBEV)) && !defined(OPENVMS) && !defined(DOS)
#if defined(HAVE_LIBEV) && !defined(OPENVMS) && !defined(DOS)
#ifdef HAVE_LIBEV_EVENT_H
#include <libev/event.h>
#elif defined(HAVE_EVENT_H)
#include <event.h>
#endif
#define USE_LIBEVENT
#endif
#if (defined(HAVE_EVENT_H) || defined(HAVE_EV_EVENT_H) || defined(HAVE_LIBEV_EVENT_H)) && defined(HAVE_LIBEVENT) && !defined(OPENVMS) && !defined(DOS)
#if defined(HAVE_EVENT_H)
#include <event.h>
#elif defined(HAVE_EV_EVENT_H)
#include <ev-event.h>
#else
#include <libev/event.h>
#endif
#define USE_LIBEVENT
#endif