Change in libosmocore[master]: configure: Introduce --disable-libsctp and error by default if libsct...

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

pespin gerrit-no-reply at lists.osmocom.org
Thu Oct 24 13:43:05 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/15871 )


Change subject: configure: Introduce --disable-libsctp and error by default if libsctp not found
......................................................................

configure: Introduce --disable-libsctp and error by default if libsctp not found

This way libosmocore build fails during configuring phase if expected
default behavior (building with libsctp support enabled and providing
osmo_sock_init2_multiaddr() API) fails. User is still provided with
--disable-libsctp option in case he doesn't need those features or his
environment doesn't provide required libsctp APIs.

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



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/71/15871/1

diff --git a/configure.ac b/configure.ac
index 2f12d86..6c54e66 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,17 +100,6 @@
 
 AC_CHECK_FUNCS(clock_gettime localtime_r)
 
-old_LIBS=$LIBS
-AC_SEARCH_LIBS([sctp_bindx], [sctp], [
-	AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support])
-	AC_SUBST(HAVE_LIBSCTP, [1])
-	if test -n "$ac_lib"; then
-		AC_SUBST(LIBSCTP_LIBS, [-l$ac_lib])
-	fi
-	], [
-	AC_MSG_WARN([sctp_bindx not found in searched libs])])
-LIBS=$old_LIBS
-
 AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
   AC_CACHE_CHECK(
     [whether struct tm has tm_gmtoff member],
@@ -171,6 +160,22 @@
 	AC_DEFINE([USE_GNUTLS], [1], [Use GnuTLS as a fallback for missing getrandom()])
 fi
 
+AC_ARG_ENABLE([libsctp], [AS_HELP_STRING([--disable-libsctp], [Do not enable socket multiaddr APIs requiring libsctp])],
+	[ENABLE_LIBSCTP=$enableval], [ENABLE_LIBSCTP="yes"])
+AM_CONDITIONAL(ENABLE_LIBSCTP, test x"$ENABLE_LIBSCTP" = x"yes")
+AS_IF([test "x$ENABLE_LIBSCTP" = "xyes"], [
+	old_LIBS=$LIBS
+	AC_SEARCH_LIBS([sctp_bindx], [sctp], [
+		AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support])
+		AC_SUBST(HAVE_LIBSCTP, [1])
+		if test -n "$ac_lib"; then
+			AC_SUBST(LIBSCTP_LIBS, [-l$ac_lib])
+		fi
+		], [
+		AC_MSG_ERROR([sctp_bindx not found in searched libs])])
+	LIBS=$old_LIBS
+])
+
 AC_ARG_ENABLE(plugin,
 	[AS_HELP_STRING(
 		[--disable-plugin],
@@ -279,6 +284,7 @@
 	AM_CONDITIONAL(ENABLE_UTILITIES, false)
 	AM_CONDITIONAL(ENABLE_GB, false)
 	AM_CONDITIONAL(ENABLE_GNUTLS, false)
+	AM_CONDITIONAL(ENABLE_LIBSCTP, false)
 	AM_CONDITIONAL(ENABLE_PCSC, false)
 	AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true)
 	AM_CONDITIONAL(ENABLE_SERCOM_STUB, true)

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/15871
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I710c9cb1c6da0e5fc94b792df8bf60194a72208f
Gerrit-Change-Number: 15871
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191024/24f4e3d9/attachment.htm>


More information about the gerrit-log mailing list