Skip to content
Snippets Groups Projects
configure 940 KiB
Newer Older
  • Learn to ignore specific revisions
  • 		else
    			osptk_cflags=""
    			osptk_ldflags=""
    		fi
    
    		# check for the header
    		osptk_saved_cppflags="${CPPFLAGS}"
    		CPPFLAGS="${CPPFLAGS} ${osptk_cflags}"
    
    		ac_fn_c_check_header_mongrel "$LINENO" "osp/osp.h" "ac_cv_header_osp_osp_h" "$ac_includes_default"
    
    David M. Lee's avatar
    David M. Lee committed
    if test "x$ac_cv_header_osp_osp_h" = xyes; then :
    
    		CPPFLAGS="${osptk_saved_cppflags}"
    
    		# check for the library
    		if test "${osptk_header_found}" = "yes"; then
    			osptk_extralibs="-lssl -lcrypto"
    
    
    			{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSPPInit in -losptk" >&5
    
    $as_echo_n "checking for OSPPInit in -losptk... " >&6; }
    
    David M. Lee's avatar
    David M. Lee committed
    if ${ac_cv_lib_osptk_OSPPInit+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    else
      ac_check_lib_save_LIBS=$LIBS
    LIBS="-losptk ${osptk_ldflags} ${osptk_extralibs} $LIBS"
    
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    char OSPPInit ();
    int
    main ()
    
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_osptk_OSPPInit=yes
    else
    
      ac_cv_lib_osptk_OSPPInit=no
    
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
    LIBS=$ac_check_lib_save_LIBS
    fi
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osptk_OSPPInit" >&5
    
    $as_echo "$ac_cv_lib_osptk_OSPPInit" >&6; }
    
    David M. Lee's avatar
    David M. Lee committed
    if test "x$ac_cv_lib_osptk_OSPPInit" = xyes; then :
    
      osptk_library_found=yes
    else
      osptk_library_found=no
    fi
    
    
    			# check OSP Toolkit version
    			if test "${osptk_library_found}" = "yes"; then
    
    				{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if OSP Toolkit version is compatible with app_osplookup" >&5
    
    $as_echo_n "checking if OSP Toolkit version is compatible with app_osplookup... " >&6; }
    
    
    				osptk_saved_cppflags="${CPPFLAGS}"
    				CPPFLAGS="${CPPFLAGS} ${osptk_cflags}"
    
    				if test "$cross_compiling" = yes; then :
      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
    
    $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
    
    David M. Lee's avatar
    David M. Lee committed
    as_fn_error $? "cannot run test program while cross compiling
    See \`config.log' for more details" "$LINENO" 5; }
    
      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    
    						#include <osp/osp.h>
    						int main(void) {
    							int ver = OSP_CLIENT_TOOLKIT_VERSION_MAJOR * 10000 + OSP_CLIENT_TOOLKIT_VERSION_MINOR * 100 + OSP_CLIENT_TOOLKIT_VERSION_BUGFIX;
    
    							int req = 4 * 10000 + 0 * 100 + 0;
    
    							return (ver < req) ? 1 : 0;
    						}
    
    _ACEOF
    
    if ac_fn_c_try_run "$LINENO"; then :
    
      osptk_compatible=no
    
    rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
      conftest.$ac_objext conftest.beam conftest.$ac_ext
    
    fi
    
    				CPPFLAGS="${osptk_saved_cppflags}"
    
    				if test "${osptk_compatible}" = "yes"; then
    
    					{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    
    $as_echo "yes" >&6; }
    
    					PBX_OSPTK=1
    					OSPTK_INCLUDE="${osptk_cflags}"
    					OSPTK_LIB="${osptk_ldflags} -losptk ${osptk_extralibs}"
    
    cat >>confdefs.h <<_ACEOF
    #define HAVE_OSPTK 1
    _ACEOF
    
    				else
    
    					{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    
    $as_echo "no" >&6; }
    
    if test "x${PBX_SRTP}" != "x1" -a "${USE_SRTP}" != "no"; then
       pbxlibdir=""
       # if --with-SRTP=DIR has been specified, use it.
       if test "x${SRTP_DIR}" != "x"; then
          if test -d ${SRTP_DIR}/lib; then
             pbxlibdir="-L${SRTP_DIR}/lib"
          else
             pbxlibdir="-L${SRTP_DIR}"
          fi
       fi
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_init in -lsrtp2" >&5
    $as_echo_n "checking for srtp_init in -lsrtp2... " >&6; }
    if ${ac_cv_lib_srtp2_srtp_init+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    LIBS="-lsrtp2 ${pbxlibdir}  $LIBS"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    
    return srtp_init ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_srtp2_srtp_init=yes
    
      ac_cv_lib_srtp2_srtp_init=no
    
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    LIBS=$ac_check_lib_save_LIBS
    fi
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_init" >&5
    $as_echo "$ac_cv_lib_srtp2_srtp_init" >&6; }
    if test "x$ac_cv_lib_srtp2_srtp_init" = xyes; then :
    
      AST_SRTP_FOUND=yes
    else
      AST_SRTP_FOUND=no
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
       if test "${AST_SRTP_FOUND}" = "yes"; then
          SRTP_LIB="${pbxlibdir} -lsrtp2 "
          # if --with-SRTP=DIR has been specified, use it.
          if test "x${SRTP_DIR}" != "x"; then
             SRTP_INCLUDE="-I${SRTP_DIR}/include"
          fi
          SRTP_INCLUDE="${SRTP_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
             CPPFLAGS="${CPPFLAGS} ${SRTP_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default"
    if test "x$ac_cv_header_srtp2_srtp_h" = xyes; then :
      SRTP_HEADER_FOUND=1
    else
      SRTP_HEADER_FOUND=0
    fi
    
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${SRTP_HEADER_FOUND}" = "x0" ; then
             SRTP_LIB=""
             SRTP_INCLUDE=""
          else
    
             PBX_SRTP=1
             cat >>confdefs.h <<_ACEOF
    #define HAVE_SRTP 1
    _ACEOF
    
             cat >>confdefs.h <<_ACEOF
    #define HAVE_SRTP_VERSION 2
    _ACEOF
    
          fi
       fi
    fi
    
    
    
    if test "x${PBX_SRTP}" = "x1"; then
       ast_ext_lib_check_shared_saved_libs="${LIBS}"
       ast_ext_lib_check_shared_saved_ldflags="${LDFLAGS}"
       ast_ext_lib_check_shared_saved_cflags="${CFLAGS}"
       LIBS="${LIBS} ${SRTP_LIB} "
       LDFLAGS="${LDFLAGS} -shared -fPIC"
       CFLAGS="${CFLAGS} ${SRTP_INCLUDE} "
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ability of -lsrtp2 to be linked in a shared object" >&5
    $as_echo_n "checking for the ability of -lsrtp2 to be linked in a shared object... " >&6; }
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    
           #include <srtp2/srtp.h>
    int
    main ()
    {
    srtp_init();
    
      ;
      return 0;
    }
    
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    $as_echo "yes" >&6; }
    
    
    else
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    $as_echo "no" >&6; }
    
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5
    $as_echo "$as_me: WARNING: ***" >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** libsrtp2 could not be linked as a shared object." >&5
    $as_echo "$as_me: WARNING: *** libsrtp2 could not be linked as a shared object." >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Try compiling libsrtp2 manually. Configure libsrtp2" >&5
    $as_echo "$as_me: WARNING: *** Try compiling libsrtp2 manually. Configure libsrtp2" >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** with ./configure --prefix=/usr replacing /usr with" >&5
    $as_echo "$as_me: WARNING: *** with ./configure --prefix=/usr replacing /usr with" >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** the prefix of your choice, and then make with" >&5
    $as_echo "$as_me: WARNING: *** the prefix of your choice, and then make with" >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** 'make libsrtp2.so'" >&5
    $as_echo "$as_me: WARNING: *** 'make libsrtp2.so'" >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5
    $as_echo "$as_me: WARNING: ***" >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** After re-installing libsrtp2, re-run the Asterisk" >&5
    $as_echo "$as_me: WARNING: *** After re-installing libsrtp2, re-run the Asterisk" >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** configure script." >&5
    $as_echo "$as_me: WARNING: *** configure script." >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5
    $as_echo "$as_me: WARNING: ***" >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** If you do not need SRTP support re-run configure" >&5
    $as_echo "$as_me: WARNING: *** If you do not need SRTP support re-run configure" >&2;}
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** with the --without-srtp option." >&5
    $as_echo "$as_me: WARNING: *** with the --without-srtp option." >&2;}
        exit 1
    
    
    
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
       CFLAGS="${ast_ext_lib_check_shared_saved_cflags}"
       LDFLAGS="${ast_ext_lib_check_shared_saved_ldflags}"
       LIBS="${ast_ext_lib_check_shared_saved_libs}"
    fi
    
    
    if test "x$PBX_SRTP" = x1;
    then
    
    if test "x${PBX_SRTP_256}" != "x1" -a "${USE_SRTP_256}" != "no"; then
       pbxlibdir=""
       # if --with-SRTP_256=DIR has been specified, use it.
       if test "x${SRTP_256_DIR}" != "x"; then
          if test -d ${SRTP_256_DIR}/lib; then
             pbxlibdir="-L${SRTP_256_DIR}/lib"
          else
             pbxlibdir="-L${SRTP_256_DIR}"
          fi
       fi
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2" >&5
    $as_echo_n "checking for srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp2... " >&6; }
    if ${ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    LIBS="-lsrtp2 ${pbxlibdir}  $LIBS"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    
    char srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 ();
    
    return srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80 ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80=yes
    
      ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80=no
    
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    LIBS=$ac_check_lib_save_LIBS
    fi
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&5
    $as_echo "$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&6; }
    if test "x$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" = xyes; then :
    
      AST_SRTP_256_FOUND=yes
    else
      AST_SRTP_256_FOUND=no
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
       if test "${AST_SRTP_256_FOUND}" = "yes"; then
          SRTP_256_LIB="${pbxlibdir} -lsrtp2 "
          # if --with-SRTP_256=DIR has been specified, use it.
          if test "x${SRTP_256_DIR}" != "x"; then
             SRTP_256_INCLUDE="-I${SRTP_256_DIR}/include"
          fi
          SRTP_256_INCLUDE="${SRTP_256_INCLUDE} "
    
    
             # no header, assume found
             SRTP_256_HEADER_FOUND="1"
    
    
          if test "x${SRTP_256_HEADER_FOUND}" = "x0" ; then
             SRTP_256_LIB=""
             SRTP_256_INCLUDE=""
          else
    
             PBX_SRTP_256=1
             cat >>confdefs.h <<_ACEOF
    #define HAVE_SRTP_256 1
    _ACEOF
    
          fi
       fi
    
    fi
    
    
    
    if test "x${PBX_SRTP_192}" != "x1" -a "${USE_SRTP_192}" != "no"; then
       pbxlibdir=""
       # if --with-SRTP_192=DIR has been specified, use it.
       if test "x${SRTP_192_DIR}" != "x"; then
          if test -d ${SRTP_192_DIR}/lib; then
             pbxlibdir="-L${SRTP_192_DIR}/lib"
          else
             pbxlibdir="-L${SRTP_192_DIR}"
          fi
       fi
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2" >&5
    $as_echo_n "checking for srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 in -lsrtp2... " >&6; }
    if ${ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    LIBS="-lsrtp2 ${pbxlibdir}  $LIBS"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    
    char srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 ();
    
    return srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80 ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80=yes
    
      ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80=no
    
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    LIBS=$ac_check_lib_save_LIBS
    fi
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&5
    $as_echo "$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" >&6; }
    if test "x$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80" = xyes; then :
    
      AST_SRTP_192_FOUND=yes
    else
      AST_SRTP_192_FOUND=no
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
       if test "${AST_SRTP_192_FOUND}" = "yes"; then
          SRTP_192_LIB="${pbxlibdir} -lsrtp2 "
          # if --with-SRTP_192=DIR has been specified, use it.
          if test "x${SRTP_192_DIR}" != "x"; then
             SRTP_192_INCLUDE="-I${SRTP_192_DIR}/include"
          fi
          SRTP_192_INCLUDE="${SRTP_192_INCLUDE} "
    
    
             # no header, assume found
             SRTP_192_HEADER_FOUND="1"
    
    
          if test "x${SRTP_192_HEADER_FOUND}" = "x0" ; then
             SRTP_192_LIB=""
             SRTP_192_INCLUDE=""
          else
    
             PBX_SRTP_192=1
             cat >>confdefs.h <<_ACEOF
    #define HAVE_SRTP_192 1
    _ACEOF
    
          fi
       fi
    
    fi
    
    
    
    if test "x${PBX_SRTP_GCM}" != "x1" -a "${USE_SRTP_GCM}" != "no"; then
       pbxlibdir=""
       # if --with-SRTP_GCM=DIR has been specified, use it.
       if test "x${SRTP_GCM_DIR}" != "x"; then
          if test -d ${SRTP_GCM_DIR}/lib; then
             pbxlibdir="-L${SRTP_GCM_DIR}/lib"
          else
             pbxlibdir="-L${SRTP_GCM_DIR}"
          fi
       fi
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2" >&5
    $as_echo_n "checking for srtp_crypto_policy_set_aes_gcm_128_8_auth in -lsrtp2... " >&6; }
    if ${ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    LIBS="-lsrtp2 ${pbxlibdir}  $LIBS"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    
    char srtp_crypto_policy_set_aes_gcm_128_8_auth ();
    
    return srtp_crypto_policy_set_aes_gcm_128_8_auth ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth=yes
    
      ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth=no
    
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    LIBS=$ac_check_lib_save_LIBS
    fi
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&5
    $as_echo "$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth" >&6; }
    if test "x$ac_cv_lib_srtp2_srtp_crypto_policy_set_aes_gcm_128_8_auth" = xyes; then :
    
      AST_SRTP_GCM_FOUND=yes
    else
      AST_SRTP_GCM_FOUND=no
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
       if test "${AST_SRTP_GCM_FOUND}" = "yes"; then
          SRTP_GCM_LIB="${pbxlibdir} -lsrtp2 "
          # if --with-SRTP_GCM=DIR has been specified, use it.
          if test "x${SRTP_GCM_DIR}" != "x"; then
             SRTP_GCM_INCLUDE="-I${SRTP_GCM_DIR}/include"
          fi
          SRTP_GCM_INCLUDE="${SRTP_GCM_INCLUDE} "
    
    
             # no header, assume found
             SRTP_GCM_HEADER_FOUND="1"
    
    
          if test "x${SRTP_GCM_HEADER_FOUND}" = "x0" ; then
             SRTP_GCM_LIB=""
             SRTP_GCM_INCLUDE=""
          else
    
             PBX_SRTP_GCM=1
             cat >>confdefs.h <<_ACEOF
    #define HAVE_SRTP_GCM 1
    _ACEOF
    
          fi
       fi
    fi
    
    
    
    if test "x${PBX_SRTP_SHUTDOWN}" != "x1" -a "${USE_SRTP_SHUTDOWN}" != "no"; then
       pbxlibdir=""
       # if --with-SRTP_SHUTDOWN=DIR has been specified, use it.
       if test "x${SRTP_SHUTDOWN_DIR}" != "x"; then
          if test -d ${SRTP_SHUTDOWN_DIR}/lib; then
             pbxlibdir="-L${SRTP_SHUTDOWN_DIR}/lib"
          else
             pbxlibdir="-L${SRTP_SHUTDOWN_DIR}"
          fi
       fi
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_shutdown in -lsrtp2" >&5
    $as_echo_n "checking for srtp_shutdown in -lsrtp2... " >&6; }
    if ${ac_cv_lib_srtp2_srtp_shutdown+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    LIBS="-lsrtp2 ${pbxlibdir}  $LIBS"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    
    char srtp_shutdown ();
    
    return srtp_shutdown ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_srtp2_srtp_shutdown=yes
    
      ac_cv_lib_srtp2_srtp_shutdown=no
    
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    LIBS=$ac_check_lib_save_LIBS
    fi
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_shutdown" >&5
    $as_echo "$ac_cv_lib_srtp2_srtp_shutdown" >&6; }
    if test "x$ac_cv_lib_srtp2_srtp_shutdown" = xyes; then :
    
      AST_SRTP_SHUTDOWN_FOUND=yes
    else
      AST_SRTP_SHUTDOWN_FOUND=no
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
       if test "${AST_SRTP_SHUTDOWN_FOUND}" = "yes"; then
          SRTP_SHUTDOWN_LIB="${pbxlibdir} -lsrtp2 "
          # if --with-SRTP_SHUTDOWN=DIR has been specified, use it.
          if test "x${SRTP_SHUTDOWN_DIR}" != "x"; then
             SRTP_SHUTDOWN_INCLUDE="-I${SRTP_SHUTDOWN_DIR}/include"
          fi
          SRTP_SHUTDOWN_INCLUDE="${SRTP_SHUTDOWN_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
             CPPFLAGS="${CPPFLAGS} ${SRTP_SHUTDOWN_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default"
    if test "x$ac_cv_header_srtp2_srtp_h" = xyes; then :
      SRTP_SHUTDOWN_HEADER_FOUND=1
    else
      SRTP_SHUTDOWN_HEADER_FOUND=0
    fi
    
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${SRTP_SHUTDOWN_HEADER_FOUND}" = "x0" ; then
             SRTP_SHUTDOWN_LIB=""
             SRTP_SHUTDOWN_INCLUDE=""
          else
    
             PBX_SRTP_SHUTDOWN=1
             cat >>confdefs.h <<_ACEOF
    #define HAVE_SRTP_SHUTDOWN 1
    _ACEOF
    
          fi
       fi
    fi
    
    
    
    
    if test "x${PBX_SRTP_GET_VERSION}" != "x1" -a "${USE_SRTP_GET_VERSION}" != "no"; then
       pbxlibdir=""
       # if --with-SRTP_GET_VERSION=DIR has been specified, use it.
       if test "x${SRTP_GET_VERSION_DIR}" != "x"; then
          if test -d ${SRTP_GET_VERSION_DIR}/lib; then
             pbxlibdir="-L${SRTP_GET_VERSION_DIR}/lib"
          else
             pbxlibdir="-L${SRTP_GET_VERSION_DIR}"
          fi
       fi
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_get_version_string in -lsrtp2" >&5
    $as_echo_n "checking for srtp_get_version_string in -lsrtp2... " >&6; }
    if ${ac_cv_lib_srtp2_srtp_get_version_string+:} false; then :
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    LIBS="-lsrtp2 ${pbxlibdir}  $LIBS"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    char srtp_get_version_string ();
    int
    main ()
    {
    return srtp_get_version_string ();
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
      ac_cv_lib_srtp2_srtp_get_version_string=yes
    else
      ac_cv_lib_srtp2_srtp_get_version_string=no
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    LIBS=$ac_check_lib_save_LIBS
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp2_srtp_get_version_string" >&5
    $as_echo "$ac_cv_lib_srtp2_srtp_get_version_string" >&6; }
    if test "x$ac_cv_lib_srtp2_srtp_get_version_string" = xyes; then :
      AST_SRTP_GET_VERSION_FOUND=yes
    else
      AST_SRTP_GET_VERSION_FOUND=no
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
       if test "${AST_SRTP_GET_VERSION_FOUND}" = "yes"; then
          SRTP_GET_VERSION_LIB="${pbxlibdir} -lsrtp2 "
          # if --with-SRTP_GET_VERSION=DIR has been specified, use it.
          if test "x${SRTP_GET_VERSION_DIR}" != "x"; then
             SRTP_GET_VERSION_INCLUDE="-I${SRTP_GET_VERSION_DIR}/include"
          fi
          SRTP_GET_VERSION_INCLUDE="${SRTP_GET_VERSION_INCLUDE} "
    
             # check for the header
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
             CPPFLAGS="${CPPFLAGS} ${SRTP_GET_VERSION_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "srtp2/srtp.h" "ac_cv_header_srtp2_srtp_h" "$ac_includes_default"
    if test "x$ac_cv_header_srtp2_srtp_h" = xyes; then :
      SRTP_GET_VERSION_HEADER_FOUND=1
    else
      SRTP_GET_VERSION_HEADER_FOUND=0
    fi
    
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${SRTP_GET_VERSION_HEADER_FOUND}" = "x0" ; then
             SRTP_GET_VERSION_LIB=""
             SRTP_GET_VERSION_INCLUDE=""
          else
    
             PBX_SRTP_GET_VERSION=1
             cat >>confdefs.h <<_ACEOF
    #define HAVE_SRTP_GET_VERSION 1
    _ACEOF
    
          fi
       fi
    fi
    
    
    
    
        # libsrtp2 removed support for PRNG, so we require OpenSSL
        if test "x$PBX_OPENSSL" != x1;
        then
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5
    $as_echo "$as_me: WARNING: ***" >&2;}
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead." >&5
    $as_echo "$as_me: WARNING: *** OpenSSL required when using libsrtp2, checking for libsrtp instead." >&2;}
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5
    $as_echo "$as_me: WARNING: ***" >&2;}
    	PBX_SRTP=0
        fi
    fi
    
    if test "x$PBX_SRTP" != x1;
    then
    
    
    if test "x${PBX_SRTP}" != "x1" -a "${USE_SRTP}" != "no"; then
       pbxlibdir=""
       # if --with-SRTP=DIR has been specified, use it.
       if test "x${SRTP_DIR}" != "x"; then
          if test -d ${SRTP_DIR}/lib; then
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for srtp_init in -lsrtp" >&5
    $as_echo_n "checking for srtp_init in -lsrtp... " >&6; }
    if ${ac_cv_lib_srtp_srtp_init+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    else
      ac_check_lib_save_LIBS=$LIBS
    LIBS="-lsrtp ${pbxlibdir}  $LIBS"
    
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    
    /* end confdefs.h.  */
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    
    return srtp_init ();
    
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_srtp_srtp_init=yes
    
      ac_cv_lib_srtp_srtp_init=no
    
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
    LIBS=$ac_check_lib_save_LIBS
    fi
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_srtp_init" >&5
    $as_echo "$ac_cv_lib_srtp_srtp_init" >&6; }
    if test "x$ac_cv_lib_srtp_srtp_init" = xyes; then :
    
      AST_SRTP_FOUND=yes
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
       if test "${AST_SRTP_FOUND}" = "yes"; then
          SRTP_LIB="${pbxlibdir} -lsrtp "
          # if --with-SRTP=DIR has been specified, use it.
          if test "x${SRTP_DIR}" != "x"; then
             SRTP_INCLUDE="-I${SRTP_DIR}/include"
          fi
          SRTP_INCLUDE="${SRTP_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
             CPPFLAGS="${CPPFLAGS} ${SRTP_INCLUDE}"
    
             ac_fn_c_check_header_mongrel "$LINENO" "srtp/srtp.h" "ac_cv_header_srtp_srtp_h" "$ac_includes_default"
    
    David M. Lee's avatar
    David M. Lee committed
    if test "x$ac_cv_header_srtp_srtp_h" = xyes; then :
    
      SRTP_HEADER_FOUND=1
    else
      SRTP_HEADER_FOUND=0
    fi
    
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${SRTP_HEADER_FOUND}" = "x0" ; then
             SRTP_LIB=""
             SRTP_INCLUDE=""
          else
    
             PBX_SRTP=1
             cat >>confdefs.h <<_ACEOF
    #define HAVE_SRTP 1
    
    _ACEOF
    
             cat >>confdefs.h <<_ACEOF
    #define HAVE_SRTP_VERSION 1
    
    if test "x${PBX_SRTP}" = "x1"; then
       ast_ext_lib_check_shared_saved_libs="${LIBS}"
       ast_ext_lib_check_shared_saved_ldflags="${LDFLAGS}"
       ast_ext_lib_check_shared_saved_cflags="${CFLAGS}"
       LIBS="${LIBS} ${SRTP_LIB} "
       LDFLAGS="${LDFLAGS} -shared -fPIC"
       CFLAGS="${CFLAGS} ${SRTP_INCLUDE} "
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the ability of -lsrtp to be linked in a shared object" >&5
    
    $as_echo_n "checking for the ability of -lsrtp to be linked in a shared object... " >&6; }
    
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    
           #include <srtp/srtp.h>
    
    if ac_fn_c_try_link "$LINENO"; then :
    
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
    
    $as_echo "yes" >&6; }
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    
    $as_echo "no" >&6; }
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5
    
    $as_echo "$as_me: WARNING: ***" >&2;}
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** libsrtp could not be linked as a shared object." >&5
    
    $as_echo "$as_me: WARNING: *** libsrtp could not be linked as a shared object." >&2;}
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Try compiling libsrtp manually. Configure libsrtp" >&5
    
    $as_echo "$as_me: WARNING: *** Try compiling libsrtp manually. Configure libsrtp" >&2;}
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** with ./configure CFLAGS=-fPIC --prefix=/usr" >&5
    
    $as_echo "$as_me: WARNING: *** with ./configure CFLAGS=-fPIC --prefix=/usr" >&2;}
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** replacing /usr with the prefix of your choice." >&5
    
    $as_echo "$as_me: WARNING: *** replacing /usr with the prefix of your choice." >&2;}
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** After re-installing libsrtp, re-run the Asterisk" >&5
    $as_echo "$as_me: WARNING: *** After re-installing libsrtp, re-run the Asterisk" >&2;}
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** configure script." >&5
    
    $as_echo "$as_me: WARNING: *** configure script." >&2;}
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ***" >&5
    
    $as_echo "$as_me: WARNING: ***" >&2;}
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** If you do not need SRTP support re-run configure" >&5
    
    $as_echo "$as_me: WARNING: *** If you do not need SRTP support re-run configure" >&2;}
    
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** with the --without-srtp option." >&5
    
    $as_echo "$as_me: WARNING: *** with the --without-srtp option." >&2;}
    
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
       CFLAGS="${ast_ext_lib_check_shared_saved_cflags}"
       LDFLAGS="${ast_ext_lib_check_shared_saved_ldflags}"
       LIBS="${ast_ext_lib_check_shared_saved_libs}"
    
    
        if test "x$PBX_SRTP" = x1;
        then
    
    
    if test "x${PBX_SRTP_256}" != "x1" -a "${USE_SRTP_256}" != "no"; then
       pbxlibdir=""
       # if --with-SRTP_256=DIR has been specified, use it.
       if test "x${SRTP_256_DIR}" != "x"; then
          if test -d ${SRTP_256_DIR}/lib; then
             pbxlibdir="-L${SRTP_256_DIR}/lib"
          else
             pbxlibdir="-L${SRTP_256_DIR}"
          fi
       fi
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp" >&5
    $as_echo_n "checking for crypto_policy_set_aes_cm_256_hmac_sha1_80 in -lsrtp... " >&6; }
    if ${ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    LIBS="-lsrtp ${pbxlibdir}  $LIBS"
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    /* end confdefs.h.  */
    
    /* Override any GCC internal prototype to avoid an error.
       Use char because int might match the return type of a GCC
       builtin and then its argument prototype would still apply.  */
    #ifdef __cplusplus
    extern "C"
    #endif
    
    char crypto_policy_set_aes_cm_256_hmac_sha1_80 ();
    
    return crypto_policy_set_aes_cm_256_hmac_sha1_80 ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80=yes
    
      ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80=no
    
    fi
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    LIBS=$ac_check_lib_save_LIBS
    fi
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&5
    $as_echo "$ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" >&6; }
    if test "x$ac_cv_lib_srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80" = xyes; then :
    
      AST_SRTP_256_FOUND=yes
    else
      AST_SRTP_256_FOUND=no
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
       if test "${AST_SRTP_256_FOUND}" = "yes"; then
          SRTP_256_LIB="${pbxlibdir} -lsrtp "
          # if --with-SRTP_256=DIR has been specified, use it.
          if test "x${SRTP_256_DIR}" != "x"; then
             SRTP_256_INCLUDE="-I${SRTP_256_DIR}/include"
          fi
          SRTP_256_INCLUDE="${SRTP_256_INCLUDE} "