aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-04-17 11:56:29 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-04-17 11:56:37 +0200
commita29ea763ea3ebf5665682e5c165caa1a98efe6b3 (patch)
tree7ae848cddacb16e0f3a38d3391d2182a041d500f
parentd5b68e2c70c5afe4f6b1248674ba8f4ae3baabd6 (diff)
Build jibuf_tool based on libpcap availability
-rw-r--r--configure.ac4
-rw-r--r--tests/Makefile.am13
2 files changed, 13 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index f01dac9..8fb338a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,6 +100,10 @@ LIBS=$old_LIBS
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,10 +1,8 @@
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
@@ -12,6 +10,12 @@ 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 \
osmo-pcap-test/proto.c \
@@ -26,6 +30,7 @@ jibuf_jibuf_tool_LDADD = \
$(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