install_prereq: Download latest Jansson.
[asterisk/asterisk.git] / configure
index fab78d0..867643e 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,4 @@
 #! /bin/sh
-# From configure.ac Revision.
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for asterisk trunk.
 #
@@ -639,6 +638,11 @@ PBX_SYSLOG_FACILITY_LOG_DAEMON
 PBX_SYSLOG_FACILITY_LOG_CRON
 PBX_SYSLOG_FACILITY_LOG_AUTHPRIV
 PBX_SYSLOG_FACILITY_LOG_AUTH
+SYSTEMD_LIBS
+SYSTEMD_CFLAGS
+SYSTEMD_INCLUDE
+SYSTEMD_LIB
+PBX_SYSTEMD
 PBX_GENERIC_ODBC
 GENERIC_ODBC_INCLUDE
 GENERIC_ODBC_LIB
@@ -692,15 +696,15 @@ PBX_IP_MTU_DISCOVER
 PBX_RTLD_NOLOAD
 PBX_GLOB_BRACE
 PBX_GLOB_NOMAGIC
+BIND8_CFLAGS
 AST_RPATH
 AST_NATIVE_ARCH
 AST_SHADOW_WARNINGS
+AST_NO_FORMAT_TRUNCATION
 AST_NO_STRICT_OVERFLOW
 AST_FORTIFY_SOURCE
 AST_TRAMPOLINES
 AST_DECLARATION_AFTER_STATEMENT
-GC_LDFLAGS
-GC_CFLAGS
 AST_UNDEFINED_SANITIZER
 AST_LEAK_SANITIZER
 AST_THREAD_SANITIZER
@@ -713,6 +717,7 @@ PBX_DYNAMIC_LIST
 POW_LIB
 PBX_WORKING_FORK
 LIBOBJS
+DISABLE_XMLDOC
 CONFIG_LIBXML2
 UUID_LIB
 UUID_INCLUDE
@@ -778,6 +783,18 @@ PBX_SRTP_SHUTDOWN
 SRTP_SHUTDOWN_DIR
 SRTP_SHUTDOWN_INCLUDE
 SRTP_SHUTDOWN_LIB
+PBX_SRTP_GCM
+SRTP_GCM_DIR
+SRTP_GCM_INCLUDE
+SRTP_GCM_LIB
+PBX_SRTP_192
+SRTP_192_DIR
+SRTP_192_INCLUDE
+SRTP_192_LIB
+PBX_SRTP_256
+SRTP_256_DIR
+SRTP_256_INCLUDE
+SRTP_256_LIB
 PBX_SRTP
 SRTP_DIR
 SRTP_INCLUDE
@@ -810,7 +827,6 @@ PBX_SPANDSP
 SPANDSP_DIR
 SPANDSP_INCLUDE
 SPANDSP_LIB
-SOUNDS_CACHE_DIR
 PBX_SDL_IMAGE
 SDL_IMAGE_DIR
 SDL_IMAGE_INCLUDE
@@ -819,10 +835,18 @@ PBX_SDL
 SDL_DIR
 SDL_INCLUDE
 SDL_LIB
+PBX_SNDFILE
+SNDFILE_DIR
+SNDFILE_INCLUDE
+SNDFILE_LIB
 PBX_RESAMPLE
 RESAMPLE_DIR
 RESAMPLE_INCLUDE
 RESAMPLE_LIB
+PBX_FFTW3
+FFTW3_DIR
+FFTW3_INCLUDE
+FFTW3_LIB
 PBX_RADIUS
 RADIUS_DIR
 RADIUS_INCLUDE
@@ -923,6 +947,18 @@ PBX_POPT
 POPT_DIR
 POPT_INCLUDE
 POPT_LIB
+PBX_PJSIP_TSX_LAYER_FIND_TSX2
+PJSIP_TSX_LAYER_FIND_TSX2_DIR
+PJSIP_TSX_LAYER_FIND_TSX2_INCLUDE
+PJSIP_TSX_LAYER_FIND_TSX2_LIB
+PBX_PJSIP_AUTH_CLT_DEINIT
+PJSIP_AUTH_CLT_DEINIT_DIR
+PJSIP_AUTH_CLT_DEINIT_INCLUDE
+PJSIP_AUTH_CLT_DEINIT_LIB
+PBX_PJSIP_INV_SESSION_REF
+PJSIP_INV_SESSION_REF_DIR
+PJSIP_INV_SESSION_REF_INCLUDE
+PJSIP_INV_SESSION_REF_LIB
 PBX_PJSIP_EVSUB_GRP_LOCK
 PJSIP_EVSUB_GRP_LOCK_DIR
 PJSIP_EVSUB_GRP_LOCK_INCLUDE
@@ -955,11 +991,10 @@ PBX_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK
 PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_DIR
 PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE
 PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_LIB
-PJPROJECT_BUNDLED
-PBX_PJPROJECT
-PJPROJECT_DIR
-PJPROJECT_INCLUDE
-PJPROJECT_LIB
+PBX_BEANSTALK
+BEANSTALK_DIR
+BEANSTALK_INCLUDE
+BEANSTALK_LIB
 PBX_PGSQL
 PGSQL_DIR
 PGSQL_INCLUDE
@@ -972,6 +1007,10 @@ PBX_OSPTK
 OSPTK_DIR
 OSPTK_INCLUDE
 OSPTK_LIB
+PBX_OPUSFILE
+OPUSFILE_DIR
+OPUSFILE_INCLUDE
+OPUSFILE_LIB
 PBX_OPUS
 OPUS_DIR
 OPUS_INCLUDE
@@ -1036,6 +1075,10 @@ PBX_LIBXML2
 LIBXML2_DIR
 LIBXML2_INCLUDE
 LIBXML2_LIB
+PBX_LIBEDIT_IS_UNICODE
+LIBEDIT_IS_UNICODE_DIR
+LIBEDIT_IS_UNICODE_INCLUDE
+LIBEDIT_IS_UNICODE_LIB
 PBX_LIBEDIT
 LIBEDIT_DIR
 LIBEDIT_INCLUDE
@@ -1152,6 +1195,10 @@ PBX_COROSYNC
 COROSYNC_DIR
 COROSYNC_INCLUDE
 COROSYNC_LIB
+PBX_CODEC2
+CODEC2_DIR
+CODEC2_INCLUDE
+CODEC2_LIB
 PBX_CAP
 CAP_DIR
 CAP_INCLUDE
@@ -1172,11 +1219,20 @@ PBX_ALSA
 ALSA_DIR
 ALSA_INCLUDE
 ALSA_LIB
+PJPROJECT_INCLUDE
+PJPROJECT_LIB
+PBX_PJPROJECT
+PJPROJECT_DIR
+PJPROJECT_BUNDLED
+PJPROJECT_CONFIGURE_OPTS
 AST_C_COMPILER_FAMILY
 AST_CLANG_BLOCKS
 AST_CLANG_BLOCKS_LIBS
 AST_NESTED_FUNCTIONS
 AST_CODE_COVERAGE
+EXTERNALS_CACHE_DIR
+SOUNDS_CACHE_DIR
+AST_DOWNLOAD_CACHE
 AST_DEVMODE_STRICT
 AST_DEVMODE
 NOISY_BUILD
@@ -1186,15 +1242,24 @@ PTHREAD_CC
 ax_pthread_config
 MD5
 SOXMIX
+PBX_BASH
+PBX_XMLSTARLET
 PBX_FLEX
 PBX_BISON
 OPENSSL
 SHA1SUM
 LDCONFIG
+DOWNLOAD_TIMEOUT
+DOWNLOAD_TO_STDOUT
 DOWNLOAD
 FETCH
+NM
+PATCH
+TAR
+BZIP2
 ALEMBIC
 GIT
+BASH
 XMLSTARLET
 XMLLINT
 KPATHSEA
@@ -1211,6 +1276,8 @@ COMPRESS
 FIND
 PYTHON
 FLEX
+CUT
+CAT
 CMP
 BISON
 GNU_LD
@@ -1320,12 +1387,17 @@ ac_user_opts='
 enable_option_checking
 with_gnu_ld
 enable_dev_mode
+with_download_cache
+with_sounds_cache
+with_externals_cache
 enable_coverage
+with_pjproject_bundled
 with_asound
 with_bfd
 with_execinfo
 with_bluetooth
 with_cap
+with_codec2
 with_cpg
 with_curses
 with_crypt
@@ -1367,20 +1439,22 @@ with_newt
 with_ogg
 with_openr2
 with_opus
+with_opusfile
 with_osptk
 with_oss
 with_postgres
+with_beanstalk
 with_pjproject
-with_pjproject_bundled
 with_popt
 with_portaudio
 with_pri
 with_pwlib
 with_radius
+with_fftw3
 with_resample
+with_sndfile
 with_sdl
 with_SDL_image
-with_sounds_cache
 with_spandsp
 with_ss7
 with_speex
@@ -1420,6 +1494,7 @@ CXX
 CXXFLAGS
 CCC
 CXXCPP
+PJPROJECT_CONFIGURE_OPTS
 PKG_CONFIG
 PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
@@ -1434,7 +1509,9 @@ PYTHONDEV_LIBS
 GMIME_CFLAGS
 GMIME_LIBS
 GTK2_CFLAGS
-GTK2_LIBS'
+GTK2_LIBS
+SYSTEMD_CFLAGS
+SYSTEMD_LIBS'
 
 
 # Initialize some variables set by options.
@@ -2060,11 +2137,21 @@ Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-download-cache=PATH
+                          use cached sound AND external module tarfiles in
+                          PATH
+  --with-sounds-cache=PATH
+                          use cached sound tarfiles in PATH
+  --with-externals-cache=PATH
+                          use cached external module tarfiles in PATH
+  --with-pjproject-bundled
+                          Use bundled pjproject libraries (default)
   --with-asound=PATH      use Advanced Linux Sound Architecture files in PATH
   --with-bfd=PATH         use Debug symbol decoding files in PATH
   --with-execinfo=PATH    use Stack Backtrace files in PATH
   --with-bluetooth=PATH   use Bluetooth files in PATH
   --with-cap=PATH         use POSIX 1.e capabilities files in PATH
+  --with-codec2=PATH      use Codec 2 Audio Decoder/Encoder files in PATH
   --with-cpg=PATH         use Corosync files in PATH
   --with-curses=PATH      use curses files in PATH
   --with-crypt=PATH       use password and data encryption files in PATH
@@ -2110,22 +2197,22 @@ Optional Packages:
   --with-ogg=PATH         use OGG files in PATH
   --with-openr2=PATH      use MFR2 files in PATH
   --with-opus=PATH        use Opus files in PATH
+  --with-opusfile=PATH    use Opusfile files in PATH
   --with-osptk=PATH       use OSP Toolkit files in PATH
   --with-oss=PATH         use Open Sound System files in PATH
   --with-postgres=PATH    use PostgreSQL files in PATH
+  --with-beanstalk=PATH   use Beanstalk Job Queue files in PATH
   --with-pjproject=PATH   use PJPROJECT files in PATH
-  --with-pjproject-bundled
-                          Use bundled pjproject libraries
   --with-popt=PATH        use popt files in PATH
   --with-portaudio=PATH   use PortAudio files in PATH
   --with-pri=PATH         use ISDN PRI files in PATH
   --with-pwlib=PATH       use PWlib files in PATH
   --with-radius=PATH      use Radius Client files in PATH
+  --with-fftw3=PATH       use LIBFFTW3 files in PATH
   --with-resample=PATH    use LIBRESAMPLE files in PATH
+  --with-sndfile=PATH     use libsndfile files in PATH
   --with-sdl=PATH         use Sdl files in PATH
   --with-SDL_image=PATH   use Sdl Image files in PATH
-  --with-sounds-cache=PATH
-                          use cached sound tarfiles in PATH
   --with-spandsp=PATH     use SPANDSP files in PATH
   --with-ss7=PATH         use ISDN SS7 files in PATH
   --with-speex=PATH       use Speex files in PATH
@@ -2160,6 +2247,8 @@ Some influential environment variables:
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CXXCPP      C++ preprocessor
+  PJPROJECT_CONFIGURE_OPTS
+              Additional configure options to pass to bundled pjproject
   PKG_CONFIG  path to pkg-config utility
   PKG_CONFIG_PATH
               directories to add to pkg-config's search path
@@ -2184,6 +2273,10 @@ Some influential environment variables:
   GMIME_LIBS  linker flags for GMIME, overriding pkg-config
   GTK2_CFLAGS C compiler flags for GTK2, overriding pkg-config
   GTK2_LIBS   linker flags for GTK2, overriding pkg-config
