socket: Introduce API osmo_sock_init2_multiaddr()

This API will be used by libosmo-netif's osmo_stream for SCTP sockets,
which in turn will be used by libosmo-sccp to support multi-homed
connections.

Related: OS#3608
Change-Id: Ic8681d9e093216c99c6bca4be81c31ef83688ed1
diff --git a/configure.ac b/configure.ac
index 39d232b..2f12d86 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,6 +100,17 @@
 
 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],