From 6f3e884ff20381724c995dd7cbf05eec3a164a7b Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Thu, 13 Oct 2016 15:05:19 +0200 Subject: Revert "Check libsctp for sctp funcs in configure.in" This reverts commit 52fae83743a6e84d719f4f82fe45e6e0efdbd6f0: Check libsctp for sctp funcs in configure.in Call AC_CHECK_LIB before calling AC_CHECK_FUNCS to check for functions in libsctp. Otherwise AC_CHECK_FUNCS will not link with libsctp to see if function exists. Reverting to the old behaviour of not checking for libsctp before checking for sctp functions. Then it works on Linux by loading libsctp and looking up the symbols i runtime, and it works on FreeBSD since there is no separate libsctp to link against - the functions are part of the default system libraries. --- erts/configure.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erts/configure.in b/erts/configure.in index 883ce2db68..6a26bbf06a 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -1710,8 +1710,7 @@ if test "x$enable_sctp" != "xno" ; then fi if test x"$ac_cv_header_netinet_sctp_h" = x"yes"; then - AC_CHECK_LIB(sctp, sctp_bindx) - AC_CHECK_FUNCS([sctp_peeloff sctp_getladdrs sctp_freeladdrs sctp_getpaddrs sctp_freepaddrs]) + AC_CHECK_FUNCS([sctp_bindx sctp_peeloff sctp_getladdrs sctp_freeladdrs sctp_getpaddrs sctp_freepaddrs]) AC_CHECK_DECLS([SCTP_UNORDERED, SCTP_ADDR_OVER, SCTP_ABORT, SCTP_EOF, SCTP_SENDALL, SCTP_ADDR_CONFIRMED, SCTP_DELAYED_ACK_TIME, -- cgit v1.2.3 From 9730ec7618c63b7ab74dd2433aaa6d1675f26518 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Fri, 14 Oct 2016 11:05:45 +0200 Subject: Configure enable libsctp dependency --- configure.in | 7 +++++-- erts/configure.in | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index ea98dc9836..8dd4e588d7 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. dnl %CopyrightBegin% dnl -dnl Copyright Ericsson AB 1998-2014. All Rights Reserved. +dnl Copyright Ericsson AB 1998-2016. All Rights Reserved. dnl dnl Licensed under the Apache License, Version 2.0 (the "License"); dnl you may not use this file except in compliance with the License. @@ -229,7 +229,10 @@ AS_HELP_STRING([--enable-kernel-poll], [enable kernel poll support]) AS_HELP_STRING([--disable-kernel-poll], [disable kernel poll support])) AC_ARG_ENABLE(sctp, -AS_HELP_STRING([--enable-sctp], [enable sctp support]) +AS_HELP_STRING([--enable-sctp], [enable sctp support (default) +to on demand load the SCTP library in runtime]) +AS_HELP_STRING([--enable-sctp=lib], [enable sctp support +to link against the SCTP library]) AS_HELP_STRING([--disable-sctp], [disable sctp support])) AC_ARG_ENABLE(hipe, diff --git a/erts/configure.in b/erts/configure.in index 6a26bbf06a..7455516def 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -196,12 +196,18 @@ AS_HELP_STRING([--disable-kernel-poll], [disable kernel poll support]), AC_ARG_ENABLE(sctp, -AS_HELP_STRING([--enable-sctp], [enable sctp support (default)]) +AS_HELP_STRING([--enable-sctp], [enable sctp support (default) +to on demand load the SCTP library in runtime if needed]) +AS_HELP_STRING([--enable-sctp=lib], [enable sctp support +to link against the SCTP library]) AS_HELP_STRING([--disable-sctp], [disable sctp support]), -[ case "$enableval" in - no) enable_sctp=no ;; - *) enable_sctp=yes ;; - esac ], enable_sctp=unknown) +[ case "x$enableval" in + xno|xyes|xlib|x) + ;; + x*) + AC_MSG_ERROR("invalid value --enable-sctp=$enableval") + ;; + esac ]) AC_ARG_ENABLE(hipe, AS_HELP_STRING([--enable-hipe], [enable hipe support]) @@ -1710,6 +1716,8 @@ if test "x$enable_sctp" != "xno" ; then fi if test x"$ac_cv_header_netinet_sctp_h" = x"yes"; then + AS_IF([test "x$enable_sctp" = "xlib"], + AC_CHECK_LIB(sctp, sctp_bindx)) AC_CHECK_FUNCS([sctp_bindx sctp_peeloff sctp_getladdrs sctp_freeladdrs sctp_getpaddrs sctp_freepaddrs]) AC_CHECK_DECLS([SCTP_UNORDERED, SCTP_ADDR_OVER, SCTP_ABORT, SCTP_EOF, SCTP_SENDALL, SCTP_ADDR_CONFIRMED, -- cgit v1.2.3