Skip to content

Commit

Permalink
build: make --with-embedded-libevent a tri-state switch
Browse files Browse the repository at this point in the history
It defaults to auto (same as before) but not embedding libevent can be
enforced with `--without-embedded-libevent`.
  • Loading branch information
vincentbernat committed Aug 16, 2015
1 parent f8688c9 commit 696f7f6
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions m4/libevent.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ AC_DEFUN([lldp_CHECK_LIBEVENT], [
AC_ARG_WITH([embedded-libevent],
AS_HELP_STRING(
[--with-embedded-libevent],
[Force the use of embedded libevent @<:@default=no@:>@]
))
[Use embedded libevent @<:@default=auto@:>@]
), [], [with_embedded_libevent=auto])
if test x"$with_embedded_libevent" = x"yes"; then
LIBEVENT_EMBEDDED=1
else
Expand All @@ -27,15 +27,23 @@ AC_DEFUN([lldp_CHECK_LIBEVENT], [
[
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no, using shipped libevent])
LIBEVENT_EMBEDDED=1
if test x"$with_embedded_libevent" = x"auto"; then
AC_MSG_RESULT([no, using shipped libevent])
LIBEVENT_EMBEDDED=1
else
AC_MSG_ERROR([*** unusable system libevent])
fi
])
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 if possible
if test x"$with_embedded_libevent" = x"auto"; then
AC_MSG_NOTICE([using shipped libevent])
LIBEVENT_EMBEDDED=1
else
AC_MSG_ERROR([*** libevent not found])
fi
])
fi
Expand Down

0 comments on commit 696f7f6

Please sign in to comment.