From 7aa5a93e77fa10f40f4e4721745c764106ae188f Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 26 Dec 2015 20:12:03 +0100 Subject: libsctp: Fix build and don't link everything to libsctp On some systems sctp_* is part of the standard libc, so do not use AC_CHECK_LIB but AC_SEARCH_LIBS to find the symbol we need. Both macros modify LIBS which means all applications will link again libsctp and this is not what we want. Undo the side-effect of LIBS and export LIBSCTP_LIBS which is already used in the Makefile.am. --- configure.ac | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 42f3f42..cd91a6f 100644 --- a/configure.ac +++ b/configure.ac @@ -40,13 +40,15 @@ PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0) dnl FIXME: We depend on libosmoabis by now until we can move LAPD code here PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.0.7) PKG_CHECK_MODULES(ORTP, ortp >= 0.15.0) -AC_CHECK_LIB([sctp], [sctp_send], [ - AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support]) - AC_SUBST(HAVE_LIBSCTP, [1]) - LIBS="-lsctp $LIBS" - ], [ - AC_MSG_ERROR([libsctp not found]) - ]) + +old_LIBS=$LIBS +AC_SEARCH_LIBS([sctp_send], [sctp], [ + AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support]) + AC_SUBST(HAVE_LIBSCTP, [1]) + AC_SUBST(LIBSCTP_LIBS, [-l$ac_lib]) + ], [ + AC_MSG_ERROR([sctp_send not found in searched libs])]) +LIBS=$old_LIBS AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) -- cgit v1.2.3