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)))