[PATCH] osmo-trx[master]: Build one osmo-trx binary for each device support enabled

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/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Tue Apr 24 17:19:00 UTC 2018


Review at  https://gerrit.osmocom.org/7917

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
---
M Transceiver52M/Makefile.am
M Transceiver52M/device/Makefile.am
M configure.ac
M debian/control
A debian/osmo-trx-uhd.install
A debian/osmo-trx-usrp1.install
M debian/osmo-trx.install
7 files changed, 65 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/17/7917/1

diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am
index ae4a5bc..3a872ef 100644
--- a/Transceiver52M/Makefile.am
+++ b/Transceiver52M/Makefile.am
@@ -80,19 +80,24 @@
 	$(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 f0675b0..2788eaa 100644
--- a/Transceiver52M/device/Makefile.am
+++ b/Transceiver52M/device/Makefile.am
@@ -6,6 +6,8 @@
 
 if DEVICE_USRP1
 SUBDIRS += usrp1
-else
+endif
+
+if DEVICE_UHD
 SUBDIRS += uhd
 endif
diff --git a/configure.ac b/configure.ac
index 70a8f4b..2b2dab7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,6 +90,11 @@
 	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 @@
     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 @@
             [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 @@
 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 b3d63a7..cae44d4 100644
--- a/debian/control
+++ b/debian/control
@@ -19,9 +19,15 @@
 Homepage: https://projects.osmocom.org/projects/osmotrx
 
 Package: osmo-trx
+Maintainer: Ivan Klyuchnikov <ivan.kluchnikov at fairwaves.ru>
+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 @@
  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 0000000..0005b76
--- /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 0000000..1b76249
--- /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 574e915..e69de29 100644
--- a/debian/osmo-trx.install
+++ b/debian/osmo-trx.install
@@ -1 +0,0 @@
-/usr/bin/osmo-trx

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea8c0d7434762713a53440d29bf3ebd84accb262
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list