Merge "endpoint identifiers: Some code cleanup."
[asterisk/asterisk.git] / configure
index 7411f71..f6e83d9 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.
 #
@@ -3711,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
@@ -7606,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 :
@@ -7633,7 +7603,6 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_XMLSTARLET" && ac_cv_path_XMLSTARLET=":"
   ;;
 esac
 fi
@@ -7647,6 +7616,10 @@ $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
@@ -13568,11 +13541,41 @@ 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 resolv.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 \
@@ -13621,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
@@ -13644,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
@@ -13725,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
@@ -13748,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
@@ -13829,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
@@ -13852,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
@@ -13890,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
@@ -13933,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
@@ -13956,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
@@ -13994,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
@@ -14056,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
@@ -14079,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
@@ -14117,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
@@ -14160,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
@@ -14183,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
@@ -14221,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
@@ -14294,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
@@ -14317,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
@@ -14355,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
@@ -14404,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
@@ -14427,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
@@ -14602,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}"
 
@@ -14639,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
 
@@ -14668,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
@@ -14691,158 +14588,149 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char uriParseUriA ();
+int
+main ()
+{
+return uriParseUriA ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_uriparser_uriParseUriA=yes
+else
+  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
+{ $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}"
+
+
+   # now check for the header.
+   if test "${AST_URIPARSER_FOUND}" = "yes"; then
+      URIPARSER_LIB="${pbxlibdir} -luriparser "
+      # if --with-URIPARSER=DIR has been specified, use it.
+      if test "x${URIPARSER_DIR}" != "x"; then
+         URIPARSER_INCLUDE="-I${URIPARSER_DIR}/include"
+      fi
+      URIPARSER_INCLUDE="${URIPARSER_INCLUDE} "
+
+         # 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"
+if test "x$ac_cv_header_uriparser_Uri_h" = xyes; then :
+  URIPARSER_HEADER_FOUND=1
+else
+  URIPARSER_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+
+      if test "x${URIPARSER_HEADER_FOUND}" = "x0" ; then
+         URIPARSER_LIB=""
+         URIPARSER_INCLUDE=""
+      else
+
+         PBX_URIPARSER=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_URIPARSER 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
+# Another mandatory item (unless it's explicitly disabled)
+# 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 ;;
+               *) as_fn_error $? "bad value ${enableval} for --disable-xmldoc" "$LINENO" 5  ;;
+       esac
+else
+  DISABLE_XMLDOC=no
+fi
+
+
+
+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=""
+   # if --with-LIBXSLT=DIR has been specified, use it.
+   if test "x${LIBXSLT_DIR}" != "x"; then
+      if test -d ${LIBXSLT_DIR}/lib; then
+         pbxlibdir="-L${LIBXSLT_DIR}/lib"
+      else
+         pbxlibdir="-L${LIBXSLT_DIR}"
+      fi
+   fi
+
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} ${LIBXML2_INCLUDE}"
+      { $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
+LIBS="-lxslt ${pbxlibdir} ${LIBXML2_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 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 :
-  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
-      URIPARSER_LIB="${pbxlibdir} -luriparser "
-      # if --with-URIPARSER=DIR has been specified, use it.
-      if test "x${URIPARSER_DIR}" != "x"; then
-         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
-         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"
-if test "x$ac_cv_header_uriparser_Uri_h" = xyes; then :
-  URIPARSER_HEADER_FOUND=1
-else
-  URIPARSER_HEADER_FOUND=0
-fi
-
-
-         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
-_ACEOF
-
-      fi
-   fi
-fi
-
-
-
-# Another mandatory item (unless it's explicitly disabled)
-# 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 ;;
-               *) as_fn_error $? "bad value ${enableval} for --disable-xmldoc" "$LINENO" 5  ;;
-       esac
-else
-  DISABLE_XMLDOC=no
-fi
-
-
-
-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=""
-   # if --with-LIBXSLT=DIR has been specified, use it.
-   if test "x${LIBXSLT_DIR}" != "x"; then
-      if test -d ${LIBXSLT_DIR}/lib; then
-         pbxlibdir="-L${LIBXSLT_DIR}/lib"
-      else
-         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_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lxslt ${pbxlibdir} ${LIBXML2_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 ${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 :
+{ $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
@@ -14852,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
@@ -14895,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
@@ -14918,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
@@ -14956,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
@@ -18016,8 +17893,8 @@ fi
 done
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler atomic operations" >&5
-$as_echo_n "checking for compiler atomic operations... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler sync operations" >&5
+$as_echo_n "checking for compiler sync operations... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -18032,6 +17909,7 @@ _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+ax_cv_have_gcc_atomics=1
 
 $as_echo "#define HAVE_GCC_ATOMICS 1" >>confdefs.h
 
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler atomic operations" >&5
+$as_echo_n "checking for compiler atomic operations... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+int foo1; int foo2 = __atomic_fetch_add(&foo1, 1, __ATOMIC_RELAXED);
+  ;
+  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; }
+ax_cv_have_c_atomics=1
+
+$as_echo "#define HAVE_C_ATOMICS 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_exeext conftest.$ac_ext
+
+if test -z $ax_cv_have_c_atomics$ax_cv_have_gcc_atomics; then
+       as_fn_error $? "*** Atomic operations are not supported by your compiler." "$LINENO" 5
+fi
+
 # glibc, AFAIK, is the only C library that makes printing a NULL to a string safe.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system printf is NULL-safe." >&5
 $as_echo_n "checking if your system printf is NULL-safe.... " >&6; }
@@ -18208,8 +18118,6 @@ CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
 
 ax_cv_have_func_attribute_pure=0
 
-if test "x" = "x"
-then
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
  void __attribute__((pure)) *test(void *muffin, ...) {return (void *) 0;}
@@ -18237,35 +18145,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; }
-
-       ax_cv_have_func_attribute_pure=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_pure 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"
@@ -18279,8 +18158,6 @@ 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;}
@@ -18308,35 +18185,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; }
-
-       ax_cv_have_func_attribute_malloc=1
-
-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"
@@ -18350,8 +18198,6 @@ 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;}
@@ -18379,35 +18225,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; }
-
-       ax_cv_have_func_attribute_const=1
-
-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"
@@ -18421,8 +18238,6 @@ 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;}
@@ -18450,35 +18265,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; }
-
-       ax_cv_have_func_attribute_unused=1
-
-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"
@@ -18492,8 +18278,6 @@ 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;}
@@ -18521,35 +18305,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; }
-
-       ax_cv_have_func_attribute_always_inline=1
-
-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"
@@ -18563,8 +18318,6 @@ 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;}
@@ -18592,35 +18345,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; }
-
-       ax_cv_have_func_attribute_deprecated=1
-
-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"
@@ -18634,8 +18358,6 @@ 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;}
@@ -18663,35 +18385,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; }
-
-       ax_cv_have_func_attribute_sentinel=1
-
-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"
@@ -18705,8 +18398,6 @@ 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;}
@@ -18734,35 +18425,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; }
-
-       ax_cv_have_func_attribute_warn_unused_result=1
-
-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"
@@ -18776,8 +18438,6 @@ 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;}
@@ -18805,35 +18465,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; }
-
-       ax_cv_have_func_attribute_may_alias=1
-
-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"
@@ -18847,8 +18478,6 @@ 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;}
@@ -18876,35 +18505,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; }
-
-       ax_cv_have_func_attribute_constructor=1
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTRIBUTE_constructor 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"
@@ -18922,8 +18522,6 @@ 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;}
@@ -18951,35 +18549,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; }
-
-       ax_cv_have_func_attribute_destructor=1
-
-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"
@@ -18996,36 +18565,6 @@ 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; }
-
-       ax_cv_have_func_attribute_noreturn=1
-
-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, ...) ;
@@ -19053,7 +18592,6 @@ $as_echo "no" >&6; }
 
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
 
 CFLAGS="$saved_CFLAGS"
