falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36975?usp=email )
Change subject: build config: add --disable-ortp option ......................................................................
build config: add --disable-ortp option
Having ortp as a mandatory dependency for Osmocom CNI suite is very burdensome for users of OS distributions that don't provide zero-effort readily installable packages for every piece of software under the sun. Furthermore, the actual usage of this dependency in Osmocom is quite minimal: in a complete Osmocom 2G network, only OsmoBTS uses the osmo_ortp layer provided by libosmo-abis, and even that dependency may become optional in the future if we implement an alternative jitter buffer mechanism natively in Osmocom.
Add --disable-ortp option to libosmo-abis configure that does what it says, similar to the numerous --disable-* options in libosmocore. When libosmo-abis is built with this option, osmo_ortp module is excluded from libosmotrau, and <osmocom/trau/osmo_ortp.h> is omitted from the installation. Packages that require osmo_ortp will then fail to build, but other Osmocom CNI components that require libosmoabis and/or libosmotrau (but not osmo_ortp) will build and work with ortp dependency eliminated.
Related: OS#6474 Change-Id: I554260483b94d812ac3a957c969a902870f53883 --- M configure.ac M include/Makefile.am M src/Makefile.am 3 files changed, 94 insertions(+), 42 deletions(-)
Approvals: Jenkins Builder: Verified falconia: Looks good to me, approved fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve
diff --git a/configure.ac b/configure.ac index 085bb83..cab95cf 100644 --- a/configure.ac +++ b/configure.ac @@ -70,7 +70,20 @@ PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.9.0) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.9.0) PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.9.0) -PKG_CHECK_MODULES(ORTP, ortp >= 0.22.0) + +AC_ARG_ENABLE([ortp], [AS_HELP_STRING([--disable-ortp], [Build without ortp support])], + [ + ENABLE_ORTP=$enableval + ], + [ + ENABLE_ORTP="yes" + ]) +AS_IF([test "x$ENABLE_ORTP" = "xyes"], [ + PKG_CHECK_MODULES(ORTP, ortp >= 0.22.0) + AC_DEFINE([HAVE_ORTP],[1],[Build with ortp support]) +]) +AM_CONDITIONAL(ENABLE_ORTP, test "x$ENABLE_ORTP" = "xyes") +AC_SUBST(ENABLE_ORTP)
AC_ARG_ENABLE([dahdi], AC_HELP_STRING([--disable-dahdi], @@ -134,45 +147,50 @@ CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" fi
-_cflags_save=$CFLAGS -CFLAGS="$CFLAGS $ORTP_CFLAGS" -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include <ortp/ortp.h>]], - [[ortp_set_log_level_mask(NULL, 0xffff);]] - )], - [AC_DEFINE([HAVE_ORTP_LOG_DOMAIN], [1], - [ortp_set_log_level_mask requires domain parameter])], - [AC_DEFINE([HAVE_ORTP_LOG_DOMAIN], [0], - [ortp_set_log_level_mask has no domain parameter])]) -CFLAGS=$_cflags_save +if test x"$ENABLE_ORTP" = x"yes" +then
-_cflags_save=$CFLAGS -CFLAGS="$CFLAGS $ORTP_CFLAGS -Werror" -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include <ortp/ortp.h> - void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; }]], - [[rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]] - )], - [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(void*)(arg)], - [rtp_session_signal_connect requires pointer parameter])], - [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(unsigned long)(arg)], - [rtp_session_signal_connect requires ulong parameter])]) -CFLAGS=$_cflags_save + _cflags_save=$CFLAGS + CFLAGS="$CFLAGS $ORTP_CFLAGS" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <ortp/ortp.h>]], + [[ortp_set_log_level_mask(NULL, 0xffff);]] + )], + [AC_DEFINE([HAVE_ORTP_LOG_DOMAIN], [1], + [ortp_set_log_level_mask requires domain parameter])], + [AC_DEFINE([HAVE_ORTP_LOG_DOMAIN], [0], + [ortp_set_log_level_mask has no domain parameter])]) + CFLAGS=$_cflags_save
-_cflags_save=$CFLAGS -CFLAGS="$CFLAGS $ORTP_CFLAGS" -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#include <ortp/ortp.h>]], - [[OrtpMemoryFunctions memfn = { };]] - )], - [AC_DEFINE([HAVE_ORTP_MEM_FUNC], [1], - [OrtpMemoryFunctions is available, will use talloc])], - [AC_DEFINE([HAVE_ORTP_MEM_FUNC], [0], - [OrtpMemoryFunctions is not available])]) -CFLAGS=$_cflags_save + _cflags_save=$CFLAGS + CFLAGS="$CFLAGS $ORTP_CFLAGS -Werror" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <ortp/ortp.h> + void fake_cb(struct _RtpSession *r, void *arg1, void *arg2, void *arg3) { return; }]], + [[rtp_session_signal_connect(NULL, "", fake_cb, (void*) fake_cb);]] + )], + [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(void*)(arg)], + [rtp_session_signal_connect requires pointer parameter])], + [AC_DEFINE([RTP_SIGNAL_PTR_CAST(arg)], [(unsigned long)(arg)], + [rtp_session_signal_connect requires ulong parameter])]) + CFLAGS=$_cflags_save + + _cflags_save=$CFLAGS + CFLAGS="$CFLAGS $ORTP_CFLAGS" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <ortp/ortp.h>]], + [[OrtpMemoryFunctions memfn = { };]] + )], + [AC_DEFINE([HAVE_ORTP_MEM_FUNC], [1], + [OrtpMemoryFunctions is available, will use talloc])], + [AC_DEFINE([HAVE_ORTP_MEM_FUNC], [0], + [OrtpMemoryFunctions is not available])]) + CFLAGS=$_cflags_save + +fi # ENABLE_ORTP
AC_MSG_RESULT([CFLAGS="$CFLAGS"]) AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) diff --git a/include/Makefile.am b/include/Makefile.am index a167ef2..88d66dc 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -3,9 +3,12 @@ nobase_include_HEADERS = osmocom/abis/ipa.h osmocom/abis/trau_frame.h \ osmocom/abis/ipa_proxy.h osmocom/abis/ipaccess.h osmocom/abis/abis.h \ osmocom/abis/subchan_demux.h osmocom/abis/e1_input.h \ - osmocom/abis/lapd.h osmocom/abis/lapd_pcap.h osmocom/trau/osmo_ortp.h \ - osmocom/abis/unixsocket_proto.h \ + osmocom/abis/lapd.h osmocom/abis/lapd_pcap.h osmocom/abis/unixsocket_proto.h \ osmocom/trau/trau_frame.h \ osmocom/trau/trau_sync.h \ osmocom/trau/trau_pcu_ericsson.h \ osmocom/trau/trau_rtp.h + +if ENABLE_ORTP +nobase_include_HEADERS += osmocom/trau/osmo_ortp.h +endif diff --git a/src/Makefile.am b/src/Makefile.am index 927d63f..d72601b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -41,10 +41,13 @@ -no-undefined \ $(NULL) libosmotrau_la_LIBADD = $(COMMONLIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) -libosmotrau_la_SOURCES = trau/osmo_ortp.c \ - trau/trau_frame.c \ +libosmotrau_la_SOURCES = trau/trau_frame.c \ trau/trau_pcu_ericsson.c \ trau/trau_sync.c \ trau/trau_rtp_conv.c
+if ENABLE_ORTP +libosmotrau_la_SOURCES += trau/osmo_ortp.c +endif + noinst_HEADERS = trau/ubit_buf.h