+  SYSTEMD_CFLAGS
+              C compiler flags for SYSTEMD, overriding pkg-config
+  SYSTEMD_LIBS
+              linker flags for SYSTEMD, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -3617,37 +3710,6 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 # check existence of the package
 
 
-ac_aux_dir=
-for ac_dir in `pwd` "$srcdir"/`pwd`; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \`pwd\` \"$srcdir\"/\`pwd\`" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
-
-
-
-
 
 
 # preserve any CFLAGS or LDFLAGS that may be set
@@ -4864,7 +4926,7 @@ case "${host_os}" in
      OSARCH=cygwin
      PBX_WINARCH=1
      ;;
-     linux-gnueabi* |  linux-gnuspe)
+     linux-gnu*)
      OSARCH=linux-gnu
      ;;
      linux-musl*)
@@ -6733,6 +6795,88 @@ $as_echo "no" >&6; }
 fi
 
 
+# Extract the first word of "cat", so it can be a program name with args.
+set dummy cat; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CAT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CAT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CAT="$CAT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_CAT" && ac_cv_path_CAT=":"
+  ;;
+esac
+fi
+CAT=$ac_cv_path_CAT
+if test -n "$CAT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5
+$as_echo "$CAT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "cut", so it can be a program name with args.
+set dummy cut; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CUT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CUT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CUT="$CUT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_CUT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_CUT" && ac_cv_path_CUT=":"
+  ;;
+esac
+fi
+CUT=$ac_cv_path_CUT
+if test -n "$CUT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5
+$as_echo "$CUT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "flex", so it can be a program name with args.
 set dummy flex; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7430,8 +7574,10 @@ $as_echo "no" >&6; }
 fi
 
 
-# Extract the first word of "xmlstarlet", so it can be a program name with args.
-set dummy xmlstarlet; ac_word=$2
+for ac_prog in xmlstarlet xml
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if ${ac_cv_path_XMLSTARLET+:} false; then :
@@ -7457,7 +7603,6 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_XMLSTARLET" && ac_cv_path_XMLSTARLET=":"
   ;;
 esac
 fi
@@ -7471,6 +7616,51 @@ $as_echo "no" >&6; }
 fi
 
 
+  test -n "$XMLSTARLET" && break
+done
+test -n "$XMLSTARLET" || XMLSTARLET=":"
+
+# Extract the first word of "bash", so it can be a program name with args.
+set dummy bash; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_BASH+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $BASH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_BASH="$BASH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_BASH" && ac_cv_path_BASH=":"
+  ;;
+esac
+fi
+BASH=$ac_cv_path_BASH
+if test -n "$BASH"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5
+$as_echo "$BASH" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "git", so it can be a program name with args.
 set dummy git; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7553,10 +7743,220 @@ $as_echo "no" >&6; }
 fi
 
 
+# Extract the first word of "bzip2", so it can be a program name with args.
+set dummy bzip2; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_BZIP2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $BZIP2 in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_BZIP2="$BZIP2" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_BZIP2" && ac_cv_path_BZIP2=":"
+  ;;
+esac
+fi
+BZIP2=$ac_cv_path_BZIP2
+if test -n "$BZIP2"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BZIP2" >&5
+$as_echo "$BZIP2" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "tar", so it can be a program name with args.
+set dummy tar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_TAR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $TAR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_TAR" && ac_cv_path_TAR=":"
+  ;;
+esac
+fi
+TAR=$ac_cv_path_TAR
+if test -n "$TAR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
+$as_echo "$TAR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "patch", so it can be a program name with args.
+set dummy patch; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PATCH+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PATCH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PATCH="$PATCH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PATCH" && ac_cv_path_PATCH=":"
+  ;;
+esac
+fi
+PATCH=$ac_cv_path_PATCH
+if test -n "$PATCH"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5
+$as_echo "$PATCH" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "sed", so it can be a program name with args.
+set dummy sed; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $SED in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SED="$SED" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_SED" && ac_cv_path_SED=":"
+  ;;
+esac
+fi
+SED=$ac_cv_path_SED
+if test -n "$SED"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5
+$as_echo "$SED" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "nm", so it can be a program name with args.
+set dummy nm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $NM in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NM="$NM" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_NM" && ac_cv_path_NM=":"
+  ;;
+esac
+fi
+NM=$ac_cv_path_NM
+if test -n "$NM"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5
+$as_echo "$NM" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
 if test "${WGET}" != ":" ; then
   DOWNLOAD=${WGET}
+  DOWNLOAD_TO_STDOUT="${WGET} -q -O-"
+  DOWNLOAD_TIMEOUT='--timeout=$1'
 else if test "${CURL}" != ":" ; then
   DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
+  DOWNLOAD_TO_STDOUT="${CURL} -Ls"
+  DOWNLOAD_TIMEOUT='--max-time $(or $2,$1)'
 else
   # Extract the first word of "fetch", so it can be a program name with args.
 set dummy fetch; ac_word=$2
@@ -7600,9 +8000,15 @@ fi
 
 
   DOWNLOAD=${FETCH}
+  DOWNLOAD_TO_STDOUT="${FETCH} -o-"
+  DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
 fi
 fi
 
+
+
+
+
 # Extract the first word of "ldconfig", so it can be a program name with args.
 set dummy ldconfig; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7778,6 +8184,20 @@ else
 fi
 
 
+if test "x${XMLSTARLET}" = "x:" ; then
+       PBX_XMLSTARLET=0
+else
+       PBX_XMLSTARLET=1
+fi
+
+
+if test "x${BASH}" = "x:" ; then
+       PBX_BASH=0
+else
+       PBX_BASH=1
+fi
+
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}soxmix", so it can be a program name with args.
 set dummy ${ac_tool_prefix}soxmix; ac_word=$2
@@ -8662,6 +9082,79 @@ fi
 
 
 
+
+
+# Check whether --with-download-cache was given.
+if test "${with_download_cache+set}" = set; then :
+  withval=$with_download_cache;
+       case ${withval} in
+       n|no)
+               unset AST_DOWNLOAD_CACHE
+               ;;
+       *)
+               if test "x${withval}" = "x"; then
+                       :
+               else
+                       AST_DOWNLOAD_CACHE="${withval}"
+               fi
+               ;;
+       esac
+
+else
+  :
+fi
+
+
+
+
+
+# Check whether --with-sounds-cache was given.
+if test "${with_sounds_cache+set}" = set; then :
+  withval=$with_sounds_cache;
+       case ${withval} in
+       n|no)
+               unset SOUNDS_CACHE_DIR
+               ;;
+       *)
+               if test "x${withval}" = "x"; then
+                       :
+               else
+                       SOUNDS_CACHE_DIR="${withval}"
+               fi
+               ;;
+       esac
+
+else
+  :
+fi
+
+
+
+
+
+# Check whether --with-externals-cache was given.
+if test "${with_externals_cache+set}" = set; then :
+  withval=$with_externals_cache;
+       case ${withval} in
+       n|no)
+               unset EXTERNALS_CACHE_DIR
+               ;;
+       *)
+               if test "x${withval}" = "x"; then
+                       :
+               else
+                       EXTERNALS_CACHE_DIR="${withval}"
+               fi
+               ;;
+       esac
+
+else
+  :
+fi
+
+
+
+
 AST_CODE_COVERAGE=no
 # Check whether --enable-coverage was given.
 if test "${enable_coverage+set}" = set; then :
@@ -8814,6 +9307,149 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
        CFLAGS="$save_CFLAGS"
 
 
+PJPROJECT_BUNDLED=yes
+
+
+
+# Check whether --with-pjproject-bundled was given.
+if test "${with_pjproject_bundled+set}" = set; then :
+  withval=$with_pjproject_bundled; case "${withval}" in
+             n|no) PJPROJECT_BUNDLED=no ;;
+             *) PJPROJECT_BUNDLED=yes ;;
+       esac
+fi
+
+
+
+
+       if test "$PJPROJECT_BUNDLED" = "yes" ; then
+
+       if test "${ac_mandatory_list#*PJPROJECT*}" != "$ac_mandatory_list" ; then
+               as_fn_error $? "--with-pjproject and --with-pjproject-bundled can't both be specified" "$LINENO" 5
+       fi
+
+       ac_mandatory_list="$ac_mandatory_list PJPROJECT"
+       PJPROJECT_DIR="${ac_top_build_prefix}third-party/pjproject"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for embedded pjproject (may have to download)" >&5
+$as_echo_n "checking for embedded pjproject (may have to download)... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring" >&5
+$as_echo "configuring" >&6; }
+
+       if test "x${DOWNLOAD_TO_STDOUT}" = "x" ; then
+               as_fn_error $? "A download utility (wget, curl or fetch) is required to download bundled pjproject" "$LINENO" 5
+       fi
+       if test "${BZIP2}" = ":" ; then
+               as_fn_error $? "bzip2 is required to extract the pjproject tar file" "$LINENO" 5
+       fi
+       if test "${TAR}" = ":" ; then
+               as_fn_error $? "tar is required to extract the pjproject tar file" "$LINENO" 5
+       fi
+       if test "${PATCH}" = ":" ; then
+               as_fn_error $? "patch is required to configure bundled pjproject" "$LINENO" 5
+       fi
+       if test "${SED}" = ":" ; then
+               as_fn_error $? "sed is required to configure bundled pjproject" "$LINENO" 5
+       fi
+       if test "${NM}" = ":" ; then
+               as_fn_error $? "nm is required to build bundled pjproject" "$LINENO" 5
+       fi
+       if test "${MD5}" = ":" ; then
+               as_fn_error $? "md5sum is required to build bundled pjproject" "$LINENO" 5
+       fi
+       if test "${CAT}" = ":" ; then
+               as_fn_error $? "cat is required to build bundled pjproject" "$LINENO" 5
+       fi
+       if test "${CUT}" = ":" ; then
+               as_fn_error $? "cut is required to build bundled pjproject" "$LINENO" 5
+       fi
+       if test "${GREP}" = ":" ; then
+               as_fn_error $? "grep is required to build bundled pjproject" "$LINENO" 5
+       fi
+
+
+       this_host=$(./config.sub $(./config.guess))
+       if test "$build" != "$this_host" ; then
+               PJPROJECT_CONFIGURE_OPTS+=" --build=$build"
+       fi
+       if test "$host" != "$this_host" ; then
+               PJPROJECT_CONFIGURE_OPTS+=" --host=$host"
+       fi
+
+       export TAR PATCH SED NM EXTERNALS_CACHE_DIR AST_DOWNLOAD_CACHE DOWNLOAD_TO_STDOUT DOWNLOAD_TIMEOUT DOWNLOAD MD5 CAT CUT GREP
+       export NOISY_BUILD
+       ${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} \
+               PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" \
+               EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" \
+               configure
+       if test $? -ne 0 ; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: Unable to configure ${PJPROJECT_DIR}" >&5
+$as_echo "$as_me: Unable to configure ${PJPROJECT_DIR}" >&6;}
+               as_fn_error $? "Re-run the ./configure command with 'NOISY_BUILD=yes' appended to see error details." "$LINENO" 5
+       fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bundled pjproject" >&5
+$as_echo_n "checking for bundled pjproject... " >&6; }
+
+       PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C ${PJPROJECT_DIR} PJPROJECT_CONFIGURE_OPTS="$PJPROJECT_CONFIGURE_OPTS" EXTERNALS_CACHE_DIR="${EXTERNALS_CACHE_DIR:-${AST_DOWNLOAD_CACHE}}" echo_cflags)
+       PJPROJECT_CFLAGS="$PJPROJECT_INCLUDE"
+       PBX_PJPROJECT=1
+
+
+$as_echo "#define HAVE_PJPROJECT 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJPROJECT_BUNDLED 1" >>confdefs.h
+
+
+
+$as_echo "#define HAVE_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJ_TRANSACTION_GRP_LOCK 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJSIP_REPLACE_MEDIA_STREAM 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJSIP_GET_DEST_INFO 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJ_SSL_CERT_LOAD_FROM_FILES2 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJSIP_EXTERNAL_RESOLVER 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJSIP_TLS_TRANSPORT_PROTO 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJSIP_EVSUB_GRP_LOCK 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJSIP_INV_SESSION_REF 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJSIP_AUTH_CLT_DEINIT 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PJSIP_TSX_LAYER_FIND_TSX2 1" >>confdefs.h
+
+
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+       fi
+
+
+
 # AST_EXT_LIB_SETUP is used to tell configure to handle variables for
 # various packages.
 # $1 is the prefix for the variables in makeopts and autoconfig.h
@@ -8988,6 +9624,38 @@ fi
 
 
 
+    CODEC2_DESCRIP="Codec 2 Audio Decoder/Encoder"
+    CODEC2_OPTION="codec2"
+    PBX_CODEC2=0
+
+# Check whether --with-codec2 was given.
+if test "${with_codec2+set}" = set; then :
+  withval=$with_codec2;
+       case ${withval} in
+       n|no)
+       USE_CODEC2=no
+       # -1 is a magic value used by menuselect to know that the package
+       # was disabled, other than 'not found'
+       PBX_CODEC2=-1
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} CODEC2"
+       ;;
+       *)
+       CODEC2_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} CODEC2"
+       ;;
+       esac
+
+fi
+
+
+
+
+
+
+
+
     COROSYNC_DESCRIP="Corosync"
     COROSYNC_OPTION="cpg"
     PBX_COROSYNC=0
 
 
 
+LIBEDIT_IS_UNICODE_DESCRIP="Libedit compiled for unicode"
+LIBEDIT_IS_UNICODE_OPTION=libedit
+LIBEDIT_IS_UNICODE_DIR=${LIBEDIT_DIR}
+
+PBX_LIBEDIT_IS_UNICODE=0
+
+
+
+
+
+
+
     LIBXML2_DESCRIP="LibXML2"
     LIBXML2_OPTION="libxml2"
     PBX_LIBXML2=0
 
 
 
+    OPUSFILE_DESCRIP="Opusfile"
+    OPUSFILE_OPTION="opusfile"
+    PBX_OPUSFILE=0
+
+# Check whether --with-opusfile was given.
+if test "${with_opusfile+set}" = set; then :
+  withval=$with_opusfile;
+       case ${withval} in
+       n|no)
+       USE_OPUSFILE=no
+       # -1 is a magic value used by menuselect to know that the package
+       # was disabled, other than 'not found'
+       PBX_OPUSFILE=-1
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} OPUSFILE"
+       ;;
+       *)
+       OPUSFILE_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} OPUSFILE"
+       ;;
+       esac
+
+fi
+
+
+
+
+
+
+
+
     OSPTK_DESCRIP="OSP Toolkit"
     OSPTK_OPTION="osptk"
     PBX_OSPTK=0
 
 
 
+    BEANSTALK_DESCRIP="Beanstalk Job Queue"
+    BEANSTALK_OPTION="beanstalk"
+    PBX_BEANSTALK=0
+
+# Check whether --with-beanstalk was given.
+if test "${with_beanstalk+set}" = set; then :
+  withval=$with_beanstalk;
+       case ${withval} in
+       n|no)
+       USE_BEANSTALK=no
+       # -1 is a magic value used by menuselect to know that the package
+       # was disabled, other than 'not found'
+       PBX_BEANSTALK=-1
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} BEANSTALK"
+       ;;
+       *)
+       BEANSTALK_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} BEANSTALK"
+       ;;
+       esac
+
+fi
+
+
+
+
+
+
+
+
+if test "x${PBX_PJPROJECT}" != "x1" ; then
 
     PJPROJECT_DESCRIP="PJPROJECT"
     PJPROJECT_OPTION="pjproject"
 
 
 
-PJPROJECT_BUNDLED=no
-
-
-
-# Check whether --with-pjproject-bundled was given.
-if test "${with_pjproject_bundled+set}" = set; then :
-  withval=$with_pjproject_bundled; case "${enableval}" in
-             n|no) PJPROJECT_BUNDLED=no ;;
-             *) PJPROJECT_BUNDLED=yes ;;
-       esac
-fi
-
-
-
-if test "$PJPROJECT_BUNDLED" = "yes" -a "${ac_mandatory_list#*PJPROJECT*}" != "$ac_mandatory_list" ; then
-   as_fn_error $? "--with-pjproject and --with-pjproject-bundled can't both be specified" "$LINENO" 5
-fi
-
-if test "$PJPROJECT_BUNDLED" = "yes" ; then
-   ac_mandatory_list="$ac_mandatory_list PJPROJECT"
-   PJPROJECT_DIR="${ac_top_build_prefix}third-party/pjproject"
-fi
-
 
 PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_DESCRIP="PJSIP Dialog Create UAS with Incremented Lock"
 PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_OPTION=pjsip
@@ -10951,6 +11673,43 @@ PBX_PJSIP_EVSUB_GRP_LOCK=0
 
 
 
+PJSIP_INV_SESSION_REF_DESCRIP="PJSIP INVITE Session Reference Count support"
+PJSIP_INV_SESSION_REF_OPTION=pjsip
+PJSIP_INV_SESSION_REF_DIR=${PJPROJECT_DIR}
+
+PBX_PJSIP_INV_SESSION_REF=0
+
+
+
+
+
+
+
+PJSIP_AUTH_CLT_DEINIT_DESCRIP="pjsip_auth_clt_deinit support"
+PJSIP_AUTH_CLT_DEINIT_OPTION=pjsip
+PJSIP_AUTH_CLT_DEINIT_DIR=${PJPROJECT_DIR}
+
+PBX_PJSIP_AUTH_CLT_DEINIT=0
+
+
+
+
+
+
+
+PJSIP_TSX_LAYER_FIND_TSX2_DESCRIP="pjsip_tsx_layer_find_tsx2 support"
+PJSIP_TSX_LAYER_FIND_TSX2_OPTION=pjsip
+PJSIP_TSX_LAYER_FIND_TSX2_DIR=${PJPROJECT_DIR}
+
+PBX_PJSIP_TSX_LAYER_FIND_TSX2=0
+
+
+
+
+
+
+fi
+
 
     POPT_DESCRIP="popt"
     POPT_OPTION="popt"
 
 
 
+    FFTW3_DESCRIP="LIBFFTW3"
+    FFTW3_OPTION="fftw3"
+    PBX_FFTW3=0
+
+# Check whether --with-fftw3 was given.
+if test "${with_fftw3+set}" = set; then :
+  withval=$with_fftw3;
+       case ${withval} in
+       n|no)
+       USE_FFTW3=no
+       # -1 is a magic value used by menuselect to know that the package
+       # was disabled, other than 'not found'
+       PBX_FFTW3=-1
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} FFTW3"
+       ;;
+       *)
+       FFTW3_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} FFTW3"
+       ;;
+       esac
+
+fi
+
+
+
+
+
+
+
+
     RESAMPLE_DESCRIP="LIBRESAMPLE"
     RESAMPLE_OPTION="resample"
     PBX_RESAMPLE=0
 
 
 
+    SNDFILE_DESCRIP="libsndfile"
+    SNDFILE_OPTION="sndfile"
+    PBX_SNDFILE=0
+
+# Check whether --with-sndfile was given.
+if test "${with_sndfile+set}" = set; then :
+  withval=$with_sndfile;
+       case ${withval} in
+       n|no)
+       USE_SNDFILE=no
+       # -1 is a magic value used by menuselect to know that the package
+       # was disabled, other than 'not found'
+       PBX_SNDFILE=-1
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} SNDFILE"
+       ;;
+       *)
+       SNDFILE_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} SNDFILE"
+       ;;
+       esac
+
+fi
+
+
+
+
+
+
+
+
     SDL_DESCRIP="Sdl"
     SDL_OPTION="sdl"
     PBX_SDL=0
 
 
 
-
-# Check whether --with-sounds-cache was given.
-if test "${with_sounds_cache+set}" = set; then :
-  withval=$with_sounds_cache;
-       case ${withval} in
-       n|no)
-               unset SOUNDS_CACHE_DIR
-               ;;
-       *)
-               if test "x${withval}" = "x"; then
-                       :
-               else
-                       SOUNDS_CACHE_DIR="${withval}"
-               fi
-               ;;
-       esac
-
-else
-  :
-fi
-
-
-
-
     SPANDSP_DESCRIP="SPANDSP"
     SPANDSP_OPTION="spandsp"
     PBX_SPANDSP=0
 
 
 
+SRTP_256_DESCRIP="SRTP Library AES-256 (ICM)"
+SRTP_256_OPTION=srtp
+SRTP_256_DIR=${SRTP_DIR}
+
+PBX_SRTP_256=0
+
+
+
+
+
+
+
+SRTP_192_DESCRIP="SRTP Library AES-192 (ICM)"
+SRTP_192_OPTION=srtp
+SRTP_192_DIR=${SRTP_DIR}
+
+PBX_SRTP_192=0
+
+
+
+
+
+
+
+SRTP_GCM_DESCRIP="SRTP Library AES-128 (GCM) and AES-256 (GCM)"
+SRTP_GCM_OPTION=srtp
+SRTP_GCM_DIR=${SRTP_DIR}
+
+PBX_SRTP_GCM=0
+
+
+
+
+
+
+
 SRTP_SHUTDOWN_DESCRIP="SRTP Library Shutdown Function"
 SRTP_SHUTDOWN_OPTION=srtp
 SRTP_SHUTDOWN_DIR=${SRTP_DIR}
 
 fi
 
+if test -z $ac_header_dirent -o "$ac_header_dirent" = "no"; then
+  as_fn_error $? "*** Could not find dirent header that defines 'DIR'." "$LINENO" 5
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
 if ${ac_cv_header_stdc+:} false; then :
@@ -12653,6 +13492,10 @@ $as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
 fi
 
+if test "$ac_cv_header_stdc" != "yes"; then
+  as_fn_error $? "*** ANSI C header files not found." "$LINENO" 5
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
 if ${ac_cv_header_sys_wait_h+:} false; then :
@@ -12694,7 +13537,68 @@ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
 
 fi
 
-for ac_header in arpa/inet.h fcntl.h inttypes.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/event.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h utime.h arpa/nameser.h sys/io.h
+if test "$ac_cv_header_sys_wait_h" != "yes"; then
+  as_fn_error $? "*** POSIX.1 compatible sys/wait.h is required." "$LINENO" 5
+fi
+
+for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H
+#  include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#  include <netinet/in.h>   /* inet_ functions / structs */
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+#  include <arpa/nameser.h> /* DNS HEADER struct */
+#endif
+#ifdef HAVE_NETDB_H
+#  include <netdb.h>
+#endif
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "$ac_cv_header_resolv_h" != "yes"; then
+  as_fn_error $? "*** resolv.h is required." "$LINENO" 5
+fi
+
+# Check for headers that are unconditionally required on all platforms.  Do not use
+# this to check for headers that are only needed by modules.
+for ac_header in  \
+  arpa/nameser.h assert.h ctype.h dlfcn.h errno.h fcntl.h float.h grp.h \
+  inttypes.h limits.h locale.h math.h pwd.h netinet/in.h regex.h \
+  sched.h stdarg.h stdint.h stdio.h stdlib.h string.h syslog.h \
+  sys/file.h sys/ioctl.h sys/param.h sys/resource.h sys/socket.h sys/stat.h \
+  sys/time.h sys/types.h sys/un.h \
+  termios.h time.h unistd.h \
+
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+  as_fn_error $? "*** A required header was not found." "$LINENO" 5
+
+fi
+
+done
+
+
+for ac_header in arpa/inet.h libintl.h malloc.h netdb.h stddef.h strings.h sys/event.h utime.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -12720,16 +13624,12 @@ if test "x${PBX_TERMCAP}" != "x1" -a "${USE_TERMCAP}" != "no"; then
          pbxlibdir="-L${TERMCAP_DIR}"
       fi
    fi
-   pbxfuncname="tgetent"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_TERMCAP_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_termcap_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -ltermcap" >&5
-$as_echo_n "checking for ${pbxfuncname} in -ltermcap... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5
+$as_echo_n "checking for tgetent in -ltermcap... " >&6; }
+if ${ac_cv_lib_termcap_tgetent+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12743,35 +13643,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char tgetent ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return tgetent ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_termcap_tgetent=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_termcap_tgetent=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5
+$as_echo "$ac_cv_lib_termcap_tgetent" >&6; }
+if test "x$ac_cv_lib_termcap_tgetent" = xyes; then :
   AST_TERMCAP_FOUND=yes
 else
   AST_TERMCAP_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_TERMCAP_FOUND}" = "yes"; then
          TERMCAP_INCLUDE="-I${TERMCAP_DIR}/include"
       fi
       TERMCAP_INCLUDE="${TERMCAP_INCLUDE} "
-      if test "x" = "x" ; then # no header, assume found
-         TERMCAP_HEADER_FOUND="1"
-      else                             # check for the header
-         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${TERMCAP_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "" "ac_cv_header_" "$ac_includes_default"
-if test "x$ac_cv_header_" = xyes; then :
-  TERMCAP_HEADER_FOUND=1
-else
-  TERMCAP_HEADER_FOUND=0
-fi
 
+         # no header, assume found
+         TERMCAP_HEADER_FOUND="1"
 
-         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
       if test "x${TERMCAP_HEADER_FOUND}" = "x0" ; then
          TERMCAP_LIB=""
          TERMCAP_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            TERMCAP_LIB=""
-         fi
+
          PBX_TERMCAP=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_TERMCAP 1
@@ -12824,16 +13710,12 @@ if test "x${PBX_TINFO}" != "x1" -a "${USE_TINFO}" != "no"; then
          pbxlibdir="-L${TINFO_DIR}"
       fi
    fi
-   pbxfuncname="tgetent"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_TINFO_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_tinfo_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -ltinfo" >&5
-$as_echo_n "checking for ${pbxfuncname} in -ltinfo... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5
+$as_echo_n "checking for tgetent in -ltinfo... " >&6; }
+if ${ac_cv_lib_tinfo_tgetent+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12847,35 +13729,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char tgetent ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return tgetent ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_tinfo_tgetent=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_tinfo_tgetent=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetent" >&5
+$as_echo "$ac_cv_lib_tinfo_tgetent" >&6; }
+if test "x$ac_cv_lib_tinfo_tgetent" = xyes; then :
   AST_TINFO_FOUND=yes
 else
   AST_TINFO_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_TINFO_FOUND}" = "yes"; then
          TINFO_INCLUDE="-I${TINFO_DIR}/include"
       fi
       TINFO_INCLUDE="${TINFO_INCLUDE} "
-      if test "x" = "x" ; then # no header, assume found
-         TINFO_HEADER_FOUND="1"
-      else                             # check for the header
-         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${TINFO_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "" "ac_cv_header_" "$ac_includes_default"
-if test "x$ac_cv_header_" = xyes; then :
-  TINFO_HEADER_FOUND=1
-else
-  TINFO_HEADER_FOUND=0
-fi
 
+         # no header, assume found
+         TINFO_HEADER_FOUND="1"
 
-         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
       if test "x${TINFO_HEADER_FOUND}" = "x0" ; then
          TINFO_LIB=""
          TINFO_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            TINFO_LIB=""
-         fi
+
          PBX_TINFO=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_TINFO 1
@@ -12928,16 +13796,12 @@ if test "x${PBX_CURSES}" != "x1" -a "${USE_CURSES}" != "no"; then
          pbxlibdir="-L${CURSES_DIR}"
       fi
    fi
-   pbxfuncname="initscr"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_CURSES_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_curses_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lcurses" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lcurses... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lcurses" >&5
+$as_echo_n "checking for initscr in -lcurses... " >&6; }
+if ${ac_cv_lib_curses_initscr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -12951,35 +13815,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char initscr ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return initscr ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_curses_initscr=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_curses_initscr=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_initscr" >&5
+$as_echo "$ac_cv_lib_curses_initscr" >&6; }
+if test "x$ac_cv_lib_curses_initscr" = xyes; then :
   AST_CURSES_FOUND=yes
 else
   AST_CURSES_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_CURSES_FOUND}" = "yes"; then
@@ -12989,9 +13852,8 @@ fi
          CURSES_INCLUDE="-I${CURSES_DIR}/include"
       fi
       CURSES_INCLUDE="${CURSES_INCLUDE} "
-      if test "xcurses.h" = "x" ; then # no header, assume found
-         CURSES_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${CURSES_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${CURSES_HEADER_FOUND}" = "x0" ; then
          CURSES_LIB=""
          CURSES_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            CURSES_LIB=""
-         fi
+
          PBX_CURSES=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_CURSES 1
@@ -13032,16 +13892,12 @@ if test "x${PBX_NCURSES}" != "x1" -a "${USE_NCURSES}" != "no"; then
          pbxlibdir="-L${NCURSES_DIR}"
       fi
    fi
-   pbxfuncname="initscr"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_NCURSES_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_ncurses_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lncurses" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lncurses... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5
+$as_echo_n "checking for initscr in -lncurses... " >&6; }
+if ${ac_cv_lib_ncurses_initscr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13055,35 +13911,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char initscr ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return initscr ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_ncurses_initscr=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_ncurses_initscr=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5
+$as_echo "$ac_cv_lib_ncurses_initscr" >&6; }
+if test "x$ac_cv_lib_ncurses_initscr" = xyes; then :
   AST_NCURSES_FOUND=yes
 else
   AST_NCURSES_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_NCURSES_FOUND}" = "yes"; then
@@ -13093,9 +13948,8 @@ fi
          NCURSES_INCLUDE="-I${NCURSES_DIR}/include"
       fi
       NCURSES_INCLUDE="${NCURSES_INCLUDE} "
-      if test "xcurses.h" = "x" ; then # no header, assume found
-         NCURSES_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${NCURSES_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${NCURSES_HEADER_FOUND}" = "x0" ; then
          NCURSES_LIB=""
          NCURSES_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            NCURSES_LIB=""
-         fi
+
          PBX_NCURSES=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_NCURSES 1
@@ -13155,16 +14007,12 @@ if test "x${PBX_LIBUUID}" != "x1" -a "${USE_LIBUUID}" != "no"; then
          pbxlibdir="-L${LIBUUID_DIR}"
       fi
    fi
-   pbxfuncname="uuid_generate_random"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_LIBUUID_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_uuid_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -luuid" >&5
-$as_echo_n "checking for ${pbxfuncname} in -luuid... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_random in -luuid" >&5
+$as_echo_n "checking for uuid_generate_random in -luuid... " >&6; }
+if ${ac_cv_lib_uuid_uuid_generate_random+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13178,35 +14026,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char uuid_generate_random ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return uuid_generate_random ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_uuid_uuid_generate_random=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_uuid_uuid_generate_random=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate_random" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_generate_random" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_generate_random" = xyes; then :
   AST_LIBUUID_FOUND=yes
 else
   AST_LIBUUID_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_LIBUUID_FOUND}" = "yes"; then
@@ -13216,9 +14063,8 @@ fi
          LIBUUID_INCLUDE="-I${LIBUUID_DIR}/include"
       fi
       LIBUUID_INCLUDE="${LIBUUID_INCLUDE} "
-      if test "xuuid/uuid.h" = "x" ; then      # no header, assume found
-         LIBUUID_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${LIBUUID_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${LIBUUID_HEADER_FOUND}" = "x0" ; then
          LIBUUID_LIB=""
          LIBUUID_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            LIBUUID_LIB=""
-         fi
+
          PBX_LIBUUID=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBUUID 1
@@ -13259,16 +14103,12 @@ if test "x${PBX_E2FSUUID}" != "x1" -a "${USE_E2FSUUID}" != "no"; then
          pbxlibdir="-L${E2FSUUID_DIR}"
       fi
    fi
-   pbxfuncname="uuid_generate_random"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_E2FSUUID_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_e2fs-uuid_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -le2fs-uuid" >&5
-$as_echo_n "checking for ${pbxfuncname} in -le2fs-uuid... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_random in -le2fs-uuid" >&5
+$as_echo_n "checking for uuid_generate_random in -le2fs-uuid... " >&6; }
+if ${ac_cv_lib_e2fs_uuid_uuid_generate_random+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13282,35 +14122,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char uuid_generate_random ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return uuid_generate_random ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_e2fs_uuid_uuid_generate_random=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_e2fs_uuid_uuid_generate_random=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_e2fs_uuid_uuid_generate_random" >&5
+$as_echo "$ac_cv_lib_e2fs_uuid_uuid_generate_random" >&6; }
+if test "x$ac_cv_lib_e2fs_uuid_uuid_generate_random" = xyes; then :
   AST_E2FSUUID_FOUND=yes
 else
   AST_E2FSUUID_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_E2FSUUID_FOUND}" = "yes"; then
@@ -13320,9 +14159,8 @@ fi
          E2FSUUID_INCLUDE="-I${E2FSUUID_DIR}/include"
       fi
       E2FSUUID_INCLUDE="${E2FSUUID_INCLUDE} "
-      if test "xuuid/uuid.h" = "x" ; then      # no header, assume found
-         E2FSUUID_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${E2FSUUID_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${E2FSUUID_HEADER_FOUND}" = "x0" ; then
          E2FSUUID_LIB=""
          E2FSUUID_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            E2FSUUID_LIB=""
-         fi
+
          PBX_E2FSUUID=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_E2FSUUID 1
@@ -13393,16 +14229,12 @@ if test "x${PBX_JANSSON}" != "x1" -a "${USE_JANSSON}" != "no"; then
          pbxlibdir="-L${JANSSON_DIR}"
       fi
    fi
-   pbxfuncname="json_dumps"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_JANSSON_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_jansson_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -ljansson" >&5
-$as_echo_n "checking for ${pbxfuncname} in -ljansson... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for json_dumps in -ljansson" >&5
+$as_echo_n "checking for json_dumps in -ljansson... " >&6; }
+if ${ac_cv_lib_jansson_json_dumps+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13416,35 +14248,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char json_dumps ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return json_dumps ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_jansson_json_dumps=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_jansson_json_dumps=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jansson_json_dumps" >&5
+$as_echo "$ac_cv_lib_jansson_json_dumps" >&6; }
+if test "x$ac_cv_lib_jansson_json_dumps" = xyes; then :
   AST_JANSSON_FOUND=yes
 else
   AST_JANSSON_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_JANSSON_FOUND}" = "yes"; then
@@ -13454,9 +14285,8 @@ fi
          JANSSON_INCLUDE="-I${JANSSON_DIR}/include"
       fi
       JANSSON_INCLUDE="${JANSSON_INCLUDE} "
-      if test "xjansson.h" = "x" ; then        # no header, assume found
-         JANSSON_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${JANSSON_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "jansson.h" "ac_cv_header_jansson_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${JANSSON_HEADER_FOUND}" = "x0" ; then
          JANSSON_LIB=""
          JANSSON_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            JANSSON_LIB=""
-         fi
+
          PBX_JANSSON=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_JANSSON 1
@@ -13503,16 +14331,12 @@ if test "x${PBX_RT}" != "x1" -a "${USE_RT}" != "no"; then
          pbxlibdir="-L${RT_DIR}"
       fi
    fi
-   pbxfuncname="clock_gettime"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_RT_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_rt_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lrt" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lrt... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13526,35 +14350,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char clock_gettime ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return clock_gettime ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_rt_clock_gettime=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_rt_clock_gettime=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
   AST_RT_FOUND=yes
 else
   AST_RT_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_RT_FOUND}" = "yes"; then
          RT_INCLUDE="-I${RT_DIR}/include"
       fi
       RT_INCLUDE="${RT_INCLUDE} "
-      if test "x" = "x" ; then # no header, assume found
-         RT_HEADER_FOUND="1"
-      else                             # check for the header
-         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${RT_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "" "ac_cv_header_" "$ac_includes_default"
-if test "x$ac_cv_header_" = xyes; then :
-  RT_HEADER_FOUND=1
-else
-  RT_HEADER_FOUND=0
-fi
 
+         # no header, assume found
+         RT_HEADER_FOUND="1"
 
-         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
       if test "x${RT_HEADER_FOUND}" = "x0" ; then
          RT_LIB=""
          RT_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            RT_LIB=""
-         fi
+
          PBX_RT=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_RT 1
@@ -13701,16 +14511,13 @@ else
 fi
 
                if test ! "x${CONFIG_LIBXML2}" = xNo; then
-                       if test x"" = x ; then A=--cflags ; else A="" ; fi
-                       LIBXML2_INCLUDE=$(${CONFIG_LIBXML2} $A)
+                       LIBXML2_INCLUDE=$(${CONFIG_LIBXML2} --cflags)
                        LIBXML2_INCLUDE=$(echo ${LIBXML2_INCLUDE} | $SED -e "s|-I|-I${LIBXML2_DIR}|g")
 
-                       if test x"" = x ; then A=--libs ; else A="" ; fi
-                       LIBXML2_LIB=$(${CONFIG_LIBXML2} $A)
+                       LIBXML2_LIB=$(${CONFIG_LIBXML2} --libs)
                        LIBXML2_LIB=$(echo ${LIBXML2_LIB} | $SED -e "s|-L|-L${LIBXML2_DIR}|g")
 
-                       if test x"#include <libxml/tree.h>
-        #include <libxml/parser.h>" != x ; then
+
                                saved_cppflags="${CPPFLAGS}"
                                CPPFLAGS="${CPPFLAGS} ${LIBXML2_INCLUDE}"
 
@@ -13738,12 +14545,7 @@ rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
                                CPPFLAGS="${saved_cppflags}"
                                LIBS="${saved_libs}"
-                       else
-                               PBX_LIBXML2=1
 
-$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h
-
-                       fi
                fi
        fi
 
@@ -13767,16 +14569,12 @@ if test "x${PBX_URIPARSER}" != "x1" -a "${USE_URIPARSER}" != "no"; then
          pbxlibdir="-L${URIPARSER_DIR}"
       fi
    fi
-   pbxfuncname="uriParseUriA"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_URIPARSER_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_uriparser_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -luriparser" >&5
-$as_echo_n "checking for ${pbxfuncname} in -luriparser... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uriParseUriA in -luriparser" >&5
+$as_echo_n "checking for uriParseUriA in -luriparser... " >&6; }
+if ${ac_cv_lib_uriparser_uriParseUriA+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13790,35 +14588,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char uriParseUriA ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return uriParseUriA ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_uriparser_uriParseUriA=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_uriparser_uriParseUriA=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uriparser_uriParseUriA" >&5
+$as_echo "$ac_cv_lib_uriparser_uriParseUriA" >&6; }
+if test "x$ac_cv_lib_uriparser_uriParseUriA" = xyes; then :
   AST_URIPARSER_FOUND=yes
 else
   AST_URIPARSER_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_URIPARSER_FOUND}" = "yes"; then
@@ -13828,9 +14625,8 @@ fi
          URIPARSER_INCLUDE="-I${URIPARSER_DIR}/include"
       fi
       URIPARSER_INCLUDE="${URIPARSER_INCLUDE} "
-      if test "xuriparser/Uri.h" = "x" ; then  # no header, assume found
-         URIPARSER_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${URIPARSER_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "uriparser/Uri.h" "ac_cv_header_uriparser_Uri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${URIPARSER_HEADER_FOUND}" = "x0" ; then
          URIPARSER_LIB=""
          URIPARSER_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            URIPARSER_LIB=""
-         fi
+
          PBX_URIPARSER=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_URIPARSER 1
 # Check whether --enable-xmldoc was given.
 if test "${enable_xmldoc+set}" = set; then :
   enableval=$enable_xmldoc; case "${enableval}" in
-               y|ye|yes) disable_xmldoc=no ;;
-               n|no)  disable_xmldoc=yes ;;
+               y|ye|yes) DISABLE_XMLDOC=no ;;
+               n|no)  DISABLE_XMLDOC=yes ;;
                *) as_fn_error $? "bad value ${enableval} for --disable-xmldoc" "$LINENO" 5  ;;
        esac
 else
-  disable_xmldoc=no
+  DISABLE_XMLDOC=no
 fi
 
 
-if test "${disable_xmldoc}" != "yes"; then
+
+if test "${DISABLE_XMLDOC}" != "yes"; then
+
+$as_echo "#define AST_XML_DOCS 1" >>confdefs.h
+
 
 if test "x${PBX_LIBXSLT}" != "x1" -a "${USE_LIBXSLT}" != "no"; then
    pbxlibdir=""
@@ -13886,16 +14684,12 @@ if test "x${PBX_LIBXSLT}" != "x1" -a "${USE_LIBXSLT}" != "no"; then
          pbxlibdir="-L${LIBXSLT_DIR}"
       fi
    fi
-   pbxfuncname="xsltLoadStylesheetPI"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_LIBXSLT_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} ${LIBXML2_INCLUDE}"
-      as_ac_Lib=`$as_echo "ac_cv_lib_xslt_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lxslt" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lxslt... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltLoadStylesheetPI in -lxslt" >&5
+$as_echo_n "checking for xsltLoadStylesheetPI in -lxslt... " >&6; }
+if ${ac_cv_lib_xslt_xsltLoadStylesheetPI+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -13909,35 +14703,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char xsltLoadStylesheetPI ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return xsltLoadStylesheetPI ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_xslt_xsltLoadStylesheetPI=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_xslt_xsltLoadStylesheetPI=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltLoadStylesheetPI" >&5
+$as_echo "$ac_cv_lib_xslt_xsltLoadStylesheetPI" >&6; }
+if test "x$ac_cv_lib_xslt_xsltLoadStylesheetPI" = xyes; then :
   AST_LIBXSLT_FOUND=yes
 else
   AST_LIBXSLT_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_LIBXSLT_FOUND}" = "yes"; then