@@ -19190,7 +18728,7 @@ LDFLAGS="${saved_sanitize_LDFLAGS}"
 
 { $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
@@ -19242,7 +18780,7 @@ 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} -O2 -Wno-format-truncation -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+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
@@ -19255,7 +18793,7 @@ 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
@@ -19825,17 +19363,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 
-ac_fn_c_check_header_mongrel "$LINENO" "libkern/OSAtomic.h" "ac_cv_header_libkern_OSAtomic_h" "$ac_includes_default"
-if test "x$ac_cv_header_libkern_OSAtomic_h" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_OSX_ATOMICS 1
-_ACEOF
-
-fi
-
-
-
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -20263,16 +19790,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
@@ -20286,35 +19809,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
@@ -20324,9 +19846,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
@@ -20368,16 +19887,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
@@ -20391,35 +19906,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
@@ -20429,9 +19943,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
@@ -20475,16 +19986,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
@@ -20498,35 +20005,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
@@ -20536,9 +20042,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
@@ -20583,16 +20086,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
@@ -20606,35 +20105,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
@@ -20644,9 +20142,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
@@ -20691,16 +20186,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
@@ -20714,35 +20205,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
@@ -20752,9 +20242,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
@@ -20981,13 +20468,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"
@@ -21027,13 +20509,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"
@@ -21073,13 +20550,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"
@@ -21118,13 +20590,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"
    else
 
     if test "x${PBX_LIBEDIT_IS_UNICODE}" != "x1" -a "${USE_LIBEDIT_IS_UNICODE}" != "no"; then
-        if test "xTesting for libedit unicode support" != "x"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Testing for libedit unicode support" >&5
+       { $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; }
-       else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"el_rfunc_t *callback;\" compiles using histedit.h" >&5
-$as_echo_n "checking if \"el_rfunc_t *callback;\" compiles using histedit.h... " >&6; }
-       fi
        saved_cppflags="${CPPFLAGS}"
        if test "x${LIBEDIT_IS_UNICODE_DIR}" != "x"; then
            LIBEDIT_IS_UNICODE_INCLUDE="-I${LIBEDIT_IS_UNICODE_DIR}/include"
@@ -21588,16 +21050,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
@@ -21611,35 +21069,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
@@ -21649,9 +21106,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
@@ -21693,16 +21147,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
@@ -21716,35 +21166,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
@@ -21754,9 +21203,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
@@ -21798,16 +21244,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
@@ -21821,35 +21263,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
@@ -21859,9 +21300,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
@@ -21904,16 +21342,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
@@ -21927,35 +21361,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
@@ -21965,9 +21398,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
@@ -22009,16 +21439,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
@@ -22032,35 +21458,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
@@ -22070,9 +21495,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
@@ -22742,16 +22164,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
@@ -22765,35 +22183,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
@@ -22803,9 +22220,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
@@ -22847,16 +22261,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
@@ -22870,35 +22280,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
@@ -22908,9 +22317,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
@@ -22952,16 +22358,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
@@ -22975,35 +22377,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
@@ -23013,9 +22414,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
@@ -23058,16 +22456,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
@@ -23081,35 +22475,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
@@ -23119,9 +22512,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
@@ -23177,16 +22567,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
@@ -23200,35 +22586,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
@@ -23238,9 +22623,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
@@ -23282,16 +22664,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
@@ -23305,35 +22683,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
@@ -23343,9 +22720,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
@@ -23387,16 +22761,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
@@ -23410,35 +22780,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
@@ -23448,9 +22817,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
@@ -23493,16 +22859,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
@@ -23516,35 +22878,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
@@ -23554,9 +22915,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
@@ -23597,16 +22955,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
@@ -23620,35 +22974,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
@@ -23658,9 +23011,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
@@ -23906,47 +23256,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
 
@@ -23962,16 +23283,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
@@ -23985,35 +23302,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
@@ -24023,9 +23339,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
@@ -24160,47 +23473,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
 
@@ -24309,15 +23593,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}"
 
@@ -24346,12 +23628,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
 
@@ -24460,17 +23737,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}"
 
@@ -24499,12 +23772,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
 
@@ -24520,16 +23788,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
@@ -24543,35 +23807,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
@@ -24581,9 +23844,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
@@ -24632,16 +23892,12 @@ if test "x${PBX_UNBOUND}" != "x1" -a "${USE_UNBOUND}" != "no"; then
          pbxlibdir="-L${UNBOUND_DIR}"
       fi
    fi
