<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10166">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">autoconf: Check for srtp_get_version_string() before using it<br><br>Change-Id: Id2a916ff9448706090e72ff2c7fb3f5ba24a05df<br>---<br>M configure<br>M configure.ac<br>M include/asterisk/autoconfig.h.in<br>M menuselect/configure<br>M res/res_srtp.c<br>5 files changed, 251 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configure b/configure</span><br><span>index c453501..9b0d46e 100755</span><br><span>--- a/configure</span><br><span>+++ b/configure</span><br><span>@@ -762,6 +762,10 @@</span><br><span> OPENSSL_DIR</span><br><span> OPENSSL_INCLUDE</span><br><span> OPENSSL_LIB</span><br><span style="color: hsl(120, 100%, 40%);">+PBX_SRTP_GET_VERSION</span><br><span style="color: hsl(120, 100%, 40%);">+SRTP_GET_VERSION_DIR</span><br><span style="color: hsl(120, 100%, 40%);">+SRTP_GET_VERSION_INCLUDE</span><br><span style="color: hsl(120, 100%, 40%);">+SRTP_GET_VERSION_LIB</span><br><span> PBX_SRTP_SHUTDOWN</span><br><span> SRTP_SHUTDOWN_DIR</span><br><span> SRTP_SHUTDOWN_INCLUDE</span><br><span>@@ -1329,6 +1333,7 @@</span><br><span> docdir</span><br><span> oldincludedir</span><br><span> includedir</span><br><span style="color: hsl(120, 100%, 40%);">+runstatedir</span><br><span> localstatedir</span><br><span> sharedstatedir</span><br><span> sysconfdir</span><br><span>@@ -1516,6 +1521,7 @@</span><br><span> sysconfdir='${prefix}/etc'</span><br><span> sharedstatedir='${prefix}/com'</span><br><span> localstatedir='${prefix}/var'</span><br><span style="color: hsl(120, 100%, 40%);">+runstatedir='${localstatedir}/run'</span><br><span> includedir='${prefix}/include'</span><br><span> oldincludedir='/usr/include'</span><br><span> docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'</span><br><span>@@ -1768,6 +1774,15 @@</span><br><span> | -silent | --silent | --silen | --sile | --sil)</span><br><span> silent=yes ;;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ -runstatedir | --runstatedir | --runstatedi | --runstated \</span><br><span style="color: hsl(120, 100%, 40%);">+ | --runstate | --runstat | --runsta | --runst | --runs \</span><br><span style="color: hsl(120, 100%, 40%);">+ | --run | --ru | --r)</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_prev=runstatedir ;;</span><br><span style="color: hsl(120, 100%, 40%);">+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \</span><br><span style="color: hsl(120, 100%, 40%);">+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \</span><br><span style="color: hsl(120, 100%, 40%);">+ | --run=* | --ru=* | --r=*)</span><br><span style="color: hsl(120, 100%, 40%);">+ runstatedir=$ac_optarg ;;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)</span><br><span> ac_prev=sbindir ;;</span><br><span> -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \</span><br><span>@@ -1905,7 +1920,7 @@</span><br><span> for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \</span><br><span> datadir sysconfdir sharedstatedir localstatedir includedir \</span><br><span> oldincludedir docdir infodir htmldir dvidir pdfdir psdir \</span><br><span style="color: hsl(0, 100%, 40%);">- libdir localedir mandir</span><br><span style="color: hsl(120, 100%, 40%);">+ libdir localedir mandir runstatedir</span><br><span> do</span><br><span> eval ac_val=\$$ac_var</span><br><span> # Remove trailing slashes.</span><br><span>@@ -2058,6 +2073,7 @@</span><br><span> --sysconfdir=DIR read-only single-machine data [PREFIX/etc]</span><br><span> --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]</span><br><span> --localstatedir=DIR modifiable single-machine data [PREFIX/var]</span><br><span style="color: hsl(120, 100%, 40%);">+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]</span><br><span> --libdir=DIR object code libraries [EPREFIX/lib]</span><br><span> --includedir=DIR C header files [PREFIX/include]</span><br><span> --oldincludedir=DIR C header files for non-gcc [/usr/include]</span><br><span>@@ -12416,6 +12432,18 @@</span><br><span> </span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+SRTP_GET_VERSION_DESCRIP="SRTP Library Version Function"</span><br><span style="color: hsl(120, 100%, 40%);">+SRTP_GET_VERSION_OPTION=srtp</span><br><span style="color: hsl(120, 100%, 40%);">+SRTP_GET_VERSION_DIR=${SRTP_DIR}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+PBX_SRTP_GET_VERSION=0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> OPENSSL_DESCRIP="OpenSSL Secure Sockets Layer"</span><br><span> OPENSSL_OPTION="ssl"</span><br><span> PBX_OPENSSL=0</span><br><span>@@ -14768,7 +14796,7 @@</span><br><span> We can't simply define LARGE_OFF_T to be 9223372036854775807,</span><br><span> since some C++ compilers masquerading as C compilers</span><br><span> incorrectly reject 9223372036854775807. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))</span><br><span style="color: hsl(120, 100%, 40%);">+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))</span><br><span> int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721</span><br><span> && LARGE_OFF_T % 2147483647 == 1)</span><br><span> ? 1 : -1];</span><br><span>@@ -14814,7 +14842,7 @@</span><br><span> We can't simply define LARGE_OFF_T to be 9223372036854775807,</span><br><span> since some C++ compilers masquerading as C compilers</span><br><span> incorrectly reject 9223372036854775807. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))</span><br><span style="color: hsl(120, 100%, 40%);">+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))</span><br><span> int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721</span><br><span> && LARGE_OFF_T % 2147483647 == 1)</span><br><span> ? 1 : -1];</span><br><span>@@ -14838,7 +14866,7 @@</span><br><span> We can't simply define LARGE_OFF_T to be 9223372036854775807,</span><br><span> since some C++ compilers masquerading as C compilers</span><br><span> incorrectly reject 9223372036854775807. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))</span><br><span style="color: hsl(120, 100%, 40%);">+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))</span><br><span> int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721</span><br><span> && LARGE_OFF_T % 2147483647 == 1)</span><br><span> ? 1 : -1];</span><br><span>@@ -14883,7 +14911,7 @@</span><br><span> We can't simply define LARGE_OFF_T to be 9223372036854775807,</span><br><span> since some C++ compilers masquerading as C compilers</span><br><span> incorrectly reject 9223372036854775807. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))</span><br><span style="color: hsl(120, 100%, 40%);">+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))</span><br><span> int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721</span><br><span> && LARGE_OFF_T % 2147483647 == 1)</span><br><span> ? 1 : -1];</span><br><span>@@ -14907,7 +14935,7 @@</span><br><span> We can't simply define LARGE_OFF_T to be 9223372036854775807,</span><br><span> since some C++ compilers masquerading as C compilers</span><br><span> incorrectly reject 9223372036854775807. */</span><br><span style="color: hsl(0, 100%, 40%);">-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))</span><br><span style="color: hsl(120, 100%, 40%);">+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))</span><br><span> int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721</span><br><span> && LARGE_OFF_T % 2147483647 == 1)</span><br><span> ? 1 : -1];</span><br><span>@@ -16207,6 +16235,8 @@</span><br><span> if (*(data + i) != *(data3 + i))</span><br><span> return 14;</span><br><span> close (fd);</span><br><span style="color: hsl(120, 100%, 40%);">+ free (data);</span><br><span style="color: hsl(120, 100%, 40%);">+ free (data3);</span><br><span> return 0;</span><br><span> }</span><br><span> _ACEOF</span><br><span>@@ -31476,6 +31506,102 @@</span><br><span> </span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+if test "x${PBX_SRTP_GET_VERSION}" != "x1" -a "${USE_SRTP_GET_VERSION}" != "no"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir=""</span><br><span style="color: hsl(120, 100%, 40%);">+ # if --with-SRTP_GET_VERSION=DIR has been specified, use it.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${SRTP_GET_VERSION_DIR}" != "x"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -d ${SRTP_GET_VERSION_DIR}/lib; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir="-L${SRTP_GET_VERSION_DIR}/lib"</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir="-L${SRTP_GET_VERSION_DIR}"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS="${CFLAGS} "</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_get_version_string in -lsrtp2" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo_n "checking for srtp_get_version_string in -lsrtp2... " >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+if ${ac_cv_lib_srtp2_srtp_get_version_string+:} false; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo_n "(cached) " >&6</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_check_lib_save_LIBS=$LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+LIBS="-lsrtp2 ${pbxlibdir} $LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+cat confdefs.h - <<_ACEOF >conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+/* end confdefs.h. */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Override any GCC internal prototype to avoid an error.</span><br><span style="color: hsl(120, 100%, 40%);">+ Use char because int might match the return type of a GCC</span><br><span style="color: hsl(120, 100%, 40%);">+ builtin and then its argument prototype would still apply. */</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef __cplusplus</span><br><span style="color: hsl(120, 100%, 40%);">+extern "C"</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+char srtp_get_version_string ();</span><br><span style="color: hsl(120, 100%, 40%);">+int</span><br><span style="color: hsl(120, 100%, 40%);">+main ()</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+return srtp_get_version_string ();</span><br><span style="color: hsl(120, 100%, 40%);">+ ;</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+if ac_fn_c_try_link "$LINENO"; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_cv_lib_srtp2_srtp_get_version_string=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_cv_lib_srtp2_srtp_get_version_string=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+rm -f core conftest.err conftest.$ac_objext \</span><br><span style="color: hsl(120, 100%, 40%);">+ conftest$ac_exeext conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+LIBS=$ac_check_lib_save_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_get_version_string" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "$ac_cv_lib_srtp2_srtp_get_version_string" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_lib_srtp2_srtp_get_version_string" = xyes; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_SRTP_GET_VERSION_FOUND=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_SRTP_GET_VERSION_FOUND=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # now check for the header.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "${AST_SRTP_GET_VERSION_FOUND}" = "yes"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_LIB="${pbxlibdir} -lsrtp2 "</span><br><span style="color: hsl(120, 100%, 40%);">+ # if --with-SRTP_GET_VERSION=DIR has been specified, use it.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${SRTP_GET_VERSION_DIR}" != "x"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_INCLUDE="-I${SRTP_GET_VERSION_DIR}/include"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_INCLUDE="${SRTP_GET_VERSION_INCLUDE} "</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # check for the header</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+ CPPFLAGS="${CPPFLAGS} ${SRTP_GET_VERSION_INCLUDE}"</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_fn_c_check_header_mongrel "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default"</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_header_srtp2_srtp_h" = xyes; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_HEADER_FOUND=1</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_HEADER_FOUND=0</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${SRTP_GET_VERSION_HEADER_FOUND}" = "x0" ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_LIB=""</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_INCLUDE=""</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_SRTP_GET_VERSION=1</span><br><span style="color: hsl(120, 100%, 40%);">+ cat >>confdefs.h <<_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+#define HAVE_SRTP_GET_VERSION 1</span><br><span style="color: hsl(120, 100%, 40%);">+_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> # libsrtp2 removed support for PRNG, so we require OpenSSL</span><br><span> if test "x$PBX_OPENSSL" != x1;</span><br><span> then</span><br><span>@@ -32015,6 +32141,102 @@</span><br><span> fi</span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x${PBX_SRTP_GET_VERSION}" != "x1" -a "${USE_SRTP_GET_VERSION}" != "no"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir=""</span><br><span style="color: hsl(120, 100%, 40%);">+ # if --with-SRTP_GET_VERSION=DIR has been specified, use it.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${SRTP_GET_VERSION_DIR}" != "x"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ if test -d ${SRTP_GET_VERSION_DIR}/lib; then</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir="-L${SRTP_GET_VERSION_DIR}/lib"</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+ pbxlibdir="-L${SRTP_GET_VERSION_DIR}"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS="${CFLAGS} "</span><br><span style="color: hsl(120, 100%, 40%);">+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_get_version_string in -lsrtp" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo_n "checking for srtp_get_version_string in -lsrtp... " >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+if ${ac_cv_lib_srtp_srtp_get_version_string+:} false; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ $as_echo_n "(cached) " >&6</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_check_lib_save_LIBS=$LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+LIBS="-lsrtp ${pbxlibdir} $LIBS"</span><br><span style="color: hsl(120, 100%, 40%);">+cat confdefs.h - <<_ACEOF >conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+/* end confdefs.h. */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Override any GCC internal prototype to avoid an error.</span><br><span style="color: hsl(120, 100%, 40%);">+ Use char because int might match the return type of a GCC</span><br><span style="color: hsl(120, 100%, 40%);">+ builtin and then its argument prototype would still apply. */</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef __cplusplus</span><br><span style="color: hsl(120, 100%, 40%);">+extern "C"</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+char srtp_get_version_string ();</span><br><span style="color: hsl(120, 100%, 40%);">+int</span><br><span style="color: hsl(120, 100%, 40%);">+main ()</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+return srtp_get_version_string ();</span><br><span style="color: hsl(120, 100%, 40%);">+ ;</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+if ac_fn_c_try_link "$LINENO"; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_cv_lib_srtp_srtp_get_version_string=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_cv_lib_srtp_srtp_get_version_string=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+rm -f core conftest.err conftest.$ac_objext \</span><br><span style="color: hsl(120, 100%, 40%);">+ conftest$ac_exeext conftest.$ac_ext</span><br><span style="color: hsl(120, 100%, 40%);">+LIBS=$ac_check_lib_save_LIBS</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_get_version_string" >&5</span><br><span style="color: hsl(120, 100%, 40%);">+$as_echo "$ac_cv_lib_srtp_srtp_get_version_string" >&6; }</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_lib_srtp_srtp_get_version_string" = xyes; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_SRTP_GET_VERSION_FOUND=yes</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_SRTP_GET_VERSION_FOUND=no</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # now check for the header.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "${AST_SRTP_GET_VERSION_FOUND}" = "yes"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_LIB="${pbxlibdir} -lsrtp "</span><br><span style="color: hsl(120, 100%, 40%);">+ # if --with-SRTP_GET_VERSION=DIR has been specified, use it.</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${SRTP_GET_VERSION_DIR}" != "x"; then</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_INCLUDE="-I${SRTP_GET_VERSION_DIR}/include"</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_INCLUDE="${SRTP_GET_VERSION_INCLUDE} "</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ # check for the header</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+ CPPFLAGS="${CPPFLAGS} ${SRTP_GET_VERSION_INCLUDE}"</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_fn_c_check_header_mongrel "$LINENO" "srtp/srtp.h" "ac_cv_header_srtp_srtp_h" "$ac_includes_default"</span><br><span style="color: hsl(120, 100%, 40%);">+if test "x$ac_cv_header_srtp_srtp_h" = xyes; then :</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_HEADER_FOUND=1</span><br><span style="color: hsl(120, 100%, 40%);">+else</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_HEADER_FOUND=0</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if test "x${SRTP_GET_VERSION_HEADER_FOUND}" = "x0" ; then</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_LIB=""</span><br><span style="color: hsl(120, 100%, 40%);">+ SRTP_GET_VERSION_INCLUDE=""</span><br><span style="color: hsl(120, 100%, 40%);">+ else</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ PBX_SRTP_GET_VERSION=1</span><br><span style="color: hsl(120, 100%, 40%);">+ cat >>confdefs.h <<_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+#define HAVE_SRTP_GET_VERSION 1</span><br><span style="color: hsl(120, 100%, 40%);">+_ACEOF</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+ fi</span><br><span style="color: hsl(120, 100%, 40%);">+fi</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> fi</span><br><span> fi</span><br><span> </span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index 431b3da..2fd8eac 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -584,6 +584,7 @@</span><br><span> AST_EXT_LIB_SETUP_OPTIONAL([SRTP_192], [SRTP Library AES-192 (ICM)], [SRTP], [srtp])</span><br><span> AST_EXT_LIB_SETUP_OPTIONAL([SRTP_GCM], [SRTP Library AES-128 (GCM) and AES-256 (GCM)], [SRTP], [srtp])</span><br><span> AST_EXT_LIB_SETUP_OPTIONAL([SRTP_SHUTDOWN], [SRTP Library Shutdown Function], [SRTP], [srtp])</span><br><span style="color: hsl(120, 100%, 40%);">+AST_EXT_LIB_SETUP_OPTIONAL([SRTP_GET_VERSION], [SRTP Library Version Function], [SRTP], [srtp])</span><br><span> AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer], [ssl])</span><br><span> AST_EXT_LIB_SETUP_OPTIONAL([RT], [Realtime functions], [rt])</span><br><span> AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])</span><br><span>@@ -2573,6 +2574,7 @@</span><br><span> AST_EXT_LIB_CHECK([SRTP_192], [srtp2], [srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80])</span><br><span> AST_EXT_LIB_CHECK([SRTP_GCM], [srtp2], [srtp_crypto_policy_set_aes_gcm_128_8_auth])</span><br><span> AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp2], [srtp_shutdown], [srtp2/srtp.h])</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_EXT_LIB_CHECK([SRTP_GET_VERSION], [srtp2], [srtp_get_version_string], [srtp2/srtp.h])</span><br><span> </span><br><span> # libsrtp2 removed support for PRNG, so we require OpenSSL</span><br><span> if test "x$PBX_OPENSSL" != x1;</span><br><span>@@ -2607,6 +2609,7 @@</span><br><span> AST_EXT_LIB_CHECK([SRTP_192], [srtp], [crypto_policy_set_aes_cm_192_hmac_sha1_80])</span><br><span> AST_EXT_LIB_CHECK([SRTP_GCM], [srtp], [crypto_policy_set_aes_gcm_128_8_auth])</span><br><span> AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h])</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_EXT_LIB_CHECK([SRTP_GET_VERSION], [srtp], [srtp_get_version_string], [srtp/srtp.h])</span><br><span> fi</span><br><span> fi</span><br><span> </span><br><span>diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in</span><br><span>index 193dbef..5d22ae1 100644</span><br><span>--- a/include/asterisk/autoconfig.h.in</span><br><span>+++ b/include/asterisk/autoconfig.h.in</span><br><span>@@ -905,6 +905,9 @@</span><br><span> feature. */</span><br><span> #undef HAVE_SRTP_GCM</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* Define to 1 if SRTP has the SRTP Library Version Function feature. */</span><br><span style="color: hsl(120, 100%, 40%);">+#undef HAVE_SRTP_GET_VERSION</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Define to 1 if SRTP has the SRTP Library Shutdown Function feature. */</span><br><span> #undef HAVE_SRTP_SHUTDOWN</span><br><span> </span><br><span>diff --git a/menuselect/configure b/menuselect/configure</span><br><span>index 8efb637..fd7d24b 100755</span><br><span>--- a/menuselect/configure</span><br><span>+++ b/menuselect/configure</span><br><span>@@ -692,6 +692,7 @@</span><br><span> docdir</span><br><span> oldincludedir</span><br><span> includedir</span><br><span style="color: hsl(120, 100%, 40%);">+runstatedir</span><br><span> localstatedir</span><br><span> sharedstatedir</span><br><span> sysconfdir</span><br><span>@@ -772,6 +773,7 @@</span><br><span> sysconfdir='${prefix}/etc'</span><br><span> sharedstatedir='${prefix}/com'</span><br><span> localstatedir='${prefix}/var'</span><br><span style="color: hsl(120, 100%, 40%);">+runstatedir='${localstatedir}/run'</span><br><span> includedir='${prefix}/include'</span><br><span> oldincludedir='/usr/include'</span><br><span> docdir='${datarootdir}/doc/${PACKAGE}'</span><br><span>@@ -1024,6 +1026,15 @@</span><br><span> | -silent | --silent | --silen | --sile | --sil)</span><br><span> silent=yes ;;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ -runstatedir | --runstatedir | --runstatedi | --runstated \</span><br><span style="color: hsl(120, 100%, 40%);">+ | --runstate | --runstat | --runsta | --runst | --runs \</span><br><span style="color: hsl(120, 100%, 40%);">+ | --run | --ru | --r)</span><br><span style="color: hsl(120, 100%, 40%);">+ ac_prev=runstatedir ;;</span><br><span style="color: hsl(120, 100%, 40%);">+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \</span><br><span style="color: hsl(120, 100%, 40%);">+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \</span><br><span style="color: hsl(120, 100%, 40%);">+ | --run=* | --ru=* | --r=*)</span><br><span style="color: hsl(120, 100%, 40%);">+ runstatedir=$ac_optarg ;;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)</span><br><span> ac_prev=sbindir ;;</span><br><span> -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \</span><br><span>@@ -1161,7 +1172,7 @@</span><br><span> for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \</span><br><span> datadir sysconfdir sharedstatedir localstatedir includedir \</span><br><span> oldincludedir docdir infodir htmldir dvidir pdfdir psdir \</span><br><span style="color: hsl(0, 100%, 40%);">- libdir localedir mandir</span><br><span style="color: hsl(120, 100%, 40%);">+ libdir localedir mandir runstatedir</span><br><span> do</span><br><span> eval ac_val=\$$ac_var</span><br><span> # Remove trailing slashes.</span><br><span>@@ -1314,6 +1325,7 @@</span><br><span> --sysconfdir=DIR read-only single-machine data [PREFIX/etc]</span><br><span> --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]</span><br><span> --localstatedir=DIR modifiable single-machine data [PREFIX/var]</span><br><span style="color: hsl(120, 100%, 40%);">+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]</span><br><span> --libdir=DIR object code libraries [EPREFIX/lib]</span><br><span> --includedir=DIR C header files [PREFIX/include]</span><br><span> --oldincludedir=DIR C header files for non-gcc [/usr/include]</span><br><span>diff --git a/res/res_srtp.c b/res/res_srtp.c</span><br><span>index ad3ea2e..bebcbe6 100644</span><br><span>--- a/res/res_srtp.c</span><br><span>+++ b/res/res_srtp.c</span><br><span>@@ -1212,7 +1212,11 @@</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef HAVE_SRTP_GET_VERSION</span><br><span> ast_verb(2, "%s initialized\n", srtp_get_version_string());</span><br><span style="color: hsl(120, 100%, 40%);">+#else</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_verb(2, "libsrtp initialized\n");</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span> </span><br><span> g_initialized = 1;</span><br><span> return 0;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10166">change 10166</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10166"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Id2a916ff9448706090e72ff2c7fb3f5ba24a05df </div>
<div style="display:none"> Gerrit-Change-Number: 10166 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>