summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-05-26 12:06:34 -0400
committerSean Bright <sean.bright@gmail.com>2017-05-26 12:06:34 -0400
commit5e9cd1f20d86de1c25b7a9accffb7d3e2601878b (patch)
tree6f0b0fb740f41b0761475657087611c563766f10 /configure.ac
parentd4ccd3a6c088f4d2fefda1a44e4555dd54335cda (diff)
res_srtp: Add support for libsrtp2
ASTERISK-25294 #close Reported by: Tzafrir Cohen ASTERISK-26976 #close Reported by: Alex Change-Id: I789b1c3d1ed31365bbd9339fa58ef36f48833c40
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac85
1 files changed, 49 insertions, 36 deletions
diff --git a/configure.ac b/configure.ac
index bf98ad386..e36f2de6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2425,46 +2425,59 @@ then
AST_C_DEFINE_CHECK([SSL_OP_NO_TLSV1_2], [SSL_OP_NO_TLSv1_2], [openssl/ssl.h])
fi
-AST_EXT_LIB_CHECK([SRTP], [srtp], [srtp_init], [srtp/srtp.h])
+AST_EXT_LIB_CHECK([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [2])
+AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [], [
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** libsrtp2 could not be linked as a shared object.])
+ AC_MSG_WARN([*** Try compiling libsrtp2 manually. Configure libsrtp2])
+ AC_MSG_WARN([*** with ./configure --prefix=/usr replacing /usr with])
+ AC_MSG_WARN([*** the prefix of your choice, and then make with])
+ AC_MSG_WARN([*** 'make libsrtp2.so'])
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** After re-installing libsrtp2, re-run the Asterisk])
+ AC_MSG_WARN([*** configure script.])
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** If you do not need SRTP support re-run configure])
+ AC_MSG_WARN([*** with the --without-srtp option.])
+ exit 1
+])
+
+if test "x$PBX_SRTP" = x1;
+then
+ AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp2], [srtp_shutdown], [srtp2/srtp.h])
+
+ # libsrtp2 removed support for PRNG, so we require OpenSSL
+ if test "x$PBX_OPENSSL" != x1;
+ then
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** OpenSSL required when using libsrtp2, checking for libsrtp instead.])
+ AC_MSG_WARN([***])
+ PBX_SRTP=0
+ fi
+fi
-if test "$PBX_SRTP" = "1";
+if test "x$PBX_SRTP" != x1;
then
- saved_libs="${LIBS}"
- saved_ldflags="${LDFLAGS}"
- saved_cflags="${CFLAGS}"
- LIBS="${LIBS} ${SRTP_LIB}"
- LDFLAGS="${LDFLAGS} -shared -fPIC"
- CFLAGS="${CFLAGS} ${SRTP_INCLUDE}"
- AC_MSG_CHECKING(for the ability of -lsrtp to be linked in a shared object)
- AC_LINK_IFELSE(
- [
- AC_LANG_PROGRAM(
- [#include <srtp/srtp.h>],
- [srtp_init();]
- )
- ],
- [ AC_MSG_RESULT(yes) ],
- [
- AC_MSG_RESULT(no)
- AC_MSG_WARN(***)
- AC_MSG_WARN(*** libsrtp could not be linked as a shared object.)
- AC_MSG_WARN(*** Try compiling libsrtp manually. Configure libsrtp)
- AC_MSG_WARN(*** with ./configure CFLAGS=-fPIC --prefix=/usr)
- AC_MSG_WARN(*** replacing /usr with the prefix of your choice.)
- AC_MSG_WARN(*** After re-installing libsrtp, re-run the Asterisk)
- AC_MSG_WARN(*** configure script.)
- AC_MSG_WARN(***)
- AC_MSG_WARN(*** If you do not need SRTP support re-run configure)
- AC_MSG_WARN(*** with the --without-srtp option.)
+ AST_EXT_LIB_CHECK([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [1])
+ AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [], [
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** libsrtp could not be linked as a shared object.])
+ AC_MSG_WARN([*** Try compiling libsrtp manually. Configure libsrtp])
+ AC_MSG_WARN([*** with ./configure CFLAGS=-fPIC --prefix=/usr])
+ AC_MSG_WARN([*** replacing /usr with the prefix of your choice.])
+ AC_MSG_WARN([*** After re-installing libsrtp, re-run the Asterisk])
+ AC_MSG_WARN([*** configure script.])
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** If you do not need SRTP support re-run configure])
+ AC_MSG_WARN([*** with the --without-srtp option.])
exit 1
- ]
- )
- LIBS="${saved_libs}"
- LDFLAGS="${saved_ldflags}"
- CFLAGS="${saved_cflags}"
-fi
+ ])
-AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h])
+ if test "x$PBX_SRTP" = x1;
+ then
+ AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h])
+ fi
+fi
for ver in 2.0 2.2 2.4 2.6; do
AST_PKG_CONFIG_CHECK([GMIME], gmime-$ver)