-   pbxfuncname="ub_ctx_delete"
-   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
@@ -24655,35 +23911,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
@@ -24693,9 +23948,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
@@ -24780,16 +24032,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
@@ -24803,35 +24051,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
@@ -24841,9 +24088,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
@@ -24885,16 +24129,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
@@ -24908,35 +24148,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
@@ -24991,16 +24217,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
@@ -25014,35 +24236,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
@@ -25052,9 +24273,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
@@ -25096,16 +24314,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
@@ -25119,35 +24333,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
@@ -25157,9 +24370,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
@@ -25201,16 +24411,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
@@ -25224,35 +24430,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
@@ -25262,9 +24467,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
@@ -25306,16 +24508,12 @@ if test "x${PBX_BEANSTALK}" != "x1" -a "${USE_BEANSTALK}" != "no"; then
          pbxlibdir="-L${BEANSTALK_DIR}"
       fi
    fi
-   pbxfuncname="bs_version"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_BEANSTALK_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_beanstalk_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lbeanstalk" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lbeanstalk... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $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
@@ -25329,35 +24527,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char bs_version ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return bs_version ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_beanstalk_bs_version=yes
 else
-  eval "$as_ac_Lib=no"
+  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
-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_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}"
-   fi
+
 
    # now check for the header.
    if test "${AST_BEANSTALK_FOUND}" = "yes"; then
@@ -25367,9 +24564,8 @@ fi
          BEANSTALK_INCLUDE="-I${BEANSTALK_DIR}/include"
       fi
       BEANSTALK_INCLUDE="${BEANSTALK_INCLUDE} "
-      if test "xbeanstalk.h" = "x" ; then      # no header, assume found
-         BEANSTALK_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # 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"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${BEANSTALK_HEADER_FOUND}" = "x0" ; then
          BEANSTALK_LIB=""
          BEANSTALK_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            BEANSTALK_LIB=""
-         fi
+
          PBX_BEANSTALK=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_BEANSTALK 1
@@ -25412,58 +24606,10 @@ 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
-      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
+      # empty lib, assume only headers
+      AST_OSS_FOUND=yes
 
-      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
 
    # now check for the header.
    if test "${AST_OSS_FOUND}" = "yes"; then
@@ -25473,9 +24619,8 @@ fi
          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
+
+         # 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"
 
 
          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
+
+            # only checking headers -> no library
             OSS_LIB=""
-         fi
+
          PBX_OSS=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_OSS 1
@@ -25516,58 +24662,10 @@ 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
-      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
+      # empty lib, assume only headers
+      AST_OSS_FOUND=yes
 
-      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
 
    # now check for the header.
    if test "${AST_OSS_FOUND}" = "yes"; then
@@ -25577,9 +24675,8 @@ fi
          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
+
+         # 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"
 
 
          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
+
+            # only checking headers -> no library
             OSS_LIB=""
-         fi
+
          PBX_OSS=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_OSS 1
@@ -25620,16 +24718,12 @@ if test "x${PBX_OSS}" != "x1" -a "${USE_OSS}" != "no"; then
          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 "$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
@@ -25643,35 +24737,34 @@ 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
@@ -25681,9 +24774,8 @@ fi
          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
@@ -26145,16 +25235,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
@@ -26168,35 +25254,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
@@ -26206,9 +25291,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
@@ -26249,16 +25331,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
@@ -26272,35 +25350,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
@@ -26310,9 +25387,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"
@@ -26406,16 +25475,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
@@ -26429,35 +25494,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
@@ -26467,9 +25531,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
@@ -26510,16 +25571,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="pj_ssl_cert_load_from_files2"
-   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
@@ -26533,35 +25590,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
@@ -26571,9 +25627,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
@@ -26614,16 +25667,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
@@ -26637,35 +25686,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
@@ -26675,9 +25723,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"
@@ -26771,16 +25811,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
@@ -26794,35 +25830,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
@@ -26832,9 +25867,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
@@ -26875,16 +25907,12 @@ if test "x${PBX_PJSIP_INV_SESSION_REF}" != "x1" -a "${USE_PJSIP_INV_SESSION_REF}
          pbxlibdir="-L${PJSIP_INV_SESSION_REF_DIR}"
       fi
    fi
-   pbxfuncname="pjsip_inv_add_ref"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJSIP_INV_SESSION_REF_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_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
@@ -26898,35 +25926,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pjsip_inv_add_ref ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pjsip_inv_add_ref ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pjsip_pjsip_inv_add_ref=yes
 else
-  eval "$as_ac_Lib=no"
+  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
-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_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}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJSIP_INV_SESSION_REF_FOUND}" = "yes"; then
@@ -26936,9 +25963,8 @@ fi
          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"
-      if test "xpjsip.h" = "x" ; then  # no header, assume found
-         PJSIP_INV_SESSION_REF_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # 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"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PJSIP_INV_SESSION_REF_HEADER_FOUND}" = "x0" ; then
          PJSIP_INV_SESSION_REF_LIB=""
          PJSIP_INV_SESSION_REF_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJSIP_INV_SESSION_REF_LIB=""
-         fi
+
          PBX_PJSIP_INV_SESSION_REF=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJSIP_INV_SESSION_REF 1
@@ -26979,16 +26003,12 @@ if test "x${PBX_PJSIP_AUTH_CLT_DEINIT}" != "x1" -a "${USE_PJSIP_AUTH_CLT_DEINIT}
          pbxlibdir="-L${PJSIP_AUTH_CLT_DEINIT_DIR}"
       fi
    fi
-   pbxfuncname="pjsip_auth_clt_deinit"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJSIP_AUTH_CLT_DEINIT_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_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
@@ -27002,35 +26022,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pjsip_auth_clt_deinit ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pjsip_auth_clt_deinit ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pjsip_pjsip_auth_clt_deinit=yes
 else
-  eval "$as_ac_Lib=no"
+  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
-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_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}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJSIP_AUTH_CLT_DEINIT_FOUND}" = "yes"; then
@@ -27040,9 +26059,8 @@ fi
          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"
-      if test "xpjsip.h" = "x" ; then  # no header, assume found
-         PJSIP_AUTH_CLT_DEINIT_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # 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"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${PJSIP_AUTH_CLT_DEINIT_HEADER_FOUND}" = "x0" ; then
          PJSIP_AUTH_CLT_DEINIT_LIB=""
          PJSIP_AUTH_CLT_DEINIT_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJSIP_AUTH_CLT_DEINIT_LIB=""
-         fi
+
          PBX_PJSIP_AUTH_CLT_DEINIT=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJSIP_AUTH_CLT_DEINIT 1
