summaryrefslogtreecommitdiffstats
path: root/utils/Makefile.am
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-04-02 23:29:40 +0000
committerPhil Sutter <phil@nwl.cc>2023-04-04 13:38:07 +0200
commitaed58f545bec0712bcdbe14e2b8386db0c650a91 (patch)
tree0bf73d6859623bfd6fe87c3d4593b3d4e987bb41 /utils/Makefile.am
parent78850e7dba64a949c440dbdbe557f59409c6db48 (diff)
build: use pkg-config for libpcap
If building statically, with libpcap built with libnl support, linking will fail, as the compiler won't be able to find the libnl symbols since static libraries don't contain dependency information. To fix this, use pkg-config to find the flags for linking libpcap, since the pkg-config files contain the neccesary dependency information. autoconf will add code to the configure script for initializing pkg-config the first time it seems PKG_CHECK_MODULES, so make the libnfnetlink check the first one in the script, so the initialization code is run unconditionally. Signed-off-by: Alyssa Ross <hi@alyssa.is> Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'utils/Makefile.am')
-rw-r--r--utils/Makefile.am6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/Makefile.am b/utils/Makefile.am
index e9eec48f..34056514 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -2,7 +2,7 @@
AM_CFLAGS = ${regular_CFLAGS}
AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_builddir}/include \
- -I${top_srcdir}/include ${libnfnetlink_CFLAGS}
+ -I${top_srcdir}/include ${libnfnetlink_CFLAGS} ${libpcap_CFLAGS}
AM_LDFLAGS = ${regular_LDFLAGS}
sbin_PROGRAMS =
@@ -25,12 +25,12 @@ endif
if ENABLE_BPFC
man_MANS += nfbpf_compile.8
sbin_PROGRAMS += nfbpf_compile
-nfbpf_compile_LDADD = -lpcap
+nfbpf_compile_LDADD = ${libpcap_LIBS}
endif
if ENABLE_SYNCONF
sbin_PROGRAMS += nfsynproxy
-nfsynproxy_LDADD = -lpcap
+nfsynproxy_LDADD = ${libpcap_LIBS}
endif
CLEANFILES = nfnl_osf.8 nfbpf_compile.8