]> granicus.if.org Git - ipset/commitdiff
build: use libmnl's pkgconfig files
authorJan Engelhardt <jengelh@medozas.de>
Tue, 19 Oct 2010 14:02:04 +0000 (16:02 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Tue, 19 Oct 2010 15:53:28 +0000 (17:53 +0200)
libmnl installs .pc files that we can directly use and which are
preferable over AC_CHECK_LIB.

Also make sure that libipset.so is linked with libmnl, otherwise
linking errors can ensue when a program tries to link to libipset.

Furthermore, remove the now-unused LIBS variable.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
configure.ac
lib/Makefile.am

index 906ef8483401ca3b9e5b082302b16068a5306747..99129eab9df26f3922a503d3f1f230e455d8a0f8 100644 (file)
@@ -109,10 +109,7 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 
 dnl Checks for libraries
-AC_CHECK_LIB([mnl], [mnl_socket_open])
-if test x"${ac_cv_lib_mnl_mnl_socket_open}" = xno; then
-  AC_MSG_ERROR(libmnl not found)
-fi
+PKG_CHECK_MODULES([libmnl], [libmnl >= 1])
 
 dnl Checks for header files
 
index bf4e133b70951db22b7c06570673619c21b8b0fa..74f36e8cdcd60cebcaedb1162739169b4acbcdcd 100644 (file)
@@ -1,11 +1,11 @@
 include $(top_srcdir)/Make_global.am
 
-AM_CFLAGS += -fPIC
-LIBS =
+AM_CFLAGS += -fPIC ${libmnl_CFLAGS}
 
 lib_LTLIBRARIES = libipset.la
 
 libipset_la_LDFLAGS = -version-info $(LIBVERSION)
+libipset_la_LIBADD  = ${libmnl_LIBS}
 libipset_la_SOURCES = \
        data.c \
        mnl.c \