mirror of https://gerrit.osmocom.org/libosmocore
configure: Support libsctp < 1.0.17 without libsctp.pc
libsctp 1.0.17 is the first to contain a pkgconfig file in upstream.
Current OpenSure Leap 15.3 as well as our OpenEmbedded meta-telephony
layer still ship 1.0.16 which contain no pkgconfig file.
Let's attempt first finding the .pc file, and otherwise manually link
against the lib.
Related: https://bugzilla.opensuse.org/show_bug.cgi?id=1197590
Related: https://build.opensuse.org/request/show/965348
Fixes: 12eed19066
Change-Id: I241634388c2d32adffebd860c88bdd13002a6af0
This commit is contained in:
parent
39f47983e1
commit
c80a004f0b
26
configure.ac
26
configure.ac
|
@ -223,16 +223,22 @@ AC_ARG_ENABLE([libsctp], [AS_HELP_STRING([--disable-libsctp], [Do not enable soc
|
||||||
[ENABLE_LIBSCTP=$enableval], [ENABLE_LIBSCTP="yes"])
|
[ENABLE_LIBSCTP=$enableval], [ENABLE_LIBSCTP="yes"])
|
||||||
AM_CONDITIONAL(ENABLE_LIBSCTP, test x"$ENABLE_LIBSCTP" = x"yes")
|
AM_CONDITIONAL(ENABLE_LIBSCTP, test x"$ENABLE_LIBSCTP" = x"yes")
|
||||||
AS_IF([test "x$ENABLE_LIBSCTP" = "xyes"], [
|
AS_IF([test "x$ENABLE_LIBSCTP" = "xyes"], [
|
||||||
old_LIBS=$LIBS
|
AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support])
|
||||||
AC_SEARCH_LIBS([sctp_bindx], [sctp], [
|
# Attempt finding .pc, otherwise set manually (<1.0.17 have no .pc file)
|
||||||
AC_DEFINE(HAVE_LIBSCTP, 1, [Define 1 to enable SCTP support])
|
PKG_CHECK_MODULES(LIBSCTP, libsctp,
|
||||||
AC_SUBST(HAVE_LIBSCTP, [1])
|
[AC_SUBST(LIBSCTP_PC, [libsctp])],
|
||||||
if test -n "$ac_lib"; then
|
[
|
||||||
AC_SUBST(LIBSCTP_LIBS, [-l$ac_lib])
|
AC_MSG_NOTICE([libsctp.pc not found (building against <1.0.17 ?), attempting manual lib lookup])
|
||||||
fi
|
old_LIBS=$LIBS
|
||||||
], [
|
AC_SEARCH_LIBS([sctp_bindx], [sctp], [
|
||||||
AC_MSG_ERROR([sctp_bindx not found in searched libs])])
|
AC_SUBST(HAVE_LIBSCTP, [1])
|
||||||
LIBS=$old_LIBS
|
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([sctp-tests], [AS_HELP_STRING([--disable-sctp-tests], [Do not run socket tests requiring system SCTP support])],
|
AC_ARG_ENABLE([sctp-tests], [AS_HELP_STRING([--disable-sctp-tests], [Do not run socket tests requiring system SCTP support])],
|
||||||
|
|
|
@ -7,7 +7,7 @@ Name: Osmocom Core Library
|
||||||
Description: C Utility Library
|
Description: C Utility Library
|
||||||
Version: @VERSION@
|
Version: @VERSION@
|
||||||
Requires: talloc
|
Requires: talloc
|
||||||
Requires.private: libsctp
|
Requires.private: @LIBSCTP_PC@
|
||||||
Libs: -L${libdir} -losmocore
|
Libs: -L${libdir} -losmocore
|
||||||
Libs.private: @PTHREAD_LIBS@
|
Libs.private: @PTHREAD_LIBS@ @LIBSCTP_LIBS@
|
||||||
Cflags: -I${includedir}/ @PTHREAD_CFLAGS@
|
Cflags: -I${includedir}/ @PTHREAD_CFLAGS@
|
||||||
|
|
Loading…
Reference in New Issue