- Configure detects libev-4.00.

git-svn-id: file:///svn/unbound/trunk@2322 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2010-10-29 15:03:20 +00:00
parent 488aee467a
commit fcf1157fa4
8 changed files with 27 additions and 8 deletions

View file

@ -81,6 +81,9 @@
/* Define to 1 if you have the `EVP_sha512' function. */
#undef HAVE_EVP_SHA512
/* Define to 1 if you have the `ev_default_loop' function. */
#undef HAVE_EV_DEFAULT_LOOP
/* Define to 1 if you have the `ev_loop' function. */
#undef HAVE_EV_LOOP
@ -824,7 +827,7 @@ struct tm;
char *strptime(const char *s, const char *format, struct tm *tm);
#endif
#if defined(HAVE_EVENT_H) && !defined(HAVE_EVENT_BASE_ONCE) && (defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS))
#if defined(HAVE_EVENT_H) && !defined(HAVE_EVENT_BASE_ONCE) && !(defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)) && (defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS))
/* using version of libevent that is not threadsafe. */
# define LIBEVENT_SIGNAL_PROBLEM 1
#endif

11
configure vendored
View file

@ -15649,6 +15649,17 @@ _ACEOF
fi
done
# only in libev. (tested on 3.51)
for ac_func in ev_default_loop
do :
ac_fn_c_check_func "$LINENO" "ev_default_loop" "ac_cv_func_ev_default_loop"
if test "x$ac_cv_func_ev_default_loop" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_EV_DEFAULT_LOOP 1
_ACEOF
fi
done
# only in libev. (tested on 4.00)
if test -n "$BAK_LDFLAGS_SET"; then
LDFLAGS="$BAK_LDFLAGS"
fi

View file

@ -549,6 +549,7 @@ large outgoing port ranges. ])
AC_CHECK_FUNCS([event_base_new]) # only in libevent 1.4.1 and later
AC_CHECK_FUNCS([event_base_get_method]) # only in libevent 1.4.3 and later
AC_CHECK_FUNCS([ev_loop]) # only in libev. (tested on 3.51)
AC_CHECK_FUNCS([ev_default_loop]) # only in libev. (tested on 4.00)
if test -n "$BAK_LDFLAGS_SET"; then
LDFLAGS="$BAK_LDFLAGS"
fi
@ -872,7 +873,7 @@ struct tm;
char *strptime(const char *s, const char *format, struct tm *tm);
#endif
#if defined(HAVE_EVENT_H) && !defined(HAVE_EVENT_BASE_ONCE) && (defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS))
#if defined(HAVE_EVENT_H) && !defined(HAVE_EVENT_BASE_ONCE) && !(defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)) && (defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS))
/* using version of libevent that is not threadsafe. */
# define LIBEVENT_SIGNAL_PROBLEM 1
#endif

View file

@ -449,7 +449,7 @@ daemon_fork(struct daemon* daemon)
*/
daemon_create_workers(daemon);
#ifdef HAVE_EV_LOOP
#if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)
/* in libev the first inited base gets signals */
if(!worker_init(daemon->workers[0], daemon->cfg, daemon->ports, 1))
fatal_exit("Could not initialize main thread");
@ -463,7 +463,7 @@ daemon_fork(struct daemon* daemon)
/* Special handling for the main thread. This is the thread
* that handles signals and remote control.
*/
#ifndef HAVE_EV_LOOP
#if !(defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP))
/* libevent has the last inited base get signals (or any base) */
if(!worker_init(daemon->workers[0], daemon->cfg, daemon->ports, 1))
fatal_exit("Could not initialize main thread");

View file

@ -89,7 +89,7 @@
/** global debug value to keep track of heap memory allocation */
void* unbound_start_brk = 0;
#if !defined(HAVE_EVENT_BASE_GET_METHOD) && defined(HAVE_EV_LOOP)
#if !defined(HAVE_EVENT_BASE_GET_METHOD) && (defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP))
static const char* ev_backend2str(int b)
{
switch(b) {
@ -122,11 +122,12 @@ static void get_event_sys(const char** n, const char** s, const char** m)
*n = "libevent";
b = event_base_new();
*m = event_base_get_method(b);
# elif defined(HAVE_EV_LOOP)
# elif defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)
*n = "libev";
b = (struct event_base*)ev_default_loop(EVFLAG_AUTO);
*m = ev_backend2str(ev_backend((struct ev_loop*)b));
# else
*n = "unknown";
*m = "not obtainable";
b = NULL;
# endif

View file

@ -2,6 +2,7 @@
- Fix uninit value in dump_infra print.
- Fix validation failure for parent and child on same server with an
insecure childzone and a CNAME from parent to child.
- Configure detects libev-4.00.
26 October 2010: Wouter
- dump_infra and flush_infra commands for unbound-control.

View file

@ -56,12 +56,14 @@
#include <openssl/pem.h>
#include <ctype.h>
#include <signal.h>
#if defined(UNBOUND_ALLOC_LITE) || defined(UNBOUND_ALLOC_STATS)
#ifdef malloc
#undef malloc
#endif
#ifdef free
#undef free
#endif
#endif /* alloc lite or alloc stats */
/** verbosity for this application */
static int verb = 0;

View file

@ -176,7 +176,7 @@ comm_base_create(int sigs)
/* use mini event time-sharing feature */
b->eb->base = event_init(&b->eb->secs, &b->eb->now);
#else
# ifdef HAVE_EV_LOOP
# if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)
/* libev */
if(sigs)
b->eb->base=(struct event_base *)ev_default_loop(EVFLAG_AUTO);
@ -200,7 +200,7 @@ comm_base_create(int sigs)
/* avoid event_get_method call which causes crashes even when
* not printing, because its result is passed */
verbose(VERB_ALGO,
#ifdef HAVE_EV_LOOP
#if defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)
"libev"
#elif defined(USE_MINI_EVENT)
"event "