Timur Davydov has uploaded this change for review.

View Change

bts: guard AMR RTP decoder stub with HAVE_LIBOSMOCODEC_STATIC

Disable dummy osmo_amr_rtp_dec() implementation when
linking against static libosmocodec to avoid symbol
conflicts

Apply to omldummy and virtual BTS models

Change-Id: Ie19ae2013893575a2f74a87af2151034abf57870
---
M configure.ac
M src/osmo-bts-omldummy/bts_model.c
M src/osmo-bts-virtual/bts_model.c
3 files changed, 11 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/42701/1
diff --git a/configure.ac b/configure.ac
index a3c22c6..947e431 100644
--- a/configure.ac
+++ b/configure.ac
@@ -345,6 +345,13 @@

PKG_CHECK_MODULES(LIBOSMOTRX, libosmo-trx-websdr >= 1.7.2)

+ # Check whether libosmo-trx-websdr is static
+ osmocodec_libdir="$($PKG_CONFIG --variable=libdir libosmocodec 2>/dev/null)"
+ if test -n "$osmocodec_libdir" && test -f "$osmocodec_libdir/libosmocodec.a" ; then
+ AC_MSG_NOTICE([found static libosmocodec.a])
+ AC_DEFINE([HAVE_LIBOSMOCODEC_STATIC], [1], [Found static libosmocodec])
+ fi
+
# Check whether libosmo-trx-websdr provides modulateBits
save_LIBS="$LIBS"
LIBS="$LIBS $LIBOSMOTRX_LIBS"
diff --git a/src/osmo-bts-omldummy/bts_model.c b/src/osmo-bts-omldummy/bts_model.c
index 8abca39..b3ca3c4 100644
--- a/src/osmo-bts-omldummy/bts_model.c
+++ b/src/osmo-bts-omldummy/bts_model.c
@@ -44,6 +44,7 @@
return -1;
}

+#ifndef HAVE_LIBOSMOCODEC_STATIC
/* TODO: check if dummy method is sufficient, else implement */
int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr,
int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti)
@@ -51,6 +52,7 @@
LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__);
return -1;
}
+#endif /* HAVE_LIBOSMOCODEC_STATIC */

void bts_model_trx_close(struct gsm_bts_trx *trx)
{
diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c
index a70abfb..8212ee7 100644
--- a/src/osmo-bts-virtual/bts_model.c
+++ b/src/osmo-bts-virtual/bts_model.c
@@ -46,6 +46,7 @@
return -1;
}

+#ifndef HAVE_LIBOSMOCODEC_STATIC
/* TODO: check if dummy method is sufficient, else implement */
int osmo_amr_rtp_dec(const uint8_t *rtppayload, int payload_len, uint8_t *cmr,
int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti)
@@ -53,6 +54,7 @@
LOGP(DL1C, LOGL_NOTICE, "Unimplemented %s\n", __func__);
return -1;
}
+#endif /* HAVE_LIBOSMOCODEC_STATIC */

void bts_model_trx_close(struct gsm_bts_trx *trx)
{

To view, visit change 42701. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie19ae2013893575a2f74a87af2151034abf57870
Gerrit-Change-Number: 42701
Gerrit-PatchSet: 1
Gerrit-Owner: Timur Davydov <dtv.comp@gmail.com>