@@ -27083,16 +26099,12 @@ if test "x${PBX_PJSIP_EVSUB_SET_UAS_TIMEOUT}" != "x1" -a "${USE_PJSIP_EVSUB_SET_
          pbxlibdir="-L${PJSIP_EVSUB_SET_UAS_TIMEOUT_DIR}"
       fi
    fi
-   pbxfuncname="pjsip_evsub_set_uas_timeout"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJSIP_EVSUB_SET_UAS_TIMEOUT_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_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
@@ -27106,35 +26118,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pjsip_evsub_set_uas_timeout ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pjsip_evsub_set_uas_timeout ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pjsip_pjsip_evsub_set_uas_timeout=yes
 else
-  eval "$as_ac_Lib=no"
+  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
-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_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}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJSIP_EVSUB_SET_UAS_TIMEOUT_FOUND}" = "yes"; then
@@ -27144,9 +26155,8 @@ fi
          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"
-      if test "xpjsip.h" = "x" ; then  # no header, assume found
-         PJSIP_EVSUB_SET_UAS_TIMEOUT_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # 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"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       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
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJSIP_EVSUB_SET_UAS_TIMEOUT_LIB=""
-         fi
+
          PBX_PJSIP_EVSUB_SET_UAS_TIMEOUT=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJSIP_EVSUB_SET_UAS_TIMEOUT 1
@@ -27187,16 +26195,12 @@ if test "x${PBX_PJSIP_TSX_LAYER_FIND_TSX2}" != "x1" -a "${USE_PJSIP_TSX_LAYER_FI
          pbxlibdir="-L${PJSIP_TSX_LAYER_FIND_TSX2_DIR}"
       fi
    fi
-   pbxfuncname="pjsip_tsx_layer_find_tsx2"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PJSIP_TSX_LAYER_FIND_TSX2_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_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
@@ -27210,35 +26214,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pjsip_tsx_layer_find_tsx2 ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pjsip_tsx_layer_find_tsx2 ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pjsip_pjsip_tsx_layer_find_tsx2=yes
 else
-  eval "$as_ac_Lib=no"
+  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
-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_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}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PJSIP_TSX_LAYER_FIND_TSX2_FOUND}" = "yes"; then
@@ -27248,9 +26251,8 @@ fi
          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"
-      if test "xpjsip.h" = "x" ; then  # no header, assume found
-         PJSIP_TSX_LAYER_FIND_TSX2_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # 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"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       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
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PJSIP_TSX_LAYER_FIND_TSX2_LIB=""
-         fi
+
          PBX_PJSIP_TSX_LAYER_FIND_TSX2=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PJSIP_TSX_LAYER_FIND_TSX2 1
@@ -27385,16 +26385,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
@@ -27408,35 +26404,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
@@ -27446,9 +26441,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
@@ -27490,16 +26482,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
@@ -27513,35 +26501,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
@@ -27551,9 +26538,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
@@ -27595,16 +26579,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
@@ -27618,35 +26598,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
@@ -27656,9 +26635,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
@@ -27699,16 +26675,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
@@ -27722,35 +26694,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
@@ -27760,9 +26731,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
@@ -27803,16 +26771,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
@@ -27826,35 +26790,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
@@ -27864,9 +26827,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
@@ -27907,16 +26867,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
@@ -27930,35 +26886,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
@@ -27968,9 +26923,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
@@ -28011,16 +26963,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
@@ -28034,35 +26982,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
@@ -28072,9 +27019,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
@@ -28115,16 +27059,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
@@ -28138,35 +27078,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
@@ -28176,9 +27115,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
@@ -28219,16 +27155,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
@@ -28242,35 +27174,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
@@ -28280,9 +27211,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
@@ -28323,16 +27251,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
@@ -28346,35 +27270,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
@@ -28384,9 +27307,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
@@ -28427,16 +27347,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
@@ -28450,35 +27366,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
@@ -28488,9 +27403,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
@@ -28531,16 +27443,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
@@ -28554,35 +27462,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
@@ -28592,9 +27499,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
@@ -28635,16 +27539,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
@@ -28658,35 +27558,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
@@ -28696,9 +27595,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
@@ -28739,16 +27635,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
@@ -28762,35 +27654,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
@@ -28800,9 +27691,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
@@ -28843,16 +27731,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
@@ -28866,35 +27750,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
@@ -28904,9 +27787,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
@@ -28947,16 +27827,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
@@ -28970,35 +27846,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
@@ -29008,9 +27883,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
@@ -29051,16 +27923,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
@@ -29074,35 +27942,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
@@ -29112,9 +27979,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
-            PRI_CALL_HOLD_LIB=""
-         fi
+
          PBX_PRI_CALL_HOLD=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_CALL_HOLD 1
@@ -29155,16 +28019,12 @@ if test "x${PBX_PRI_CALL_REROUTING}" != "x1" -a "${USE_PRI_CALL_REROUTING}" != "
          pbxlibdir="-L${PRI_CALL_REROUTING_DIR}"
       fi
    fi
-   pbxfuncname="pri_reroute_enable"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_CALL_REROUTING_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_reroute_enable in -lpri" >&5
+$as_echo_n "checking for pri_reroute_enable in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_reroute_enable+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -29178,35 +28038,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_reroute_enable ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_reroute_enable ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_reroute_enable=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_reroute_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_reroute_enable" >&5
+$as_echo "$ac_cv_lib_pri_pri_reroute_enable" >&6; }
+if test "x$ac_cv_lib_pri_pri_reroute_enable" = xyes; then :
   AST_PRI_CALL_REROUTING_FOUND=yes
 else
   AST_PRI_CALL_REROUTING_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_CALL_REROUTING_FOUND}" = "yes"; then
@@ -29216,9 +28075,8 @@ fi
          PRI_CALL_REROUTING_INCLUDE="-I${PRI_CALL_REROUTING_DIR}/include"
       fi
       PRI_CALL_REROUTING_INCLUDE="${PRI_CALL_REROUTING_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_CALL_REROUTING_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_CALL_REROUTING_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_REROUTING_HEADER_FOUND}" = "x0" ; then
          PRI_CALL_REROUTING_LIB=""
          PRI_CALL_REROUTING_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_CALL_REROUTING_LIB=""
-         fi
+
          PBX_PRI_CALL_REROUTING=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_CALL_REROUTING 1
