]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Configure detects libev-4.00.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 29 Oct 2010 15:03:20 +0000 (15:03 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 29 Oct 2010 15:03:20 +0000 (15:03 +0000)
git-svn-id: file:///svn/unbound/trunk@2322 be551aaa-1e26-0410-a405-d3ace91eadb9

config.h.in
configure
configure.ac
daemon/daemon.c
daemon/unbound.c
doc/Changelog
testcode/petal.c
util/netevent.c

index d962977f4877657a28b63788e5858b315b0f96fd..2c72be45f2c5fdde3bc4f6814a943b79af7f8ee2 100644 (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
index abb43c94316f0b96710a3628d4231f0c2c8eb7f1..4929af35891f58ee0add1870d9bf502a614dd735 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
index c625b97e413f14dcff8b6277b225987a9cfff45d..d3e5d17df95fa5d3af49334d5870afcc048c7839 100644 (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
index 9413247597ab23e8119f1c81583ab98bfa07907c..36b6caae52b5e026e2de067ce7cae99337c1edba 100644 (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");
index 22074985d74310602f69c1e2a73e54d63cc11165..b61fd4f34e8a0e117245ff87c0d804fb9e2184b1 100644 (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
index 32522a8eb5d08ada03536dcca7e9eb7a31da0723..17901e0b63b74eac274ed9195b3df26030992997 100644 (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.
index 5cfc7da548fb001dcdbf53ea73b58adb8e1c0d89..14a187e3ff2633661b9bcb104247457e21e7e104 100644 (file)
 #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;
index c04d192e560d293da96bf0a9df8af6e24bd6deac..aabef4164d5a05fb48c219f534ea8b4b12e72a5e 100644 (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 "