@@ -13947,9 +14740,8 @@ fi
          LIBXSLT_INCLUDE="-I${LIBXSLT_DIR}/include"
       fi
       LIBXSLT_INCLUDE="${LIBXSLT_INCLUDE} ${LIBXML2_INCLUDE}"
-      if test "xlibxslt/xsltInternals.h" = "x" ; then  # no header, assume found
-         LIBXSLT_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${LIBXSLT_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xsltInternals.h" "ac_cv_header_libxslt_xsltInternals_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${LIBXSLT_HEADER_FOUND}" = "x0" ; then
          LIBXSLT_LIB=""
          LIBXSLT_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            LIBXSLT_LIB=""
-         fi
+
          PBX_LIBXSLT=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBXSLT 1
@@ -13990,16 +14780,12 @@ if test "x${PBX_LIBXSLT_CLEANUP}" != "x1" -a "${USE_LIBXSLT_CLEANUP}" != "no"; t
          pbxlibdir="-L${LIBXSLT_CLEANUP_DIR}"
       fi
    fi
-   pbxfuncname="xsltCleanupGlobals"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_LIBXSLT_CLEANUP_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} ${LIBXML2_INCLUDE}"
-      as_ac_Lib=`$as_echo "ac_cv_lib_xslt_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lxslt" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lxslt... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xsltCleanupGlobals in -lxslt" >&5
+$as_echo_n "checking for xsltCleanupGlobals in -lxslt... " >&6; }
+if ${ac_cv_lib_xslt_xsltCleanupGlobals+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -14013,35 +14799,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char xsltCleanupGlobals ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return xsltCleanupGlobals ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_xslt_xsltCleanupGlobals=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_xslt_xsltCleanupGlobals=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xslt_xsltCleanupGlobals" >&5
+$as_echo "$ac_cv_lib_xslt_xsltCleanupGlobals" >&6; }
+if test "x$ac_cv_lib_xslt_xsltCleanupGlobals" = xyes; then :
   AST_LIBXSLT_CLEANUP_FOUND=yes
 else
   AST_LIBXSLT_CLEANUP_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_LIBXSLT_CLEANUP_FOUND}" = "yes"; then
@@ -14051,9 +14836,8 @@ fi
          LIBXSLT_CLEANUP_INCLUDE="-I${LIBXSLT_CLEANUP_DIR}/include"
       fi
       LIBXSLT_CLEANUP_INCLUDE="${LIBXSLT_CLEANUP_INCLUDE} ${LIBXML2_INCLUDE}"
-      if test "xlibxslt/xsltInternals.h" = "x" ; then  # no header, assume found
-         LIBXSLT_CLEANUP_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${LIBXSLT_CLEANUP_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libxslt/xsltInternals.h" "ac_cv_header_libxslt_xsltInternals_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${LIBXSLT_CLEANUP_HEADER_FOUND}" = "x0" ; then
          LIBXSLT_CLEANUP_LIB=""
          LIBXSLT_CLEANUP_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            LIBXSLT_CLEANUP_LIB=""
-         fi
+
          PBX_LIBXSLT_CLEANUP=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBXSLT_CLEANUP 1
 
 
 
-# https support (in main/http.c) uses funopen on BSD systems,
-# fopencookie on linux
-for ac_func in funopen fopencookie
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
 for ac_func in inet_aton
 do :
   ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
 
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have usable eventfd support" >&5
+$as_echo_n "checking if we have usable eventfd support... " >&6; }
+if test "$cross_compiling" = yes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compile" >&5
+$as_echo "cross-compile" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute pure' support" >&5
-$as_echo_n "checking for compiler 'attribute pure' support... " >&6; }
-saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
-
-
-if test "x" = "x"
-then
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
- void __attribute__((pure)) *test(void *muffin, ...) {return (void *) 0;}
+#include <sys/eventfd.h>
 int
 main ()
 {
-
+return eventfd(0, EFD_NONBLOCK | EFD_SEMAPHORE) == -1;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_pure 1
-_ACEOF
+$as_echo "#define HAVE_EVENTFD 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
-else
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute pure' support" >&5
+$as_echo_n "checking for compiler 'attribute pure' support... " >&6; }
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
+
+ax_cv_have_func_attribute_pure=0
+
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
+ void __attribute__((pure)) *test(void *muffin, ...) {return (void *) 0;}
 int
 main ()
 {
@@ -17328,6 +18100,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_pure=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_pure 1
@@ -17339,7 +18112,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -17351,9 +18123,8 @@ $as_echo_n "checking for compiler 'attribute malloc' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_malloc=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((malloc)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17369,6 +18140,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_malloc=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_malloc 1
@@ -17380,34 +18152,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_malloc 1
-_ACEOF
-
-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
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -17419,9 +18163,8 @@ $as_echo_n "checking for compiler 'attribute const' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_const=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((const)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17437,6 +18180,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_const=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_const 1
@@ -17448,34 +18192,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_const 1
-_ACEOF
-
-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
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -17487,9 +18203,8 @@ $as_echo_n "checking for compiler 'attribute unused' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_unused=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((unused)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17505,6 +18220,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_unused=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_unused 1
@@ -17516,34 +18232,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_unused 1
-_ACEOF
-
-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
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -17555,9 +18243,8 @@ $as_echo_n "checking for compiler 'attribute always_inline' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_always_inline=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((always_inline)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17573,6 +18260,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_always_inline=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_always_inline 1
@@ -17584,34 +18272,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_always_inline 1
-_ACEOF
-
-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
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -17623,9 +18283,8 @@ $as_echo_n "checking for compiler 'attribute deprecated' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_deprecated=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((deprecated)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17641,6 +18300,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_deprecated=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_deprecated 1
@@ -17652,34 +18312,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_deprecated 1
-_ACEOF
-
-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
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -17691,9 +18323,8 @@ $as_echo_n "checking for compiler 'attribute sentinel' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_sentinel=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((sentinel)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17709,6 +18340,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_sentinel=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_sentinel 1
@@ -17720,34 +18352,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_sentinel 1
-_ACEOF
-
-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
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -17759,9 +18363,8 @@ $as_echo_n "checking for compiler 'attribute warn_unused_result' support... " >&
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_warn_unused_result=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((warn_unused_result)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17777,6 +18380,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_warn_unused_result=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_warn_unused_result 1
@@ -17788,34 +18392,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_warn_unused_result 1
-_ACEOF
-
-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
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -17827,9 +18403,8 @@ $as_echo_n "checking for compiler 'attribute may_alias' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_may_alias=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((may_alias)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17845,6 +18420,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_may_alias=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_may_alias 1
@@ -17856,34 +18432,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_may_alias 1
-_ACEOF
-
-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
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -17895,9 +18443,8 @@ $as_echo_n "checking for compiler 'attribute constructor' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_constructor=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((constructor)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17913,6 +18460,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_constructor=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_constructor 1
@@ -17924,38 +18472,14 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
 
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_constructor 1
-_ACEOF
+CFLAGS="$saved_CFLAGS"
 
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
 
+if test "$ax_cv_have_func_attribute_constructor" != "1"; then
+       as_fn_error $? "*** Function constructor attribute is not supported by your compiler." "$LINENO" 5
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-CFLAGS="$saved_CFLAGS"
-
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute destructor' support" >&5
@@ -17963,9 +18487,8 @@ $as_echo_n "checking for compiler 'attribute destructor' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_destructor=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((destructor)) *test(void *muffin, ...) {return (void *) 0;}
@@ -17981,6 +18504,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_destructor=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_destructor 1
@@ -17992,75 +18516,22 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__(()) *test(void *muffin, ...) ;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_destructor 1
-_ACEOF
-
-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
-fi
 
 
 CFLAGS="$saved_CFLAGS"
 
 
+if test "$ax_cv_have_func_attribute_destructor" != "1"; then
+       as_fn_error $? "*** Function destructor attribute is not supported by your compiler." "$LINENO" 5
+fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler 'attribute noreturn' support" >&5
 $as_echo_n "checking for compiler 'attribute noreturn' support... " >&6; }
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
+ax_cv_have_func_attribute_noreturn=0
 
-if test "xnoreturn" = "x"
-then
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
- void __attribute__((noreturn)) *test(void *muffin, ...) {return (void *) 0;}
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_noreturn 1
-_ACEOF
-
-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
-else
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((noreturn)) *test(void *muffin, ...) ;
@@ -18076,6 +18547,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 
+       ax_cv_have_func_attribute_noreturn=1
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_ATTRIBUTE_noreturn 1
@@ -18087,7 +18559,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -18116,7 +18587,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
 $as_echo "yes" >&6; }
        AST_ADDRESS_SANITIZER=1
 else
-  AST_ADDRESS_SANITIZER=
+  AST_ADDRESS_SANITIZER=0
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
@@ -18148,7 +18619,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
 $as_echo "yes" >&6; }
        AST_THREAD_SANITIZER=1
 else
-  AST_THREAD_SANITIZER=
+  AST_THREAD_SANITIZER=0
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
@@ -18222,65 +18693,9 @@ CFLAGS="${saved_sanitize_CFLAGS}"
 LDFLAGS="${saved_sanitize_LDFLAGS}"
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ffunction-sections support" >&5
-$as_echo_n "checking for -ffunction-sections support... " >&6; }
-saved_CFLAGS="${CFLAGS}"
-CFLAGS="${CFLAGS} -ffunction-sections"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-int x = 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-       saved_LDFLAGS="${LDFLAGS}"
-       LDFLAGS="${LDFLAGS} -Wl,--gc-sections"
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --gc-sections support" >&5
-$as_echo_n "checking for --gc-sections support... " >&6; }
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-int x = 1;
-  ;
-  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; }
-               GC_CFLAGS="-ffunction-sections"
-               GC_LDFLAGS="-Wl,--gc-sections"
-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_exeext conftest.$ac_ext
-       LDFLAGS="${saved_LDFLAGS}"
-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
-CFLAGS="${saved_CFLAGS}"
-
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wdeclaration-after-statement support" >&5
 $as_echo_n "checking for -Wdeclaration-after-statement support... " >&6; }
-if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+if $(${CC} -Wdeclaration-after-statement -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
        AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
@@ -18330,9 +18745,22 @@ $as_echo "no" >&6; }
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wno-format-truncation" >&5
+$as_echo_n "checking for -Wno-format-truncation... " >&6; }
+if $(${CC} -Wno-format-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation
+else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       AST_NO_FORMAT_TRUNCATION=
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wshadow" >&5
 $as_echo_n "checking for -Wshadow... " >&6; }
-if $(${CC} -Wshadow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+if $(${CC} -Wshadow -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
        AST_SHADOW_WARNINGS=-Wshadow
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BIND_8_COMPAT required" >&5
+$as_echo_n "checking for BIND_8_COMPAT required... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#undef BIND_8_COMPAT
+#include <arpa/nameser.h>
+
+int
+main ()
+{
+int x = NXDOMAIN
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+BIND8_CFLAGS=-DBIND_8_COMPAT
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 
     if test "x${PBX_GLOB_NOMAGIC}" != "x1"; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLOB_NOMAGIC in glob.h" >&5
@@ -19313,16 +19768,12 @@ if test "x${PBX_ALSA}" != "x1" -a "${USE_ALSA}" != "no"; then
          pbxlibdir="-L${ALSA_DIR}"
       fi
    fi
-   pbxfuncname="snd_spcm_init"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_ALSA_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_asound_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lasound" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lasound... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for snd_spcm_init in -lasound" >&5
+$as_echo_n "checking for snd_spcm_init in -lasound... " >&6; }
+if ${ac_cv_lib_asound_snd_spcm_init+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -19336,35 +19787,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char snd_spcm_init ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return snd_spcm_init ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_asound_snd_spcm_init=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_asound_snd_spcm_init=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asound_snd_spcm_init" >&5
+$as_echo "$ac_cv_lib_asound_snd_spcm_init" >&6; }
+if test "x$ac_cv_lib_asound_snd_spcm_init" = xyes; then :
   AST_ALSA_FOUND=yes
 else
   AST_ALSA_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_ALSA_FOUND}" = "yes"; then
@@ -19374,9 +19824,8 @@ fi
          ALSA_INCLUDE="-I${ALSA_DIR}/include"
       fi
       ALSA_INCLUDE="${ALSA_INCLUDE} "
-      if test "xalsa/asoundlib.h" = "x" ; then # no header, assume found
-         ALSA_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${ALSA_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${ALSA_HEADER_FOUND}" = "x0" ; then
          ALSA_LIB=""
          ALSA_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            ALSA_LIB=""
-         fi
+
          PBX_ALSA=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_ALSA 1
@@ -19418,16 +19865,12 @@ if test "x${PBX_BFD}" != "x1" -a "${USE_BFD}" != "no"; then
          pbxlibdir="-L${BFD_DIR}"
       fi
    fi
-   pbxfuncname="bfd_openr"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_BFD_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_bfd_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lbfd" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lbfd... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_openr in -lbfd" >&5
+$as_echo_n "checking for bfd_openr in -lbfd... " >&6; }
+if ${ac_cv_lib_bfd_bfd_openr+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -19441,35 +19884,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char bfd_openr ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return bfd_openr ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_bfd_bfd_openr=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_bfd_bfd_openr=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_openr" >&5
+$as_echo "$ac_cv_lib_bfd_bfd_openr" >&6; }
+if test "x$ac_cv_lib_bfd_bfd_openr" = xyes; then :
   AST_BFD_FOUND=yes
 else
   AST_BFD_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_BFD_FOUND}" = "yes"; then
@@ -19479,9 +19921,8 @@ fi
          BFD_INCLUDE="-I${BFD_DIR}/include"
       fi
       BFD_INCLUDE="${BFD_INCLUDE} "
-      if test "xbfd.h" = "x" ; then    # no header, assume found
-         BFD_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${BFD_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${BFD_HEADER_FOUND}" = "x0" ; then
          BFD_LIB=""
          BFD_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            BFD_LIB=""
-         fi
+
          PBX_BFD=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_BFD 1
@@ -19525,16 +19964,12 @@ if test "x${PBX_BFD}" != "x1" -a "${USE_BFD}" != "no"; then
          pbxlibdir="-L${BFD_DIR}"
       fi
    fi
-   pbxfuncname="bfd_check_format"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_BFD_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_bfd_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lbfd" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lbfd... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_check_format in -lbfd" >&5
+$as_echo_n "checking for bfd_check_format in -lbfd... " >&6; }
+if ${ac_cv_lib_bfd_bfd_check_format+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -19548,35 +19983,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char bfd_check_format ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return bfd_check_format ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_bfd_bfd_check_format=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_bfd_bfd_check_format=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_check_format" >&5
+$as_echo "$ac_cv_lib_bfd_bfd_check_format" >&6; }
+if test "x$ac_cv_lib_bfd_bfd_check_format" = xyes; then :
   AST_BFD_FOUND=yes
 else
   AST_BFD_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_BFD_FOUND}" = "yes"; then
@@ -19586,9 +20020,8 @@ fi
          BFD_INCLUDE="-I${BFD_DIR}/include"
       fi
       BFD_INCLUDE="${BFD_INCLUDE} "
-      if test "xbfd.h" = "x" ; then    # no header, assume found
-         BFD_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${BFD_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${BFD_HEADER_FOUND}" = "x0" ; then
          BFD_LIB=""
          BFD_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            BFD_LIB=""
-         fi
+
          PBX_BFD=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_BFD 1
@@ -19633,16 +20064,12 @@ if test "x${PBX_BFD}" != "x1" -a "${USE_BFD}" != "no"; then
          pbxlibdir="-L${BFD_DIR}"
       fi
    fi
-   pbxfuncname="bfd_check_format"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_BFD_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_bfd_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lbfd" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lbfd... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_check_format in -lbfd" >&5
+$as_echo_n "checking for bfd_check_format in -lbfd... " >&6; }
+if ${ac_cv_lib_bfd_bfd_check_format+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -19656,35 +20083,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char bfd_check_format ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return bfd_check_format ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_bfd_bfd_check_format=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_bfd_bfd_check_format=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_check_format" >&5
+$as_echo "$ac_cv_lib_bfd_bfd_check_format" >&6; }
+if test "x$ac_cv_lib_bfd_bfd_check_format" = xyes; then :
   AST_BFD_FOUND=yes
 else
   AST_BFD_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_BFD_FOUND}" = "yes"; then
@@ -19694,9 +20120,8 @@ fi
          BFD_INCLUDE="-I${BFD_DIR}/include"
       fi
       BFD_INCLUDE="${BFD_INCLUDE} "
-      if test "xbfd.h" = "x" ; then    # no header, assume found
-         BFD_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${BFD_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${BFD_HEADER_FOUND}" = "x0" ; then
          BFD_LIB=""
          BFD_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            BFD_LIB=""
-         fi
+
          PBX_BFD=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_BFD 1
@@ -19741,16 +20164,12 @@ if test "x${PBX_CAP}" != "x1" -a "${USE_CAP}" != "no"; then
          pbxlibdir="-L${CAP_DIR}"
       fi
    fi
-   pbxfuncname="cap_from_text"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_CAP_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_cap_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lcap" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lcap... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_from_text in -lcap" >&5
+$as_echo_n "checking for cap_from_text in -lcap... " >&6; }
+if ${ac_cv_lib_cap_cap_from_text+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -19764,35 +20183,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char cap_from_text ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return cap_from_text ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_cap_cap_from_text=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_cap_cap_from_text=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_from_text" >&5
+$as_echo "$ac_cv_lib_cap_cap_from_text" >&6; }
+if test "x$ac_cv_lib_cap_cap_from_text" = xyes; then :
   AST_CAP_FOUND=yes
 else
   AST_CAP_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_CAP_FOUND}" = "yes"; then
@@ -19802,9 +20220,8 @@ fi
          CAP_INCLUDE="-I${CAP_DIR}/include"
       fi
       CAP_INCLUDE="${CAP_INCLUDE} "
-      if test "xsys/capability.h" = "x" ; then # no header, assume found
-         CAP_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${CAP_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${CAP_HEADER_FOUND}" = "x0" ; then
          CAP_LIB=""
          CAP_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            CAP_LIB=""
-         fi
+
          PBX_CAP=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_CAP 1
@@ -20031,13 +20446,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
     if test "x${PBX_DAHDI_LINEREVERSE_VMWI}" != "x1" -a "${USE_DAHDI_LINEREVERSE_VMWI}" != "no"; then
-        if test "xenhanced dahdi vmwi support" != "x"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for enhanced dahdi vmwi support" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for enhanced dahdi vmwi support" >&5
 $as_echo_n "checking for enhanced dahdi vmwi support... " >&6; }
-       else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"struct dahdi_vmwi_info booger\" compiles using dahdi/user.h" >&5
-$as_echo_n "checking if \"struct dahdi_vmwi_info booger\" compiles using dahdi/user.h... " >&6; }
-       fi
        saved_cppflags="${CPPFLAGS}"
        if test "x${DAHDI_LINEREVERSE_VMWI_DIR}" != "x"; then
            DAHDI_LINEREVERSE_VMWI_INCLUDE="-I${DAHDI_LINEREVERSE_VMWI_DIR}/include"
@@ -20077,13 +20487,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
     if test "x${PBX_DAHDI_ECHOCANCEL_FAX_MODE}" != "x1" -a "${USE_DAHDI_ECHOCANCEL_FAX_MODE}" != "no"; then
-        if test "x" != "x"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for " >&5
-$as_echo_n "checking for ... " >&6; }
-       else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"int foo = DAHDI_ECHOCANCEL_FAX_MODE\" compiles using dahdi/user.h" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"int foo = DAHDI_ECHOCANCEL_FAX_MODE\" compiles using dahdi/user.h" >&5
 $as_echo_n "checking if \"int foo = DAHDI_ECHOCANCEL_FAX_MODE\" compiles using dahdi/user.h... " >&6; }
-       fi
        saved_cppflags="${CPPFLAGS}"
        if test "x${DAHDI_ECHOCANCEL_FAX_MODE_DIR}" != "x"; then
            DAHDI_ECHOCANCEL_FAX_MODE_INCLUDE="-I${DAHDI_ECHOCANCEL_FAX_MODE_DIR}/include"
@@ -20123,13 +20528,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
     if test "x${PBX_GETIFADDRS}" != "x1" -a "${USE_GETIFADDRS}" != "no"; then
-        if test "xgetifaddrs() support" != "x"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getifaddrs() support" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getifaddrs() support" >&5
 $as_echo_n "checking for getifaddrs() support... " >&6; }
-       else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"struct ifaddrs *p; getifaddrs(&p)\" compiles using ifaddrs.h" >&5
-$as_echo_n "checking if \"struct ifaddrs *p; getifaddrs(&p)\" compiles using ifaddrs.h... " >&6; }
-       fi
        saved_cppflags="${CPPFLAGS}"
        if test "x${GETIFADDRS_DIR}" != "x"; then
            GETIFADDRS_INCLUDE="-I${GETIFADDRS_DIR}/include"
@@ -20168,13 +20568,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
     if test "x${PBX_TIMERFD}" != "x1" -a "${USE_TIMERFD}" != "no"; then
-        if test "xtimerfd support" != "x"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timerfd support" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timerfd support" >&5
 $as_echo_n "checking for timerfd support... " >&6; }
-       else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"timerfd_create(0,0); timerfd_settime(0,0,NULL,NULL);\" compiles using sys/timerfd.h" >&5
-$as_echo_n "checking if \"timerfd_create(0,0); timerfd_settime(0,0,NULL,NULL);\" compiles using sys/timerfd.h... " >&6; }
-       fi
        saved_cppflags="${CPPFLAGS}"
        if test "x${TIMERFD_DIR}" != "x"; then
            TIMERFD_INCLUDE="-I${TIMERFD_DIR}/include"
    fi
 
       if test "$PBX_LIBEDIT" = "1"; then
-        LIBEDIT_INTERNAL="no"
+      LIBEDIT_INTERNAL="no"
       fi
    fi
    if test "${LIBEDIT_INTERNAL}" = "yes"; then
       PBX_LIBEDIT=1
+      LIBEDIT_IS_UNICODE=no
+   else
+
+    if test "x${PBX_LIBEDIT_IS_UNICODE}" != "x1" -a "${USE_LIBEDIT_IS_UNICODE}" != "no"; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Testing for libedit unicode support" >&5
+$as_echo_n "checking for Testing for libedit unicode support... " >&6; }
+       saved_cppflags="${CPPFLAGS}"
+       if test "x${LIBEDIT_IS_UNICODE_DIR}" != "x"; then
+           LIBEDIT_IS_UNICODE_INCLUDE="-I${LIBEDIT_IS_UNICODE_DIR}/include"
+       fi
+       CPPFLAGS="${CPPFLAGS} ${LIBEDIT_IS_UNICODE_INCLUDE}"
+
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+ #include <histedit.h>
+int
+main ()
+{
+ el_rfunc_t *callback;;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+               PBX_LIBEDIT_IS_UNICODE=1
+
+$as_echo "#define HAVE_LIBEDIT_IS_UNICODE 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
+
    fi
 fi
 
@@ -20591,16 +21028,12 @@ if test "x${PBX_ICONV}" != "x1" -a "${USE_ICONV}" != "no"; then
          pbxlibdir="-L${ICONV_DIR}"
       fi
    fi
-   pbxfuncname="iconv_open"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_ICONV_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_iconv_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -liconv" >&5
-$as_echo_n "checking for ${pbxfuncname} in -liconv... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open in -liconv" >&5
+$as_echo_n "checking for iconv_open in -liconv... " >&6; }
+if ${ac_cv_lib_iconv_iconv_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -20614,35 +21047,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char iconv_open ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return iconv_open ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_iconv_iconv_open=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_iconv_iconv_open=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv_open" >&5
+$as_echo "$ac_cv_lib_iconv_iconv_open" >&6; }
+if test "x$ac_cv_lib_iconv_iconv_open" = xyes; then :
   AST_ICONV_FOUND=yes
 else
   AST_ICONV_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_ICONV_FOUND}" = "yes"; then
@@ -20652,9 +21084,8 @@ fi
          ICONV_INCLUDE="-I${ICONV_DIR}/include"
       fi
       ICONV_INCLUDE="${ICONV_INCLUDE} "
-      if test "xiconv.h" = "x" ; then  # no header, assume found
-         ICONV_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${ICONV_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${ICONV_HEADER_FOUND}" = "x0" ; then
          ICONV_LIB=""
          ICONV_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            ICONV_LIB=""
-         fi
+
          PBX_ICONV=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_ICONV 1
@@ -20696,16 +21125,12 @@ if test "x${PBX_ICONV}" != "x1" -a "${USE_ICONV}" != "no"; then
          pbxlibdir="-L${ICONV_DIR}"
       fi
    fi
-   pbxfuncname="libiconv_open"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_ICONV_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_iconv_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -liconv" >&5
-$as_echo_n "checking for ${pbxfuncname} in -liconv... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
+$as_echo_n "checking for libiconv_open in -liconv... " >&6; }
+if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -20719,35 +21144,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char libiconv_open ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return libiconv_open ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_iconv_libiconv_open=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_iconv_libiconv_open=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5
+$as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
+if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
   AST_ICONV_FOUND=yes
 else
   AST_ICONV_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_ICONV_FOUND}" = "yes"; then
@@ -20757,9 +21181,8 @@ fi
          ICONV_INCLUDE="-I${ICONV_DIR}/include"
       fi
       ICONV_INCLUDE="${ICONV_INCLUDE} "
-      if test "xiconv.h" = "x" ; then  # no header, assume found
-         ICONV_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${ICONV_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${ICONV_HEADER_FOUND}" = "x0" ; then
          ICONV_LIB=""
          ICONV_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            ICONV_LIB=""
-         fi
+
          PBX_ICONV=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_ICONV 1
@@ -20801,16 +21222,12 @@ if test "x${PBX_ICONV}" != "x1" -a "${USE_ICONV}" != "no"; then
          pbxlibdir="-L${ICONV_DIR}"
       fi
    fi
-   pbxfuncname="iconv_close"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_ICONV_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_c_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lc" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lc... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_close in -lc" >&5
+$as_echo_n "checking for iconv_close in -lc... " >&6; }
+if ${ac_cv_lib_c_iconv_close+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -20824,35 +21241,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char iconv_close ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return iconv_close ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_c_iconv_close=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_c_iconv_close=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_iconv_close" >&5
+$as_echo "$ac_cv_lib_c_iconv_close" >&6; }
+if test "x$ac_cv_lib_c_iconv_close" = xyes; then :
   AST_ICONV_FOUND=yes
 else
   AST_ICONV_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_ICONV_FOUND}" = "yes"; then
@@ -20862,9 +21278,8 @@ fi
          ICONV_INCLUDE="-I${ICONV_DIR}/include"
       fi
       ICONV_INCLUDE="${ICONV_INCLUDE} "
-      if test "xiconv.h" = "x" ; then  # no header, assume found
-         ICONV_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${ICONV_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${ICONV_HEADER_FOUND}" = "x0" ; then
          ICONV_LIB=""
          ICONV_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            ICONV_LIB=""
-         fi
+
          PBX_ICONV=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_ICONV 1
@@ -20907,16 +21320,12 @@ if test "x${PBX_ICAL}" != "x1" -a "${USE_ICAL}" != "no"; then
          pbxlibdir="-L${ICAL_DIR}"
       fi
    fi
-   pbxfuncname="icaltimezone_get_utc_timezone"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_ICAL_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
-      as_ac_Lib=`$as_echo "ac_cv_lib_ical_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lical" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lical... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icaltimezone_get_utc_timezone in -lical" >&5
+$as_echo_n "checking for icaltimezone_get_utc_timezone in -lical... " >&6; }
+if ${ac_cv_lib_ical_icaltimezone_get_utc_timezone+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -20930,35 +21339,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char icaltimezone_get_utc_timezone ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return icaltimezone_get_utc_timezone ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_ical_icaltimezone_get_utc_timezone=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_ical_icaltimezone_get_utc_timezone=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ical_icaltimezone_get_utc_timezone" >&5
+$as_echo "$ac_cv_lib_ical_icaltimezone_get_utc_timezone" >&6; }
+if test "x$ac_cv_lib_ical_icaltimezone_get_utc_timezone" = xyes; then :
   AST_ICAL_FOUND=yes
 else
   AST_ICAL_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_ICAL_FOUND}" = "yes"; then
