]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
configure: add a flag to force use of embedded libevent
authorVincent Bernat <vincent.bernat@dailymotion.com>
Mon, 24 Jun 2013 09:57:21 +0000 (11:57 +0200)
committerVincent Bernat <vincent.bernat@dailymotion.com>
Mon, 24 Jun 2013 09:57:21 +0000 (11:57 +0200)
This will prove useful for OSX when building as a package.

m4/libevent.m4

index 7ce59b84741a174da8a3766244b180c7339fd427..bed15311f5ce9c3fe32e1ff5dfb901a2ff922497 100644 (file)
@@ -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