@@ -29259,16 +28115,12 @@ if test "x${PBX_PRI_SETUP_KEYPAD}" != "x1" -a "${USE_PRI_SETUP_KEYPAD}" != "no";
          pbxlibdir="-L${PRI_SETUP_KEYPAD_DIR}"
       fi
    fi
-   pbxfuncname="pri_sr_set_keypad_digits"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_SETUP_KEYPAD_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_keypad_digits in -lpri" >&5
+$as_echo_n "checking for pri_sr_set_keypad_digits in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_sr_set_keypad_digits+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -29282,35 +28134,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_sr_set_keypad_digits ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_sr_set_keypad_digits ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_sr_set_keypad_digits=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_sr_set_keypad_digits=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_keypad_digits" >&5
+$as_echo "$ac_cv_lib_pri_pri_sr_set_keypad_digits" >&6; }
+if test "x$ac_cv_lib_pri_pri_sr_set_keypad_digits" = xyes; then :
   AST_PRI_SETUP_KEYPAD_FOUND=yes
 else
   AST_PRI_SETUP_KEYPAD_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_SETUP_KEYPAD_FOUND}" = "yes"; then
@@ -29320,9 +28171,8 @@ fi
          PRI_SETUP_KEYPAD_INCLUDE="-I${PRI_SETUP_KEYPAD_DIR}/include"
       fi
       PRI_SETUP_KEYPAD_INCLUDE="${PRI_SETUP_KEYPAD_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_SETUP_KEYPAD_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_SETUP_KEYPAD_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_KEYPAD_HEADER_FOUND}" = "x0" ; then
          PRI_SETUP_KEYPAD_LIB=""
          PRI_SETUP_KEYPAD_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_SETUP_KEYPAD_LIB=""
-         fi
+
          PBX_PRI_SETUP_KEYPAD=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_SETUP_KEYPAD 1
@@ -29367,16 +28215,12 @@ if test "x${PBX_PRI_PROG_W_CAUSE}" != "x1" -a "${USE_PRI_PROG_W_CAUSE}" != "no";
          pbxlibdir="-L${PRI_PROG_W_CAUSE_DIR}"
       fi
    fi
-   pbxfuncname="pri_progress_with_cause"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_PROG_W_CAUSE_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_progress_with_cause in -lpri" >&5
+$as_echo_n "checking for pri_progress_with_cause in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_progress_with_cause+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -29390,35 +28234,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_progress_with_cause ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_progress_with_cause ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_progress_with_cause=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_progress_with_cause=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_progress_with_cause" >&5
+$as_echo "$ac_cv_lib_pri_pri_progress_with_cause" >&6; }
+if test "x$ac_cv_lib_pri_pri_progress_with_cause" = xyes; then :
   AST_PRI_PROG_W_CAUSE_FOUND=yes
 else
   AST_PRI_PROG_W_CAUSE_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_PROG_W_CAUSE_FOUND}" = "yes"; then
@@ -29428,9 +28271,8 @@ fi
          PRI_PROG_W_CAUSE_INCLUDE="-I${PRI_PROG_W_CAUSE_DIR}/include"
       fi
       PRI_PROG_W_CAUSE_INCLUDE="${PRI_PROG_W_CAUSE_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_PROG_W_CAUSE_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_PROG_W_CAUSE_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_PROG_W_CAUSE_HEADER_FOUND}" = "x0" ; then
          PRI_PROG_W_CAUSE_LIB=""
          PRI_PROG_W_CAUSE_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_PROG_W_CAUSE_LIB=""
-         fi
+
          PBX_PRI_PROG_W_CAUSE=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_PROG_W_CAUSE 1
@@ -29471,16 +28311,12 @@ if test "x${PBX_PRI_INBANDDISCONNECT}" != "x1" -a "${USE_PRI_INBANDDISCONNECT}"
          pbxlibdir="-L${PRI_INBANDDISCONNECT_DIR}"
       fi
    fi
-   pbxfuncname="pri_set_inbanddisconnect"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_INBANDDISCONNECT_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_set_inbanddisconnect in -lpri" >&5
+$as_echo_n "checking for pri_set_inbanddisconnect in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_set_inbanddisconnect+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -29494,35 +28330,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_set_inbanddisconnect ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_set_inbanddisconnect ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_set_inbanddisconnect=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_set_inbanddisconnect=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_set_inbanddisconnect" >&5
+$as_echo "$ac_cv_lib_pri_pri_set_inbanddisconnect" >&6; }
+if test "x$ac_cv_lib_pri_pri_set_inbanddisconnect" = xyes; then :
   AST_PRI_INBANDDISCONNECT_FOUND=yes
 else
   AST_PRI_INBANDDISCONNECT_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_INBANDDISCONNECT_FOUND}" = "yes"; then
@@ -29532,9 +28367,8 @@ fi
          PRI_INBANDDISCONNECT_INCLUDE="-I${PRI_INBANDDISCONNECT_DIR}/include"
       fi
       PRI_INBANDDISCONNECT_INCLUDE="${PRI_INBANDDISCONNECT_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_INBANDDISCONNECT_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_INBANDDISCONNECT_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_INBANDDISCONNECT_HEADER_FOUND}" = "x0" ; then
          PRI_INBANDDISCONNECT_LIB=""
          PRI_INBANDDISCONNECT_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_INBANDDISCONNECT_LIB=""
-         fi
+
          PBX_PRI_INBANDDISCONNECT=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_INBANDDISCONNECT 1
@@ -29575,16 +28407,12 @@ if test "x${PBX_PRI_SERVICE_MESSAGES}" != "x1" -a "${USE_PRI_SERVICE_MESSAGES}"
          pbxlibdir="-L${PRI_SERVICE_MESSAGES_DIR}"
       fi
    fi
-   pbxfuncname="pri_maintenance_service"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_SERVICE_MESSAGES_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_maintenance_service in -lpri" >&5
+$as_echo_n "checking for pri_maintenance_service in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_maintenance_service+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -29598,35 +28426,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_maintenance_service ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_maintenance_service ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_maintenance_service=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_maintenance_service=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_maintenance_service" >&5
+$as_echo "$ac_cv_lib_pri_pri_maintenance_service" >&6; }
+if test "x$ac_cv_lib_pri_pri_maintenance_service" = xyes; then :
   AST_PRI_SERVICE_MESSAGES_FOUND=yes
 else
   AST_PRI_SERVICE_MESSAGES_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_SERVICE_MESSAGES_FOUND}" = "yes"; then
