osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/33681 )


Change subject: configure: add --enable-meas-udp2db/pcap2db/vis
......................................................................

configure: add --enable-meas-udp2db/pcap2db/vis

Do not build these utils implicitly if libsqlite3/libpcap/libcdk are
installed. Add configure flags for explicit building and fail if
dependencies are missing.

Keep behavior in deb and rpm packaging:
* deb: build meas_vis
* rpm: build none of these (libcdk dependency for meas_vis is not
  available in most rpm-based distributions we build for)

Fixes: OS#5173
Depends: docker-playground I015b6d7cb834e99ea5d04206ba5f8c519c4e6af1
Change-Id: I8b3d5efb769437a5d3036e1e627b8d477275d93e
---
M configure.ac
M contrib/jenkins.sh
M debian/rules
M src/utils/Makefile.am
4 files changed, 63 insertions(+), 19 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/81/33681/1

diff --git a/configure.ac b/configure.ac
index b3cc09d..ac3c534 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,24 @@
 AM_CONDITIONAL(BUILD_IPA_UTILS, test "x$osmo_ac_ipa_utils" = "xyes")
 AC_SUBST(osmo_ac_ipa_utils)

+# Enable/disable osmo-meas-udp2db
+AC_ARG_ENABLE([meas-udp2db], [AS_HELP_STRING([--enable-meas-udp2db], [Build 
osmo-meas-udp2db: listen to meas_feed on UDP and write it to an sqlite3 
database [default=no]])],
+    [osmo_ac_meas_udp2db="$enableval"],[osmo_ac_meas_udp2db="no"])
+AM_CONDITIONAL(BUILD_MEAS_UDP2DB, test "x$osmo_ac_meas_udp2db" = "xyes")
+AC_SUBST(osmo_ac_meas_udp2db)
+
+# Enable/disable osmo-meas-pcap2db
+AC_ARG_ENABLE([meas-pcap2db], [AS_HELP_STRING([--enable-meas-pcap2db], [Build 
osmo-meas-pcap2db: read PCAP file with meas_feed data and write it to an 
sqlite3 database [default=no]])],
+    [osmo_ac_meas_pcap2db="$enableval"],[osmo_ac_meas_pcap2db="no"])
+AM_CONDITIONAL(BUILD_MEAS_PCAP2DB, test "x$osmo_ac_meas_pcap2db" = "xyes")
+AC_SUBST(osmo_ac_meas_pcap2db)
+
+# Enable/disable meas_vis
+AC_ARG_ENABLE([meas-vis], [AS_HELP_STRING([--enable-meas-vis], [Build 
meas_vis: curses-visualization of measurements [default=no]])],
+    [osmo_ac_meas_vis="$enableval"],[osmo_ac_meas_vis="no"])
+AM_CONDITIONAL(BUILD_MEAS_VIS, test "x$osmo_ac_meas_vis" = "xyes")
+AC_SUBST(osmo_ac_meas_vis)
+
 dnl checks for libraries
 PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.8.0)
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.8.0)
@@ -55,19 +73,15 @@
 dnl checks for header files
 AC_HEADER_STDC

-found_pcap=yes
-AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no)
-AM_CONDITIONAL(HAVE_PCAP, test "$found_pcap" = yes)
-
-found_cdk=yes
-AC_CHECK_HEADERS(cdk/cdk.h,,found_cdk=no)
-AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes)
-
-found_sqlite3=yes
-PKG_CHECK_MODULES(SQLITE3, sqlite3, ,found_sqlite3=no)
-AM_CONDITIONAL(HAVE_SQLITE3, test "$found_sqlite3" = yes)
-AC_SUBST(found_sqlite3)
-
+if test "$osmo_ac_meas_pcap2db" = "yes" || test "$osmo_ac_meas_udp2db" = 
"yes"; then
+       PKG_CHECK_MODULES(SQLITE3, sqlite3)
+fi
+if test "$osmo_ac_meas_pcap2db" = "yes"; then
+       AC_CHECK_HEADERS(pcap/pcap.h, [], AC_MSG_ERROR(Unable to find libpcap))
+fi
+if test "$osmo_ac_meas_vis" = "yes"; then
+       AC_CHECK_HEADERS(cdk/cdk.h, [], AC_MSG_ERROR(Unable to find libcdk))
+fi

 dnl Checks for typedefs, structures and compiler characteristics

diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index a89f7d5..f35cada 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -60,7 +60,13 @@
 osmo-build-dep.sh osmo-mgw

 # Additional configure options and depends
-CONFIG="--enable-external-tests --enable-werror"
+CONFIG="
+       --enable-external-tests
+       --enable-meas-pcap2db
+       --enable-meas-upd2db
+       --enable-meas-vis
+       --enable-werror
+"
 if [ "$WITH_MANUALS" = "1" ]; then
        CONFIG="$CONFIG --enable-manuals"
 fi
diff --git a/debian/rules b/debian/rules
index e6834c3..0401371 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,7 +2,11 @@
 %:
        dh $@ --with autoreconf

-CONFIGURE_FLAGS += --with-systemdsystemunitdir=/lib/systemd/system 
--enable-manuals
+CONFIGURE_FLAGS += "
+       --enable-manuals
+       --enable-meas-vis
+       --with-systemdsystemunitdir=/lib/systemd/system
+"
 override_dh_auto_configure:
        dh_auto_configure -- $(CONFIGURE_FLAGS)

diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index 18debe7..ece993f 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -28,17 +28,17 @@
        isdnsync \
        meas_json \
        $(NULL)
-if HAVE_SQLITE3
+if BUILD_MEAS_UDP2DB
 bin_PROGRAMS += \
        osmo-meas-udp2db \
        $(NULL)
-if HAVE_PCAP
+endif
+if BUILD_MEAS_PCAP2DB
 bin_PROGRAMS += \
        osmo-meas-pcap2db \
        $(NULL)
 endif
-endif
-if HAVE_LIBCDK
+if BUILD_MEAS_VIS
 bin_PROGRAMS += \
        meas_vis \
        $(NULL)

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/33681
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8b3d5efb769437a5d3036e1e627b8d477275d93e
Gerrit-Change-Number: 33681
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-MessageType: newchange

Reply via email to