1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-02 08:57:19 -04: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 # 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]) [if test "$withval" = yes; then enable_libevent=yes; else enable_libevent=no; fi])
cf_have_libevent=no cf_have_libevent=no
if test "$enable_libevent" = yes; then if test "$enable_libevent" = yes -a "$cf_have_libev" = no; then
AC_CHECK_HEADERS(event.h ev-event.h libev/event.h) AC_CHECK_HEADERS(event.h ev-event.h)
if test "$ac_cv_header_event_h" = yes; then if test "$ac_cv_header_event_h" = yes; then
AC_CHECK_LIB(event, event_loop) AC_CHECK_LIB(event, event_loop)
if test "$ac_cv_lib_event_event_loop" = yes; then if test "$ac_cv_lib_event_event_loop" = yes; then
cf_have_libevent=libevent cf_have_libevent=yes
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
fi fi
fi 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) 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 fi
EL_LOG_CONFIG([CONFIG_LIBEV], [[libev]], [[$cf_have_libev]])
EL_LOG_CONFIG([CONFIG_LIBEVENT], [[libevent]], [[$cf_have_libevent]]) EL_LOG_CONFIG([CONFIG_LIBEVENT], [[libevent]], [[$cf_have_libevent]])

View File

@ -31,13 +31,20 @@
#include <poll.h> #include <poll.h>
#endif #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) #if defined(HAVE_EVENT_H)
#include <event.h> #include <event.h>
#elif defined(HAVE_EV_EVENT_H) #elif defined(HAVE_EV_EVENT_H)
#include <ev-event.h> #include <ev-event.h>
#else
#include <libev/event.h>
#endif #endif
#define USE_LIBEVENT #define USE_LIBEVENT
#endif #endif

View File

@ -6,13 +6,20 @@
#include <errno.h> #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) #if defined(HAVE_EVENT_H)
#include <event.h> #include <event.h>
#elif defined(HAVE_EV_EVENT_H) #elif defined(HAVE_EV_EVENT_H)
#include <ev-event.h> #include <ev-event.h>
#else
#include <libev/event.h>
#endif #endif
#define USE_LIBEVENT #define USE_LIBEVENT
#endif #endif