@@ -29636,9 +28463,8 @@ fi
          PRI_SERVICE_MESSAGES_INCLUDE="-I${PRI_SERVICE_MESSAGES_DIR}/include"
       fi
       PRI_SERVICE_MESSAGES_INCLUDE="${PRI_SERVICE_MESSAGES_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_SERVICE_MESSAGES_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_SERVICE_MESSAGES_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_SERVICE_MESSAGES_HEADER_FOUND}" = "x0" ; then
          PRI_SERVICE_MESSAGES_LIB=""
          PRI_SERVICE_MESSAGES_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_SERVICE_MESSAGES_LIB=""
-         fi
+
          PBX_PRI_SERVICE_MESSAGES=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_SERVICE_MESSAGES 1
@@ -29679,16 +28503,12 @@ if test "x${PBX_PRI_REVERSE_CHARGE}" != "x1" -a "${USE_PRI_REVERSE_CHARGE}" != "
          pbxlibdir="-L${PRI_REVERSE_CHARGE_DIR}"
       fi
    fi
-   pbxfuncname="pri_sr_set_reversecharge"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_PRI_REVERSE_CHARGE_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_reversecharge in -lpri" >&5
+$as_echo_n "checking for pri_sr_set_reversecharge in -lpri... " >&6; }
+if ${ac_cv_lib_pri_pri_sr_set_reversecharge+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -29702,35 +28522,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char pri_sr_set_reversecharge ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return pri_sr_set_reversecharge ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_pri_pri_sr_set_reversecharge=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_pri_pri_sr_set_reversecharge=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_reversecharge" >&5
+$as_echo "$ac_cv_lib_pri_pri_sr_set_reversecharge" >&6; }
+if test "x$ac_cv_lib_pri_pri_sr_set_reversecharge" = xyes; then :
   AST_PRI_REVERSE_CHARGE_FOUND=yes
 else
   AST_PRI_REVERSE_CHARGE_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_PRI_REVERSE_CHARGE_FOUND}" = "yes"; then
@@ -29740,9 +28559,8 @@ fi
          PRI_REVERSE_CHARGE_INCLUDE="-I${PRI_REVERSE_CHARGE_DIR}/include"
       fi
       PRI_REVERSE_CHARGE_INCLUDE="${PRI_REVERSE_CHARGE_INCLUDE} "
-      if test "xlibpri.h" = "x" ; then # no header, assume found
-         PRI_REVERSE_CHARGE_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${PRI_REVERSE_CHARGE_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_REVERSE_CHARGE_HEADER_FOUND}" = "x0" ; then
          PRI_REVERSE_CHARGE_LIB=""
          PRI_REVERSE_CHARGE_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            PRI_REVERSE_CHARGE_LIB=""
-         fi
+
          PBX_PRI_REVERSE_CHARGE=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_PRI_REVERSE_CHARGE 1
@@ -29785,16 +28601,12 @@ if test "x${PBX_RESAMPLE}" != "x1" -a "${USE_RESAMPLE}" != "no"; then
          pbxlibdir="-L${RESAMPLE_DIR}"
       fi
    fi
-   pbxfuncname="resample_open"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_RESAMPLE_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_resample_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lresample" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lresample... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resample_open in -lresample" >&5
+$as_echo_n "checking for resample_open in -lresample... " >&6; }
+if ${ac_cv_lib_resample_resample_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -29808,35 +28620,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char resample_open ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return resample_open ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_resample_resample_open=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_resample_resample_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_resample_resample_open" >&5
+$as_echo "$ac_cv_lib_resample_resample_open" >&6; }
+if test "x$ac_cv_lib_resample_resample_open" = xyes; then :
   AST_RESAMPLE_FOUND=yes
 else
   AST_RESAMPLE_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_RESAMPLE_FOUND}" = "yes"; then
@@ -29846,9 +28657,8 @@ fi
          RESAMPLE_INCLUDE="-I${RESAMPLE_DIR}/include"
       fi
       RESAMPLE_INCLUDE="${RESAMPLE_INCLUDE} "
-      if test "xlibresample.h" = "x" ; then    # no header, assume found
-         RESAMPLE_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${RESAMPLE_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libresample.h" "ac_cv_header_libresample_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${RESAMPLE_HEADER_FOUND}" = "x0" ; then
          RESAMPLE_LIB=""
          RESAMPLE_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            RESAMPLE_LIB=""
-         fi
+
          PBX_RESAMPLE=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_RESAMPLE 1
@@ -29889,16 +28697,12 @@ if test "x${PBX_FFTW3}" != "x1" -a "${USE_FFTW3}" != "no"; then
          pbxlibdir="-L${FFTW3_DIR}"
       fi
    fi
-   pbxfuncname="fftw_alloc_real"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_FFTW3_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_fftw3_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lfftw3" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lfftw3... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_alloc_real in -lfftw3" >&5
+$as_echo_n "checking for fftw_alloc_real in -lfftw3... " >&6; }
+if ${ac_cv_lib_fftw3_fftw_alloc_real+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -29912,35 +28716,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char fftw_alloc_real ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return fftw_alloc_real ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_fftw3_fftw_alloc_real=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_fftw3_fftw_alloc_real=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_fftw3_fftw_alloc_real" >&5
+$as_echo "$ac_cv_lib_fftw3_fftw_alloc_real" >&6; }
+if test "x$ac_cv_lib_fftw3_fftw_alloc_real" = xyes; then :
   AST_FFTW3_FOUND=yes
 else
   AST_FFTW3_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_FFTW3_FOUND}" = "yes"; then
@@ -29950,9 +28753,8 @@ fi
          FFTW3_INCLUDE="-I${FFTW3_DIR}/include"
       fi
       FFTW3_INCLUDE="${FFTW3_INCLUDE} "
