Skip to content
Snippets Groups Projects
configure 940 KiB
Newer Older
  • Learn to ignore specific revisions
  • 
    $as_echo "#define HAVE_SPANDSP 1" >>confdefs.h
    
    
    
    else
             { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
    $as_echo "no" >&6; }
    
    fi
    rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    	CPPFLAGS="${saved_cppflags}"
        fi
    
    
    if test "x${PBX_SPANDSP}" = "x1" ; then
    	# We found the correct version in the header, now let's make sure it links
    	# properly, and that libtiff is available
    	PBX_SPANDSP=0
    
    if test "x${PBX_SPANDSP}" != "x1" -a "${USE_SPANDSP}" != "no"; then
    
       # if --with-SPANDSP=DIR has been specified, use it.
       if test "x${SPANDSP_DIR}" != "x"; then
          if test -d ${SPANDSP_DIR}/lib; then
             pbxlibdir="-L${SPANDSP_DIR}/lib"
    
             pbxlibdir="-L${SPANDSP_DIR}"
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for span_set_message_handler in -lspandsp" >&5
    $as_echo_n "checking for span_set_message_handler in -lspandsp... " >&6; }
    if ${ac_cv_lib_spandsp_span_set_message_handler+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    else
      ac_check_lib_save_LIBS=$LIBS
    
    LIBS="-lspandsp ${pbxlibdir} -ltiff $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 span_set_message_handler ();
    
    return span_set_message_handler ();
    
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_spandsp_span_set_message_handler=yes
    
      ac_cv_lib_spandsp_span_set_message_handler=no
    
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_spandsp_span_set_message_handler" >&5
    $as_echo "$ac_cv_lib_spandsp_span_set_message_handler" >&6; }
    if test "x$ac_cv_lib_spandsp_span_set_message_handler" = xyes; then :
      AST_SPANDSP_FOUND=yes
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
       # now check for the header.
    
       if test "${AST_SPANDSP_FOUND}" = "yes"; then
          SPANDSP_LIB="${pbxlibdir} -lspandsp -ltiff"
          # if --with-SPANDSP=DIR has been specified, use it.
          if test "x${SPANDSP_DIR}" != "x"; then
             SPANDSP_INCLUDE="-I${SPANDSP_DIR}/include"
    
          SPANDSP_INCLUDE="${SPANDSP_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${SPANDSP_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "spandsp.h" "ac_cv_header_spandsp_h" "$ac_includes_default"
    if test "x$ac_cv_header_spandsp_h" = xyes; then :
      SPANDSP_HEADER_FOUND=1
    
      SPANDSP_HEADER_FOUND=0
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${SPANDSP_HEADER_FOUND}" = "x0" ; then
             SPANDSP_LIB=""
             SPANDSP_INCLUDE=""
    
             cat >>confdefs.h <<_ACEOF
    
    #define HAVE_SPANDSP 1
    
    if test "x${PBX_SPANDSP}" = "x1" ; then
    	# We also need t38_terminal_init()
    	PBX_SPANDSP=0
    
    if test "x${PBX_SPANDSP}" != "x1" -a "${USE_SPANDSP}" != "no"; then
    
       # if --with-SPANDSP=DIR has been specified, use it.
       if test "x${SPANDSP_DIR}" != "x"; then
          if test -d ${SPANDSP_DIR}/lib; then
             pbxlibdir="-L${SPANDSP_DIR}/lib"
    
             pbxlibdir="-L${SPANDSP_DIR}"
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t38_terminal_init in -lspandsp" >&5
    $as_echo_n "checking for t38_terminal_init in -lspandsp... " >&6; }
    if ${ac_cv_lib_spandsp_t38_terminal_init+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    
    LIBS="-lspandsp ${pbxlibdir} -ltiff $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 t38_terminal_init ();
    
    return t38_terminal_init ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_spandsp_t38_terminal_init=yes
    
      ac_cv_lib_spandsp_t38_terminal_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_spandsp_t38_terminal_init" >&5
    $as_echo "$ac_cv_lib_spandsp_t38_terminal_init" >&6; }
    if test "x$ac_cv_lib_spandsp_t38_terminal_init" = xyes; then :
      AST_SPANDSP_FOUND=yes
    
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
       if test "${AST_SPANDSP_FOUND}" = "yes"; then
          SPANDSP_LIB="${pbxlibdir} -lspandsp -ltiff"
          # if --with-SPANDSP=DIR has been specified, use it.
          if test "x${SPANDSP_DIR}" != "x"; then
             SPANDSP_INCLUDE="-I${SPANDSP_DIR}/include"
    
          SPANDSP_INCLUDE="${SPANDSP_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${SPANDSP_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "spandsp.h" "ac_cv_header_spandsp_h" "$ac_includes_default"
    if test "x$ac_cv_header_spandsp_h" = xyes; then :
      SPANDSP_HEADER_FOUND=1
    
      SPANDSP_HEADER_FOUND=0
    
    fi
    
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${SPANDSP_HEADER_FOUND}" = "x0" ; then
             SPANDSP_LIB=""
             SPANDSP_INCLUDE=""
    
             cat >>confdefs.h <<_ACEOF
    
    #define HAVE_SPANDSP 1
    
    # Check for libss7 v2.0 branch compatible version.
    
    if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
    
       # if --with-SS7=DIR has been specified, use it.
       if test "x${SS7_DIR}" != "x"; then
          if test -d ${SS7_DIR}/lib; then
             pbxlibdir="-L${SS7_DIR}/lib"
    
             pbxlibdir="-L${SS7_DIR}"
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
    
          CFLAGS="${CFLAGS} "
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ss7_set_isup_timer in -lss7" >&5
    $as_echo_n "checking for ss7_set_isup_timer in -lss7... " >&6; }
    if ${ac_cv_lib_ss7_ss7_set_isup_timer+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    
    LIBS="-lss7 ${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 ss7_set_isup_timer ();
    
    return ss7_set_isup_timer ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_ss7_ss7_set_isup_timer=yes
    
      ac_cv_lib_ss7_ss7_set_isup_timer=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_ss7_ss7_set_isup_timer" >&5
    $as_echo "$ac_cv_lib_ss7_ss7_set_isup_timer" >&6; }
    if test "x$ac_cv_lib_ss7_ss7_set_isup_timer" = xyes; then :
      AST_SS7_FOUND=yes
    
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
    
       if test "${AST_SS7_FOUND}" = "yes"; then
          SS7_LIB="${pbxlibdir} -lss7 "
          # if --with-SS7=DIR has been specified, use it.
          if test "x${SS7_DIR}" != "x"; then
             SS7_INCLUDE="-I${SS7_DIR}/include"
    
          SS7_INCLUDE="${SS7_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${SS7_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "libss7.h" "ac_cv_header_libss7_h" "$ac_includes_default"
    if test "x$ac_cv_header_libss7_h" = xyes; then :
      SS7_HEADER_FOUND=1
    
    fi
    
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${SS7_HEADER_FOUND}" = "x0" ; then
             SS7_LIB=""
             SS7_INCLUDE=""
    
             cat >>confdefs.h <<_ACEOF
    
    if test "x${PBX_OPENR2}" != "x1" -a "${USE_OPENR2}" != "no"; then
    
       # if --with-OPENR2=DIR has been specified, use it.
       if test "x${OPENR2_DIR}" != "x"; then
          if test -d ${OPENR2_DIR}/lib; then
             pbxlibdir="-L${OPENR2_DIR}/lib"
    
             pbxlibdir="-L${OPENR2_DIR}"
    
          fi
       fi
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openr2_chan_new in -lopenr2" >&5
    $as_echo_n "checking for openr2_chan_new in -lopenr2... " >&6; }
    if ${ac_cv_lib_openr2_openr2_chan_new+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    
    LIBS="-lopenr2 ${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 openr2_chan_new ();
    
    return openr2_chan_new ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_openr2_openr2_chan_new=yes
    
      ac_cv_lib_openr2_openr2_chan_new=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_openr2_openr2_chan_new" >&5
    $as_echo "$ac_cv_lib_openr2_openr2_chan_new" >&6; }
    if test "x$ac_cv_lib_openr2_openr2_chan_new" = xyes; then :
      AST_OPENR2_FOUND=yes
    
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
    
       if test "${AST_OPENR2_FOUND}" = "yes"; then
          OPENR2_LIB="${pbxlibdir} -lopenr2 "
          # if --with-OPENR2=DIR has been specified, use it.
          if test "x${OPENR2_DIR}" != "x"; then
             OPENR2_INCLUDE="-I${OPENR2_DIR}/include"
    
          OPENR2_INCLUDE="${OPENR2_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${OPENR2_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "openr2.h" "ac_cv_header_openr2_h" "$ac_includes_default"
    if test "x$ac_cv_header_openr2_h" = xyes; then :
      OPENR2_HEADER_FOUND=1
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${OPENR2_HEADER_FOUND}" = "x0" ; then
             OPENR2_LIB=""
             OPENR2_INCLUDE=""
    
             cat >>confdefs.h <<_ACEOF
    
    if test "x${PBX_OPUS}" != "x1" -a "${USE_OPUS}" != "no"; then
    
       # if --with-OPUS=DIR has been specified, use it.
       if test "x${OPUS_DIR}" != "x"; then
          if test -d ${OPUS_DIR}/lib; then
             pbxlibdir="-L${OPUS_DIR}/lib"
    
             pbxlibdir="-L${OPUS_DIR}"
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opus_encoder_create in -lopus" >&5
    $as_echo_n "checking for opus_encoder_create in -lopus... " >&6; }
    if ${ac_cv_lib_opus_opus_encoder_create+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    LIBS="-lopus ${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 opus_encoder_create ();
    
    return opus_encoder_create ();
    
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_opus_opus_encoder_create=yes
    
      ac_cv_lib_opus_opus_encoder_create=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_opus_opus_encoder_create" >&5
    $as_echo "$ac_cv_lib_opus_opus_encoder_create" >&6; }
    if test "x$ac_cv_lib_opus_opus_encoder_create" = xyes; then :
      AST_OPUS_FOUND=yes
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
    
       if test "${AST_OPUS_FOUND}" = "yes"; then
          OPUS_LIB="${pbxlibdir} -lopus "
          # if --with-OPUS=DIR has been specified, use it.
          if test "x${OPUS_DIR}" != "x"; then
             OPUS_INCLUDE="-I${OPUS_DIR}/include"
    
          OPUS_INCLUDE="${OPUS_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${OPUS_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "opus/opus.h" "ac_cv_header_opus_opus_h" "$ac_includes_default"
    if test "x$ac_cv_header_opus_opus_h" = xyes; then :
      OPUS_HEADER_FOUND=1
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${OPUS_HEADER_FOUND}" = "x0" ; then
             OPUS_LIB=""
             OPUS_INCLUDE=""
    
             cat >>confdefs.h <<_ACEOF
    
    # opusfile.h includes <opus_multistream.h> so we need to make sure that
    # either $OPUS_INCLUDE or /usr/include/opus is added to the search path.
    __opus_include=${OPUS_INCLUDE}
    if test -z "$__opus_include" -o x"$__opus_include" = x" " ; then
    	__opus_include=-I/usr/include/opus
    
    if test "x${PBX_OPUSFILE}" != "x1" -a "${USE_OPUSFILE}" != "no"; then
    
       # if --with-OPUSFILE=DIR has been specified, use it.
       if test "x${OPUSFILE_DIR}" != "x"; then
          if test -d ${OPUSFILE_DIR}/lib; then
             pbxlibdir="-L${OPUSFILE_DIR}/lib"
    
             pbxlibdir="-L${OPUSFILE_DIR}"
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
    
          CFLAGS="${CFLAGS} $__opus_include"
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for op_open_callbacks in -lopusfile" >&5
    $as_echo_n "checking for op_open_callbacks in -lopusfile... " >&6; }
    if ${ac_cv_lib_opusfile_op_open_callbacks+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    
    LIBS="-lopusfile ${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 op_open_callbacks ();
    
    return op_open_callbacks ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_opusfile_op_open_callbacks=yes
    
      ac_cv_lib_opusfile_op_open_callbacks=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_opusfile_op_open_callbacks" >&5
    $as_echo "$ac_cv_lib_opusfile_op_open_callbacks" >&6; }
    if test "x$ac_cv_lib_opusfile_op_open_callbacks" = xyes; then :
      AST_OPUSFILE_FOUND=yes
    
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
       if test "${AST_OPUSFILE_FOUND}" = "yes"; then
          OPUSFILE_LIB="${pbxlibdir} -lopusfile "
          # if --with-OPUSFILE=DIR has been specified, use it.
          if test "x${OPUSFILE_DIR}" != "x"; then
             OPUSFILE_INCLUDE="-I${OPUSFILE_DIR}/include"
    
          OPUSFILE_INCLUDE="${OPUSFILE_INCLUDE} $__opus_include"
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${OPUSFILE_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "opus/opusfile.h" "ac_cv_header_opus_opusfile_h" "$ac_includes_default"
    if test "x$ac_cv_header_opus_opusfile_h" = xyes; then :
      OPUSFILE_HEADER_FOUND=1
    
      OPUSFILE_HEADER_FOUND=0
    
    fi
    
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${OPUSFILE_HEADER_FOUND}" = "x0" ; then
             OPUSFILE_LIB=""
             OPUSFILE_INCLUDE=""
    
    #define HAVE_OPUSFILE 1
    
    for ver in ${LUA_VERSIONS:-5.4 5.3 5.2 5.1}; do
    
    if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then
    
    Kevin P. Fleming's avatar
    Kevin P. Fleming committed
       pbxlibdir=""
    
       # if --with-LUA=DIR has been specified, use it.
       if test "x${LUA_DIR}" != "x"; then
          if test -d ${LUA_DIR}/lib; then
             pbxlibdir="-L${LUA_DIR}/lib"
    
    Kevin P. Fleming's avatar
    Kevin P. Fleming committed
          else
    
             pbxlibdir="-L${LUA_DIR}"
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          as_ac_Lib=`$as_echo "ac_cv_lib_lua${ver}''_luaL_newstate" | $as_tr_sh`
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaL_newstate in -llua${ver}" >&5
    $as_echo_n "checking for luaL_newstate in -llua${ver}... " >&6; }
    if eval \${$as_ac_Lib+:} false; then :
    
      $as_echo_n "(cached) " >&6
    
    Kevin P. Fleming's avatar
    Kevin P. Fleming committed
    else
      ac_check_lib_save_LIBS=$LIBS
    
    LIBS="-llua${ver} ${pbxlibdir} -lm $LIBS"
    
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    
    Kevin P. Fleming's avatar
    Kevin P. Fleming committed
    
    /* 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 luaL_newstate ();
    
    return luaL_newstate ();
    
    if ac_fn_c_try_link "$LINENO"; then :
    
    rm -f core conftest.err conftest.$ac_objext \
        conftest$ac_exeext conftest.$ac_ext
    
    LIBS=$ac_check_lib_save_LIBS
    fi
    
    eval ac_res=\$$as_ac_Lib
    	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
    $as_echo "$ac_res" >&6; }
    if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
      AST_LUA_FOUND=yes
    
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
       if test "${AST_LUA_FOUND}" = "yes"; then
          LUA_LIB="${pbxlibdir} -llua${ver} -lm"
          # if --with-LUA=DIR has been specified, use it.
          if test "x${LUA_DIR}" != "x"; then
             LUA_INCLUDE="-I${LUA_DIR}/include"
    
          LUA_INCLUDE="${LUA_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${LUA_INCLUDE}"
             as_ac_Header=`$as_echo "ac_cv_header_lua${ver}/lua.h" | $as_tr_sh`
    ac_fn_c_check_header_mongrel "$LINENO" "lua${ver}/lua.h" "$as_ac_Header" "$ac_includes_default"
    if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
      LUA_HEADER_FOUND=1
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${LUA_HEADER_FOUND}" = "x0" ; then
             LUA_LIB=""
             LUA_INCLUDE=""
    
             cat >>confdefs.h <<_ACEOF
    
    	if test "x${PBX_LUA}" = "x1" ; then
    		if test x"${LUA_DIR}" = x; then
    			LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua${ver}"
    		else
    			LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua${ver}"
    		fi
    		break;
    	fi
    done
    
    # Some distributions (like openSUSE and NetBSD) remove the 5.x suffix.
    if test "x${LUA_VERSIONS}" = "x"; then
    
    if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then
    
       # if --with-LUA=DIR has been specified, use it.
       if test "x${LUA_DIR}" != "x"; then
          if test -d ${LUA_DIR}/lib; then
             pbxlibdir="-L${LUA_DIR}/lib"
    
             pbxlibdir="-L${LUA_DIR}"
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaL_newstate in -llua" >&5
    $as_echo_n "checking for luaL_newstate in -llua... " >&6; }
    if ${ac_cv_lib_lua_luaL_newstate+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    
    LIBS="-llua ${pbxlibdir} -lm $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 luaL_newstate ();
    
    return luaL_newstate ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_lua_luaL_newstate=yes
    
      ac_cv_lib_lua_luaL_newstate=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_lua_luaL_newstate" >&5
    $as_echo "$ac_cv_lib_lua_luaL_newstate" >&6; }
    if test "x$ac_cv_lib_lua_luaL_newstate" = xyes; then :
      AST_LUA_FOUND=yes
    
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
    
       if test "${AST_LUA_FOUND}" = "yes"; then
          LUA_LIB="${pbxlibdir} -llua -lm"
          # if --with-LUA=DIR has been specified, use it.
          if test "x${LUA_DIR}" != "x"; then
             LUA_INCLUDE="-I${LUA_DIR}/include"
    
          LUA_INCLUDE="${LUA_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${LUA_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "lua.h" "ac_cv_header_lua_h" "$ac_includes_default"
    if test "x$ac_cv_header_lua_h" = xyes; then :
      LUA_HEADER_FOUND=1
    
    fi
    
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${LUA_HEADER_FOUND}" = "x0" ; then
             LUA_LIB=""
             LUA_INCLUDE=""
    
             cat >>confdefs.h <<_ACEOF
    
    # Accept either RADIUS client library, their APIs are fully compatible,
    # just different header filenames and different SONAMEs
    
    if test "x${PBX_RADIUS}" != "x1" -a "${USE_RADIUS}" != "no"; then
    
       pbxlibdir=""
    
       # if --with-RADIUS=DIR has been specified, use it.
       if test "x${RADIUS_DIR}" != "x"; then
          if test -d ${RADIUS_DIR}/lib; then
             pbxlibdir="-L${RADIUS_DIR}/lib"
    
             pbxlibdir="-L${RADIUS_DIR}"
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lfreeradius-client" >&5
    $as_echo_n "checking for rc_read_config in -lfreeradius-client... " >&6; }
    if ${ac_cv_lib_freeradius_client_rc_read_config+:} false; then :
    
      $as_echo_n "(cached) " >&6
    else
      ac_check_lib_save_LIBS=$LIBS
    
    LIBS="-lfreeradius-client ${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 rc_read_config ();
    
    return rc_read_config ();
    
      ;
      return 0;
    }
    _ACEOF
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_freeradius_client_rc_read_config=yes
    
      ac_cv_lib_freeradius_client_rc_read_config=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_freeradius_client_rc_read_config" >&5
    $as_echo "$ac_cv_lib_freeradius_client_rc_read_config" >&6; }
    if test "x$ac_cv_lib_freeradius_client_rc_read_config" = xyes; then :
      AST_RADIUS_FOUND=yes
    
    fi
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
    
       if test "${AST_RADIUS_FOUND}" = "yes"; then
          RADIUS_LIB="${pbxlibdir} -lfreeradius-client "
          # if --with-RADIUS=DIR has been specified, use it.
          if test "x${RADIUS_DIR}" != "x"; then
             RADIUS_INCLUDE="-I${RADIUS_DIR}/include"
    
          RADIUS_INCLUDE="${RADIUS_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${RADIUS_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "freeradius-client.h" "ac_cv_header_freeradius_client_h" "$ac_includes_default"
    if test "x$ac_cv_header_freeradius_client_h" = xyes; then :
      RADIUS_HEADER_FOUND=1
    
    fi
    
    
             CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
    
          if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then
             RADIUS_LIB=""
             RADIUS_INCLUDE=""
    
             cat >>confdefs.h <<_ACEOF
    
    if test "x${PBX_RADIUS}" = "x1"; then
    
    $as_echo "#define RADIUS_HEADER_STR <freeradius-client.h>" >>confdefs.h
    
    else
    
    if test "x${PBX_RADIUS}" != "x1" -a "${USE_RADIUS}" != "no"; then
    
       # if --with-RADIUS=DIR has been specified, use it.
       if test "x${RADIUS_DIR}" != "x"; then
          if test -d ${RADIUS_DIR}/lib; then
             pbxlibdir="-L${RADIUS_DIR}/lib"
    
             pbxlibdir="-L${RADIUS_DIR}"
    
          ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
          CFLAGS="${CFLAGS} "
    
          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rc_read_config in -lradiusclient-ng" >&5
    $as_echo_n "checking for rc_read_config in -lradiusclient-ng... " >&6; }
    if ${ac_cv_lib_radiusclient_ng_rc_read_config+:} false; then :
    
    LIBS="-lradiusclient-ng ${pbxlibdir}  $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 rc_read_config ();
    
    return rc_read_config ();
    
    if ac_fn_c_try_link "$LINENO"; then :
    
      ac_cv_lib_radiusclient_ng_rc_read_config=yes
    
      ac_cv_lib_radiusclient_ng_rc_read_config=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_radiusclient_ng_rc_read_config" >&5
    $as_echo "$ac_cv_lib_radiusclient_ng_rc_read_config" >&6; }
    if test "x$ac_cv_lib_radiusclient_ng_rc_read_config" = xyes; then :
      AST_RADIUS_FOUND=yes
    
          CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    
    
       # now check for the header.
    
       if test "${AST_RADIUS_FOUND}" = "yes"; then
          RADIUS_LIB="${pbxlibdir} -lradiusclient-ng "
          # if --with-RADIUS=DIR has been specified, use it.
          if test "x${RADIUS_DIR}" != "x"; then
             RADIUS_INCLUDE="-I${RADIUS_DIR}/include"
    
          RADIUS_INCLUDE="${RADIUS_INCLUDE} "
    
             ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
    
             CPPFLAGS="${CPPFLAGS} ${RADIUS_INCLUDE}"
             ac_fn_c_check_header_mongrel "$LINENO" "radiusclient-ng.h" "ac_cv_header_radiusclient_ng_h" "$ac_includes_default"
    if test "x$ac_cv_header_radiusclient_ng_h" = xyes; then :
      RADIUS_HEADER_FOUND=1