[PATCH] osmo-msc[master]: build: check for -lgsm

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sun Aug 27 15:39:23 UTC 2017


Hello Jenkins Builder,

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

    https://gerrit.osmocom.org/3587

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

build: check for -lgsm

If libosmo-legacy-mgcp is built with --enable-mgcp-transcoding, we need to link
-lgsm here as well. This autodetects whether -lgsm is necessary.

Todo: how about --with-g729?

Todo: osmo-msc is only using the mgcp client and should not actually need
      transcoding nor -lgsm.

Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43
---
M configure.ac
1 file changed, 27 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/87/3587/6

diff --git a/configure.ac b/configure.ac
index 67afc2d..397e90c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,17 +60,6 @@
     [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"])
 AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"])
 
-if test "$osmo_ac_mgcp_transcoding" = "yes" ; then
-    AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""], [AC_MSG_ERROR([--enable-mgcp-transcoding: cannot find usable libgsm])])
-    AC_SUBST(LIBRARY_GSM)
-    if test "$osmo_ac_with_g729" = "yes" ; then
-	PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])])
-    fi
-    AC_DEFINE(BUILD_MGCP_TRANSCODING, 1, [Define if we want to build the MGCP gateway with transcoding support])
-fi
-AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes")
-AC_SUBST(osmo_ac_mgcp_transcoding)
-
 # Enable/disable 3G aka IuPS + IuCS support?
 AC_ARG_ENABLE([iu], [AS_HELP_STRING([--enable-iu], [Build 3G support, aka IuPS and IuCS interfaces])],
     [osmo_ac_iu="$enableval"],[osmo_ac_iu="no"])
@@ -134,6 +123,33 @@
    AC_SUBST([COVERAGE_LDFLAGS])
 fi
 
+AC_DEFUN([CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM], [
+  AC_CACHE_CHECK(
+    [whether libosmo-legacy-mgcp needs -lgsm],
+    libosmo_cv_legacy_mgcp_needs_libgsm, [
+       SAVE_LDFLAGS="${LDFLAGS}"
+       LDFLAGS="${LIBOSMOLEGACYMGCP_LIBS} ${LIBOSMOVTY_LIBS}"
+       AC_LINK_IFELSE(
+         [AC_LANG_PROGRAM([
+                           #include <osmocom/legacy_mgcp/mgcpgw_client.h>
+                         ], [
+                           mgcpgw_client_init(0, 0);
+                         ])],
+         [libosmo_cv_legacy_mgcp_needs_libgsm=no],
+         [libosmo_cv_legacy_mgcp_needs_libgsm=yes])
+       LDFLAGS="${SAVE_LDFLAGS}"
+       ])
+  ])
+CHECK_LIBOSMO_LEGACY_MGCP_NEEDS_LIBGSM
+if test "x$libosmo_cv_legacy_mgcp_needs_libgsm" = xyes; then
+    AC_SEARCH_LIBS([gsm_create], [gsm], [LIBRARY_GSM="$LIBS";LIBS=""],
+		   [AC_MSG_ERROR([libosmo-legacy-mgcp is built with transcoding and needs -lgsm but cannot find usable libgsm])])
+    AC_SUBST(LIBRARY_GSM)
+    if test "$osmo_ac_with_g729" = "yes" ; then
+	PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])])
+    fi
+fi
+
 AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
   AC_CACHE_CHECK(
     [whether struct tm has tm_gmtoff member],

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iab55a089ae36017b79e7cbc3cac45ef9fd85dd43
Gerrit-PatchSet: 6
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list