(trunk) #2167 improve the autoconf libevent test: don't use the OS copy unless it's got evutil_vsnprintf()

This commit is contained in:
Charles Kerr 2009-06-05 13:45:21 +00:00
parent eaa9d37ee1
commit a6235689a4
1 changed files with 22 additions and 9 deletions

View File

@ -170,16 +170,29 @@ dnl build our copy of libevent whether we use it or not,
dnl because "make dist" needs its Makefiles to exist, and
dnl AM_CONDITIONAL + AC_CONFIG_SUBDIRS don't seem to play nice
AC_CONFIG_SUBDIRS([third-party/libevent])
libevent_source=bundled
AC_CHECK_LIB([event],[evutil_vsnprintf],
[libevent_found=yes],
[libevent_found=no],
[-levent])
AC_CHECK_HEADER([event-config.h],
[libevent_source=system
LIBEVENT_CPPFLAGS=""
LIBEVENT_LIBS="-levent -lrt"],
[libevent_source=bundled
AC_MSG_NOTICE([couldn't find event-config.h, so using our own copy of libevent from third-party/libevent/.])
AC_MSG_NOTICE([if you are cross-compiling this is probably NOT what you want.])
LIBEVENT_CPPFLAGS="-I\$(top_srcdir)/third-party/libevent -I\$(top_builddir)/third-party/libevent"
LIBEVENT_LIBS="\$(top_builddir)/third-party/libevent/libevent.la"])
[libevent_headers_found=yes],
[libevent_headers_found=no])
libevent_source=bundled
if test "x$libevent_found" = "xyes" ; then
if test "x$libevent_headers_found" = "xyes"; then
libevent_source=system
fi
fi
if test "x$libevent_source" = "xbundled"; then
AC_MSG_NOTICE([couldn't find event-config.h, so using our own copy of libevent from third-party/libevent/.])
AC_MSG_NOTICE([if you are cross-compiling this is probably NOT what you want.])
LIBEVENT_CPPFLAGS="-I\$(top_srcdir)/third-party/libevent -I\$(top_builddir)/third-party/libevent"
LIBEVENT_LIBS="\$(top_builddir)/third-party/libevent/libevent.la"
else
LIBEVENT_CPPFLAGS=""
LIBEVENT_LIBS="-levent -lrt"
fi
AC_SUBST(LIBEVENT_CPPFLAGS)
AC_SUBST(LIBEVENT_LIBS)