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
This commit is contained in:
Pau Espin 2018-04-24 18:49:03 +02:00
parent e564f0fd84
commit f3d7f443a0
7 changed files with 65 additions and 19 deletions

View File

@ -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

View File

@ -6,6 +6,8 @@ SUBDIRS =
if DEVICE_USRP1
SUBDIRS += usrp1
else
endif
if DEVICE_UHD
SUBDIRS += uhd
endif

View File

@ -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"])

41
debian/control vendored
View File

@ -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 <ivan.kluchnikov@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 @@ 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

1
debian/osmo-trx-uhd.install vendored Normal file
View File

@ -0,0 +1 @@
/usr/bin/osmo-trx-uhd

1
debian/osmo-trx-usrp1.install vendored Normal file
View File

@ -0,0 +1 @@
/usr/bin/osmo-trx-usrp1

View File

@ -1 +0,0 @@
/usr/bin/osmo-trx