From: Vincent Bernat Date: Mon, 24 Jun 2013 09:57:21 +0000 (+0200) Subject: configure: add a flag to force use of embedded libevent X-Git-Tag: 0.7.6~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f829effd3fe8f56878efd73df23e30381ca09e2f;p=thirdparty%2Flldpd.git configure: add a flag to force use of embedded libevent This will prove useful for OSX when building as a package. --- diff --git a/m4/libevent.m4 b/m4/libevent.m4 index 7ce59b84..bed15311 100644 --- a/m4/libevent.m4 +++ b/m4/libevent.m4 @@ -3,8 +3,17 @@ # AC_DEFUN([lldp_CHECK_LIBEVENT], [ - # First, try with pkg-config - PKG_CHECK_MODULES([LIBEVENT], [libevent >= 2.0.5], [ + # Do we require embedded libevent? + AC_ARG_WITH([embedded-libevent], + AS_HELP_STRING( + [--with-embedded-libevent], + [For the use of embedded libevent @<:@default=no@:>@] + )) + if test x"$with_embedded_libevent" = x"yes"; then + LIBEVENT_EMBEDDED=1 + else + # If not forced, check first with pkg-config + PKG_CHECK_MODULES([LIBEVENT], [libevent >= 2.0.5], [ # Check if we have a working libevent AC_MSG_CHECKING([if system libevent works as expected]) _save_CFLAGS="$CFLAGS" @@ -23,11 +32,12 @@ AC_DEFUN([lldp_CHECK_LIBEVENT], [ ]) CFLAGS="$_save_CFLAGS" LIBS="$_save_LIBS" - ], [ - # No appropriate version, let's use the shipped copy - AC_MSG_NOTICE([using shipped libevent]) - LIBEVENT_EMBEDDED=1 - ]) + ], [ + # No appropriate version, let's use the shipped copy + AC_MSG_NOTICE([using shipped libevent]) + LIBEVENT_EMBEDDED=1 + ]) + fi if test x"$LIBEVENT_EMBEDDED" != x; then unset LIBEVENT_LIBS