@@ -20968,9 +21376,8 @@ fi
          ICAL_INCLUDE="-I${ICAL_DIR}/include"
       fi
       ICAL_INCLUDE="${ICAL_INCLUDE} ${PTHREAD_CFLAGS}"
-      if test "xlibical/ical.h" = "x" ; then   # no header, assume found
-         ICAL_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${ICAL_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libical/ical.h" "ac_cv_header_libical_ical_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${ICAL_HEADER_FOUND}" = "x0" ; then
          ICAL_LIB=""
          ICAL_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            ICAL_LIB=""
-         fi
+
          PBX_ICAL=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_ICAL 1
@@ -21012,16 +21417,12 @@ if test "x${PBX_IKSEMEL}" != "x1" -a "${USE_IKSEMEL}" != "no"; then
          pbxlibdir="-L${IKSEMEL_DIR}"
       fi
    fi
-   pbxfuncname="iks_start_sasl"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_IKSEMEL_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_iksemel_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -liksemel" >&5
-$as_echo_n "checking for ${pbxfuncname} in -liksemel... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iks_start_sasl in -liksemel" >&5
+$as_echo_n "checking for iks_start_sasl in -liksemel... " >&6; }
+if ${ac_cv_lib_iksemel_iks_start_sasl+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -21035,35 +21436,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char iks_start_sasl ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return iks_start_sasl ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_iksemel_iks_start_sasl=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_iksemel_iks_start_sasl=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iksemel_iks_start_sasl" >&5
+$as_echo "$ac_cv_lib_iksemel_iks_start_sasl" >&6; }
+if test "x$ac_cv_lib_iksemel_iks_start_sasl" = xyes; then :
   AST_IKSEMEL_FOUND=yes
 else
   AST_IKSEMEL_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_IKSEMEL_FOUND}" = "yes"; then
@@ -21073,9 +21473,8 @@ fi
          IKSEMEL_INCLUDE="-I${IKSEMEL_DIR}/include"
       fi
       IKSEMEL_INCLUDE="${IKSEMEL_INCLUDE} "
