Maintainer: Vincent Bernat <bernat@debian.org>
Build-Depends: debhelper (>= 5), cdbs, autotools-dev,
libsnmp15-dev | libsnmp9-dev | libsnmp-dev,
- libxml2-dev, libevent-dev, pkg-config, libtool
+ libxml2-dev, libevent-dev, pkg-config
Standards-Version: 3.8.4
Homepage: https://trac.luffy.cx/lldpd/
LIBEVENT_URL=http://libevent.org/
_save_LIBS="$LIBS"
_save_CFLAGS="$CFLAGS"
- _save_CC="$CC"
# First, try with pkg-config
PKG_CHECK_MODULES([LIBEVENT], [libevent >= 1.4.3], [], [:])
AC_MSG_CHECKING([how to compile with libevent])
if test x"$1" = x -o x"$1" = x"yes"; then
# Nothing specified, use default location from pkg-config
- :
+ LIBS="$LIBS $LIBEVENT_LIBS"
+ CFLAGS="$LIBEVENT_CFLAGS $CFLAGS"
+ AC_TRY_LINK([
+@%:@include <sys/time.h>
+@%:@include <sys/types.h>
+@%:@include <event2/event.h>], [ event_base_new(); ],
+ [ libevent_linked=yes ], [ libevent_linked=no ])
+
+ if test x"$libevent_linked" = x"yes"; then
+ AC_MSG_RESULT([ok with $LIBEVENT_LIBS $LIBEVENT_CFLAGS])
+ else
+ if test x"$LIBEVENT_LIBS" = x; then
+ AC_MSG_RESULT([no libevent])
+ else
+ AC_MSG_RESULT([failed with $LIBEVENT_LIBS $LIBEVENT_CFLAGS])
+ fi
+ AC_MSG_ERROR([
+ *** libevent 2.x is required. Grab it from $LIBEVENT_URL
+ *** or install libevent-dev package])
+ fi
+ LIBS="$_save_LIBS"
+ CFLAGS="$_save_CFLAGS"
else
# Black magic....
if test -d "$1"; then
break
fi
done
+ AC_MSG_RESULT([ok with $LIBEVENT_LIBS $LIBEVENT_CFLAGS])
;;
*.tar.gz)
# This won't work for cross compilation. Dunno how to handle this.
}
LIBEVENT_CFLAGS=-I`readlink -f "$levdir/../include"`
AC_MSG_RESULT([successful!])
- AC_MSG_CHECKING([how to use this fresh new libevent])
;;
*)
AC_MSG_RESULT(failed)
fi
fi
fi
-
- # Can I compile and link it? We need to use libtool
- LIBS="$LIBS $LIBEVENT_LIBS"
- CFLAGS="$LIBEVENT_CFLAGS $CFLAGS"
- CC="${SHELL-/bin/sh} libtool link $CC"
- AC_TRY_LINK([
-@%:@include <sys/time.h>
-@%:@include <sys/types.h>
-@%:@include <event2/event.h>], [ event_base_new(); ],
- [ libevent_linked=yes ], [ libevent_linked=no ])
-
- if test x"$libevent_linked" = x"yes"; then
- AC_SUBST([LIBEVENT_LIBS])
- AC_SUBST([LIBEVENT_CFLAGS])
- AC_MSG_RESULT([ok with $LIBEVENT_LIBS $LIBEVENT_CFLAGS])
- else
- if test x"$LIBEVENT_LIBS" = x; then
- AC_MSG_RESULT([no libevent])
- else
- AC_MSG_RESULT([failed with $LIBEVENT_LIBS $LIBEVENT_CFLAGS])
- fi
- AC_MSG_ERROR([
-*** libevent 2.x is required. Grab it from $LIBEVENT_URL
-*** or install libevent-dev package])
- fi
- CC="$_save_CC"
- LIBS="$_save_LIBS"
- CFLAGS="$_save_CFLAGS"
+ AC_SUBST([LIBEVENT_LIBS])
+ AC_SUBST([LIBEVENT_CFLAGS])
])