From: Marc Fournier Date: Wed, 7 Aug 2013 05:55:01 +0000 (+0200) Subject: use pkg-config to locate libmnl and configure netlink plugin X-Git-Tag: collectd-5.4.0~11^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=490b75428904a3ad147ee6f9d0641f8ad944c98f;p=collectd.git use pkg-config to locate libmnl and configure netlink plugin --- diff --git a/configure.in b/configure.in index bcfb0564..c98e3c3a 100644 --- a/configure.in +++ b/configure.in @@ -2503,7 +2503,7 @@ AM_CONDITIONAL(BUILD_WITH_LIBMYSQL, test "x$with_libmysql" = "xyes") # --with-libmnl {{{ with_libmnl_cflags="" -with_libmnl_libs="-lmnl" +with_libmnl_libs="" AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to libmnl.])], [ echo "libmnl: withval = $withval" @@ -2532,9 +2532,16 @@ AC_ARG_WITH(libmnl, [AS_HELP_STRING([--with-libmnl@<:@=PREFIX@:>@], [Path to lib with_libmnl="no (Linux only library)" fi ]) +if test "x$PKG_CONFIG" = "x" +then + with_libmnl="no (Don't have pkg-config)" +fi if test "x$with_libmnl" = "xyes" then - with_libmnl="no (libmnl.h not found)" + if $PKG_CONFIG --exists libmnl 2>/dev/null; then + with_libmnl_cflags="$with_libmnl_ldflags `$PKG_CONFIG --cflags libmnl`" + with_libmnl_libs="$with_libmnl_libs `$PKG_CONFIG --libs libmnl`" + fi AC_CHECK_HEADERS(libmnl.h libmnl/libmnl.h, [