-      if test "xiksemel.h" = "x" ; then        # no header, assume found
-         IKSEMEL_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${IKSEMEL_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "iksemel.h" "ac_cv_header_iksemel_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${IKSEMEL_HEADER_FOUND}" = "x0" ; then
          IKSEMEL_LIB=""
          IKSEMEL_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            IKSEMEL_LIB=""
-         fi
+
          PBX_IKSEMEL=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_IKSEMEL 1
@@ -21745,16 +22142,12 @@ if test "x${PBX_IODBC}" != "x1" -a "${USE_IODBC}" != "no"; then
          pbxlibdir="-L${IODBC_DIR}"
       fi
    fi
-   pbxfuncname="SQLConnect"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_IODBC_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
-      as_ac_Lib=`$as_echo "ac_cv_lib_iodbc_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -liodbc" >&5
-$as_echo_n "checking for ${pbxfuncname} in -liodbc... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -liodbc" >&5
+$as_echo_n "checking for SQLConnect in -liodbc... " >&6; }
+if ${ac_cv_lib_iodbc_SQLConnect+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -21768,35 +22161,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char SQLConnect ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return SQLConnect ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_iodbc_SQLConnect=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_iodbc_SQLConnect=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLConnect" >&5
+$as_echo "$ac_cv_lib_iodbc_SQLConnect" >&6; }
+if test "x$ac_cv_lib_iodbc_SQLConnect" = xyes; then :
   AST_IODBC_FOUND=yes
 else
   AST_IODBC_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_IODBC_FOUND}" = "yes"; then
@@ -21806,9 +22198,8 @@ fi
          IODBC_INCLUDE="-I${IODBC_DIR}/include"
       fi
       IODBC_INCLUDE="${IODBC_INCLUDE} ${PTHREAD_CFLAGS}"
-      if test "xsql.h" = "x" ; then    # no header, assume found
-         IODBC_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${IODBC_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "sql.h" "ac_cv_header_sql_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${IODBC_HEADER_FOUND}" = "x0" ; then
          IODBC_LIB=""
          IODBC_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            IODBC_LIB=""
-         fi
+
          PBX_IODBC=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_IODBC 1
@@ -21850,16 +22239,12 @@ if test "x${PBX_INOTIFY}" != "x1" -a "${USE_INOTIFY}" != "no"; then
          pbxlibdir="-L${INOTIFY_DIR}"
       fi
    fi
-   pbxfuncname="inotify_init"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_INOTIFY_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_c_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lc" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lc... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inotify_init in -lc" >&5
+$as_echo_n "checking for inotify_init in -lc... " >&6; }
+if ${ac_cv_lib_c_inotify_init+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -21873,35 +22258,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char inotify_init ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return inotify_init ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_c_inotify_init=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_c_inotify_init=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inotify_init" >&5
+$as_echo "$ac_cv_lib_c_inotify_init" >&6; }
+if test "x$ac_cv_lib_c_inotify_init" = xyes; then :
   AST_INOTIFY_FOUND=yes
 else
   AST_INOTIFY_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_INOTIFY_FOUND}" = "yes"; then
@@ -21911,9 +22295,8 @@ fi
          INOTIFY_INCLUDE="-I${INOTIFY_DIR}/include"
       fi
       INOTIFY_INCLUDE="${INOTIFY_INCLUDE} "
-      if test "xsys/inotify.h" = "x" ; then    # no header, assume found
-         INOTIFY_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${INOTIFY_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "sys/inotify.h" "ac_cv_header_sys_inotify_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${INOTIFY_HEADER_FOUND}" = "x0" ; then
          INOTIFY_LIB=""
          INOTIFY_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            INOTIFY_LIB=""
-         fi
+
          PBX_INOTIFY=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_INOTIFY 1
@@ -21955,16 +22336,12 @@ if test "x${PBX_JACK}" != "x1" -a "${USE_JACK}" != "no"; then
          pbxlibdir="-L${JACK_DIR}"
       fi
    fi
-   pbxfuncname="jack_activate"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_JACK_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_jack_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -ljack" >&5
-$as_echo_n "checking for ${pbxfuncname} in -ljack... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jack_activate in -ljack" >&5
+$as_echo_n "checking for jack_activate in -ljack... " >&6; }
+if ${ac_cv_lib_jack_jack_activate+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -21978,35 +22355,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char jack_activate ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return jack_activate ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_jack_jack_activate=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_jack_jack_activate=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jack_jack_activate" >&5
+$as_echo "$ac_cv_lib_jack_jack_activate" >&6; }
+if test "x$ac_cv_lib_jack_jack_activate" = xyes; then :
   AST_JACK_FOUND=yes
 else
   AST_JACK_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_JACK_FOUND}" = "yes"; then
@@ -22016,9 +22392,8 @@ fi
          JACK_INCLUDE="-I${JACK_DIR}/include"
       fi
       JACK_INCLUDE="${JACK_INCLUDE} "
-      if test "xjack/jack.h" = "x" ; then      # no header, assume found
-         JACK_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${JACK_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "jack/jack.h" "ac_cv_header_jack_jack_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${JACK_HEADER_FOUND}" = "x0" ; then
          JACK_LIB=""
          JACK_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            JACK_LIB=""
-         fi
+
          PBX_JACK=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_JACK 1
@@ -22061,16 +22434,12 @@ if test "x${PBX_KQUEUE}" != "x1" -a "${USE_KQUEUE}" != "no"; then
          pbxlibdir="-L${KQUEUE_DIR}"
       fi
    fi
-   pbxfuncname="kqueue"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_KQUEUE_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_c_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lc" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lc... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kqueue in -lc" >&5
+$as_echo_n "checking for kqueue in -lc... " >&6; }
+if ${ac_cv_lib_c_kqueue+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -22084,35 +22453,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char kqueue ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return kqueue ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_c_kqueue=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_c_kqueue=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_kqueue" >&5
+$as_echo "$ac_cv_lib_c_kqueue" >&6; }
+if test "x$ac_cv_lib_c_kqueue" = xyes; then :
   AST_KQUEUE_FOUND=yes
 else
   AST_KQUEUE_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_KQUEUE_FOUND}" = "yes"; then
@@ -22122,9 +22490,8 @@ fi
          KQUEUE_INCLUDE="-I${KQUEUE_DIR}/include"
       fi
       KQUEUE_INCLUDE="${KQUEUE_INCLUDE} "
-      if test "xsys/event.h" = "x" ; then      # no header, assume found
-         KQUEUE_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${KQUEUE_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${KQUEUE_HEADER_FOUND}" = "x0" ; then
          KQUEUE_LIB=""
          KQUEUE_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            KQUEUE_LIB=""
-         fi
+
          PBX_KQUEUE=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_KQUEUE 1
@@ -22180,16 +22545,12 @@ if test "x${PBX_LTDL}" != "x1" -a "${USE_LTDL}" != "no"; then
          pbxlibdir="-L${LTDL_DIR}"
       fi
    fi
-   pbxfuncname="lt_dlinit"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_LTDL_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_ltdl_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lltdl" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lltdl... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dlinit in -lltdl" >&5
+$as_echo_n "checking for lt_dlinit in -lltdl... " >&6; }
+if ${ac_cv_lib_ltdl_lt_dlinit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -22203,35 +22564,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char lt_dlinit ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return lt_dlinit ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_ltdl_lt_dlinit=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_ltdl_lt_dlinit=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dlinit" >&5
+$as_echo "$ac_cv_lib_ltdl_lt_dlinit" >&6; }
+if test "x$ac_cv_lib_ltdl_lt_dlinit" = xyes; then :
   AST_LTDL_FOUND=yes
 else
   AST_LTDL_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_LTDL_FOUND}" = "yes"; then
@@ -22241,9 +22601,8 @@ fi
          LTDL_INCLUDE="-I${LTDL_DIR}/include"
       fi
       LTDL_INCLUDE="${LTDL_INCLUDE} "
-      if test "xltdl.h" = "x" ; then   # no header, assume found
-         LTDL_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${LTDL_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${LTDL_HEADER_FOUND}" = "x0" ; then
          LTDL_LIB=""
          LTDL_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            LTDL_LIB=""
-         fi
+
          PBX_LTDL=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_LTDL 1
@@ -22285,16 +22642,12 @@ if test "x${PBX_LDAP}" != "x1" -a "${USE_LDAP}" != "no"; then
          pbxlibdir="-L${LDAP_DIR}"
       fi
    fi
-   pbxfuncname="ldap_initialize"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_LDAP_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_ldap_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lldap" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lldap... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap" >&5
+$as_echo_n "checking for ldap_initialize in -lldap... " >&6; }
+if ${ac_cv_lib_ldap_ldap_initialize+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -22308,35 +22661,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char ldap_initialize ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return ldap_initialize ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_ldap_ldap_initialize=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_ldap_ldap_initialize=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_initialize" >&5
+$as_echo "$ac_cv_lib_ldap_ldap_initialize" >&6; }
+if test "x$ac_cv_lib_ldap_ldap_initialize" = xyes; then :
   AST_LDAP_FOUND=yes
 else
   AST_LDAP_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_LDAP_FOUND}" = "yes"; then
@@ -22346,9 +22698,8 @@ fi
          LDAP_INCLUDE="-I${LDAP_DIR}/include"
       fi
       LDAP_INCLUDE="${LDAP_INCLUDE} "
-      if test "xldap.h" = "x" ; then   # no header, assume found
-         LDAP_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${LDAP_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${LDAP_HEADER_FOUND}" = "x0" ; then
          LDAP_LIB=""
          LDAP_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            LDAP_LIB=""
-         fi
+
          PBX_LDAP=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_LDAP 1
@@ -22390,16 +22739,12 @@ if test "x${PBX_MISDN}" != "x1" -a "${USE_MISDN}" != "no"; then
          pbxlibdir="-L${MISDN_DIR}"
       fi
    fi
-   pbxfuncname="mISDN_open"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_MISDN_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_mISDN_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lmISDN" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lmISDN... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mISDN_open in -lmISDN" >&5
+$as_echo_n "checking for mISDN_open in -lmISDN... " >&6; }
+if ${ac_cv_lib_mISDN_mISDN_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -22413,35 +22758,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char mISDN_open ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return mISDN_open ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_mISDN_mISDN_open=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_mISDN_mISDN_open=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mISDN_mISDN_open" >&5
+$as_echo "$ac_cv_lib_mISDN_mISDN_open" >&6; }
+if test "x$ac_cv_lib_mISDN_mISDN_open" = xyes; then :
   AST_MISDN_FOUND=yes
 else
   AST_MISDN_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_MISDN_FOUND}" = "yes"; then
@@ -22451,9 +22795,8 @@ fi
          MISDN_INCLUDE="-I${MISDN_DIR}/include"
       fi
       MISDN_INCLUDE="${MISDN_INCLUDE} "
-      if test "xmISDNuser/mISDNlib.h" = "x" ; then     # no header, assume found
-         MISDN_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${MISDN_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "mISDNuser/mISDNlib.h" "ac_cv_header_mISDNuser_mISDNlib_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${MISDN_HEADER_FOUND}" = "x0" ; then
          MISDN_LIB=""
          MISDN_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            MISDN_LIB=""
-         fi
+
          PBX_MISDN=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_MISDN 1
@@ -22496,16 +22837,12 @@ if test "x${PBX_ISDNNET}" != "x1" -a "${USE_ISDNNET}" != "no"; then
          pbxlibdir="-L${ISDNNET_DIR}"
       fi
    fi
-   pbxfuncname="init_manager"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_ISDNNET_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_isdnnet_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lisdnnet" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lisdnnet... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for init_manager in -lisdnnet" >&5
+$as_echo_n "checking for init_manager in -lisdnnet... " >&6; }
+if ${ac_cv_lib_isdnnet_init_manager+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -22519,35 +22856,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char init_manager ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return init_manager ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_isdnnet_init_manager=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_isdnnet_init_manager=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_isdnnet_init_manager" >&5
+$as_echo "$ac_cv_lib_isdnnet_init_manager" >&6; }
+if test "x$ac_cv_lib_isdnnet_init_manager" = xyes; then :
   AST_ISDNNET_FOUND=yes
 else
   AST_ISDNNET_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_ISDNNET_FOUND}" = "yes"; then
@@ -22557,9 +22893,8 @@ fi
          ISDNNET_INCLUDE="-I${ISDNNET_DIR}/include"
       fi
       ISDNNET_INCLUDE="${ISDNNET_INCLUDE} "
-      if test "xmISDNuser/isdn_net.h" = "x" ; then     # no header, assume found
-         ISDNNET_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${ISDNNET_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "mISDNuser/isdn_net.h" "ac_cv_header_mISDNuser_isdn_net_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${ISDNNET_HEADER_FOUND}" = "x0" ; then
          ISDNNET_LIB=""
          ISDNNET_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            ISDNNET_LIB=""
-         fi
+
          PBX_ISDNNET=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_ISDNNET 1
@@ -22600,16 +22933,12 @@ if test "x${PBX_SUPPSERV}" != "x1" -a "${USE_SUPPSERV}" != "no"; then
          pbxlibdir="-L${SUPPSERV_DIR}"
       fi
    fi
-   pbxfuncname="encodeFac"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_SUPPSERV_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_suppserv_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lsuppserv" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lsuppserv... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for encodeFac in -lsuppserv" >&5
+$as_echo_n "checking for encodeFac in -lsuppserv... " >&6; }
+if ${ac_cv_lib_suppserv_encodeFac+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -22623,35 +22952,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char encodeFac ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return encodeFac ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_suppserv_encodeFac=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_suppserv_encodeFac=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_suppserv_encodeFac" >&5
+$as_echo "$ac_cv_lib_suppserv_encodeFac" >&6; }
+if test "x$ac_cv_lib_suppserv_encodeFac" = xyes; then :
   AST_SUPPSERV_FOUND=yes
 else
   AST_SUPPSERV_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_SUPPSERV_FOUND}" = "yes"; then
@@ -22661,9 +22989,8 @@ fi
          SUPPSERV_INCLUDE="-I${SUPPSERV_DIR}/include"
       fi
       SUPPSERV_INCLUDE="${SUPPSERV_INCLUDE} "
-      if test "xmISDNuser/suppserv.h" = "x" ; then     # no header, assume found
-         SUPPSERV_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${SUPPSERV_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "mISDNuser/suppserv.h" "ac_cv_header_mISDNuser_suppserv_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${SUPPSERV_HEADER_FOUND}" = "x0" ; then
          SUPPSERV_LIB=""
          SUPPSERV_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            SUPPSERV_LIB=""
-         fi
+
          PBX_SUPPSERV=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_SUPPSERV 1
@@ -22909,47 +23234,18 @@ else
 fi
 
                if test ! "x${CONFIG_MYSQLCLIENT}" = xNo; then
-                       if test x"" = x ; then A=--cflags ; else A="" ; fi
-                       MYSQLCLIENT_INCLUDE=$(${CONFIG_MYSQLCLIENT} $A)
+                       MYSQLCLIENT_INCLUDE=$(${CONFIG_MYSQLCLIENT} --cflags)
                        MYSQLCLIENT_INCLUDE=$(echo ${MYSQLCLIENT_INCLUDE} | $SED -e "s|-I|-I${MYSQLCLIENT_DIR}|g")
 
-                       if test x"" = x ; then A=--libs ; else A="" ; fi
-                       MYSQLCLIENT_LIB=$(${CONFIG_MYSQLCLIENT} $A)
+                       MYSQLCLIENT_LIB=$(${CONFIG_MYSQLCLIENT} --libs)
                        MYSQLCLIENT_LIB=$(echo ${MYSQLCLIENT_LIB} | $SED -e "s|-L|-L${MYSQLCLIENT_DIR}|g")
 
-                       if test x"" != x ; then
-                               saved_cppflags="${CPPFLAGS}"
-                               CPPFLAGS="${CPPFLAGS} ${MYSQLCLIENT_INCLUDE}"
 
-                               saved_libs="${LIBS}"
-                               LIBS=${MYSQLCLIENT_LIB}
-
-                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
- ;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-   PBX_MYSQLCLIENT=1
-$as_echo "#define HAVE_MYSQLCLIENT 1" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-                               CPPFLAGS="${saved_cppflags}"
-                               LIBS="${saved_libs}"
-                       else
                                PBX_MYSQLCLIENT=1
 
 $as_echo "#define HAVE_MYSQLCLIENT 1" >>confdefs.h
 
-                       fi
+
                fi
        fi
 
@@ -22965,16 +23261,12 @@ if test "x${PBX_NBS}" != "x1" -a "${USE_NBS}" != "no"; then
          pbxlibdir="-L${NBS_DIR}"
       fi
    fi
-   pbxfuncname="nbs_connect"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_NBS_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_nbs_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lnbs" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lnbs... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nbs_connect in -lnbs" >&5
+$as_echo_n "checking for nbs_connect in -lnbs... " >&6; }
+if ${ac_cv_lib_nbs_nbs_connect+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -22988,35 +23280,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char nbs_connect ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return nbs_connect ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_nbs_nbs_connect=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_nbs_nbs_connect=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nbs_nbs_connect" >&5
+$as_echo "$ac_cv_lib_nbs_nbs_connect" >&6; }
+if test "x$ac_cv_lib_nbs_nbs_connect" = xyes; then :
   AST_NBS_FOUND=yes
 else
   AST_NBS_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_NBS_FOUND}" = "yes"; then
@@ -23026,9 +23317,8 @@ fi
          NBS_INCLUDE="-I${NBS_DIR}/include"
       fi
       NBS_INCLUDE="${NBS_INCLUDE} "
-      if test "xnbs.h" = "x" ; then    # no header, assume found
-         NBS_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${NBS_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "nbs.h" "ac_cv_header_nbs_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${NBS_HEADER_FOUND}" = "x0" ; then
          NBS_LIB=""
          NBS_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            NBS_LIB=""
-         fi
+
          PBX_NBS=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_NBS 1
@@ -23163,47 +23451,18 @@ else
 fi
 
                if test ! "x${CONFIG_NEON}" = xNo; then
-                       if test x"" = x ; then A=--cflags ; else A="" ; fi
-                       NEON_INCLUDE=$(${CONFIG_NEON} $A)
+                       NEON_INCLUDE=$(${CONFIG_NEON} --cflags)
                        NEON_INCLUDE=$(echo ${NEON_INCLUDE} | $SED -e "s|-I|-I${NEON_DIR}|g")
 
-                       if test x"" = x ; then A=--libs ; else A="" ; fi
-                       NEON_LIB=$(${CONFIG_NEON} $A)
+                       NEON_LIB=$(${CONFIG_NEON} --libs)
                        NEON_LIB=$(echo ${NEON_LIB} | $SED -e "s|-L|-L${NEON_DIR}|g")
 
-                       if test x"" != x ; then
-                               saved_cppflags="${CPPFLAGS}"
-                               CPPFLAGS="${CPPFLAGS} ${NEON_INCLUDE}"
-
-                               saved_libs="${LIBS}"
-                               LIBS=${NEON_LIB}
-
-                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int
-main ()
-{
- ;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-   PBX_NEON=1
-$as_echo "#define HAVE_NEON 1" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-                               CPPFLAGS="${saved_cppflags}"
-                               LIBS="${saved_libs}"
-                       else
                                PBX_NEON=1
 
 $as_echo "#define HAVE_NEON 1" >>confdefs.h
 
-                       fi
+
                fi
        fi
 
@@ -23312,15 +23571,13 @@ else
 fi
 
                if test ! "x${CONFIG_NEON29}" = xNo; then
-                       if test x"" = x ; then A=--cflags ; else A="" ; fi
-                       NEON29_INCLUDE=$(${CONFIG_NEON29} $A)
+                       NEON29_INCLUDE=$(${CONFIG_NEON29} --cflags)
                        NEON29_INCLUDE=$(echo ${NEON29_INCLUDE} | $SED -e "s|-I|-I${NEON29_DIR}|g")
 
-                       if test x"--libs" = x ; then A=--libs ; else A="--libs" ; fi
-                       NEON29_LIB=$(${CONFIG_NEON29} $A)
+                       NEON29_LIB=$(${CONFIG_NEON29} --libs)
                        NEON29_LIB=$(echo ${NEON29_LIB} | $SED -e "s|-L|-L${NEON29_DIR}|g")
 
-                       if test x"#include <ne_auth.h>" != x ; then
+
                                saved_cppflags="${CPPFLAGS}"
                                CPPFLAGS="${CPPFLAGS} ${NEON29_INCLUDE}"
 
@@ -23349,12 +23606,7 @@ rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
                                CPPFLAGS="${saved_cppflags}"
                                LIBS="${saved_libs}"
-                       else
-                               PBX_NEON29=1
 
-$as_echo "#define HAVE_NEON29 1" >>confdefs.h
-
-                       fi
                fi
        fi
 
@@ -23463,17 +23715,13 @@ else
 fi
 
                if test ! "x${CONFIG_NETSNMP}" = xNo; then
-                       if test x"" = x ; then A=--cflags ; else A="" ; fi
-                       NETSNMP_INCLUDE=$(${CONFIG_NETSNMP} $A)
+                       NETSNMP_INCLUDE=$(${CONFIG_NETSNMP} --cflags)
                        NETSNMP_INCLUDE=$(echo ${NETSNMP_INCLUDE} | $SED -e "s|-I|-I${NETSNMP_DIR}|g")
 
-                       if test x"--agent-libs" = x ; then A=--libs ; else A="--agent-libs" ; fi
-                       NETSNMP_LIB=$(${CONFIG_NETSNMP} $A)
+                       NETSNMP_LIB=$(${CONFIG_NETSNMP} --agent-libs)
                        NETSNMP_LIB=$(echo ${NETSNMP_LIB} | $SED -e "s|-L|-L${NETSNMP_DIR}|g")
 
-                       if test x"#include <net-snmp/net-snmp-config.h>
-#include <net-snmp/net-snmp-includes.h>
-#include <net-snmp/agent/net-snmp-agent-includes.h>" != x ; then
+
                                saved_cppflags="${CPPFLAGS}"
                                CPPFLAGS="${CPPFLAGS} ${NETSNMP_INCLUDE}"
 
@@ -23502,12 +23750,7 @@ rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
                                CPPFLAGS="${saved_cppflags}"
                                LIBS="${saved_libs}"
-                       else
-                               PBX_NETSNMP=1
-
-$as_echo "#define HAVE_NETSNMP 1" >>confdefs.h
 
-                       fi
                fi
        fi
 
@@ -23523,16 +23766,12 @@ if test "x${PBX_NEWT}" != "x1" -a "${USE_NEWT}" != "no"; then
          pbxlibdir="-L${NEWT_DIR}"
       fi
    fi
-   pbxfuncname="newtBell"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_NEWT_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_newt_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lnewt" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lnewt... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for newtBell in -lnewt" >&5
+$as_echo_n "checking for newtBell in -lnewt... " >&6; }
+if ${ac_cv_lib_newt_newtBell+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -23546,35 +23785,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char newtBell ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return newtBell ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_newt_newtBell=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_newt_newtBell=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_newt_newtBell" >&5
+$as_echo "$ac_cv_lib_newt_newtBell" >&6; }
+if test "x$ac_cv_lib_newt_newtBell" = xyes; then :
   AST_NEWT_FOUND=yes
 else
   AST_NEWT_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_NEWT_FOUND}" = "yes"; then
@@ -23584,9 +23822,8 @@ fi
          NEWT_INCLUDE="-I${NEWT_DIR}/include"
       fi
       NEWT_INCLUDE="${NEWT_INCLUDE} "
-      if test "xnewt.h" = "x" ; then   # no header, assume found
-         NEWT_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${NEWT_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "newt.h" "ac_cv_header_newt_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${NEWT_HEADER_FOUND}" = "x0" ; then
          NEWT_LIB=""
          NEWT_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            NEWT_LIB=""
-         fi
+
          PBX_NEWT=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_NEWT 1
@@ -23635,16 +23870,12 @@ if test "x${PBX_UNBOUND}" != "x1" -a "${USE_UNBOUND}" != "no"; then
          pbxlibdir="-L${UNBOUND_DIR}"
       fi
    fi
-   pbxfuncname="ub_ctx_add_ta_autr"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_UNBOUND_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_unbound_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lunbound" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lunbound... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ub_ctx_delete in -lunbound" >&5
+$as_echo_n "checking for ub_ctx_delete in -lunbound... " >&6; }
+if ${ac_cv_lib_unbound_ub_ctx_delete+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -23658,35 +23889,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char ub_ctx_delete ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return ub_ctx_delete ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_unbound_ub_ctx_delete=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_unbound_ub_ctx_delete=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unbound_ub_ctx_delete" >&5
+$as_echo "$ac_cv_lib_unbound_ub_ctx_delete" >&6; }
+if test "x$ac_cv_lib_unbound_ub_ctx_delete" = xyes; then :
   AST_UNBOUND_FOUND=yes
 else
   AST_UNBOUND_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_UNBOUND_FOUND}" = "yes"; then
@@ -23696,9 +23926,8 @@ fi
          UNBOUND_INCLUDE="-I${UNBOUND_DIR}/include"
       fi
       UNBOUND_INCLUDE="${UNBOUND_INCLUDE} "
-      if test "xunbound.h" = "x" ; then        # no header, assume found
-         UNBOUND_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${UNBOUND_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "unbound.h" "ac_cv_header_unbound_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${UNBOUND_HEADER_FOUND}" = "x0" ; then
          UNBOUND_LIB=""
          UNBOUND_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            UNBOUND_LIB=""
-         fi
+
          PBX_UNBOUND=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_UNBOUND 1
 
 
 
+    if test "x${PBX_UNBOUND_CONST_PARAMS}" != "x1" -a "${USE_UNBOUND_CONST_PARAMS}" != "no"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNBOUND_VERSION_MAJOR declared in unbound.h" >&5
+$as_echo_n "checking for UNBOUND_VERSION_MAJOR declared in unbound.h... " >&6; }
+        saved_cppflags="${CPPFLAGS}"
+        if test "x${UNBOUND_CONST_PARAMS_DIR}" != "x"; then
+            UNBOUND_CONST_PARAMS_INCLUDE="-I${UNBOUND_CONST_PARAMS_DIR}/include"
+        fi
+        CPPFLAGS="${CPPFLAGS} ${UNBOUND_CONST_PARAMS_INCLUDE}"
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+ #include <unbound.h>
+int
+main ()
+{
+#if !defined(UNBOUND_VERSION_MAJOR)
+                                    (void) UNBOUND_VERSION_MAJOR;
+                                #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                PBX_UNBOUND_CONST_PARAMS=1
+
+$as_echo "#define HAVE_UNBOUND_CONST_PARAMS 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_UNIXODBC}" != "x1" -a "${USE_UNIXODBC}" != "no"; then
    pbxlibdir=""
@@ -23740,16 +24010,12 @@ if test "x${PBX_UNIXODBC}" != "x1" -a "${USE_UNIXODBC}" != "no"; then
          pbxlibdir="-L${UNIXODBC_DIR}"
       fi
    fi
-   pbxfuncname="SQLConnect"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_UNIXODBC_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_odbc_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lodbc" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lodbc... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLConnect in -lodbc" >&5
+$as_echo_n "checking for SQLConnect in -lodbc... " >&6; }
+if ${ac_cv_lib_odbc_SQLConnect+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -23763,35 +24029,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char SQLConnect ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return SQLConnect ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_odbc_SQLConnect=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_odbc_SQLConnect=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLConnect" >&5
+$as_echo "$ac_cv_lib_odbc_SQLConnect" >&6; }
+if test "x$ac_cv_lib_odbc_SQLConnect" = xyes; then :
   AST_UNIXODBC_FOUND=yes
 else
   AST_UNIXODBC_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_UNIXODBC_FOUND}" = "yes"; then
@@ -23801,9 +24066,8 @@ fi
          UNIXODBC_INCLUDE="-I${UNIXODBC_DIR}/include"
       fi
       UNIXODBC_INCLUDE="${UNIXODBC_INCLUDE} "
-      if test "xsql.h" = "x" ; then    # no header, assume found
-         UNIXODBC_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${UNIXODBC_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "sql.h" "ac_cv_header_sql_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${UNIXODBC_HEADER_FOUND}" = "x0" ; then
          UNIXODBC_LIB=""
          UNIXODBC_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            UNIXODBC_LIB=""
-         fi
+
          PBX_UNIXODBC=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_UNIXODBC 1
@@ -23845,16 +24107,12 @@ if test "x${PBX_OGG}" != "x1" -a "${USE_OGG}" != "no"; then
          pbxlibdir="-L${OGG_DIR}"
       fi
    fi
-   pbxfuncname="ogg_sync_init"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_OGG_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_ogg_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -logg" >&5
-$as_echo_n "checking for ${pbxfuncname} in -logg... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ogg_sync_init in -logg" >&5
+$as_echo_n "checking for ogg_sync_init in -logg... " >&6; }
+if ${ac_cv_lib_ogg_ogg_sync_init+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -23868,35 +24126,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char ogg_sync_init ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return ogg_sync_init ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_ogg_ogg_sync_init=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_ogg_ogg_sync_init=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ogg_ogg_sync_init" >&5
+$as_echo "$ac_cv_lib_ogg_ogg_sync_init" >&6; }
+if test "x$ac_cv_lib_ogg_ogg_sync_init" = xyes; then :
   AST_OGG_FOUND=yes
 else
   AST_OGG_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_OGG_FOUND}" = "yes"; then
          OGG_INCLUDE="-I${OGG_DIR}/include"
       fi
       OGG_INCLUDE="${OGG_INCLUDE} "
-      if test "x" = "x" ; then # no header, assume found
-         OGG_HEADER_FOUND="1"
-      else                             # check for the header
-         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${OGG_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "" "ac_cv_header_" "$ac_includes_default"
-if test "x$ac_cv_header_" = xyes; then :
-  OGG_HEADER_FOUND=1
-else
-  OGG_HEADER_FOUND=0
-fi
 
+         # no header, assume found
+         OGG_HEADER_FOUND="1"
 
-         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
       if test "x${OGG_HEADER_FOUND}" = "x0" ; then
          OGG_LIB=""
          OGG_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            OGG_LIB=""
-         fi
+
          PBX_OGG=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_OGG 1
@@ -23951,16 +24195,12 @@ if test "x${PBX_BKTR}" != "x1" -a "${USE_BKTR}" != "no"; then
          pbxlibdir="-L${BKTR_DIR}"
       fi
    fi
-   pbxfuncname="backtrace"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_BKTR_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_execinfo_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lexecinfo" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lexecinfo... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lexecinfo" >&5
+$as_echo_n "checking for backtrace in -lexecinfo... " >&6; }
+if ${ac_cv_lib_execinfo_backtrace+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -23974,35 +24214,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char backtrace ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return backtrace ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_execinfo_backtrace=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_execinfo_backtrace=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_execinfo_backtrace" >&5
+$as_echo "$ac_cv_lib_execinfo_backtrace" >&6; }
+if test "x$ac_cv_lib_execinfo_backtrace" = xyes; then :
   AST_BKTR_FOUND=yes
 else
   AST_BKTR_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_BKTR_FOUND}" = "yes"; then
@@ -24012,9 +24251,8 @@ fi
          BKTR_INCLUDE="-I${BKTR_DIR}/include"
       fi
       BKTR_INCLUDE="${BKTR_INCLUDE} "
-      if test "xexecinfo.h" = "x" ; then       # no header, assume found
-         BKTR_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${BKTR_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${BKTR_HEADER_FOUND}" = "x0" ; then
          BKTR_LIB=""
          BKTR_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            BKTR_LIB=""
-         fi
+
          PBX_BKTR=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_BKTR 1
@@ -24056,16 +24292,12 @@ if test "x${PBX_BKTR}" != "x1" -a "${USE_BKTR}" != "no"; then
          pbxlibdir="-L${BKTR_DIR}"
       fi
    fi
-   pbxfuncname="backtrace"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_BKTR_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_c_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lc" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lc... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lc" >&5
+$as_echo_n "checking for backtrace in -lc... " >&6; }
+if ${ac_cv_lib_c_backtrace+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -24079,35 +24311,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char backtrace ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return backtrace ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_c_backtrace=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_c_backtrace=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_backtrace" >&5
+$as_echo "$ac_cv_lib_c_backtrace" >&6; }
+if test "x$ac_cv_lib_c_backtrace" = xyes; then :
   AST_BKTR_FOUND=yes
 else
   AST_BKTR_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_BKTR_FOUND}" = "yes"; then
@@ -24117,9 +24348,8 @@ fi
          BKTR_INCLUDE="-I${BKTR_DIR}/include"
       fi
       BKTR_INCLUDE="${BKTR_INCLUDE} "
-      if test "xexecinfo.h" = "x" ; then       # no header, assume found
-         BKTR_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${BKTR_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${BKTR_HEADER_FOUND}" = "x0" ; then
          BKTR_LIB=""
          BKTR_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            BKTR_LIB=""
-         fi
+
          PBX_BKTR=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_BKTR 1
@@ -24161,16 +24389,12 @@ if test "x${PBX_BLUETOOTH}" != "x1" -a "${USE_BLUETOOTH}" != "no"; then
          pbxlibdir="-L${BLUETOOTH_DIR}"
       fi
    fi
-   pbxfuncname="ba2str"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_BLUETOOTH_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_bluetooth_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lbluetooth" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lbluetooth... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ba2str in -lbluetooth" >&5
+$as_echo_n "checking for ba2str in -lbluetooth... " >&6; }
+if ${ac_cv_lib_bluetooth_ba2str+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -24184,35 +24408,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char ba2str ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return ba2str ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_bluetooth_ba2str=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_bluetooth_ba2str=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bluetooth_ba2str" >&5
+$as_echo "$ac_cv_lib_bluetooth_ba2str" >&6; }
+if test "x$ac_cv_lib_bluetooth_ba2str" = xyes; then :
   AST_BLUETOOTH_FOUND=yes
 else
   AST_BLUETOOTH_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_BLUETOOTH_FOUND}" = "yes"; then
@@ -24222,9 +24445,8 @@ fi
          BLUETOOTH_INCLUDE="-I${BLUETOOTH_DIR}/include"
       fi
       BLUETOOTH_INCLUDE="${BLUETOOTH_INCLUDE} "
-      if test "xbluetooth/bluetooth.h" = "x" ; then    # no header, assume found
-         BLUETOOTH_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${BLUETOOTH_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${BLUETOOTH_HEADER_FOUND}" = "x0" ; then
          BLUETOOTH_LIB=""
          BLUETOOTH_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            BLUETOOTH_LIB=""
-         fi
+
          PBX_BLUETOOTH=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_BLUETOOTH 1
 
 
 
+
+if test "x${PBX_BEANSTALK}" != "x1" -a "${USE_BEANSTALK}" != "no"; then
+   pbxlibdir=""
+   # if --with-BEANSTALK=DIR has been specified, use it.
+   if test "x${BEANSTALK_DIR}" != "x"; then
+      if test -d ${BEANSTALK_DIR}/lib; then
+         pbxlibdir="-L${BEANSTALK_DIR}/lib"
+      else
+         pbxlibdir="-L${BEANSTALK_DIR}"
+      fi
+   fi
+
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} "
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bs_version in -lbeanstalk" >&5
+$as_echo_n "checking for bs_version in -lbeanstalk... " >&6; }
+if ${ac_cv_lib_beanstalk_bs_version+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbeanstalk ${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 bs_version ();
+int
+main ()
+{
+return bs_version ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_beanstalk_bs_version=yes
+else
+  ac_cv_lib_beanstalk_bs_version=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_beanstalk_bs_version" >&5
+$as_echo "$ac_cv_lib_beanstalk_bs_version" >&6; }
+if test "x$ac_cv_lib_beanstalk_bs_version" = xyes; then :
+  AST_BEANSTALK_FOUND=yes
+else
+  AST_BEANSTALK_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+
+
+   # now check for the header.
+   if test "${AST_BEANSTALK_FOUND}" = "yes"; then
+      BEANSTALK_LIB="${pbxlibdir} -lbeanstalk "
+      # if --with-BEANSTALK=DIR has been specified, use it.
+      if test "x${BEANSTALK_DIR}" != "x"; then
+         BEANSTALK_INCLUDE="-I${BEANSTALK_DIR}/include"
+      fi
+      BEANSTALK_INCLUDE="${BEANSTALK_INCLUDE} "
+
+         # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${BEANSTALK_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "beanstalk.h" "ac_cv_header_beanstalk_h" "$ac_includes_default"
+if test "x$ac_cv_header_beanstalk_h" = xyes; then :
+  BEANSTALK_HEADER_FOUND=1
+else
+  BEANSTALK_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+
+      if test "x${BEANSTALK_HEADER_FOUND}" = "x0" ; then
+         BEANSTALK_LIB=""
+         BEANSTALK_INCLUDE=""
+      else
+
+         PBX_BEANSTALK=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_BEANSTALK 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
 # possible places for oss definitions
 
 if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
@@ -24267,16 +24584,124 @@ if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
          pbxlibdir="-L${OSS_DIR}"
       fi
    fi
-   pbxfuncname=""
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+
+      # empty lib, assume only headers
       AST_OSS_FOUND=yes
-   else
+
+
+   # now check for the header.
+   if test "${AST_OSS_FOUND}" = "yes"; then
+      OSS_LIB="${pbxlibdir} -lossaudio "
+      # if --with-OSS=DIR has been specified, use it.
+      if test "x${OSS_DIR}" != "x"; then
+         OSS_INCLUDE="-I${OSS_DIR}/include"
+      fi
+      OSS_INCLUDE="${OSS_INCLUDE} "
+
+         # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${OSS_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "linux/soundcard.h" "ac_cv_header_linux_soundcard_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_soundcard_h" = xyes; then :
+  OSS_HEADER_FOUND=1
+else
+  OSS_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+
+      if test "x${OSS_HEADER_FOUND}" = "x0" ; then
+         OSS_LIB=""
+         OSS_INCLUDE=""
+      else
+
+            # only checking headers -> no library
+            OSS_LIB=""
+
+         PBX_OSS=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_OSS 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
+if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
+   pbxlibdir=""
+   # if --with-OSS=DIR has been specified, use it.
+   if test "x${OSS_DIR}" != "x"; then
+      if test -d ${OSS_DIR}/lib; then
+         pbxlibdir="-L${OSS_DIR}/lib"
+      else
+         pbxlibdir="-L${OSS_DIR}"
+      fi
+   fi
+
+      # empty lib, assume only headers
+      AST_OSS_FOUND=yes
+
+
+   # now check for the header.
+   if test "${AST_OSS_FOUND}" = "yes"; then
+      OSS_LIB="${pbxlibdir} -lossaudio "
+      # if --with-OSS=DIR has been specified, use it.
+      if test "x${OSS_DIR}" != "x"; then
+         OSS_INCLUDE="-I${OSS_DIR}/include"
+      fi
+      OSS_INCLUDE="${OSS_INCLUDE} "
+
+         # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${OSS_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_soundcard_h" = xyes; then :
+  OSS_HEADER_FOUND=1
+else
+  OSS_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+
+      if test "x${OSS_HEADER_FOUND}" = "x0" ; then
+         OSS_LIB=""
+         OSS_INCLUDE=""
+      else
+
+            # only checking headers -> no library
+            OSS_LIB=""
+
+         PBX_OSS=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_OSS 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
+if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
+   pbxlibdir=""
+   # if --with-OSS=DIR has been specified, use it.
+   if test "x${OSS_DIR}" != "x"; then
+      if test -d ${OSS_DIR}/lib; then
+         pbxlibdir="-L${OSS_DIR}/lib"
+      else
+         pbxlibdir="-L${OSS_DIR}"
+      fi
+   fi
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_ossaudio_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lossaudio" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lossaudio... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for oss_ioctl_mixer in -lossaudio" >&5
+$as_echo_n "checking for oss_ioctl_mixer in -lossaudio... " >&6; }
+if ${ac_cv_lib_ossaudio_oss_ioctl_mixer+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -24290,140 +24715,35 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char oss_ioctl_mixer ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return oss_ioctl_mixer ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_ossaudio_oss_ioctl_mixer=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_ossaudio_oss_ioctl_mixer=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ossaudio_oss_ioctl_mixer" >&5
+$as_echo "$ac_cv_lib_ossaudio_oss_ioctl_mixer" >&6; }
+if test "x$ac_cv_lib_ossaudio_oss_ioctl_mixer" = xyes; then :
   AST_OSS_FOUND=yes
 else
   AST_OSS_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
-
-   # now check for the header.
-   if test "${AST_OSS_FOUND}" = "yes"; then
-      OSS_LIB="${pbxlibdir} -lossaudio "
-      # if --with-OSS=DIR has been specified, use it.
-      if test "x${OSS_DIR}" != "x"; then
-         OSS_INCLUDE="-I${OSS_DIR}/include"
-      fi
-      OSS_INCLUDE="${OSS_INCLUDE} "
-      if test "xlinux/soundcard.h" = "x" ; then        # no header, assume found
-         OSS_HEADER_FOUND="1"
-      else                             # check for the header
-         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${OSS_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "linux/soundcard.h" "ac_cv_header_linux_soundcard_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_soundcard_h" = xyes; then :
-  OSS_HEADER_FOUND=1
-else
-  OSS_HEADER_FOUND=0
-fi
-
-
-         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
-      if test "x${OSS_HEADER_FOUND}" = "x0" ; then
-         OSS_LIB=""
-         OSS_INCLUDE=""
-      else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            OSS_LIB=""
-         fi
-         PBX_OSS=1
-         cat >>confdefs.h <<_ACEOF
-#define HAVE_OSS 1
-_ACEOF
-
-      fi
-   fi
-fi
 
 
-
-if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
-   pbxlibdir=""
-   # if --with-OSS=DIR has been specified, use it.
-   if test "x${OSS_DIR}" != "x"; then
-      if test -d ${OSS_DIR}/lib; then
-         pbxlibdir="-L${OSS_DIR}/lib"
-      else
-         pbxlibdir="-L${OSS_DIR}"
-      fi
-   fi
-   pbxfuncname=""
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_OSS_FOUND=yes
-   else
-      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
-      CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_ossaudio_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lossaudio" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lossaudio... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lossaudio ${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 ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
-else
-  eval "$as_ac_Lib=no"
-fi
-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_OSS_FOUND=yes
-else
-  AST_OSS_FOUND=no
-fi
-
-      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
-
    # now check for the header.
    if test "${AST_OSS_FOUND}" = "yes"; then
       OSS_LIB="${pbxlibdir} -lossaudio "
          OSS_INCLUDE="-I${OSS_DIR}/include"
       fi
       OSS_INCLUDE="${OSS_INCLUDE} "
-      if test "xsys/soundcard.h" = "x" ; then  # no header, assume found
-         OSS_HEADER_FOUND="1"
-      else                             # check for the header
-         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${OSS_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "sys/soundcard.h" "ac_cv_header_sys_soundcard_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_soundcard_h" = xyes; then :
-  OSS_HEADER_FOUND=1
-else
-  OSS_HEADER_FOUND=0
-fi
-
 
-         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
-      if test "x${OSS_HEADER_FOUND}" = "x0" ; then
-         OSS_LIB=""
-         OSS_INCLUDE=""
-      else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            OSS_LIB=""
-         fi
-         PBX_OSS=1
-         cat >>confdefs.h <<_ACEOF
-#define HAVE_OSS 1
-_ACEOF
-
-      fi
-   fi
-fi
-
-
-
-if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
-   pbxlibdir=""
-   # if --with-OSS=DIR has been specified, use it.
-   if test "x${OSS_DIR}" != "x"; then
-      if test -d ${OSS_DIR}/lib; then
-         pbxlibdir="-L${OSS_DIR}/lib"
-      else
-         pbxlibdir="-L${OSS_DIR}"
-      fi
-   fi
-   pbxfuncname="oss_ioctl_mixer"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_OSS_FOUND=yes
-   else
-      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
-      CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_ossaudio_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lossaudio" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lossaudio... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lossaudio ${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 ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
-else
-  eval "$as_ac_Lib=no"
-fi
-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_OSS_FOUND=yes
-else
-  AST_OSS_FOUND=no
-fi
-
-      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
-
-   # now check for the header.
-   if test "${AST_OSS_FOUND}" = "yes"; then
-      OSS_LIB="${pbxlibdir} -lossaudio "
-      # if --with-OSS=DIR has been specified, use it.
-      if test "x${OSS_DIR}" != "x"; then
-         OSS_INCLUDE="-I${OSS_DIR}/include"
-      fi
-      OSS_INCLUDE="${OSS_INCLUDE} "
-      if test "xsoundcard.h" = "x" ; then      # no header, assume found
-         OSS_HEADER_FOUND="1"
-      else                             # check for the header
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${OSS_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "soundcard.h" "ac_cv_header_soundcard_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${OSS_HEADER_FOUND}" = "x0" ; then
          OSS_LIB=""
          OSS_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            OSS_LIB=""
-         fi
+
          PBX_OSS=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_OSS 1
@@ -24899,248 +25112,7 @@ $as_echo "$as_me: *** including --without-postgres" >&6;}
 fi
 
 if test "$USE_PJPROJECT" != "no" ; then
-   if test "$PJPROJECT_BUNDLED" = "yes" ; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for embedded pjproject (may have to download)" >&5
-$as_echo_n "checking for embedded pjproject (may have to download)... " >&6; }
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: configuring" >&5
-$as_echo "configuring" >&6; }
-       ${GNU_MAKE} --quiet --no-print-directory -C $PJPROJECT_DIR configure
-       if test $? -ne 0 ; then
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-               { $as_echo "$as_me:${as_lineno-$LINENO}: Unable to configure $PJPROJECT_DIR" >&5
-$as_echo "$as_me: Unable to configure $PJPROJECT_DIR" >&6;}
-               as_fn_error $? "Run \"${GNU_MAKE} -C $PJPROJECT_DIR NOISY_BUILD=yes configure\" to see error details." "$LINENO" 5
-       fi
-
-       PJPROJECT_INCLUDE=$(${GNU_MAKE} --quiet --no-print-directory -C $PJPROJECT_DIR echo_cflags)
-       PJPROJECT_CFLAGS="$PJPROJECT_INCLUDE"
-       PBX_PJPROJECT=1
-       PJPROJECT_BUNDLED=yes
-
-$as_echo "#define HAVE_PJPROJECT 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_PJPROJECT_BUNDLED 1" >>confdefs.h
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for embedded pjproject" >&5
-$as_echo_n "checking for embedded pjproject... " >&6; }
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-
-       PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE="$PJPROJECT_INCLUDE"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_dlg_create_uas_and_inc_lock declared in pjsip.h" >&5
-$as_echo_n "checking for pjsip_dlg_create_uas_and_inc_lock declared in pjsip.h... " >&6; }
-
-       saved_cpp="$CPPFLAGS"
-       CPPFLAGS="$PJPROJECT_INCLUDE"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pjsip.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "pjsip_dlg_create_uas_and_inc_lock" >/dev/null 2>&1; then :
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-               PBX_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK=1
-
-$as_echo "#define HAVE_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK 1" >>confdefs.h
-
-
-else
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f conftest*
-
-
-       CPPGLAGS="$saved_cpp"
-       PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE="$PJPROJECT_INCLUDE"
-
-
-       PJ_TRANSACTION_GRP_LOCK_INCLUDE="$PJPROJECT_INCLUDE"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_tsx_create_uac2 declared in pjsip.h" >&5
-$as_echo_n "checking for pjsip_tsx_create_uac2 declared in pjsip.h... " >&6; }
-
-       saved_cpp="$CPPFLAGS"
-       CPPFLAGS="$PJPROJECT_INCLUDE"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pjsip.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "pjsip_tsx_create_uac2" >/dev/null 2>&1; then :
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-               PBX_PJ_TRANSACTION_GRP_LOCK=1
-
-$as_echo "#define HAVE_PJ_TRANSACTION_GRP_LOCK 1" >>confdefs.h
-
-
-else
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f conftest*
-
-
-       CPPGLAGS="$saved_cpp"
-       PJ_TRANSACTION_GRP_LOCK_INCLUDE="$PJPROJECT_INCLUDE"
-
-
-       PJSIP_REPLACE_MEDIA_STREAM_INCLUDE="$PJPROJECT_INCLUDE"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE declared in pjmedia.h" >&5
-$as_echo_n "checking for PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE declared in pjmedia.h... " >&6; }
-
-       saved_cpp="$CPPFLAGS"
-       CPPFLAGS="$PJPROJECT_INCLUDE"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pjmedia.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE" >/dev/null 2>&1; then :
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-               PBX_PJSIP_REPLACE_MEDIA_STREAM=1
-
-$as_echo "#define HAVE_PJSIP_REPLACE_MEDIA_STREAM 1" >>confdefs.h
-
-
-else
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f conftest*
-
-
-       CPPGLAGS="$saved_cpp"
-       PJSIP_REPLACE_MEDIA_STREAM_INCLUDE="$PJPROJECT_INCLUDE"
-
-
-       PJSIP_GET_DEST_INFO_INCLUDE="$PJPROJECT_INCLUDE"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_get_dest_info declared in pjsip.h" >&5
-$as_echo_n "checking for pjsip_get_dest_info declared in pjsip.h... " >&6; }
-
-       saved_cpp="$CPPFLAGS"
-       CPPFLAGS="$PJPROJECT_INCLUDE"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pjsip.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "pjsip_get_dest_info" >/dev/null 2>&1; then :
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-               PBX_PJSIP_GET_DEST_INFO=1
-
-$as_echo "#define HAVE_PJSIP_GET_DEST_INFO 1" >>confdefs.h
-
-
-else
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f conftest*
-
-
-       CPPGLAGS="$saved_cpp"
-       PJSIP_GET_DEST_INFO_INCLUDE="$PJPROJECT_INCLUDE"
-
-
-       PJ_SSL_CERT_LOAD_FROM_FILES2_INCLUDE="$PJPROJECT_INCLUDE"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_ssl_cert_load_from_files2 declared in pjlib.h" >&5
-$as_echo_n "checking for pj_ssl_cert_load_from_files2 declared in pjlib.h... " >&6; }
-
-       saved_cpp="$CPPFLAGS"
-       CPPFLAGS="$PJPROJECT_INCLUDE"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pjlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "pj_ssl_cert_load_from_files2" >/dev/null 2>&1; then :
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-               PBX_PJ_SSL_CERT_LOAD_FROM_FILES2=1
-
-$as_echo "#define HAVE_PJ_SSL_CERT_LOAD_FROM_FILES2 1" >>confdefs.h
-
-
-else
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f conftest*
-
-
-       CPPGLAGS="$saved_cpp"
-       PJ_SSL_CERT_LOAD_FROM_FILES2_INCLUDE="$PJPROJECT_INCLUDE"
-
-
-       PJSIP_EXTERNAL_RESOLVER_INCLUDE="$PJPROJECT_INCLUDE"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_endpt_set_ext_resolver declared in pjsip.h" >&5
-$as_echo_n "checking for pjsip_endpt_set_ext_resolver declared in pjsip.h... " >&6; }
-
-       saved_cpp="$CPPFLAGS"
-       CPPFLAGS="$PJPROJECT_INCLUDE"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pjsip.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "pjsip_endpt_set_ext_resolver" >/dev/null 2>&1; then :
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-               PBX_PJSIP_EXTERNAL_RESOLVER=1
-
-$as_echo "#define HAVE_PJSIP_EXTERNAL_RESOLVER 1" >>confdefs.h
-
-
-else
-
-               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-fi
-rm -f conftest*
-
-
-       CPPGLAGS="$saved_cpp"
-       PJSIP_EXTERNAL_RESOLVER_INCLUDE="$PJPROJECT_INCLUDE"
-
-
-$as_echo "#define HAVE_PJSIP_TLS_TRANSPORT_PROTO 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_PJSIP_EVSUB_GRP_LOCK 1" >>confdefs.h
-
-
-   else
+   if test "$PJPROJECT_BUNDLED" = "no" ; then
 
    if test "x${PBX_PJPROJECT}" != "x1" -a "${USE_PJPROJECT}" != "no"; then
 
@@ -25241,16 +25213,12 @@ if test "x${PBX_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK}" != "x1" -a "${USE_PJSIP_DLG_
          pbxlibdir="-L${PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_DIR}"
       fi
    fi
-   pbxfuncname="pjsip_dlg_create_uas_and_inc_lock"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
-      as_ac_Lib=`$as_echo "ac_cv_lib_pjsip_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpjsip" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpjsip... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_dlg_create_uas_and_inc_lock in -lpjsip" >&5
+$as_echo_n "checking for pjsip_dlg_create_uas_and_inc_lock in -lpjsip... " >&6; }
+if ${ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -25264,35 +25232,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pjsip_dlg_create_uas_and_inc_lock ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pjsip_dlg_create_uas_and_inc_lock ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock" >&5
+$as_echo "$ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock" >&6; }
+if test "x$ac_cv_lib_pjsip_pjsip_dlg_create_uas_and_inc_lock" = xyes; then :
   AST_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_FOUND=yes
 else
   AST_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_FOUND}" = "yes"; then
