Change in osmo-bsc[master]: Add configure flag to disable build of osmo-bsc

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Tue Mar 12 20:39:15 UTC 2019


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/13226


Change subject: Add configure flag to disable build of osmo-bsc
......................................................................

Add configure flag to disable build of osmo-bsc

This way only ipaccess utils can be built without requiring osmo-bsc
specific dependencies.

Change-Id: I39783245a11aacaecf0873b3b74b60b559256f79
---
M configure.ac
M contrib/jenkins.sh
M src/osmo-bsc/Makefile.am
M tests/Makefile.am
M tests/atlocal.in
M tests/testsuite.at
6 files changed, 91 insertions(+), 25 deletions(-)



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

diff --git a/configure.ac b/configure.ac
index cdee90c..539d64d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,15 +44,25 @@
 AM_CONDITIONAL(BUILD_IPA_UTILS, test "x$osmo_ac_ipa_utils" = "xyes")
 AC_SUBST(osmo_ac_ipa_utils)
 
+# Enable/disable osmo-bsc build?
+AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build osmo-bsc])],
+    [build_osmo_bsc="$enableval"],[build_osmo_bsc="yes"])
+AM_CONDITIONAL(BUILD_OSMO_BSC, test "x$build_osmo_bsc" = "xyes")
+AC_SUBST(build_osmo_bsc)
+
 PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.12.0)
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.12.0)
 PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.12.0)
 PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.12.0)
 PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.1)
-PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.3.0)
-PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.10.0)
-PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.10.0)
-PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.4.0)
+
+
+if test "x$build_osmo_bsc" = "xyes" ; then
+	PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.3.0)
+	PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.10.0)
+	PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.10.0)
+	PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.4.0)
+fi
 
 dnl checks for header files
 AC_HEADER_STDC
diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh
index a47935f..e288820 100755
--- a/contrib/jenkins.sh
+++ b/contrib/jenkins.sh
@@ -31,7 +31,36 @@
 export LD_LIBRARY_PATH="$inst/lib"
 export PATH="$inst/bin:$PATH"
 
+do_build() {
+	configure_flags="$1"
+	distcheck_flags="$2"
+	set +x
+	echo
+	echo
+	echo
+	echo " =============================== osmo-bsc ==============================="
+	echo
+	set -x
+
+	cd "$base"
+	autoreconf --install --force
+	./configure $configure_flags
+	$MAKE $PARALLEL_MAKE
+	LD_LIBRARY_PATH="$inst/lib" $MAKE check \
+	  || cat-testlogs.sh
+	LD_LIBRARY_PATH="$inst/lib" \
+	  DISTCHECK_CONFIGURE_FLAGS="$distcheck_flags" \
+	  $MAKE distcheck \
+	  || cat-testlogs.sh
+	$MAKE maintainer-clean
+}
+
 osmo-build-dep.sh libosmo-abis
+
+# To build ipaccess-utils we just need libosmocore and libosmo-abis:
+ipacess_utils_flags="--enable-sanitize --disable-external-tests --disable-vty-tests --disable-osmo-bsc --enable-ipaccess-utils --enable-werror $CONFIG"
+do_build "$ipacess_utils_flags" "$ipacess_utils_flags"
+
 osmo-build-dep.sh libosmo-netif
 osmo-build-dep.sh libosmo-sccp
 osmo-build-dep.sh osmo-mgw
@@ -43,27 +72,10 @@
 	CONFIG="--enable-manuals"
 fi
 
-set +x
-echo
-echo
-echo
-echo " =============================== osmo-bsc ==============================="
-echo
-set -x
-
-cd "$base"
-autoreconf --install --force
-./configure --enable-sanitize --enable-external-tests --enable-werror $CONFIG
-$MAKE $PARALLEL_MAKE
-LD_LIBRARY_PATH="$inst/lib" $MAKE check \
-  || cat-testlogs.sh
-LD_LIBRARY_PATH="$inst/lib" \
-  DISTCHECK_CONFIGURE_FLAGS="--enable-vty-tests --enable-external-tests --enable-werror $CONFIG" \
-  $MAKE distcheck \
-  || cat-testlogs.sh
-
 if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
 	make -C "$base/doc/manuals" publish
 fi
 
