]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Portability, --with-libevent= can point to a (compiled) source directory
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 2 Feb 2007 17:19:27 +0000 (17:19 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 2 Feb 2007 17:19:27 +0000 (17:19 +0000)
for libevent, that version of libevent is then used.

git-svn-id: file:///svn/unbound/trunk@61 be551aaa-1e26-0410-a405-d3ace91eadb9

Makefile.in
configure.ac

index 9c2a46bb834bad7610954288808efe918f12f123..aec72eaf5013306bf0b1870ea84c515f016342e8 100644 (file)
@@ -26,8 +26,8 @@ libtool=@libtool@
 ldnsdir=@ldnsdir@
 
 CC=@CC@
-CPPFLAGS=@CPPFLAGS@ @DEFS@ -I.
-CFLAGS=@CFLAGS@ -I.
+CPPFLAGS=-I. @CPPFLAGS@ @DEFS@
+CFLAGS=-I. @CFLAGS@
 LDFLAGS=@LDFLAGS@
 LIBS=@LIBS@
 LIBOBJS=@LIBOBJS@
index 57defe0c023f146ea84044696ba414fe7890ea21..fa1b79657605ccefa78df8a5e056beeb1a7a3046 100644 (file)
@@ -211,12 +211,20 @@ AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname],
             fi
         done
         if test x_$found_libevent != x_yes; then
-            AC_MSG_ERROR(Cannot find the libevent library in $withval)
+               if test -f "$dir/event.h" -a -f "$dir/.libs/libevent.a"; then
+                       # libevent source directory
+                       AC_MSG_RESULT(found in $thedir)
+                       CPPFLAGS="$CPPFLAGS -I$thedir";
+                       LDFLAGS="$thedir/.libs/*.o $LDFLAGS";
+                       AC_SEARCH_LIBS(event_set, [event])
+               else
+                       AC_MSG_ERROR(Cannot find the libevent library in $withval)
+               fi
         else
             AC_MSG_RESULT(found in $thedir)
             LDFLAGS="$LDFLAGS -L$thedir/lib";
            RUNTIME_PATH="$RUNTIME_PATH -R$thedir/lib"
-           AC_CHECK_LIB(event, event_set)
+           AC_SEARCH_LIBS(event_set, [event])
         fi
        AC_SUBST(RUNTIME_PATH)
     fi
@@ -282,6 +290,10 @@ AH_BOTTOM([
 #include <arpa/inet.h>
 #endif
 
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
+
 #ifdef HAVE_ATTR_FORMAT
 #  define ATTR_FORMAT(archetype, string_index, first_to_check) \
     __attribute__ ((format (archetype, string_index, first_to_check)))