@@ -25302,9 +25269,8 @@ fi
          PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE="-I${PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_DIR}/include"
       fi
       PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE="${PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE} $PJPROJECT_CFLAGS"
-      if test "xpjsip.h" = "x" ; then  # no header, assume found
-         PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_HEADER_FOUND}" = "x0" ; then
          PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_LIB=""
          PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJSIP_DLG_CREATE_UAS_AND_INC_LOCK_LIB=""
-         fi
+
          PBX_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJSIP_DLG_CREATE_UAS_AND_INC_LOCK 1
@@ -25345,16 +25309,12 @@ if test "x${PBX_PJ_TRANSACTION_GRP_LOCK}" != "x1" -a "${USE_PJ_TRANSACTION_GRP_L
          pbxlibdir="-L${PJ_TRANSACTION_GRP_LOCK_DIR}"
       fi
    fi
-   pbxfuncname="pjsip_tsx_create_uac2"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJ_TRANSACTION_GRP_LOCK_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
-      as_ac_Lib=`$as_echo "ac_cv_lib_pjsip_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpjsip" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpjsip... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_tsx_create_uac2 in -lpjsip" >&5
+$as_echo_n "checking for pjsip_tsx_create_uac2 in -lpjsip... " >&6; }
+if ${ac_cv_lib_pjsip_pjsip_tsx_create_uac2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -25368,35 +25328,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pjsip_tsx_create_uac2 ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pjsip_tsx_create_uac2 ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pjsip_pjsip_tsx_create_uac2=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pjsip_pjsip_tsx_create_uac2=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_tsx_create_uac2" >&5
+$as_echo "$ac_cv_lib_pjsip_pjsip_tsx_create_uac2" >&6; }
+if test "x$ac_cv_lib_pjsip_pjsip_tsx_create_uac2" = xyes; then :
   AST_PJ_TRANSACTION_GRP_LOCK_FOUND=yes
 else
   AST_PJ_TRANSACTION_GRP_LOCK_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJ_TRANSACTION_GRP_LOCK_FOUND}" = "yes"; then
@@ -25406,9 +25365,8 @@ fi
          PJ_TRANSACTION_GRP_LOCK_INCLUDE="-I${PJ_TRANSACTION_GRP_LOCK_DIR}/include"
       fi
       PJ_TRANSACTION_GRP_LOCK_INCLUDE="${PJ_TRANSACTION_GRP_LOCK_INCLUDE} $PJPROJECT_CFLAGS"
-      if test "xpjsip.h" = "x" ; then  # no header, assume found
-         PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PJ_TRANSACTION_GRP_LOCK_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PJ_TRANSACTION_GRP_LOCK_HEADER_FOUND}" = "x0" ; then
          PJ_TRANSACTION_GRP_LOCK_LIB=""
          PJ_TRANSACTION_GRP_LOCK_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJ_TRANSACTION_GRP_LOCK_LIB=""
-         fi
+
          PBX_PJ_TRANSACTION_GRP_LOCK=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJ_TRANSACTION_GRP_LOCK 1
       LIBS="${LIBS} ${PJPROJECT_LIB}"
 
     if test "x${PBX_PJSIP_REPLACE_MEDIA_STREAM}" != "x1" -a "${USE_PJSIP_REPLACE_MEDIA_STREAM}" != "no"; then
-        if test "x" != "x"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for " >&5
-$as_echo_n "checking for ... " >&6; }
-       else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE\" compiles using pjmedia.h" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE\" compiles using pjmedia.h" >&5
 $as_echo_n "checking if \"pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE\" compiles using pjmedia.h... " >&6; }
-       fi
        saved_cppflags="${CPPFLAGS}"
        if test "x${PJSIP_REPLACE_MEDIA_STREAM_DIR}" != "x"; then
            PJSIP_REPLACE_MEDIA_STREAM_INCLUDE="-I${PJSIP_REPLACE_MEDIA_STREAM_DIR}/include"
@@ -25502,16 +25453,12 @@ if test "x${PBX_PJSIP_GET_DEST_INFO}" != "x1" -a "${USE_PJSIP_GET_DEST_INFO}" !=
          pbxlibdir="-L${PJSIP_GET_DEST_INFO_DIR}"
       fi
    fi
-   pbxfuncname="pjsip_get_dest_info"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJSIP_GET_DEST_INFO_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
-      as_ac_Lib=`$as_echo "ac_cv_lib_pjsip_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpjsip" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpjsip... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_get_dest_info in -lpjsip" >&5
+$as_echo_n "checking for pjsip_get_dest_info in -lpjsip... " >&6; }
+if ${ac_cv_lib_pjsip_pjsip_get_dest_info+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -25525,35 +25472,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pjsip_get_dest_info ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pjsip_get_dest_info ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pjsip_pjsip_get_dest_info=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pjsip_pjsip_get_dest_info=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_get_dest_info" >&5
+$as_echo "$ac_cv_lib_pjsip_pjsip_get_dest_info" >&6; }
+if test "x$ac_cv_lib_pjsip_pjsip_get_dest_info" = xyes; then :
   AST_PJSIP_GET_DEST_INFO_FOUND=yes
 else
   AST_PJSIP_GET_DEST_INFO_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJSIP_GET_DEST_INFO_FOUND}" = "yes"; then
@@ -25563,9 +25509,8 @@ fi
          PJSIP_GET_DEST_INFO_INCLUDE="-I${PJSIP_GET_DEST_INFO_DIR}/include"
       fi
       PJSIP_GET_DEST_INFO_INCLUDE="${PJSIP_GET_DEST_INFO_INCLUDE} $PJPROJECT_CFLAGS"
-      if test "xpjsip.h" = "x" ; then  # no header, assume found
-         PJSIP_GET_DEST_INFO_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PJSIP_GET_DEST_INFO_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PJSIP_GET_DEST_INFO_HEADER_FOUND}" = "x0" ; then
          PJSIP_GET_DEST_INFO_LIB=""
          PJSIP_GET_DEST_INFO_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJSIP_GET_DEST_INFO_LIB=""
-         fi
+
          PBX_PJSIP_GET_DEST_INFO=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJSIP_GET_DEST_INFO 1
@@ -25606,16 +25549,12 @@ if test "x${PBX_PJ_SSL_CERT_LOAD_FROM_FILES2}" != "x1" -a "${USE_PJ_SSL_CERT_LOA
          pbxlibdir="-L${PJ_SSL_CERT_LOAD_FROM_FILES2_DIR}"
       fi
    fi
