diff mbox

build: fail in configure on missing dependency for optional component

Message ID 1374451358-13294-1-git-send-email-willemb@google.com
State Accepted
Headers show

Commit Message

Willem de Bruijn July 22, 2013, 12:02 a.m. UTC
The build of utils/nfbpf_compile depends on libpcap. If configure is
run with --enable-bpf-compiler, the script succeeds, but make fails.

This small patch adds a test for the dependency (libpcap) in configure
and fails hard if not found.

---

This small patch addresses your comment when merging the original
nfbpf_compiler commit 1ac30c97c339957b6e3c5cf571de7bc38c827730.
Sorry that it took me so long. Maybe it is not relevant anymore.
---
 configure.ac | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Pablo Neira Ayuso July 26, 2013, 2:33 p.m. UTC | #1
On Sun, Jul 21, 2013 at 08:02:38PM -0400, Willem de Bruijn wrote:
> The build of utils/nfbpf_compile depends on libpcap. If configure is
> run with --enable-bpf-compiler, the script succeeds, but make fails.
> 
> This small patch adds a test for the dependency (libpcap) in configure
> and fails hard if not found.
> 
> ---
> 
> This small patch addresses your comment when merging the original
> nfbpf_compiler commit 1ac30c97c339957b6e3c5cf571de7bc38c827730.
> Sorry that it took me so long. Maybe it is not relevant anymore.

Yes, I still want this in the tree. Applied, thanks Willem.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index d165d52..d443706 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,11 @@  AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
 AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
 AM_CONDITIONAL([ENABLE_BPFC], [test "$enable_bpfc" = "yes"])
 
+if test "x$enable_bpfc" = "xyes"; then
+	AC_CHECK_LIB(pcap, pcap_compile, ,
+                     AC_MSG_ERROR(pcap library required by optional component))
+fi
+
 PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
 	[nfnetlink=1], [nfnetlink=0])
 AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])