[PATCH] osmo-bts[master]: Fix test dependencies

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Tue Jan 16 14:36:55 UTC 2018


Hello Neels Hofmeyr, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/5818

to look at the new patch set (#8).

Fix test dependencies

The stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
                 from ../../include/osmo-bts/bts.h:4,
                 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory
 #include <osmocom/abis/e1_input.h>

Let's make sure that tests have all required CFLAGS/LIBS to build by
allowing to specify sysmobts headers location explicitly similar to
other BTS models. To propagate dependencies properly, sysmobts-calib was
moved into osmo-bts-sysmo/misc.

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
---
M .gitignore
M Makefile.am
M configure.ac
M contrib/jenkins_sysmobts.sh
D contrib/sysmobts-calib/Makefile
M src/osmo-bts-sysmo/Makefile.am
R src/osmo-bts-sysmo/misc/sysmobts-calib.c
R src/osmo-bts-sysmo/misc/sysmobts-layer1.c
R src/osmo-bts-sysmo/misc/sysmobts-layer1.h
M tests/misc/Makefile.am
M tests/sysmobts/Makefile.am
11 files changed, 34 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/8

diff --git a/.gitignore b/.gitignore
index 2e8c884..1780e1c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,8 +22,7 @@
 core
 core.*
 
-contrib/sysmobts-calib/sysmobts-calib
-
+src/osmo-bts-sysmo/sysmobts-calib
 src/osmo-bts-sysmo/l1fwd-proxy
 src/osmo-bts-sysmo/osmo-bts-sysmo
 src/osmo-bts-sysmo/osmo-bts-sysmo-remote
diff --git a/Makefile.am b/Makefile.am
index 4832c84..dc42574 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,10 +7,6 @@
 EXTRA_DIST = \
 	contrib/dump_docs.py contrib/screenrc-l1fwd contrib/osmo-bts-sysmo.service \
 	contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \
-	contrib/sysmobts.init contrib/sysmobts-calib/Makefile \
-	contrib/sysmobts-calib/sysmobts-calib.c \
-	contrib/sysmobts-calib/sysmobts-layer1.c \
-	contrib/sysmobts-calib/sysmobts-layer1.h \
 	doc/examples/sysmo/osmo-bts.cfg \
 	doc/examples/sysmo/sysmobts-mgr.cfg \
 	doc/examples/virtual/openbsc-virtual.cfg \
diff --git a/configure.ac b/configure.ac
index 89443d0..1c3efe0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,15 +54,32 @@
 PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0)
 PKG_CHECK_MODULES(ORTP, ortp)
 
+AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool])
+AC_ARG_ENABLE(sysmobts-calib,
+		AC_HELP_STRING([--enable-sysmobts-calib],
+				[enable code for sysmobts calibration tool [default=no]]),
+		[enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"])
+AC_MSG_RESULT([$enable_sysmobts_calib])
+AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes")
+
 AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support])
 AC_ARG_ENABLE(sysmocom-bts,
 		AC_HELP_STRING([--enable-sysmocom-bts],
 				[enable code for sysmoBTS L1/PHY [default=no]]),
 		[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
+AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])],
+			 [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
+AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir)
 AC_MSG_RESULT([$enable_sysmocom_bts])
 AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
 if test "$enable_sysmocom_bts" = "yes"; then
+	oldCPPFLAGS=$CPPFLAGS
+	CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS"
+	AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
+			[AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])],
+			[#include <sysmocom/femtobts/superfemto.h>])
 	PKG_CHECK_MODULES(LIBGPS, libgps)
+	CPPFLAGS=$oldCPPFLAGS
 fi
 
 AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh
index faeb7c9..88aef3d 100755
--- a/contrib/jenkins_sysmobts.sh
+++ b/contrib/jenkins_sysmobts.sh
@@ -16,13 +16,13 @@
 mkdir -p "$inst/include/sysmocom/femtobts"
 ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
 
-configure_flags="--enable-sysmocom-bts"
-
-build_bts "osmo-bts-sysmo" "$configure_flags"
+configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts"
 
 # This will not work for the femtobts
 if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then
-  $MAKE -C contrib/sysmobts-calib
+    configure_flags="$configure_flags --enable-sysmobts-calib"
 fi
 
+build_bts "osmo-bts-sysmo" "$configure_flags"
+
 osmo-clean-workspace.sh
diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile
deleted file mode 100644
index a5d4b99..0000000
--- a/contrib/sysmobts-calib/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror
-LIBS=`pkg-config --libs libosmocore libosmogsm`
-
-all: sysmobts-calib
-
-sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o
-	$(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS)
-
-clean:
-	@rm -f sysmobts-calib *.o
diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am
index c48b77c..b837d3a 100644
--- a/src/osmo-bts-sysmo/Makefile.am
+++ b/src/osmo-bts-sysmo/Makefile.am
@@ -1,9 +1,10 @@
-AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR)
 AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS)
 COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS)
 
 EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \
 	misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \
+	misc/sysmobts-layer1.h \
 	l1_fwd.h l1_if.h l1_transp.h eeprom.h utils.h oml_router.h
 
 bin_PROGRAMS = osmo-bts-sysmo osmo-bts-sysmo-remote l1fwd-proxy sysmobts-mgr sysmobts-util
@@ -20,6 +21,13 @@
 l1fwd_proxy_SOURCES = l1_fwd_main.c l1_transp_hw.c
 l1fwd_proxy_LDADD = $(top_builddir)/src/common/libbts.a $(COMMON_LDADD)
 
+if ENABLE_SYSMOBTS_CALIB
+bin_PROGRAMS = sysmobts-calib
+
+sysmobts_calib_SOURCES = misc/sysmobts-calib.c misc/sysmobts-layer1.c
+sysmobts_calib_LDADD = -lrt $(COMMON_LDADD)
+endif
+
 sysmobts_mgr_SOURCES = \
 		misc/sysmobts_mgr.c misc/sysmobts_misc.c \
 		misc/sysmobts_par.c misc/sysmobts_nl.c \
diff --git a/contrib/sysmobts-calib/sysmobts-calib.c b/src/osmo-bts-sysmo/misc/sysmobts-calib.c
similarity index 100%
rename from contrib/sysmobts-calib/sysmobts-calib.c
rename to src/osmo-bts-sysmo/misc/sysmobts-calib.c
diff --git a/contrib/sysmobts-calib/sysmobts-layer1.c b/src/osmo-bts-sysmo/misc/sysmobts-layer1.c
similarity index 100%
rename from contrib/sysmobts-calib/sysmobts-layer1.c
rename to src/osmo-bts-sysmo/misc/sysmobts-layer1.c
diff --git a/contrib/sysmobts-calib/sysmobts-layer1.h b/src/osmo-bts-sysmo/misc/sysmobts-layer1.h
similarity index 100%
rename from contrib/sysmobts-calib/sysmobts-layer1.h
rename to src/osmo-bts-sysmo/misc/sysmobts-layer1.h
diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am
index 6575fe8..2ddb649 100644
--- a/tests/misc/Makefile.am
+++ b/tests/misc/Makefile.am
@@ -1,6 +1,6 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include
-AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)
-LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS)
+AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS)
+LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS)
 noinst_PROGRAMS = misc_test
 EXTRA_DIST = misc_test.ok
 
diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am
index 654ab5d..2a57b2b 100644
--- a/tests/sysmobts/Makefile.am
+++ b/tests/sysmobts/Makefile.am
@@ -1,4 +1,4 @@
-AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR)
 AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS)
 LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS)
 

-- 
To view, visit https://gerrit.osmocom.org/5818
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
Gerrit-PatchSet: 8
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list