From f3d7f443a01e2a021a32cdbb402a38fdcedd2fee Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 24 Apr 2018 18:49:03 +0200 Subject: [PATCH] Build one osmo-trx binary for each device support enabled Same way as we do in osmo-bts. After this commit, osmo-trx no longer exists. Instead, osmo-trx-uhd and osmo-trx-usrp1 are generated based on configure flags enabled. A new flag --with(out)-uhd has been added to enable/disable build of osmo-trx with UHD backend. It is left enabled by default to keep compatibility with older build scripts. Binary with USRP1 backend must still be manually enabled with --with-usrp1 flag. Change-Id: Iea8c0d7434762713a53440d29bf3ebd84accb262 --- Transceiver52M/Makefile.am | 27 +++++++++++--------- Transceiver52M/device/Makefile.am | 4 ++- configure.ac | 9 +++++-- debian/control | 41 ++++++++++++++++++++++++++++--- debian/osmo-trx-uhd.install | 1 + debian/osmo-trx-usrp1.install | 1 + debian/osmo-trx.install | 1 - 7 files changed, 65 insertions(+), 19 deletions(-) create mode 100644 debian/osmo-trx-uhd.install create mode 100644 debian/osmo-trx-usrp1.install diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index ae4a5bc6..3a872efe 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -80,19 +80,24 @@ COMMON_LDADD = \ $(LIBOSMOCTRL_LIBS) \ $(LIBOSMOVTY_LIBS) -bin_PROGRAMS = osmo-trx -osmo_trx_SOURCES = osmo-trx.cpp +bin_PROGRAMS = -if DEVICE_USRP1 -osmo_trx_LDADD = \ - $(COMMON_LDADD) \ - $(USRP_LIBS) \ - $(builddir)/device/usrp1/libdevice.la -osmo_trx_CPPFLAGS = $(AM_CPPFLAGS) $(USRP_CFLAGS) -else -osmo_trx_LDADD = \ +if DEVICE_UHD +bin_PROGRAMS += osmo-trx-uhd +osmo_trx_uhd_SOURCES = osmo-trx.cpp +osmo_trx_uhd_LDADD = \ $(COMMON_LDADD) \ $(UHD_LIBS) \ $(builddir)/device/uhd/libdevice.la -osmo_trx_CPPFLAGS = $(AM_CPPFLAGS) $(UHD_CFLAGS) +osmo_trx_uhd_CPPFLAGS = $(AM_CPPFLAGS) $(UHD_CFLAGS) +endif + +if DEVICE_USRP1 +bin_PROGRAMS += osmo-trx-usrp1 +osmo_trx_usrp1_SOURCES = osmo-trx.cpp +osmo_trx_usrp1_LDADD = \ + $(COMMON_LDADD) \ + $(USRP_LIBS) \ + $(builddir)/device/usrp1/libdevice.la +osmo_trx_usrp1_CPPFLAGS = $(AM_CPPFLAGS) $(USRP_CFLAGS) endif diff --git a/Transceiver52M/device/Makefile.am b/Transceiver52M/device/Makefile.am index f0675b0d..2788eaaa 100644 --- a/Transceiver52M/device/Makefile.am +++ b/Transceiver52M/device/Makefile.am @@ -6,6 +6,8 @@ SUBDIRS = if DEVICE_USRP1 SUBDIRS += usrp1 -else +endif + +if DEVICE_UHD SUBDIRS += uhd endif diff --git a/configure.ac b/configure.ac index 70a8f4b0..2b2dab7a 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,11 @@ then LDFLAGS="$LDFLAGS -fsanitize=address -fsanitize=undefined" fi +AC_ARG_WITH(uhd, [ + AS_HELP_STRING([--with-uhd], + [enable UHD based transceiver]) +]) + AC_ARG_WITH(usrp1, [ AS_HELP_STRING([--with-usrp1], [enable USRP1 gnuradio based transceiver]) @@ -128,7 +133,7 @@ AS_IF([test "x$with_usrp1" = "xyes"], [ PKG_CHECK_MODULES(USRP, usrp >= 3.3) ]) -AS_IF([test "x$with_usrp1" != "xyes"],[ +AS_IF([test "x$with_uhd" != "xno"],[ PKG_CHECK_MODULES(UHD, uhd >= 003.011, [AC_DEFINE(USE_UHD_3_11, 1, UHD version 3.11.0 or higher)], [PKG_CHECK_MODULES(UHD, uhd >= 003.009, @@ -136,7 +141,6 @@ AS_IF([test "x$with_usrp1" != "xyes"],[ [PKG_CHECK_MODULES(UHD, uhd >= 003.005)] )] ) - AC_DEFINE(USE_UHD, 1, All UHD versions) ]) AS_IF([test "x$with_singledb" = "xyes"], [ @@ -178,6 +182,7 @@ dnl Check if the compiler supports runtime SIMD detection CHECK_BUILTIN_SUPPORT([__builtin_cpu_supports], [Runtime SIMD detection will be disabled]) +AM_CONDITIONAL(DEVICE_UHD, [test "x$with_uhd" != "xno"]) AM_CONDITIONAL(DEVICE_USRP1, [test "x$with_usrp1" = "xyes"]) AM_CONDITIONAL(ARCH_ARM, [test "x$with_neon" = "xyes" || test "x$with_neon_vfpv4" = "xyes"]) AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"]) diff --git a/debian/control b/debian/control index b3d63a7a..cae44d41 100644 --- a/debian/control +++ b/debian/control @@ -19,9 +19,15 @@ Vcs-Git: git://git.osmocom.org/osmo-trx Homepage: https://projects.osmocom.org/projects/osmotrx Package: osmo-trx +Maintainer: Ivan Klyuchnikov +Depends: osmo-trx-uhd +Architecture: all +Description: Virtual package for osmo-trx-uhd + +Package: osmo-trx-uhd Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: SDR transceiver that implements Layer 1 of a GSM BTS +Description: SDR transceiver that implements Layer 1 of a GSM BTS (UHD) OsmoTRX is a software-defined radio transceiver that implements the Layer 1 physical layer of a BTS comprising the following 3GPP specifications: . @@ -37,10 +43,37 @@ Description: SDR transceiver that implements Layer 1 of a GSM BTS between different telecommunication associations for developing new generations of mobile phone networks. (post-2G/GSM) -Package: osmo-trx-dbg +Package: osmo-trx-uhd-dbg Architecture: any Section: debug Priority: extra -Depends: osmo-trx (= ${binary:Version}), ${misc:Depends} -Description: Debug symbols for the osmo-trx +Depends: osmo-trx-uhd (= ${binary:Version}), ${misc:Depends} +Description: Debug symbols for the osmo-trx-uhd + Make debugging possible + +Package: osmo-trx-usrp1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: SDR transceiver that implements Layer 1 of a GSM BTS (USRP1) + OsmoTRX is a software-defined radio transceiver that implements the Layer 1 + physical layer of a BTS comprising the following 3GPP specifications: + . + TS 05.01 "Physical layer on the radio path" + TS 05.02 "Multiplexing and Multiple Access on the Radio Path" + TS 05.04 "Modulation" + TS 05.10 "Radio subsystem synchronization" + . + In this context, BTS is "Base transceiver station". It's the stations that + connect mobile phones to the mobile network. + . + 3GPP is the "3rd Generation Partnership Project" which is the collaboration + between different telecommunication associations for developing new + generations of mobile phone networks. (post-2G/GSM) + +Package: osmo-trx-usrp1-dbg +Architecture: any +Section: debug +Priority: extra +Depends: osmo-trx-usrp1 (= ${binary:Version}), ${misc:Depends} +Description: Debug symbols for the osmo-trx-usrp1 Make debugging possible diff --git a/debian/osmo-trx-uhd.install b/debian/osmo-trx-uhd.install new file mode 100644 index 00000000..0005b768 --- /dev/null +++ b/debian/osmo-trx-uhd.install @@ -0,0 +1 @@ +/usr/bin/osmo-trx-uhd diff --git a/debian/osmo-trx-usrp1.install b/debian/osmo-trx-usrp1.install new file mode 100644 index 00000000..1b762496 --- /dev/null +++ b/debian/osmo-trx-usrp1.install @@ -0,0 +1 @@ +/usr/bin/osmo-trx-usrp1 diff --git a/debian/osmo-trx.install b/debian/osmo-trx.install index 574e915d..e69de29b 100644 --- a/debian/osmo-trx.install +++ b/debian/osmo-trx.install @@ -1 +0,0 @@ -/usr/bin/osmo-trx