-      if test "xfftw3.h" = "x" ; then  # no header, assume found
-         FFTW3_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${FFTW3_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${FFTW3_HEADER_FOUND}" = "x0" ; then
          FFTW3_LIB=""
          FFTW3_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            FFTW3_LIB=""
-         fi
+
          PBX_FFTW3=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_FFTW3 1
@@ -29993,16 +28793,12 @@ if test "x${PBX_SNDFILE}" != "x1" -a "${USE_SNDFILE}" != "no"; then
          pbxlibdir="-L${SNDFILE_DIR}"
       fi
    fi
-   pbxfuncname="sf_open"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_SNDFILE_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_sndfile_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lsndfile" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lsndfile... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sf_open in -lsndfile" >&5
+$as_echo_n "checking for sf_open in -lsndfile... " >&6; }
+if ${ac_cv_lib_sndfile_sf_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -30016,35 +28812,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char sf_open ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return sf_open ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_sndfile_sf_open=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_sndfile_sf_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_sndfile_sf_open" >&5
+$as_echo "$ac_cv_lib_sndfile_sf_open" >&6; }
+if test "x$ac_cv_lib_sndfile_sf_open" = xyes; then :
   AST_SNDFILE_FOUND=yes
 else
   AST_SNDFILE_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_SNDFILE_FOUND}" = "yes"; then
@@ -30054,9 +28849,8 @@ fi
          SNDFILE_INCLUDE="-I${SNDFILE_DIR}/include"
       fi
       SNDFILE_INCLUDE="${SNDFILE_INCLUDE} "
-      if test "xsndfile.h" = "x" ; then        # no header, assume found
-         SNDFILE_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${SNDFILE_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "sndfile.h" "ac_cv_header_sndfile_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${SNDFILE_HEADER_FOUND}" = "x0" ; then
          SNDFILE_LIB=""
          SNDFILE_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            SNDFILE_LIB=""
-         fi
+
          PBX_SNDFILE=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_SNDFILE 1
 
 
     if test "x${PBX_SPANDSP}" != "x1" -a "${USE_SPANDSP}" != "no"; then
-        if test "xminimum version of SpanDSP" != "x"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for minimum version of SpanDSP" >&5
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for minimum version of SpanDSP" >&5
 $as_echo_n "checking for minimum version of SpanDSP... " >&6; }
-       else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if \"
-               #if SPANDSP_RELEASE_DATE < 20080516
-               #error \"spandsp 0.0.5 or greater is required\"
-               #endif
-       \" compiles using spandsp/version.h" >&5
-$as_echo_n "checking if \"
-               #if SPANDSP_RELEASE_DATE < 20080516
-               #error \"spandsp 0.0.5 or greater is required\"
-               #endif
-       \" compiles using spandsp/version.h... " >&6; }
-       fi
        saved_cppflags="${CPPFLAGS}"
        if test "x${SPANDSP_DIR}" != "x"; then
            SPANDSP_INCLUDE="-I${SPANDSP_DIR}/include"
@@ -30160,16 +28939,12 @@ if test "x${PBX_SPANDSP}" != "x1" -a "${USE_SPANDSP}" != "no"; then
          pbxlibdir="-L${SPANDSP_DIR}"
       fi
    fi
-   pbxfuncname="span_set_message_handler"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_SPANDSP_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_spandsp_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lspandsp" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lspandsp... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for span_set_message_handler in -lspandsp" >&5
+$as_echo_n "checking for span_set_message_handler in -lspandsp... " >&6; }
+if ${ac_cv_lib_spandsp_span_set_message_handler+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -30183,35 +28958,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char span_set_message_handler ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return span_set_message_handler ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_spandsp_span_set_message_handler=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_spandsp_span_set_message_handler=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_spandsp_span_set_message_handler" >&5
+$as_echo "$ac_cv_lib_spandsp_span_set_message_handler" >&6; }
+if test "x$ac_cv_lib_spandsp_span_set_message_handler" = xyes; then :
   AST_SPANDSP_FOUND=yes
 else
   AST_SPANDSP_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_SPANDSP_FOUND}" = "yes"; then
@@ -30221,9 +28995,8 @@ fi
          SPANDSP_INCLUDE="-I${SPANDSP_DIR}/include"
       fi
       SPANDSP_INCLUDE="${SPANDSP_INCLUDE} "
-      if test "xspandsp.h" = "x" ; then        # no header, assume found
-         SPANDSP_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${SPANDSP_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "spandsp.h" "ac_cv_header_spandsp_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${SPANDSP_HEADER_FOUND}" = "x0" ; then
          SPANDSP_LIB=""
          SPANDSP_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            SPANDSP_LIB=""
-         fi
+
          PBX_SPANDSP=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_SPANDSP 1
@@ -30269,16 +29040,12 @@ if test "x${PBX_SPANDSP}" != "x1" -a "${USE_SPANDSP}" != "no"; then
          pbxlibdir="-L${SPANDSP_DIR}"
       fi
    fi
-   pbxfuncname="t38_terminal_init"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_SPANDSP_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_spandsp_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lspandsp" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lspandsp... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for t38_terminal_init in -lspandsp" >&5
+$as_echo_n "checking for t38_terminal_init in -lspandsp... " >&6; }
+if ${ac_cv_lib_spandsp_t38_terminal_init+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -30292,35 +29059,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char t38_terminal_init ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return t38_terminal_init ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_spandsp_t38_terminal_init=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_spandsp_t38_terminal_init=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-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_spandsp_t38_terminal_init" >&5
+$as_echo "$ac_cv_lib_spandsp_t38_terminal_init" >&6; }
+if test "x$ac_cv_lib_spandsp_t38_terminal_init" = xyes; then :
   AST_SPANDSP_FOUND=yes
 else
   AST_SPANDSP_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_SPANDSP_FOUND}" = "yes"; then
@@ -30330,9 +29096,8 @@ fi
          SPANDSP_INCLUDE="-I${SPANDSP_DIR}/include"
       fi
       SPANDSP_INCLUDE="${SPANDSP_INCLUDE} "
-      if test "xspandsp.h" = "x" ; then        # no header, assume found
-         SPANDSP_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${SPANDSP_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "spandsp.h" "ac_cv_header_spandsp_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${SPANDSP_HEADER_FOUND}" = "x0" ; then
          SPANDSP_LIB=""
          SPANDSP_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            SPANDSP_LIB=""
-         fi
+
          PBX_SPANDSP=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_SPANDSP 1
@@ -30376,16 +29139,12 @@ if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
          pbxlibdir="-L${SS7_DIR}"
       fi
    fi
-   pbxfuncname="ss7_set_isup_timer"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_SS7_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_ss7_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lss7" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lss7... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ss7_set_isup_timer in -lss7" >&5
+$as_echo_n "checking for ss7_set_isup_timer in -lss7... " >&6; }
+if ${ac_cv_lib_ss7_ss7_set_isup_timer+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -30399,35 +29158,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char ss7_set_isup_timer ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return ss7_set_isup_timer ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_ss7_ss7_set_isup_timer=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_ss7_ss7_set_isup_timer=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-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_ss7_ss7_set_isup_timer" >&5
+$as_echo "$ac_cv_lib_ss7_ss7_set_isup_timer" >&6; }
+if test "x$ac_cv_lib_ss7_ss7_set_isup_timer" = xyes; then :
   AST_SS7_FOUND=yes
 else
   AST_SS7_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_SS7_FOUND}" = "yes"; then
