From 89b60e9fd7b2a223e1fede8484e5791e6c5bb0ff Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Mon, 23 Feb 2015 12:11:22 +0100 Subject: [PATCH] configure: Use pkg-config to detect libiptc used by connmark/forecast This ensures the library is available. On Debian/Ubuntu it is a dynamic library provided by the iptables-dev package. --- configure.ac | 6 ++++++ src/libcharon/plugins/connmark/Makefile.am | 4 ++-- src/libcharon/plugins/forecast/Makefile.am | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index cb47c69bd5..f1e5046510 100644 --- a/configure.ac +++ b/configure.ac @@ -1078,6 +1078,12 @@ if test x$xauth_pam = xtrue; then AC_CHECK_HEADER([security/pam_appl.h],,[AC_MSG_ERROR([PAM header security/pam_appl.h not found!])]) fi +if test x$connmark = xtrue -o x$forecast = xtrue; then + PKG_CHECK_MODULES(libiptc, [libiptc]) + AC_SUBST(libiptc_CFLAGS) + AC_SUBST(libiptc_LIBS) +fi + if test x$capabilities = xnative; then AC_MSG_NOTICE([Usage of the native Linux capabilities interface is deprecated, use libcap instead]) # Linux requires the following for capset(), Android does not have it, diff --git a/src/libcharon/plugins/connmark/Makefile.am b/src/libcharon/plugins/connmark/Makefile.am index c70f529cee..cc4d0ec8d5 100644 --- a/src/libcharon/plugins/connmark/Makefile.am +++ b/src/libcharon/plugins/connmark/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/libcharon AM_CFLAGS = \ - $(PLUGIN_CFLAGS) + $(PLUGIN_CFLAGS) $(libiptc_CFLAGS) if MONOLITHIC noinst_LTLIBRARIES = libstrongswan-connmark.la @@ -17,4 +17,4 @@ libstrongswan_connmark_la_SOURCES = \ connmark_plugin.h connmark_plugin.c libstrongswan_connmark_la_LDFLAGS = -module -avoid-version -libstrongswan_connmark_la_LIBADD = -lip4tc +libstrongswan_connmark_la_LIBADD = $(libiptc_LIBS) diff --git a/src/libcharon/plugins/forecast/Makefile.am b/src/libcharon/plugins/forecast/Makefile.am index fc08eecc43..ce573135d6 100644 --- a/src/libcharon/plugins/forecast/Makefile.am +++ b/src/libcharon/plugins/forecast/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/libcharon AM_CFLAGS = \ - $(PLUGIN_CFLAGS) + $(PLUGIN_CFLAGS) $(libiptc_CFLAGS) if MONOLITHIC noinst_LTLIBRARIES = libstrongswan-forecast.la @@ -18,4 +18,4 @@ libstrongswan_forecast_la_SOURCES = \ forecast_plugin.h forecast_plugin.c libstrongswan_forecast_la_LDFLAGS = -module -avoid-version -libstrongswan_forecast_la_LIBADD = -lip4tc +libstrongswan_forecast_la_LIBADD = $(libiptc_LIBS) -- 2.47.2