-   pbxfuncname="pjsip/include/pjsip/sip_util.h"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJ_SSL_CERT_LOAD_FROM_FILES2_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
-      as_ac_Lib=`$as_echo "ac_cv_lib_pj_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpj" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpj... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pj_ssl_cert_load_from_files2 in -lpj" >&5
+$as_echo_n "checking for pj_ssl_cert_load_from_files2 in -lpj... " >&6; }
+if ${ac_cv_lib_pj_pj_ssl_cert_load_from_files2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -25629,35 +25568,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pj_ssl_cert_load_from_files2 ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pj_ssl_cert_load_from_files2 ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pj_pj_ssl_cert_load_from_files2=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pj_pj_ssl_cert_load_from_files2=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pj_pj_ssl_cert_load_from_files2" >&5
+$as_echo "$ac_cv_lib_pj_pj_ssl_cert_load_from_files2" >&6; }
+if test "x$ac_cv_lib_pj_pj_ssl_cert_load_from_files2" = xyes; then :
   AST_PJ_SSL_CERT_LOAD_FROM_FILES2_FOUND=yes
 else
   AST_PJ_SSL_CERT_LOAD_FROM_FILES2_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJ_SSL_CERT_LOAD_FROM_FILES2_FOUND}" = "yes"; then
@@ -25667,9 +25605,8 @@ fi
          PJ_SSL_CERT_LOAD_FROM_FILES2_INCLUDE="-I${PJ_SSL_CERT_LOAD_FROM_FILES2_DIR}/include"
       fi
       PJ_SSL_CERT_LOAD_FROM_FILES2_INCLUDE="${PJ_SSL_CERT_LOAD_FROM_FILES2_INCLUDE} $PJPROJECT_CFLAGS"
-      if test "xpjlib.h" = "x" ; then  # no header, assume found
-         PJ_SSL_CERT_LOAD_FROM_FILES2_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PJ_SSL_CERT_LOAD_FROM_FILES2_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "pjlib.h" "ac_cv_header_pjlib_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PJ_SSL_CERT_LOAD_FROM_FILES2_HEADER_FOUND}" = "x0" ; then
          PJ_SSL_CERT_LOAD_FROM_FILES2_LIB=""
          PJ_SSL_CERT_LOAD_FROM_FILES2_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJ_SSL_CERT_LOAD_FROM_FILES2_LIB=""
-         fi
+
          PBX_PJ_SSL_CERT_LOAD_FROM_FILES2=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJ_SSL_CERT_LOAD_FROM_FILES2 1
@@ -25710,16 +25645,12 @@ if test "x${PBX_PJSIP_EXTERNAL_RESOLVER}" != "x1" -a "${USE_PJSIP_EXTERNAL_RESOL
          pbxlibdir="-L${PJSIP_EXTERNAL_RESOLVER_DIR}"
       fi
    fi
-   pbxfuncname="pjsip_endpt_set_ext_resolver"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJSIP_EXTERNAL_RESOLVER_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
-      as_ac_Lib=`$as_echo "ac_cv_lib_pjsip_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpjsip" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpjsip... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_endpt_set_ext_resolver in -lpjsip" >&5
+$as_echo_n "checking for pjsip_endpt_set_ext_resolver in -lpjsip... " >&6; }
+if ${ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -25733,35 +25664,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pjsip_endpt_set_ext_resolver ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pjsip_endpt_set_ext_resolver ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver" >&5
+$as_echo "$ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver" >&6; }
+if test "x$ac_cv_lib_pjsip_pjsip_endpt_set_ext_resolver" = xyes; then :
   AST_PJSIP_EXTERNAL_RESOLVER_FOUND=yes
 else
   AST_PJSIP_EXTERNAL_RESOLVER_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJSIP_EXTERNAL_RESOLVER_FOUND}" = "yes"; then
@@ -25771,9 +25701,8 @@ fi
          PJSIP_EXTERNAL_RESOLVER_INCLUDE="-I${PJSIP_EXTERNAL_RESOLVER_DIR}/include"
       fi
       PJSIP_EXTERNAL_RESOLVER_INCLUDE="${PJSIP_EXTERNAL_RESOLVER_INCLUDE} $PJPROJECT_CFLAGS"
-      if test "xpjsip.h" = "x" ; then  # no header, assume found
-         PJSIP_EXTERNAL_RESOLVER_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PJSIP_EXTERNAL_RESOLVER_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PJSIP_EXTERNAL_RESOLVER_HEADER_FOUND}" = "x0" ; then
          PJSIP_EXTERNAL_RESOLVER_LIB=""
          PJSIP_EXTERNAL_RESOLVER_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJSIP_EXTERNAL_RESOLVER_LIB=""
-         fi
+
          PBX_PJSIP_EXTERNAL_RESOLVER=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJSIP_EXTERNAL_RESOLVER 1
       LIBS="${LIBS} ${PJPROJECT_LIB}"
 
     if test "x${PBX_PJSIP_TLS_TRANSPORT_PROTO}" != "x1" -a "${USE_PJSIP_TLS_TRANSPORT_PROTO}" != "no"; then
-        if test "x" != "x"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for " >&5
-$as_echo_n "checking for ... " >&6; }
-       else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"struct pjsip_tls_setting setting; int proto; proto = setting.proto;\" compiles using pjsip.h" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"struct pjsip_tls_setting setting; int proto; proto = setting.proto;\" compiles using pjsip.h" >&5
 $as_echo_n "checking if \"struct pjsip_tls_setting setting; int proto; proto = setting.proto;\" compiles using pjsip.h... " >&6; }
-       fi
        saved_cppflags="${CPPFLAGS}"
        if test "x${PJSIP_TLS_TRANSPORT_PROTO_DIR}" != "x"; then
            PJSIP_TLS_TRANSPORT_PROTO_INCLUDE="-I${PJSIP_TLS_TRANSPORT_PROTO_DIR}/include"
@@ -25867,16 +25789,12 @@ if test "x${PBX_PJSIP_EVSUB_GRP_LOCK}" != "x1" -a "${USE_PJSIP_EVSUB_GRP_LOCK}"
          pbxlibdir="-L${PJSIP_EVSUB_GRP_LOCK_DIR}"
       fi
    fi