@@ -30437,9 +29195,8 @@ fi
          SS7_INCLUDE="-I${SS7_DIR}/include"
       fi
       SS7_INCLUDE="${SS7_INCLUDE} "
-      if test "xlibss7.h" = "x" ; then # no header, assume found
-         SS7_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${SS7_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "libss7.h" "ac_cv_header_libss7_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${SS7_HEADER_FOUND}" = "x0" ; then
          SS7_LIB=""
          SS7_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            SS7_LIB=""
-         fi
+
          PBX_SS7=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_SS7 1
@@ -30481,16 +29236,12 @@ if test "x${PBX_OPENR2}" != "x1" -a "${USE_OPENR2}" != "no"; then
          pbxlibdir="-L${OPENR2_DIR}"
       fi
    fi
-   pbxfuncname="openr2_chan_new"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_OPENR2_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_openr2_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lopenr2" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lopenr2... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openr2_chan_new in -lopenr2" >&5
+$as_echo_n "checking for openr2_chan_new in -lopenr2... " >&6; }
+if ${ac_cv_lib_openr2_openr2_chan_new+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -30504,35 +29255,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char openr2_chan_new ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return openr2_chan_new ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_openr2_openr2_chan_new=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_openr2_openr2_chan_new=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-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_openr2_openr2_chan_new" >&5
+$as_echo "$ac_cv_lib_openr2_openr2_chan_new" >&6; }
+if test "x$ac_cv_lib_openr2_openr2_chan_new" = xyes; then :
   AST_OPENR2_FOUND=yes
 else
   AST_OPENR2_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_OPENR2_FOUND}" = "yes"; then
@@ -30542,9 +29292,8 @@ fi
          OPENR2_INCLUDE="-I${OPENR2_DIR}/include"
       fi
       OPENR2_INCLUDE="${OPENR2_INCLUDE} "
-      if test "xopenr2.h" = "x" ; then # no header, assume found
-         OPENR2_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${OPENR2_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "openr2.h" "ac_cv_header_openr2_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${OPENR2_HEADER_FOUND}" = "x0" ; then
          OPENR2_LIB=""
          OPENR2_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            OPENR2_LIB=""
-         fi
+
          PBX_OPENR2=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_OPENR2 1
@@ -30586,16 +29333,12 @@ if test "x${PBX_OPUS}" != "x1" -a "${USE_OPUS}" != "no"; then
          pbxlibdir="-L${OPUS_DIR}"
       fi
    fi
-   pbxfuncname="opus_encoder_create"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_OPUS_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_opus_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lopus" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lopus... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for opus_encoder_create in -lopus" >&5
+$as_echo_n "checking for opus_encoder_create in -lopus... " >&6; }
+if ${ac_cv_lib_opus_opus_encoder_create+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -30609,35 +29352,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char opus_encoder_create ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return opus_encoder_create ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_opus_opus_encoder_create=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_opus_opus_encoder_create=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_opus_opus_encoder_create" >&5
+$as_echo "$ac_cv_lib_opus_opus_encoder_create" >&6; }
+if test "x$ac_cv_lib_opus_opus_encoder_create" = xyes; then :
   AST_OPUS_FOUND=yes
 else
   AST_OPUS_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_OPUS_FOUND}" = "yes"; then
@@ -30647,9 +29389,8 @@ fi
          OPUS_INCLUDE="-I${OPUS_DIR}/include"
       fi
       OPUS_INCLUDE="${OPUS_INCLUDE} "
-      if test "xopus/opus.h" = "x" ; then      # no header, assume found
-         OPUS_HEADER_FOUND="1"
-      else                             # check for the header
+
+         # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
          CPPFLAGS="${CPPFLAGS} ${OPUS_INCLUDE}"
          ac_fn_c_check_header_mongrel "$LINENO" "opus/opus.h" "ac_cv_header_opus_opus_h" "$ac_includes_default"
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
+
       if test "x${OPUS_HEADER_FOUND}" = "x0" ; then
          OPUS_LIB=""
          OPUS_INCLUDE=""
       else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            OPUS_LIB=""
-         fi
+
          PBX_OPUS=1
          cat >>confdefs.h <<_ACEOF
 #define HAVE_OPUS 1
@@ -30696,16 +29435,12 @@ if test "x${PBX_OPUSFILE}" != "x1" -a "${USE_OPUSFILE}" != "no"; then
          pbxlibdir="-L${OPUSFILE_DIR}"
       fi
    fi
-   pbxfuncname="op_open_callbacks"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_OPUSFILE_FOUND=yes
-   else
+
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} $__opus_include"
-      as_ac_Lib=`$as_echo "ac_cv_lib_opusfile_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lopusfile" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lopusfile... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for op_open_callbacks in -lopusfile" >&5
+$as_echo_n "checking for op_open_callbacks in -lopusfile... " >&6; }
+if ${ac_cv_lib_opusfile_op_open_callbacks+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -30719,35 +29454,34 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char ${pbxfuncname} ();
+char op_open_callbacks ();
 int
 main ()
 {
-return ${pbxfuncname} ();
+return op_open_callbacks ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
+  ac_cv_lib_opusfile_op_open_callbacks=yes
 else
-  eval "$as_ac_Lib=no"
+  ac_cv_lib_opusfile_op_open_callbacks=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-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_opusfile_op_open_callbacks" >&5
+$as_echo "$ac_cv_lib_opusfile_op_open_callbacks" >&6; }
+if test "x$ac_cv_lib_opusfile_op_open_callbacks" = xyes; then :
   AST_OPUSFILE_FOUND=yes
 else
   AST_OPUSFILE_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
+
 
    # now check for the header.
    if test "${AST_OPUSFILE_FOUND}" = "yes"; then
@@ -30757,9 +29491,8 @@ fi
          OPUSFILE_INCLUDE="-I${OPUSFILE_DIR}/include"