From: Wouter Wijngaards Date: Fri, 2 Feb 2007 17:19:27 +0000 (+0000) Subject: Portability, --with-libevent= can point to a (compiled) source directory X-Git-Tag: release-0.0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0232164d29d22ae134d92541883aa3b3a8a50e9b;p=thirdparty%2Funbound.git Portability, --with-libevent= can point to a (compiled) source directory for libevent, that version of libevent is then used. git-svn-id: file:///svn/unbound/trunk@61 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/Makefile.in b/Makefile.in index 9c2a46bb8..aec72eaf5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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@ diff --git a/configure.ac b/configure.ac index 57defe0c0..fa1b79657 100644 --- a/configure.ac +++ b/configure.ac @@ -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 #endif +#ifdef HAVE_GETOPT_H +#include +#endif + #ifdef HAVE_ATTR_FORMAT # define ATTR_FORMAT(archetype, string_index, first_to_check) \ __attribute__ ((format (archetype, string_index, first_to_check)))