-   pbxfuncname="pjsip_evsub_add_ref"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJSIP_EVSUB_GRP_LOCK_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
-      as_ac_Lib=`$as_echo "ac_cv_lib_pjsip_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpjsip" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpjsip... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_evsub_add_ref in -lpjsip" >&5
+$as_echo_n "checking for pjsip_evsub_add_ref in -lpjsip... " >&6; }
+if ${ac_cv_lib_pjsip_pjsip_evsub_add_ref+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -25890,35 +25808,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pjsip_evsub_add_ref ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pjsip_evsub_add_ref ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pjsip_pjsip_evsub_add_ref=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pjsip_pjsip_evsub_add_ref=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pjsip_pjsip_evsub_add_ref" >&5
+$as_echo "$ac_cv_lib_pjsip_pjsip_evsub_add_ref" >&6; }
+if test "x$ac_cv_lib_pjsip_pjsip_evsub_add_ref" = xyes; then :
   AST_PJSIP_EVSUB_GRP_LOCK_FOUND=yes
 else
   AST_PJSIP_EVSUB_GRP_LOCK_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJSIP_EVSUB_GRP_LOCK_FOUND}" = "yes"; then
@@ -25928,9 +25845,8 @@ fi
          PJSIP_EVSUB_GRP_LOCK_INCLUDE="-I${PJSIP_EVSUB_GRP_LOCK_DIR}/include"
       fi
       PJSIP_EVSUB_GRP_LOCK_INCLUDE="${PJSIP_EVSUB_GRP_LOCK_INCLUDE} $PJPROJECT_CFLAGS"
-      if test "xpjsip.h" = "x" ; then  # no header, assume found
-         PJSIP_EVSUB_GRP_LOCK_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PJSIP_EVSUB_GRP_LOCK_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PJSIP_EVSUB_GRP_LOCK_HEADER_FOUND}" = "x0" ; then
          PJSIP_EVSUB_GRP_LOCK_LIB=""
          PJSIP_EVSUB_GRP_LOCK_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJSIP_EVSUB_GRP_LOCK_LIB=""
-         fi
+
          PBX_PJSIP_EVSUB_GRP_LOCK=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJSIP_EVSUB_GRP_LOCK 1
@@ -25960,6 +25874,390 @@ _ACEOF
 fi
 
 
+
+if test "x${PBX_PJSIP_INV_SESSION_REF}" != "x1" -a "${USE_PJSIP_INV_SESSION_REF}" != "no"; then
+   pbxlibdir=""
+   # if --with-PJSIP_INV_SESSION_REF=DIR has been specified, use it.
+   if test "x${PJSIP_INV_SESSION_REF_DIR}" != "x"; then
+      if test -d ${PJSIP_INV_SESSION_REF_DIR}/lib; then
+         pbxlibdir="-L${PJSIP_INV_SESSION_REF_DIR}/lib"
+      else
+         pbxlibdir="-L${PJSIP_INV_SESSION_REF_DIR}"
+      fi
+   fi
+
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_inv_add_ref in -lpjsip" >&5
+$as_echo_n "checking for pjsip_inv_add_ref in -lpjsip... " >&6; }
+if ${ac_cv_lib_pjsip_pjsip_inv_add_ref+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $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 pjsip_inv_add_ref ();
+int
+main ()
+{
+return pjsip_inv_add_ref ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pjsip_pjsip_inv_add_ref=yes
+else
+  ac_cv_lib_pjsip_pjsip_inv_add_ref=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_pjsip_pjsip_inv_add_ref" >&5
+$as_echo "$ac_cv_lib_pjsip_pjsip_inv_add_ref" >&6; }
+if test "x$ac_cv_lib_pjsip_pjsip_inv_add_ref" = xyes; then :
+  AST_PJSIP_INV_SESSION_REF_FOUND=yes
+else
+  AST_PJSIP_INV_SESSION_REF_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+
+
+   # now check for the header.
+   if test "${AST_PJSIP_INV_SESSION_REF_FOUND}" = "yes"; then
+      PJSIP_INV_SESSION_REF_LIB="${pbxlibdir} -lpjsip $PJPROJECT_LIB"
+      # if --with-PJSIP_INV_SESSION_REF=DIR has been specified, use it.
+      if test "x${PJSIP_INV_SESSION_REF_DIR}" != "x"; then
+         PJSIP_INV_SESSION_REF_INCLUDE="-I${PJSIP_INV_SESSION_REF_DIR}/include"
+      fi
+      PJSIP_INV_SESSION_REF_INCLUDE="${PJSIP_INV_SESSION_REF_INCLUDE} $PJPROJECT_CFLAGS"
+
+         # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${PJSIP_INV_SESSION_REF_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
+if test "x$ac_cv_header_pjsip_h" = xyes; then :
+  PJSIP_INV_SESSION_REF_HEADER_FOUND=1
+else
+  PJSIP_INV_SESSION_REF_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+
+      if test "x${PJSIP_INV_SESSION_REF_HEADER_FOUND}" = "x0" ; then
+         PJSIP_INV_SESSION_REF_LIB=""
+         PJSIP_INV_SESSION_REF_INCLUDE=""
+      else
+
+         PBX_PJSIP_INV_SESSION_REF=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_PJSIP_INV_SESSION_REF 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
+if test "x${PBX_PJSIP_AUTH_CLT_DEINIT}" != "x1" -a "${USE_PJSIP_AUTH_CLT_DEINIT}" != "no"; then
+   pbxlibdir=""
+   # if --with-PJSIP_AUTH_CLT_DEINIT=DIR has been specified, use it.
+   if test "x${PJSIP_AUTH_CLT_DEINIT_DIR}" != "x"; then
+      if test -d ${PJSIP_AUTH_CLT_DEINIT_DIR}/lib; then
+         pbxlibdir="-L${PJSIP_AUTH_CLT_DEINIT_DIR}/lib"
+      else
+         pbxlibdir="-L${PJSIP_AUTH_CLT_DEINIT_DIR}"
+      fi
+   fi
+
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_auth_clt_deinit in -lpjsip" >&5
+$as_echo_n "checking for pjsip_auth_clt_deinit in -lpjsip... " >&6; }
+if ${ac_cv_lib_pjsip_pjsip_auth_clt_deinit+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $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 pjsip_auth_clt_deinit ();
+int
+main ()
+{
+return pjsip_auth_clt_deinit ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pjsip_pjsip_auth_clt_deinit=yes
+else
+  ac_cv_lib_pjsip_pjsip_auth_clt_deinit=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_pjsip_pjsip_auth_clt_deinit" >&5
+$as_echo "$ac_cv_lib_pjsip_pjsip_auth_clt_deinit" >&6; }
+if test "x$ac_cv_lib_pjsip_pjsip_auth_clt_deinit" = xyes; then :
+  AST_PJSIP_AUTH_CLT_DEINIT_FOUND=yes
+else
+  AST_PJSIP_AUTH_CLT_DEINIT_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+
+
+   # now check for the header.
+   if test "${AST_PJSIP_AUTH_CLT_DEINIT_FOUND}" = "yes"; then
+      PJSIP_AUTH_CLT_DEINIT_LIB="${pbxlibdir} -lpjsip $PJPROJECT_LIB"
+      # if --with-PJSIP_AUTH_CLT_DEINIT=DIR has been specified, use it.
+      if test "x${PJSIP_AUTH_CLT_DEINIT_DIR}" != "x"; then
+         PJSIP_AUTH_CLT_DEINIT_INCLUDE="-I${PJSIP_AUTH_CLT_DEINIT_DIR}/include"
+      fi
+      PJSIP_AUTH_CLT_DEINIT_INCLUDE="${PJSIP_AUTH_CLT_DEINIT_INCLUDE} $PJPROJECT_CFLAGS"
+
+         # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${PJSIP_AUTH_CLT_DEINIT_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
+if test "x$ac_cv_header_pjsip_h" = xyes; then :
+  PJSIP_AUTH_CLT_DEINIT_HEADER_FOUND=1
+else
+  PJSIP_AUTH_CLT_DEINIT_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+
+      if test "x${PJSIP_AUTH_CLT_DEINIT_HEADER_FOUND}" = "x0" ; then
+         PJSIP_AUTH_CLT_DEINIT_LIB=""
+         PJSIP_AUTH_CLT_DEINIT_INCLUDE=""
+      else
+
+         PBX_PJSIP_AUTH_CLT_DEINIT=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_PJSIP_AUTH_CLT_DEINIT 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
+if test "x${PBX_PJSIP_EVSUB_SET_UAS_TIMEOUT}" != "x1" -a "${USE_PJSIP_EVSUB_SET_UAS_TIMEOUT}" != "no"; then
+   pbxlibdir=""
+   # if --with-PJSIP_EVSUB_SET_UAS_TIMEOUT=DIR has been specified, use it.
+   if test "x${PJSIP_EVSUB_SET_UAS_TIMEOUT_DIR}" != "x"; then
+      if test -d ${PJSIP_EVSUB_SET_UAS_TIMEOUT_DIR}/lib; then
+         pbxlibdir="-L${PJSIP_EVSUB_SET_UAS_TIMEOUT_DIR}/lib"
+      else
+         pbxlibdir="-L${PJSIP_EVSUB_SET_UAS_TIMEOUT_DIR}"
+      fi
+   fi
+
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_evsub_set_uas_timeout in -lpjsip" >&5
+$as_echo_n "checking for pjsip_evsub_set_uas_timeout in -lpjsip... " >&6; }
+if ${ac_cv_lib_pjsip_pjsip_evsub_set_uas_timeout+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $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 pjsip_evsub_set_uas_timeout ();
+int
+main ()
+{
+return pjsip_evsub_set_uas_timeout ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pjsip_pjsip_evsub_set_uas_timeout=yes
+else
+  ac_cv_lib_pjsip_pjsip_evsub_set_uas_timeout=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_pjsip_pjsip_evsub_set_uas_timeout" >&5
+$as_echo "$ac_cv_lib_pjsip_pjsip_evsub_set_uas_timeout" >&6; }
+if test "x$ac_cv_lib_pjsip_pjsip_evsub_set_uas_timeout" = xyes; then :
+  AST_PJSIP_EVSUB_SET_UAS_TIMEOUT_FOUND=yes
+else
+  AST_PJSIP_EVSUB_SET_UAS_TIMEOUT_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+
+
+   # now check for the header.
+   if test "${AST_PJSIP_EVSUB_SET_UAS_TIMEOUT_FOUND}" = "yes"; then
+      PJSIP_EVSUB_SET_UAS_TIMEOUT_LIB="${pbxlibdir} -lpjsip $PJPROJECT_LIB"
+      # if --with-PJSIP_EVSUB_SET_UAS_TIMEOUT=DIR has been specified, use it.
+      if test "x${PJSIP_EVSUB_SET_UAS_TIMEOUT_DIR}" != "x"; then
+         PJSIP_EVSUB_SET_UAS_TIMEOUT_INCLUDE="-I${PJSIP_EVSUB_SET_UAS_TIMEOUT_DIR}/include"
+      fi
+      PJSIP_EVSUB_SET_UAS_TIMEOUT_INCLUDE="${PJSIP_EVSUB_SET_UAS_TIMEOUT_INCLUDE} $PJPROJECT_CFLAGS"
+
+         # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${PJSIP_EVSUB_SET_UAS_TIMEOUT_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
+if test "x$ac_cv_header_pjsip_h" = xyes; then :
+  PJSIP_EVSUB_SET_UAS_TIMEOUT_HEADER_FOUND=1
+else
+  PJSIP_EVSUB_SET_UAS_TIMEOUT_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+
+      if test "x${PJSIP_EVSUB_SET_UAS_TIMEOUT_HEADER_FOUND}" = "x0" ; then
+         PJSIP_EVSUB_SET_UAS_TIMEOUT_LIB=""
+         PJSIP_EVSUB_SET_UAS_TIMEOUT_INCLUDE=""
+      else
+
+         PBX_PJSIP_EVSUB_SET_UAS_TIMEOUT=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_PJSIP_EVSUB_SET_UAS_TIMEOUT 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
+if test "x${PBX_PJSIP_TSX_LAYER_FIND_TSX2}" != "x1" -a "${USE_PJSIP_TSX_LAYER_FIND_TSX2}" != "no"; then
+   pbxlibdir=""
+   # if --with-PJSIP_TSX_LAYER_FIND_TSX2=DIR has been specified, use it.
+   if test "x${PJSIP_TSX_LAYER_FIND_TSX2_DIR}" != "x"; then
+      if test -d ${PJSIP_TSX_LAYER_FIND_TSX2_DIR}/lib; then
+         pbxlibdir="-L${PJSIP_TSX_LAYER_FIND_TSX2_DIR}/lib"
+      else
+         pbxlibdir="-L${PJSIP_TSX_LAYER_FIND_TSX2_DIR}"
+      fi
+   fi
+
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} $PJPROJECT_CFLAGS"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pjsip_tsx_layer_find_tsx2 in -lpjsip" >&5
+$as_echo_n "checking for pjsip_tsx_layer_find_tsx2 in -lpjsip... " >&6; }
+if ${ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpjsip ${pbxlibdir} $PJPROJECT_LIB $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 pjsip_tsx_layer_find_tsx2 ();
+int
+main ()
+{
+return pjsip_tsx_layer_find_tsx2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2=yes
+else
+  ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2=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_pjsip_pjsip_tsx_layer_find_tsx2" >&5
+$as_echo "$ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2" >&6; }
+if test "x$ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2" = xyes; then :
+  AST_PJSIP_TSX_LAYER_FIND_TSX2_FOUND=yes
+else
+  AST_PJSIP_TSX_LAYER_FIND_TSX2_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+
+
+   # now check for the header.
+   if test "${AST_PJSIP_TSX_LAYER_FIND_TSX2_FOUND}" = "yes"; then
+      PJSIP_TSX_LAYER_FIND_TSX2_LIB="${pbxlibdir} -lpjsip $PJPROJECT_LIB"
+      # if --with-PJSIP_TSX_LAYER_FIND_TSX2=DIR has been specified, use it.
+      if test "x${PJSIP_TSX_LAYER_FIND_TSX2_DIR}" != "x"; then
+         PJSIP_TSX_LAYER_FIND_TSX2_INCLUDE="-I${PJSIP_TSX_LAYER_FIND_TSX2_DIR}/include"
+      fi
+      PJSIP_TSX_LAYER_FIND_TSX2_INCLUDE="${PJSIP_TSX_LAYER_FIND_TSX2_INCLUDE} $PJPROJECT_CFLAGS"
+
+         # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${PJSIP_TSX_LAYER_FIND_TSX2_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "pjsip.h" "ac_cv_header_pjsip_h" "$ac_includes_default"
+if test "x$ac_cv_header_pjsip_h" = xyes; then :
+  PJSIP_TSX_LAYER_FIND_TSX2_HEADER_FOUND=1
+else
+  PJSIP_TSX_LAYER_FIND_TSX2_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+
+      if test "x${PJSIP_TSX_LAYER_FIND_TSX2_HEADER_FOUND}" = "x0" ; then
+         PJSIP_TSX_LAYER_FIND_TSX2_LIB=""
+         PJSIP_TSX_LAYER_FIND_TSX2_INCLUDE=""
+      else
+
+         PBX_PJSIP_TSX_LAYER_FIND_TSX2=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_PJSIP_TSX_LAYER_FIND_TSX2 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
    fi
 fi
 
@@ -26065,16 +26363,12 @@ if test "x${PBX_POPT}" != "x1" -a "${USE_POPT}" != "no"; then
          pbxlibdir="-L${POPT_DIR}"
       fi
    fi
-   pbxfuncname="poptStrerror"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_POPT_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_popt_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpopt" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpopt... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poptStrerror in -lpopt" >&5
+$as_echo_n "checking for poptStrerror in -lpopt... " >&6; }
+if ${ac_cv_lib_popt_poptStrerror+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -26088,35 +26382,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char poptStrerror ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return poptStrerror ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_popt_poptStrerror=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_popt_poptStrerror=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_popt_poptStrerror" >&5
+$as_echo "$ac_cv_lib_popt_poptStrerror" >&6; }
+if test "x$ac_cv_lib_popt_poptStrerror" = xyes; then :
   AST_POPT_FOUND=yes
 else
   AST_POPT_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_POPT_FOUND}" = "yes"; then
@@ -26126,9 +26419,8 @@ fi
          POPT_INCLUDE="-I${POPT_DIR}/include"
       fi
       POPT_INCLUDE="${POPT_INCLUDE} "
-      if test "xpopt.h" = "x" ; then   # no header, assume found
-         POPT_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${POPT_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "popt.h" "ac_cv_header_popt_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${POPT_HEADER_FOUND}" = "x0" ; then
          POPT_LIB=""
          POPT_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            POPT_LIB=""
-         fi
+
          PBX_POPT=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_POPT 1
@@ -26170,16 +26460,12 @@ if test "x${PBX_PORTAUDIO}" != "x1" -a "${USE_PORTAUDIO}" != "no"; then
          pbxlibdir="-L${PORTAUDIO_DIR}"
       fi
    fi
-   pbxfuncname="Pa_GetDeviceCount"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PORTAUDIO_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_portaudio_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lportaudio" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lportaudio... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pa_GetDeviceCount in -lportaudio" >&5
+$as_echo_n "checking for Pa_GetDeviceCount in -lportaudio... " >&6; }
+if ${ac_cv_lib_portaudio_Pa_GetDeviceCount+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -26193,35 +26479,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char Pa_GetDeviceCount ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return Pa_GetDeviceCount ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_portaudio_Pa_GetDeviceCount=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_portaudio_Pa_GetDeviceCount=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_portaudio_Pa_GetDeviceCount" >&5
+$as_echo "$ac_cv_lib_portaudio_Pa_GetDeviceCount" >&6; }
+if test "x$ac_cv_lib_portaudio_Pa_GetDeviceCount" = xyes; then :
   AST_PORTAUDIO_FOUND=yes
 else
   AST_PORTAUDIO_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PORTAUDIO_FOUND}" = "yes"; then
@@ -26231,9 +26516,8 @@ fi
          PORTAUDIO_INCLUDE="-I${PORTAUDIO_DIR}/include"
       fi
       PORTAUDIO_INCLUDE="${PORTAUDIO_INCLUDE} "
-      if test "xportaudio.h" = "x" ; then      # no header, assume found
-         PORTAUDIO_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PORTAUDIO_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "portaudio.h" "ac_cv_header_portaudio_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PORTAUDIO_HEADER_FOUND}" = "x0" ; then
          PORTAUDIO_LIB=""
          PORTAUDIO_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PORTAUDIO_LIB=""
-         fi
+
          PBX_PORTAUDIO=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PORTAUDIO 1
@@ -26275,16 +26557,12 @@ if test "x${PBX_PRI}" != "x1" -a "${USE_PRI}" != "no"; then
          pbxlibdir="-L${PRI_DIR}"
       fi
    fi
-   pbxfuncname="pri_connected_line_update"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_connected_line_update in -lpri" >&5
+$as_echo_n "checking for pri_connected_line_update in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_connected_line_update+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -26298,35 +26576,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_connected_line_update ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_connected_line_update ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_connected_line_update=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_connected_line_update=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_connected_line_update" >&5
+$as_echo "$ac_cv_lib_pri_pri_connected_line_update" >&6; }
+if test "x$ac_cv_lib_pri_pri_connected_line_update" = xyes; then :
   AST_PRI_FOUND=yes
 else
   AST_PRI_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_FOUND}" = "yes"; then
@@ -26336,9 +26613,8 @@ fi
          PRI_INCLUDE="-I${PRI_DIR}/include"
       fi
       PRI_INCLUDE="${PRI_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_HEADER_FOUND}" = "x0" ; then
          PRI_LIB=""
          PRI_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_LIB=""
-         fi
+
          PBX_PRI=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI 1
@@ -26379,16 +26653,12 @@ if test "x${PBX_PRI_SETUP_ACK_INBAND}" != "x1" -a "${USE_PRI_SETUP_ACK_INBAND}"
          pbxlibdir="-L${PRI_SETUP_ACK_INBAND_DIR}"
       fi
    fi
-   pbxfuncname="pri_setup_ack"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_SETUP_ACK_INBAND_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_setup_ack in -lpri" >&5
+$as_echo_n "checking for pri_setup_ack in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_setup_ack+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -26402,35 +26672,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_setup_ack ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_setup_ack ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_setup_ack=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_setup_ack=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_setup_ack" >&5
+$as_echo "$ac_cv_lib_pri_pri_setup_ack" >&6; }
+if test "x$ac_cv_lib_pri_pri_setup_ack" = xyes; then :
   AST_PRI_SETUP_ACK_INBAND_FOUND=yes
 else
   AST_PRI_SETUP_ACK_INBAND_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_SETUP_ACK_INBAND_FOUND}" = "yes"; then
@@ -26440,9 +26709,8 @@ fi
          PRI_SETUP_ACK_INBAND_INCLUDE="-I${PRI_SETUP_ACK_INBAND_DIR}/include"
       fi
       PRI_SETUP_ACK_INBAND_INCLUDE="${PRI_SETUP_ACK_INBAND_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_SETUP_ACK_INBAND_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_SETUP_ACK_INBAND_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_SETUP_ACK_INBAND_HEADER_FOUND}" = "x0" ; then
          PRI_SETUP_ACK_INBAND_LIB=""
          PRI_SETUP_ACK_INBAND_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_SETUP_ACK_INBAND_LIB=""
-         fi
+
          PBX_PRI_SETUP_ACK_INBAND=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_SETUP_ACK_INBAND 1
@@ -26483,16 +26749,12 @@ if test "x${PBX_PRI_L2_PERSISTENCE}" != "x1" -a "${USE_PRI_L2_PERSISTENCE}" != "
          pbxlibdir="-L${PRI_L2_PERSISTENCE_DIR}"
       fi
    fi
-   pbxfuncname="pri_persistent_layer2_option"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_L2_PERSISTENCE_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_persistent_layer2_option in -lpri" >&5
+$as_echo_n "checking for pri_persistent_layer2_option in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_persistent_layer2_option+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -26506,35 +26768,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_persistent_layer2_option ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_persistent_layer2_option ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_persistent_layer2_option=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_persistent_layer2_option=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_persistent_layer2_option" >&5
+$as_echo "$ac_cv_lib_pri_pri_persistent_layer2_option" >&6; }
+if test "x$ac_cv_lib_pri_pri_persistent_layer2_option" = xyes; then :
   AST_PRI_L2_PERSISTENCE_FOUND=yes
 else
   AST_PRI_L2_PERSISTENCE_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_L2_PERSISTENCE_FOUND}" = "yes"; then
@@ -26544,9 +26805,8 @@ fi
          PRI_L2_PERSISTENCE_INCLUDE="-I${PRI_L2_PERSISTENCE_DIR}/include"
       fi
       PRI_L2_PERSISTENCE_INCLUDE="${PRI_L2_PERSISTENCE_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_L2_PERSISTENCE_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_L2_PERSISTENCE_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_L2_PERSISTENCE_HEADER_FOUND}" = "x0" ; then
          PRI_L2_PERSISTENCE_LIB=""
          PRI_L2_PERSISTENCE_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_L2_PERSISTENCE_LIB=""
-         fi
+
          PBX_PRI_L2_PERSISTENCE=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_L2_PERSISTENCE 1
@@ -26587,16 +26845,12 @@ if test "x${PBX_PRI_DATETIME_SEND}" != "x1" -a "${USE_PRI_DATETIME_SEND}" != "no
          pbxlibdir="-L${PRI_DATETIME_SEND_DIR}"
       fi
    fi
-   pbxfuncname="pri_date_time_send_option"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_DATETIME_SEND_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_date_time_send_option in -lpri" >&5
+$as_echo_n "checking for pri_date_time_send_option in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_date_time_send_option+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -26610,35 +26864,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_date_time_send_option ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_date_time_send_option ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_date_time_send_option=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_date_time_send_option=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_date_time_send_option" >&5
+$as_echo "$ac_cv_lib_pri_pri_date_time_send_option" >&6; }
+if test "x$ac_cv_lib_pri_pri_date_time_send_option" = xyes; then :
   AST_PRI_DATETIME_SEND_FOUND=yes
 else
   AST_PRI_DATETIME_SEND_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_DATETIME_SEND_FOUND}" = "yes"; then
@@ -26648,9 +26901,8 @@ fi
          PRI_DATETIME_SEND_INCLUDE="-I${PRI_DATETIME_SEND_DIR}/include"
       fi
       PRI_DATETIME_SEND_INCLUDE="${PRI_DATETIME_SEND_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_DATETIME_SEND_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_DATETIME_SEND_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_DATETIME_SEND_HEADER_FOUND}" = "x0" ; then
          PRI_DATETIME_SEND_LIB=""
          PRI_DATETIME_SEND_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_DATETIME_SEND_LIB=""
-         fi
+
          PBX_PRI_DATETIME_SEND=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_DATETIME_SEND 1
@@ -26691,16 +26941,12 @@ if test "x${PBX_PRI_MWI_V2}" != "x1" -a "${USE_PRI_MWI_V2}" != "no"; then
          pbxlibdir="-L${PRI_MWI_V2_DIR}"
       fi
    fi
-   pbxfuncname="pri_mwi_indicate_v2"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_MWI_V2_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_mwi_indicate_v2 in -lpri" >&5
+$as_echo_n "checking for pri_mwi_indicate_v2 in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_mwi_indicate_v2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -26714,35 +26960,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_mwi_indicate_v2 ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_mwi_indicate_v2 ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_mwi_indicate_v2=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_mwi_indicate_v2=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_mwi_indicate_v2" >&5
+$as_echo "$ac_cv_lib_pri_pri_mwi_indicate_v2" >&6; }
+if test "x$ac_cv_lib_pri_pri_mwi_indicate_v2" = xyes; then :
   AST_PRI_MWI_V2_FOUND=yes
 else
   AST_PRI_MWI_V2_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_MWI_V2_FOUND}" = "yes"; then
@@ -26752,9 +26997,8 @@ fi
          PRI_MWI_V2_INCLUDE="-I${PRI_MWI_V2_DIR}/include"
       fi
       PRI_MWI_V2_INCLUDE="${PRI_MWI_V2_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_MWI_V2_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_MWI_V2_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_MWI_V2_HEADER_FOUND}" = "x0" ; then
          PRI_MWI_V2_LIB=""
          PRI_MWI_V2_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_MWI_V2_LIB=""
-         fi
+
          PBX_PRI_MWI_V2=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_MWI_V2 1
@@ -26795,16 +27037,12 @@ if test "x${PBX_PRI_DISPLAY_TEXT}" != "x1" -a "${USE_PRI_DISPLAY_TEXT}" != "no";
          pbxlibdir="-L${PRI_DISPLAY_TEXT_DIR}"
       fi
    fi
-   pbxfuncname="pri_display_text"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_DISPLAY_TEXT_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_display_text in -lpri" >&5
+$as_echo_n "checking for pri_display_text in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_display_text+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -26818,35 +27056,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_display_text ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_display_text ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_display_text=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_display_text=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_display_text" >&5
+$as_echo "$ac_cv_lib_pri_pri_display_text" >&6; }
+if test "x$ac_cv_lib_pri_pri_display_text" = xyes; then :
   AST_PRI_DISPLAY_TEXT_FOUND=yes
 else
   AST_PRI_DISPLAY_TEXT_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_DISPLAY_TEXT_FOUND}" = "yes"; then
@@ -26856,9 +27093,8 @@ fi
          PRI_DISPLAY_TEXT_INCLUDE="-I${PRI_DISPLAY_TEXT_DIR}/include"
       fi
       PRI_DISPLAY_TEXT_INCLUDE="${PRI_DISPLAY_TEXT_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_DISPLAY_TEXT_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_DISPLAY_TEXT_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_DISPLAY_TEXT_HEADER_FOUND}" = "x0" ; then
          PRI_DISPLAY_TEXT_LIB=""
          PRI_DISPLAY_TEXT_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_DISPLAY_TEXT_LIB=""
-         fi
+
          PBX_PRI_DISPLAY_TEXT=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_DISPLAY_TEXT 1
@@ -26899,16 +27133,12 @@ if test "x${PBX_PRI_MWI}" != "x1" -a "${USE_PRI_MWI}" != "no"; then
          pbxlibdir="-L${PRI_MWI_DIR}"
       fi
    fi
-   pbxfuncname="pri_mwi_indicate"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_MWI_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_mwi_indicate in -lpri" >&5
+$as_echo_n "checking for pri_mwi_indicate in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_mwi_indicate+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -26922,35 +27152,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_mwi_indicate ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_mwi_indicate ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_mwi_indicate=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_mwi_indicate=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_mwi_indicate" >&5
+$as_echo "$ac_cv_lib_pri_pri_mwi_indicate" >&6; }
+if test "x$ac_cv_lib_pri_pri_mwi_indicate" = xyes; then :
   AST_PRI_MWI_FOUND=yes
 else
   AST_PRI_MWI_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_MWI_FOUND}" = "yes"; then
@@ -26960,9 +27189,8 @@ fi
          PRI_MWI_INCLUDE="-I${PRI_MWI_DIR}/include"
       fi
       PRI_MWI_INCLUDE="${PRI_MWI_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_MWI_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_MWI_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_MWI_HEADER_FOUND}" = "x0" ; then
          PRI_MWI_LIB=""
          PRI_MWI_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_MWI_LIB=""
-         fi
+
          PBX_PRI_MWI=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_MWI 1
@@ -27003,16 +27229,12 @@ if test "x${PBX_PRI_MCID}" != "x1" -a "${USE_PRI_MCID}" != "no"; then
          pbxlibdir="-L${PRI_MCID_DIR}"
       fi
    fi
-   pbxfuncname="pri_mcid_enable"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_MCID_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_mcid_enable in -lpri" >&5
+$as_echo_n "checking for pri_mcid_enable in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_mcid_enable+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -27026,35 +27248,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_mcid_enable ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_mcid_enable ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_mcid_enable=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_mcid_enable=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_mcid_enable" >&5
+$as_echo "$ac_cv_lib_pri_pri_mcid_enable" >&6; }
+if test "x$ac_cv_lib_pri_pri_mcid_enable" = xyes; then :
   AST_PRI_MCID_FOUND=yes
 else
   AST_PRI_MCID_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_MCID_FOUND}" = "yes"; then
@@ -27064,9 +27285,8 @@ fi
          PRI_MCID_INCLUDE="-I${PRI_MCID_DIR}/include"
       fi
       PRI_MCID_INCLUDE="${PRI_MCID_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_MCID_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_MCID_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_MCID_HEADER_FOUND}" = "x0" ; then
          PRI_MCID_LIB=""
          PRI_MCID_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_MCID_LIB=""
-         fi
+
          PBX_PRI_MCID=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_MCID 1
@@ -27107,16 +27325,12 @@ if test "x${PBX_PRI_CALL_WAITING}" != "x1" -a "${USE_PRI_CALL_WAITING}" != "no";
          pbxlibdir="-L${PRI_CALL_WAITING_DIR}"
       fi
    fi
-   pbxfuncname="pri_connect_ack_enable"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_CALL_WAITING_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_connect_ack_enable in -lpri" >&5
+$as_echo_n "checking for pri_connect_ack_enable in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_connect_ack_enable+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -27130,35 +27344,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_connect_ack_enable ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_connect_ack_enable ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_connect_ack_enable=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_connect_ack_enable=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_connect_ack_enable" >&5
+$as_echo "$ac_cv_lib_pri_pri_connect_ack_enable" >&6; }
+if test "x$ac_cv_lib_pri_pri_connect_ack_enable" = xyes; then :
   AST_PRI_CALL_WAITING_FOUND=yes
 else
   AST_PRI_CALL_WAITING_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_CALL_WAITING_FOUND}" = "yes"; then
@@ -27168,9 +27381,8 @@ fi
          PRI_CALL_WAITING_INCLUDE="-I${PRI_CALL_WAITING_DIR}/include"
       fi
       PRI_CALL_WAITING_INCLUDE="${PRI_CALL_WAITING_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_CALL_WAITING_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_CALL_WAITING_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_CALL_WAITING_HEADER_FOUND}" = "x0" ; then
          PRI_CALL_WAITING_LIB=""
          PRI_CALL_WAITING_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_CALL_WAITING_LIB=""
-         fi
+
          PBX_PRI_CALL_WAITING=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_CALL_WAITING 1
@@ -27211,16 +27421,12 @@ if test "x${PBX_PRI_AOC_EVENTS}" != "x1" -a "${USE_PRI_AOC_EVENTS}" != "no"; the
          pbxlibdir="-L${PRI_AOC_EVENTS_DIR}"
       fi
    fi
-   pbxfuncname="pri_aoc_events_enable"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_AOC_EVENTS_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_aoc_events_enable in -lpri" >&5
+$as_echo_n "checking for pri_aoc_events_enable in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_aoc_events_enable+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -27234,35 +27440,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_aoc_events_enable ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_aoc_events_enable ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_aoc_events_enable=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_aoc_events_enable=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_aoc_events_enable" >&5
+$as_echo "$ac_cv_lib_pri_pri_aoc_events_enable" >&6; }
+if test "x$ac_cv_lib_pri_pri_aoc_events_enable" = xyes; then :
   AST_PRI_AOC_EVENTS_FOUND=yes
 else
   AST_PRI_AOC_EVENTS_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_AOC_EVENTS_FOUND}" = "yes"; then
@@ -27272,9 +27477,8 @@ fi
          PRI_AOC_EVENTS_INCLUDE="-I${PRI_AOC_EVENTS_DIR}/include"
       fi
       PRI_AOC_EVENTS_INCLUDE="${PRI_AOC_EVENTS_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_AOC_EVENTS_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_AOC_EVENTS_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_AOC_EVENTS_HEADER_FOUND}" = "x0" ; then
          PRI_AOC_EVENTS_LIB=""
          PRI_AOC_EVENTS_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_AOC_EVENTS_LIB=""
-         fi
+
          PBX_PRI_AOC_EVENTS=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_AOC_EVENTS 1
@@ -27315,16 +27517,12 @@ if test "x${PBX_PRI_TRANSFER}" != "x1" -a "${USE_PRI_TRANSFER}" != "no"; then
          pbxlibdir="-L${PRI_TRANSFER_DIR}"
       fi
    fi
-   pbxfuncname="pri_transfer_enable"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_TRANSFER_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_transfer_enable in -lpri" >&5
+$as_echo_n "checking for pri_transfer_enable in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_transfer_enable+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -27338,35 +27536,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_transfer_enable ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_transfer_enable ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_transfer_enable=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_transfer_enable=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_transfer_enable" >&5
+$as_echo "$ac_cv_lib_pri_pri_transfer_enable" >&6; }
+if test "x$ac_cv_lib_pri_pri_transfer_enable" = xyes; then :
   AST_PRI_TRANSFER_FOUND=yes
 else
   AST_PRI_TRANSFER_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_TRANSFER_FOUND}" = "yes"; then
@@ -27376,9 +27573,8 @@ fi
          PRI_TRANSFER_INCLUDE="-I${PRI_TRANSFER_DIR}/include"
       fi
       PRI_TRANSFER_INCLUDE="${PRI_TRANSFER_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_TRANSFER_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_TRANSFER_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_TRANSFER_HEADER_FOUND}" = "x0" ; then
          PRI_TRANSFER_LIB=""
          PRI_TRANSFER_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_TRANSFER_LIB=""
-         fi
+
          PBX_PRI_TRANSFER=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_TRANSFER 1
@@ -27419,16 +27613,12 @@ if test "x${PBX_PRI_CCSS}" != "x1" -a "${USE_PRI_CCSS}" != "no"; then
          pbxlibdir="-L${PRI_CCSS_DIR}"
       fi
    fi
-   pbxfuncname="pri_cc_enable"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_CCSS_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_cc_enable in -lpri" >&5
+$as_echo_n "checking for pri_cc_enable in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_cc_enable+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -27442,35 +27632,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_cc_enable ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_cc_enable ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_cc_enable=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_cc_enable=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_cc_enable" >&5
+$as_echo "$ac_cv_lib_pri_pri_cc_enable" >&6; }
+if test "x$ac_cv_lib_pri_pri_cc_enable" = xyes; then :
   AST_PRI_CCSS_FOUND=yes
 else
   AST_PRI_CCSS_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_CCSS_FOUND}" = "yes"; then
@@ -27480,9 +27669,8 @@ fi
          PRI_CCSS_INCLUDE="-I${PRI_CCSS_DIR}/include"
       fi
       PRI_CCSS_INCLUDE="${PRI_CCSS_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_CCSS_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_CCSS_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_CCSS_HEADER_FOUND}" = "x0" ; then
          PRI_CCSS_LIB=""
          PRI_CCSS_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_CCSS_LIB=""
-         fi
+
          PBX_PRI_CCSS=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_CCSS 1
@@ -27523,16 +27709,12 @@ if test "x${PBX_PRI_HANGUP_FIX}" != "x1" -a "${USE_PRI_HANGUP_FIX}" != "no"; the
          pbxlibdir="-L${PRI_HANGUP_FIX_DIR}"
       fi
    fi
-   pbxfuncname="pri_hangup_fix_enable"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_HANGUP_FIX_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_hangup_fix_enable in -lpri" >&5
+$as_echo_n "checking for pri_hangup_fix_enable in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_hangup_fix_enable+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -27546,35 +27728,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_hangup_fix_enable ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_hangup_fix_enable ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_hangup_fix_enable=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_hangup_fix_enable=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_hangup_fix_enable" >&5
+$as_echo "$ac_cv_lib_pri_pri_hangup_fix_enable" >&6; }
+if test "x$ac_cv_lib_pri_pri_hangup_fix_enable" = xyes; then :
   AST_PRI_HANGUP_FIX_FOUND=yes
 else
   AST_PRI_HANGUP_FIX_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_HANGUP_FIX_FOUND}" = "yes"; then
@@ -27584,9 +27765,8 @@ fi
          PRI_HANGUP_FIX_INCLUDE="-I${PRI_HANGUP_FIX_DIR}/include"
       fi
       PRI_HANGUP_FIX_INCLUDE="${PRI_HANGUP_FIX_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_HANGUP_FIX_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_HANGUP_FIX_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_HANGUP_FIX_HEADER_FOUND}" = "x0" ; then
          PRI_HANGUP_FIX_LIB=""
          PRI_HANGUP_FIX_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_HANGUP_FIX_LIB=""
-         fi
+
          PBX_PRI_HANGUP_FIX=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_HANGUP_FIX 1
@@ -27627,16 +27805,12 @@ if test "x${PBX_PRI_SUBADDR}" != "x1" -a "${USE_PRI_SUBADDR}" != "no"; then
          pbxlibdir="-L${PRI_SUBADDR_DIR}"
       fi
    fi
-   pbxfuncname="pri_sr_set_called_subaddress"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_SUBADDR_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_sr_set_called_subaddress in -lpri" >&5
+$as_echo_n "checking for pri_sr_set_called_subaddress in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_sr_set_called_subaddress+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -27650,35 +27824,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_sr_set_called_subaddress ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_sr_set_called_subaddress ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_sr_set_called_subaddress=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_sr_set_called_subaddress=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_sr_set_called_subaddress" >&5
+$as_echo "$ac_cv_lib_pri_pri_sr_set_called_subaddress" >&6; }
+if test "x$ac_cv_lib_pri_pri_sr_set_called_subaddress" = xyes; then :
   AST_PRI_SUBADDR_FOUND=yes
 else
   AST_PRI_SUBADDR_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_SUBADDR_FOUND}" = "yes"; then
@@ -27688,9 +27861,8 @@ fi
          PRI_SUBADDR_INCLUDE="-I${PRI_SUBADDR_DIR}/include"
       fi
       PRI_SUBADDR_INCLUDE="${PRI_SUBADDR_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_SUBADDR_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_SUBADDR_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_SUBADDR_HEADER_FOUND}" = "x0" ; then
          PRI_SUBADDR_LIB=""
          PRI_SUBADDR_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_SUBADDR_LIB=""
-         fi
+
          PBX_PRI_SUBADDR=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_SUBADDR 1
@@ -27731,16 +27901,12 @@ if test "x${PBX_PRI_CALL_HOLD}" != "x1" -a "${USE_PRI_CALL_HOLD}" != "no"; then
          pbxlibdir="-L${PRI_CALL_HOLD_DIR}"
       fi
    fi
-   pbxfuncname="pri_hold_enable"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_CALL_HOLD_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_pri_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lpri" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lpri... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pri_hold_enable in -lpri" >&5
+$as_echo_n "checking for pri_hold_enable in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_hold_enable+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -27754,35 +27920,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_hold_enable ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_hold_enable ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_hold_enable=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_hold_enable=no
 fi
 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 :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pri_pri_hold_enable" >&5
+$as_echo "$ac_cv_lib_pri_pri_hold_enable" >&6; }
+if test "x$ac_cv_lib_pri_pri_hold_enable" = xyes; then :
   AST_PRI_CALL_HOLD_FOUND=yes
 else
   AST_PRI_CALL_HOLD_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_CALL_HOLD_FOUND}" = "yes"; then
@@ -27792,9 +27957,8 @@ fi
          PRI_CALL_HOLD_INCLUDE="-I${PRI_CALL_HOLD_DIR}/include"
       fi
       PRI_CALL_HOLD_INCLUDE="${PRI_CALL_HOLD_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_CALL_HOLD_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_CALL_HOLD_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libpri.h" "ac_cv_header_libpri_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PRI_CALL_HOLD_HEADER_FOUND}" = "x0" ; then
          PRI_CALL_HOLD_LIB=""
          PRI_CALL_HOLD_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
- &nbs