+do_build "--enable-sanitize --enable-external-tests --enable-werror $CONFIG" "--enable-vty-tests --enable-external-tests --enable-werror $CONFIG"
+
 osmo-clean-workspace.sh
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 0fabe51..eff8a67 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -43,6 +43,8 @@
 	$(LIBOSMOABIS_LIBS) \
 	$(NULL)
 
+if BUILD_OSMO_BSC
+
 bin_PROGRAMS = \
 	osmo-bsc \
 	$(NULL)
@@ -132,3 +134,5 @@
 	$(LIBOSMOSIGTRAN_LIBS) \
 	$(LIBOSMOMGCPCLIENT_LIBS) \
 	$(NULL)
+
+endif # BUILD_OSMO_BSC
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 446276b..4efdafa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,12 +1,17 @@
 SUBDIRS = \
+	abis \
+	nanobts_omlattr \
+	$(NULL)
+
+if BUILD_OSMO_BSC
+SUBDIRS += \
 	bsc \
 	codec_pref \
 	gsm0408 \
-	abis \
 	subscr \
-	nanobts_omlattr \
 	handover \
 	$(NULL)
+endif
 
 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
diff --git a/tests/atlocal.in b/tests/atlocal.in
index e69de29..c76d9c8 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -0,0 +1 @@
+build_osmo_bsc='@build_osmo_bsc@'
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 1a190dd..3f01141 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -3,12 +3,14 @@
 
 AT_SETUP([gsm0408])
 AT_KEYWORDS([gsm0408])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/gsm0408/gsm0408_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/gsm0408/gsm0408_test], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([bsc_subscr])
 AT_KEYWORDS([bsc_subscr])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/subscr/bsc_subscr_test.ok > expout
 cat $abs_srcdir/subscr/bsc_subscr_test.err > experr
 AT_CHECK([$abs_top_builddir/tests/subscr/bsc_subscr_test], [], [expout], [experr])
@@ -22,12 +24,14 @@
 
 AT_SETUP([bsc])
 AT_KEYWORDS([bsc])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/bsc/bsc_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/bsc/bsc_test], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([codec_pref])
 AT_KEYWORDS([codec_pref])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/codec_pref/codec_pref_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/codec_pref/codec_pref_test], [], [expout], [ignore])
 AT_CLEANUP
@@ -40,6 +44,7 @@
 
 AT_SETUP([neighbor_ident])
 AT_KEYWORDS([neighbor_ident])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/neighbor_ident_test.ok > expout
 cat $abs_srcdir/handover/neighbor_ident_test.err > experr
 AT_CHECK([$abs_top_builddir/tests/handover/neighbor_ident_test], [], [expout], [experr])
@@ -47,174 +52,203 @@
 
 AT_SETUP([handover test 0])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 0], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 1])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 1], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 2])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 2], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 3])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 3], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 4])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 4], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 5])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 5], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 6])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 6], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 7])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 7], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 8])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 8], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 9])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 9], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 10])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 10], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 11])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 11], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 12])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 12], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 13])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 13], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 14])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 14], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 15])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 15], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 16])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 16], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 17])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 17], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 18])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 18], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 19])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 19], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 20])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 20], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 21])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 21], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 22])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 22], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 23])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 23], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 24])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 24], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 25])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 25], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 26])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 26], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 27])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 27], [], [expout], [ignore])
 AT_CLEANUP
 
 AT_SETUP([handover test 28])
 AT_KEYWORDS([handover])
+AT_SKIP_IF([! test "x$build_osmo_bsc" = "xyes"])
 cat $abs_srcdir/handover/handover_test.ok > expout
 AT_CHECK([$abs_top_builddir/tests/handover/handover_test 28], [], [expout], [ignore])
 AT_CLEANUP

-- 
To view, visit https://gerrit.osmocom.org/13226
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I39783245a11aacaecf0873b3b74b60b559256f79
Gerrit-Change-Number: 13226
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190312/048d2b7f/attachment.html>


More information about the gerrit-log mailing list