Review at https://gerrit.osmocom.org/7848
Build jibuf_tool based on libpcap availability
Change-Id: I27cdb1b5175a5b02638e6d743b686bdf4b1be144
---
M configure.ac
M tests/Makefile.am
2 files changed, 13 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/48/7848/1
diff --git a/configure.ac b/configure.ac
index f01dac9..8fb338a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,6 +100,10 @@
AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be
built))
+found_pcap=yes
+AC_CHECK_HEADERS(pcap.h,,found_pcap=no)
+AM_CONDITIONAL(HAVE_PCAP, test "$found_pcap" = yes)
+
AC_ARG_ENABLE(doxygen,
[AS_HELP_STRING(
[--disable-doxygen],
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dd0e2b2..a53fdb3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,16 +1,20 @@
AM_CFLAGS = -Wall -I$(top_srcdir)/include $(LIBOSMOCORE_CFLAGS) -g
AM_LDFLAGS = $(LIBOSMOCORE_LDFLAGS)
-check_PROGRAMS = osmux/osmux_test jibuf/jibuf_test jibuf/jibuf_tool
-check_HEADERS = \
- osmo-pcap-test/osmo_pcap.h \
- osmo-pcap-test/proto.h
+check_PROGRAMS = osmux/osmux_test jibuf/jibuf_test
+check_HEADERS =
osmux_osmux_test_SOURCES = osmux/osmux_test.c
osmux_osmux_test_LDADD = $(LIBOSMOCORE_LIBS)
$(top_builddir)/src/libosmonetif.la
jibuf_jibuf_test_SOURCES = jibuf/jibuf_test.c
jibuf_jibuf_test_LDADD = $(LIBOSMOCORE_LIBS)
$(top_builddir)/src/libosmonetif.la
+
+if HAVE_PCAP
+check_PROGRAMS += jibuf/jibuf_tool
+check_HEADERS += \
+ osmo-pcap-test/osmo_pcap.h \
+ osmo-pcap-test/proto.h
jibuf_jibuf_tool_SOURCES = \
jibuf/jibuf_tool.c \
@@ -26,6 +30,7 @@
$(LIBOSMOCORE_LIBS) \
$(top_builddir)/src/libosmonetif.la \
-lpcap
+endif
# The `:;' works around a Bash 3.2 bug when the output is not writeable.
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
--
To view, visit https://gerrit.osmocom.org/7848
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I27cdb1b5175a5b02638e6d743b686bdf4b1be144
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <[email protected]>