]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
ensure that DAHDI_INCLUDE and ZAPTEL_INCLUDE are added in all the places needed
authorKevin P. Fleming <kpfleming@digium.com>
Thu, 3 Jul 2008 16:12:58 +0000 (16:12 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Thu, 3 Jul 2008 16:12:58 +0000 (16:12 +0000)
improve AST_EXT_LIB_CHECK to accept (and remember) additional CFLAGS data like it does in trunk already

(closes issue #12911)
Reported by: tzafrir

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127754 65c4cc65-6c06-0410-ace0-fbb531ad65f3

acinclude.m4
configure
configure.ac
main/Makefile

index 106688b69f8961dd7464751add9e4b809f7221a7..14271237b8ce390523d3d6b0d0a2fa645d1a129d 100644 (file)
@@ -42,7 +42,7 @@ AC_SUBST([$1_DIR])
 AC_SUBST([PBX_$1])
 ])
 
-# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data])
+# AST_EXT_LIB_CHECK([package symbol name], [package library name], [function to check], [package header], [additional LIB data], [additional INCLUDE data])
 
 AC_DEFUN([AST_EXT_LIB_CHECK],
 [
@@ -63,17 +63,14 @@ if test "${USE_$1}" != "no"; then
       if test "x${$1_DIR}" != "x"; then
          $1_LIB="${pbxlibdir} ${$1_LIB}"
         $1_INCLUDE="-I${$1_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${$1_DIR}/include"
-        if test "x$4" != "x" ; then
-           AC_CHECK_HEADER([${$1_DIR}/include/$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "x$4" != "x" ; then
-            AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
-        fi
       fi
+      $1_INCLUDE="${$1_INCLUDE} $6"
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${$1_INCLUDE}"
+      if test "x$4" != "x" ; then
+         AC_CHECK_HEADER([$4], [$1_HEADER_FOUND=1], [$1_HEADER_FOUND=0])
+      fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${$1_HEADER_FOUND}" = "x0" ; then
          if test -n "${$1_MANDATORY}" ;
          then
index 555027df81acd42739077167045442f3fd1e228c..8fa965b56f272b1aa2ad8a4c2d183794ad0fbcfa 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 122613 .
+# From configure.ac Revision: 125132 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61 for asterisk 1.4.
 #
       if test "x${ALSA_DIR}" != "x"; then
          ALSA_LIB="${pbxlibdir} ${ALSA_LIB}"
         ALSA_INCLUDE="-I${ALSA_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${ALSA_DIR}/include"
-        if test "xalsa/asoundlib.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${ALSA_DIR}/include/alsa/asoundlib.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${ALSA_DIR}/include/alsa/asoundlib.h" >&5
-echo $ECHO_N "checking for ${ALSA_DIR}/include/alsa/asoundlib.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${ALSA_DIR}/include/alsa/asoundlib.h usability" >&5
-echo $ECHO_N "checking ${ALSA_DIR}/include/alsa/asoundlib.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${ALSA_DIR}/include/alsa/asoundlib.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${ALSA_DIR}/include/alsa/asoundlib.h presence" >&5
-echo $ECHO_N "checking ${ALSA_DIR}/include/alsa/asoundlib.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${ALSA_DIR}/include/alsa/asoundlib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${ALSA_DIR}/include/alsa/asoundlib.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${ALSA_DIR}/include/alsa/asoundlib.h" >&5
-echo $ECHO_N "checking for ${ALSA_DIR}/include/alsa/asoundlib.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  ALSA_HEADER_FOUND=1
-else
-  ALSA_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xalsa/asoundlib.h" != "x" ; then
-            if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then
+      fi
+      ALSA_INCLUDE="${ALSA_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${ALSA_INCLUDE}"
+      if test "xalsa/asoundlib.h" != "x" ; then
+         if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for alsa/asoundlib.h" >&5
 echo $ECHO_N "checking for alsa/asoundlib.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_alsa_asoundlib_h+set}" = set; then
@@ -16709,8 +16567,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${ALSA_HEADER_FOUND}" = "x0" ; then
          if test -n "${ALSA_MANDATORY}" ;
          then
       if test "x${CURSES_DIR}" != "x"; then
          CURSES_LIB="${pbxlibdir} ${CURSES_LIB}"
         CURSES_INCLUDE="-I${CURSES_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${CURSES_DIR}/include"
-        if test "xcurses.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${CURSES_DIR}/include/curses.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${CURSES_DIR}/include/curses.h" >&5
-echo $ECHO_N "checking for ${CURSES_DIR}/include/curses.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${CURSES_DIR}/include/curses.h usability" >&5
-echo $ECHO_N "checking ${CURSES_DIR}/include/curses.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${CURSES_DIR}/include/curses.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${CURSES_DIR}/include/curses.h presence" >&5
-echo $ECHO_N "checking ${CURSES_DIR}/include/curses.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${CURSES_DIR}/include/curses.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CURSES_DIR}/include/curses.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${CURSES_DIR}/include/curses.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${CURSES_DIR}/include/curses.h" >&5
-echo $ECHO_N "checking for ${CURSES_DIR}/include/curses.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  CURSES_HEADER_FOUND=1
-else
-  CURSES_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xcurses.h" != "x" ; then
-            if test "${ac_cv_header_curses_h+set}" = set; then
+      fi
+      CURSES_INCLUDE="${CURSES_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${CURSES_INCLUDE}"
+      if test "xcurses.h" != "x" ; then
+         if test "${ac_cv_header_curses_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for curses.h" >&5
 echo $ECHO_N "checking for curses.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_curses_h+set}" = set; then
@@ -17118,8 +16834,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${CURSES_HEADER_FOUND}" = "x0" ; then
          if test -n "${CURSES_MANDATORY}" ;
          then
       if test "x${CAP_DIR}" != "x"; then
          CAP_LIB="${pbxlibdir} ${CAP_LIB}"
         CAP_INCLUDE="-I${CAP_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${CAP_DIR}/include"
-        if test "xsys/capability.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${CAP_DIR}/include/sys/capability.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${CAP_DIR}/include/sys/capability.h" >&5
-echo $ECHO_N "checking for ${CAP_DIR}/include/sys/capability.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      CAP_INCLUDE="${CAP_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${CAP_INCLUDE}"
+      if test "xsys/capability.h" != "x" ; then
+         if test "${ac_cv_header_sys_capability_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for sys/capability.h" >&5
+echo $ECHO_N "checking for sys/capability.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sys_capability_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_capability_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_capability_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${CAP_DIR}/include/sys/capability.h usability" >&5
-echo $ECHO_N "checking ${CAP_DIR}/include/sys/capability.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sys/capability.h usability" >&5
+echo $ECHO_N "checking sys/capability.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17268,7 +16984,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${CAP_DIR}/include/sys/capability.h>
+#include <sys/capability.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -17300,157 +17016,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${CAP_DIR}/include/sys/capability.h presence" >&5
-echo $ECHO_N "checking ${CAP_DIR}/include/sys/capability.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sys/capability.h presence" >&5
+echo $ECHO_N "checking sys/capability.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${CAP_DIR}/include/sys/capability.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${CAP_DIR}/include/sys/capability.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${CAP_DIR}/include/sys/capability.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CAP_DIR}/include/sys/capability.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${CAP_DIR}/include/sys/capability.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${CAP_DIR}/include/sys/capability.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${CAP_DIR}/include/sys/capability.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CAP_DIR}/include/sys/capability.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${CAP_DIR}/include/sys/capability.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CAP_DIR}/include/sys/capability.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${CAP_DIR}/include/sys/capability.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CAP_DIR}/include/sys/capability.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${CAP_DIR}/include/sys/capability.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CAP_DIR}/include/sys/capability.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${CAP_DIR}/include/sys/capability.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${CAP_DIR}/include/sys/capability.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${CAP_DIR}/include/sys/capability.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${CAP_DIR}/include/sys/capability.h" >&5
-echo $ECHO_N "checking for ${CAP_DIR}/include/sys/capability.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  CAP_HEADER_FOUND=1
-else
-  CAP_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xsys/capability.h" != "x" ; then
-            if test "${ac_cv_header_sys_capability_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for sys/capability.h" >&5
-echo $ECHO_N "checking for sys/capability.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sys_capability_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_capability_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_capability_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/capability.h usability" >&5
-echo $ECHO_N "checking sys/capability.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <sys/capability.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking sys/capability.h presence" >&5
-echo $ECHO_N "checking sys/capability.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/capability.h>
+#include <sys/capability.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -17528,8 +17102,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${CAP_HEADER_FOUND}" = "x0" ; then
          if test -n "${CAP_MANDATORY}" ;
          then
       if test "x${IKSEMEL_DIR}" != "x"; then
          IKSEMEL_LIB="${pbxlibdir} ${IKSEMEL_LIB}"
         IKSEMEL_INCLUDE="-I${IKSEMEL_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${IKSEMEL_DIR}/include"
-        if test "xiksemel.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${IKSEMEL_DIR}/include/iksemel.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${IKSEMEL_DIR}/include/iksemel.h" >&5
-echo $ECHO_N "checking for ${IKSEMEL_DIR}/include/iksemel.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${IKSEMEL_DIR}/include/iksemel.h usability" >&5
-echo $ECHO_N "checking ${IKSEMEL_DIR}/include/iksemel.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${IKSEMEL_DIR}/include/iksemel.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${IKSEMEL_DIR}/include/iksemel.h presence" >&5
-echo $ECHO_N "checking ${IKSEMEL_DIR}/include/iksemel.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${IKSEMEL_DIR}/include/iksemel.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${IKSEMEL_DIR}/include/iksemel.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${IKSEMEL_DIR}/include/iksemel.h" >&5
-echo $ECHO_N "checking for ${IKSEMEL_DIR}/include/iksemel.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  IKSEMEL_HEADER_FOUND=1
-else
-  IKSEMEL_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xiksemel.h" != "x" ; then
-            if test "${ac_cv_header_iksemel_h+set}" = set; then
+      fi
+      IKSEMEL_INCLUDE="${IKSEMEL_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${IKSEMEL_INCLUDE}"
+      if test "xiksemel.h" != "x" ; then
+         if test "${ac_cv_header_iksemel_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for iksemel.h" >&5
 echo $ECHO_N "checking for iksemel.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_iksemel_h+set}" = set; then
@@ -18791,8 +18223,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${IKSEMEL_HEADER_FOUND}" = "x0" ; then
          if test -n "${IKSEMEL_MANDATORY}" ;
          then
       if test "x${GNUTLS_DIR}" != "x"; then
          GNUTLS_LIB="${pbxlibdir} ${GNUTLS_LIB}"
         GNUTLS_INCLUDE="-I${GNUTLS_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${GNUTLS_DIR}/include"
-        if test "xgnutls/gnutls.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${GNUTLS_DIR}/include/gnutls/gnutls.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/gnutls/gnutls.h" >&5
-echo $ECHO_N "checking for ${GNUTLS_DIR}/include/gnutls/gnutls.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      GNUTLS_INCLUDE="${GNUTLS_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${GNUTLS_INCLUDE}"
+      if test "xgnutls/gnutls.h" != "x" ; then
+         if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for gnutls/gnutls.h" >&5
+echo $ECHO_N "checking for gnutls/gnutls.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_gnutls_gnutls_h" >&5
+echo "${ECHO_T}$ac_cv_header_gnutls_gnutls_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/gnutls/gnutls.h usability" >&5
-echo $ECHO_N "checking ${GNUTLS_DIR}/include/gnutls/gnutls.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking gnutls/gnutls.h usability" >&5
+echo $ECHO_N "checking gnutls/gnutls.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -18941,7 +18373,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${GNUTLS_DIR}/include/gnutls/gnutls.h>
+#include <gnutls/gnutls.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -18973,157 +18405,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${GNUTLS_DIR}/include/gnutls/gnutls.h presence" >&5
-echo $ECHO_N "checking ${GNUTLS_DIR}/include/gnutls/gnutls.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking gnutls/gnutls.h presence" >&5
+echo $ECHO_N "checking gnutls/gnutls.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${GNUTLS_DIR}/include/gnutls/gnutls.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${GNUTLS_DIR}/include/gnutls/gnutls.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${GNUTLS_DIR}/include/gnutls/gnutls.h" >&5
-echo $ECHO_N "checking for ${GNUTLS_DIR}/include/gnutls/gnutls.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  GNUTLS_HEADER_FOUND=1
-else
-  GNUTLS_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xgnutls/gnutls.h" != "x" ; then
-            if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for gnutls/gnutls.h" >&5
-echo $ECHO_N "checking for gnutls/gnutls.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_gnutls_gnutls_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_gnutls_gnutls_h" >&5
-echo "${ECHO_T}$ac_cv_header_gnutls_gnutls_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking gnutls/gnutls.h usability" >&5
-echo $ECHO_N "checking gnutls/gnutls.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <gnutls/gnutls.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking gnutls/gnutls.h presence" >&5
-echo $ECHO_N "checking gnutls/gnutls.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <gnutls/gnutls.h>
+#include <gnutls/gnutls.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -19201,8 +18491,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${GNUTLS_HEADER_FOUND}" = "x0" ; then
          if test -n "${GNUTLS_MANDATORY}" ;
          then
       if test "x${LTDL_DIR}" != "x"; then
          LTDL_LIB="${pbxlibdir} ${LTDL_LIB}"
         LTDL_INCLUDE="-I${LTDL_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${LTDL_DIR}/include"
-        if test "xltdl.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${LTDL_DIR}/include/ltdl.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${LTDL_DIR}/include/ltdl.h" >&5
-echo $ECHO_N "checking for ${LTDL_DIR}/include/ltdl.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${LTDL_DIR}/include/ltdl.h usability" >&5
-echo $ECHO_N "checking ${LTDL_DIR}/include/ltdl.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${LTDL_DIR}/include/ltdl.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${LTDL_DIR}/include/ltdl.h presence" >&5
-echo $ECHO_N "checking ${LTDL_DIR}/include/ltdl.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${LTDL_DIR}/include/ltdl.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${LTDL_DIR}/include/ltdl.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${LTDL_DIR}/include/ltdl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${LTDL_DIR}/include/ltdl.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${LTDL_DIR}/include/ltdl.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${LTDL_DIR}/include/ltdl.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${LTDL_DIR}/include/ltdl.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${LTDL_DIR}/include/ltdl.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${LTDL_DIR}/include/ltdl.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${LTDL_DIR}/include/ltdl.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${LTDL_DIR}/include/ltdl.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${LTDL_DIR}/include/ltdl.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${LTDL_DIR}/include/ltdl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${LTDL_DIR}/include/ltdl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${LTDL_DIR}/include/ltdl.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${LTDL_DIR}/include/ltdl.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${LTDL_DIR}/include/ltdl.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${LTDL_DIR}/include/ltdl.h" >&5
-echo $ECHO_N "checking for ${LTDL_DIR}/include/ltdl.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  LTDL_HEADER_FOUND=1
-else
-  LTDL_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xltdl.h" != "x" ; then
-            if test "${ac_cv_header_ltdl_h+set}" = set; then
+      fi
+      LTDL_INCLUDE="${LTDL_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${LTDL_INCLUDE}"
+      if test "xltdl.h" != "x" ; then
+         if test "${ac_cv_header_ltdl_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for ltdl.h" >&5
 echo $ECHO_N "checking for ltdl.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_ltdl_h+set}" = set; then
@@ -20456,8 +19604,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${LTDL_HEADER_FOUND}" = "x0" ; then
          if test -n "${LTDL_MANDATORY}" ;
          then
       if test "x${MISDN_DIR}" != "x"; then
          MISDN_LIB="${pbxlibdir} ${MISDN_LIB}"
         MISDN_INCLUDE="-I${MISDN_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${MISDN_DIR}/include"
-        if test "xmISDNuser/mISDNlib.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${MISDN_DIR}/include/mISDNuser/mISDNlib.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h" >&5
-echo $ECHO_N "checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      MISDN_INCLUDE="${MISDN_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${MISDN_INCLUDE}"
+      if test "xmISDNuser/mISDNlib.h" != "x" ; then
+         if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for mISDNuser/mISDNlib.h" >&5
+echo $ECHO_N "checking for mISDNuser/mISDNlib.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_mISDNlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_mISDNuser_mISDNlib_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h usability" >&5
-echo $ECHO_N "checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking mISDNuser/mISDNlib.h usability" >&5
+echo $ECHO_N "checking mISDNuser/mISDNlib.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20822,149 +19970,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${MISDN_DIR}/include/mISDNuser/mISDNlib.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h presence" >&5
-echo $ECHO_N "checking ${MISDN_DIR}/include/mISDNuser/mISDNlib.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${MISDN_DIR}/include/mISDNuser/mISDNlib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${MISDN_DIR}/include/mISDNuser/mISDNlib.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h" >&5
-echo $ECHO_N "checking for ${MISDN_DIR}/include/mISDNuser/mISDNlib.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  MISDN_HEADER_FOUND=1
-else
-  MISDN_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xmISDNuser/mISDNlib.h" != "x" ; then
-            if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for mISDNuser/mISDNlib.h" >&5
-echo $ECHO_N "checking for mISDNuser/mISDNlib.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_mISDNuser_mISDNlib_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_mISDNlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_mISDNuser_mISDNlib_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking mISDNuser/mISDNlib.h usability" >&5
-echo $ECHO_N "checking mISDNuser/mISDNlib.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <mISDNuser/mISDNlib.h>
+#include <mISDNuser/mISDNlib.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -21082,8 +20088,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${MISDN_HEADER_FOUND}" = "x0" ; then
          if test -n "${MISDN_MANDATORY}" ;
          then
       if test "x${ISDNNET_DIR}" != "x"; then
          ISDNNET_LIB="${pbxlibdir} ${ISDNNET_LIB}"
         ISDNNET_INCLUDE="-I${ISDNNET_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${ISDNNET_DIR}/include"
-        if test "xmISDNuser/isdn_net.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${ISDNNET_DIR}/include/mISDNuser/isdn_net.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h" >&5
-echo $ECHO_N "checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h usability" >&5
-echo $ECHO_N "checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${ISDNNET_DIR}/include/mISDNuser/isdn_net.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h presence" >&5
-echo $ECHO_N "checking ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${ISDNNET_DIR}/include/mISDNuser/isdn_net.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h" >&5
-echo $ECHO_N "checking for ${ISDNNET_DIR}/include/mISDNuser/isdn_net.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  ISDNNET_HEADER_FOUND=1
-else
-  ISDNNET_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xmISDNuser/isdn_net.h" != "x" ; then
-            if test "${ac_cv_header_mISDNuser_isdn_net_h+set}" = set; then
+      fi
+      ISDNNET_INCLUDE="${ISDNNET_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${ISDNNET_INCLUDE}"
+      if test "xmISDNuser/isdn_net.h" != "x" ; then
+         if test "${ac_cv_header_mISDNuser_isdn_net_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for mISDNuser/isdn_net.h" >&5
 echo $ECHO_N "checking for mISDNuser/isdn_net.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_mISDNuser_isdn_net_h+set}" = set; then
@@ -21492,8 +20356,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${ISDNNET_HEADER_FOUND}" = "x0" ; then
          if test -n "${ISDNNET_MANDATORY}" ;
          then
       if test "x${SUPPSERV_DIR}" != "x"; then
          SUPPSERV_LIB="${pbxlibdir} ${SUPPSERV_LIB}"
         SUPPSERV_INCLUDE="-I${SUPPSERV_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${SUPPSERV_DIR}/include"
-        if test "xmISDNuser/suppserv.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${SUPPSERV_DIR}/include/mISDNuser/suppserv.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h" >&5
-echo $ECHO_N "checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      SUPPSERV_INCLUDE="${SUPPSERV_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${SUPPSERV_INCLUDE}"
+      if test "xmISDNuser/suppserv.h" != "x" ; then
+         if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for mISDNuser/suppserv.h" >&5
+echo $ECHO_N "checking for mISDNuser/suppserv.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_suppserv_h" >&5
+echo "${ECHO_T}$ac_cv_header_mISDNuser_suppserv_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h usability" >&5
-echo $ECHO_N "checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking mISDNuser/suppserv.h usability" >&5
+echo $ECHO_N "checking mISDNuser/suppserv.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21640,7 +20504,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${SUPPSERV_DIR}/include/mISDNuser/suppserv.h>
+#include <mISDNuser/suppserv.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -21672,157 +20536,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h presence" >&5
-echo $ECHO_N "checking ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking mISDNuser/suppserv.h presence" >&5
+echo $ECHO_N "checking mISDNuser/suppserv.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${SUPPSERV_DIR}/include/mISDNuser/suppserv.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h" >&5
-echo $ECHO_N "checking for ${SUPPSERV_DIR}/include/mISDNuser/suppserv.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  SUPPSERV_HEADER_FOUND=1
-else
-  SUPPSERV_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xmISDNuser/suppserv.h" != "x" ; then
-            if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for mISDNuser/suppserv.h" >&5
-echo $ECHO_N "checking for mISDNuser/suppserv.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_mISDNuser_suppserv_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_mISDNuser_suppserv_h" >&5
-echo "${ECHO_T}$ac_cv_header_mISDNuser_suppserv_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking mISDNuser/suppserv.h usability" >&5
-echo $ECHO_N "checking mISDNuser/suppserv.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <mISDNuser/suppserv.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking mISDNuser/suppserv.h presence" >&5
-echo $ECHO_N "checking mISDNuser/suppserv.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <mISDNuser/suppserv.h>
+#include <mISDNuser/suppserv.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -21900,8 +20622,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${SUPPSERV_HEADER_FOUND}" = "x0" ; then
          if test -n "${SUPPSERV_MANDATORY}" ;
          then
       if test "x${NBS_DIR}" != "x"; then
          NBS_LIB="${pbxlibdir} ${NBS_LIB}"
         NBS_INCLUDE="-I${NBS_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${NBS_DIR}/include"
-        if test "xnbs.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${NBS_DIR}/include/nbs.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${NBS_DIR}/include/nbs.h" >&5
-echo $ECHO_N "checking for ${NBS_DIR}/include/nbs.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${NBS_DIR}/include/nbs.h usability" >&5
-echo $ECHO_N "checking ${NBS_DIR}/include/nbs.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${NBS_DIR}/include/nbs.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${NBS_DIR}/include/nbs.h presence" >&5
-echo $ECHO_N "checking ${NBS_DIR}/include/nbs.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${NBS_DIR}/include/nbs.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${NBS_DIR}/include/nbs.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${NBS_DIR}/include/nbs.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NBS_DIR}/include/nbs.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${NBS_DIR}/include/nbs.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${NBS_DIR}/include/nbs.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${NBS_DIR}/include/nbs.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NBS_DIR}/include/nbs.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${NBS_DIR}/include/nbs.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NBS_DIR}/include/nbs.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${NBS_DIR}/include/nbs.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NBS_DIR}/include/nbs.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${NBS_DIR}/include/nbs.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NBS_DIR}/include/nbs.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${NBS_DIR}/include/nbs.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NBS_DIR}/include/nbs.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${NBS_DIR}/include/nbs.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${NBS_DIR}/include/nbs.h" >&5
-echo $ECHO_N "checking for ${NBS_DIR}/include/nbs.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  NBS_HEADER_FOUND=1
-else
-  NBS_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xnbs.h" != "x" ; then
-            if test "${ac_cv_header_nbs_h+set}" = set; then
+      fi
+      NBS_INCLUDE="${NBS_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${NBS_INCLUDE}"
+      if test "xnbs.h" != "x" ; then
+         if test "${ac_cv_header_nbs_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for nbs.h" >&5
 echo $ECHO_N "checking for nbs.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_nbs_h+set}" = set; then
@@ -22449,8 +21029,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${NBS_HEADER_FOUND}" = "x0" ; then
          if test -n "${NBS_MANDATORY}" ;
          then
       if test "x${NCURSES_DIR}" != "x"; then
          NCURSES_LIB="${pbxlibdir} ${NCURSES_LIB}"
         NCURSES_INCLUDE="-I${NCURSES_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${NCURSES_DIR}/include"
-        if test "xcurses.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${NCURSES_DIR}/include/curses.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${NCURSES_DIR}/include/curses.h" >&5
-echo $ECHO_N "checking for ${NCURSES_DIR}/include/curses.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      NCURSES_INCLUDE="${NCURSES_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${NCURSES_INCLUDE}"
+      if test "xcurses.h" != "x" ; then
+         if test "${ac_cv_header_curses_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for curses.h" >&5
+echo $ECHO_N "checking for curses.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_curses_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5
+echo "${ECHO_T}$ac_cv_header_curses_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${NCURSES_DIR}/include/curses.h usability" >&5
-echo $ECHO_N "checking ${NCURSES_DIR}/include/curses.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking curses.h usability" >&5
+echo $ECHO_N "checking curses.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22598,7 +21178,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${NCURSES_DIR}/include/curses.h>
+#include <curses.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -22630,157 +21210,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${NCURSES_DIR}/include/curses.h presence" >&5
-echo $ECHO_N "checking ${NCURSES_DIR}/include/curses.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking curses.h presence" >&5
+echo $ECHO_N "checking curses.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${NCURSES_DIR}/include/curses.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${NCURSES_DIR}/include/curses.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${NCURSES_DIR}/include/curses.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NCURSES_DIR}/include/curses.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${NCURSES_DIR}/include/curses.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${NCURSES_DIR}/include/curses.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${NCURSES_DIR}/include/curses.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NCURSES_DIR}/include/curses.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${NCURSES_DIR}/include/curses.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NCURSES_DIR}/include/curses.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${NCURSES_DIR}/include/curses.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NCURSES_DIR}/include/curses.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${NCURSES_DIR}/include/curses.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NCURSES_DIR}/include/curses.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${NCURSES_DIR}/include/curses.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NCURSES_DIR}/include/curses.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${NCURSES_DIR}/include/curses.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${NCURSES_DIR}/include/curses.h" >&5
-echo $ECHO_N "checking for ${NCURSES_DIR}/include/curses.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  NCURSES_HEADER_FOUND=1
-else
-  NCURSES_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xcurses.h" != "x" ; then
-            if test "${ac_cv_header_curses_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for curses.h" >&5
-echo $ECHO_N "checking for curses.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_curses_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5
-echo "${ECHO_T}$ac_cv_header_curses_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking curses.h usability" >&5
-echo $ECHO_N "checking curses.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <curses.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking curses.h presence" >&5
-echo $ECHO_N "checking curses.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <curses.h>
+#include <curses.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -22858,8 +21296,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${NCURSES_HEADER_FOUND}" = "x0" ; then
          if test -n "${NCURSES_MANDATORY}" ;
          then
       if test "x${NEWT_DIR}" != "x"; then
          NEWT_LIB="${pbxlibdir} ${NEWT_LIB}"
         NEWT_INCLUDE="-I${NEWT_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${NEWT_DIR}/include"
-        if test "xnewt.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${NEWT_DIR}/include/newt.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${NEWT_DIR}/include/newt.h" >&5
-echo $ECHO_N "checking for ${NEWT_DIR}/include/newt.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${NEWT_DIR}/include/newt.h usability" >&5
-echo $ECHO_N "checking ${NEWT_DIR}/include/newt.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${NEWT_DIR}/include/newt.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${NEWT_DIR}/include/newt.h presence" >&5
-echo $ECHO_N "checking ${NEWT_DIR}/include/newt.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${NEWT_DIR}/include/newt.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${NEWT_DIR}/include/newt.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${NEWT_DIR}/include/newt.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NEWT_DIR}/include/newt.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${NEWT_DIR}/include/newt.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${NEWT_DIR}/include/newt.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${NEWT_DIR}/include/newt.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NEWT_DIR}/include/newt.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${NEWT_DIR}/include/newt.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NEWT_DIR}/include/newt.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${NEWT_DIR}/include/newt.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NEWT_DIR}/include/newt.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${NEWT_DIR}/include/newt.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NEWT_DIR}/include/newt.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${NEWT_DIR}/include/newt.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${NEWT_DIR}/include/newt.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${NEWT_DIR}/include/newt.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${NEWT_DIR}/include/newt.h" >&5
-echo $ECHO_N "checking for ${NEWT_DIR}/include/newt.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  NEWT_HEADER_FOUND=1
-else
-  NEWT_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xnewt.h" != "x" ; then
-            if test "${ac_cv_header_newt_h+set}" = set; then
+      fi
+      NEWT_INCLUDE="${NEWT_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${NEWT_INCLUDE}"
+      if test "xnewt.h" != "x" ; then
+         if test "${ac_cv_header_newt_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for newt.h" >&5
 echo $ECHO_N "checking for newt.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_newt_h+set}" = set; then
@@ -23591,8 +21887,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${NEWT_HEADER_FOUND}" = "x0" ; then
          if test -n "${NEWT_MANDATORY}" ;
          then
       if test "x${UNIXODBC_DIR}" != "x"; then
          UNIXODBC_LIB="${pbxlibdir} ${UNIXODBC_LIB}"
         UNIXODBC_INCLUDE="-I${UNIXODBC_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${UNIXODBC_DIR}/include"
-        if test "xsql.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${UNIXODBC_DIR}/include/sql.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${UNIXODBC_DIR}/include/sql.h" >&5
-echo $ECHO_N "checking for ${UNIXODBC_DIR}/include/sql.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      UNIXODBC_INCLUDE="${UNIXODBC_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${UNIXODBC_INCLUDE}"
+      if test "xsql.h" != "x" ; then
+         if test "${ac_cv_header_sql_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for sql.h" >&5
+echo $ECHO_N "checking for sql.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sql_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sql_h" >&5
+echo "${ECHO_T}$ac_cv_header_sql_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${UNIXODBC_DIR}/include/sql.h usability" >&5
-echo $ECHO_N "checking ${UNIXODBC_DIR}/include/sql.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sql.h usability" >&5
+echo $ECHO_N "checking sql.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23740,149 +22036,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${UNIXODBC_DIR}/include/sql.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${UNIXODBC_DIR}/include/sql.h presence" >&5
-echo $ECHO_N "checking ${UNIXODBC_DIR}/include/sql.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${UNIXODBC_DIR}/include/sql.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${UNIXODBC_DIR}/include/sql.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${UNIXODBC_DIR}/include/sql.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${UNIXODBC_DIR}/include/sql.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${UNIXODBC_DIR}/include/sql.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${UNIXODBC_DIR}/include/sql.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${UNIXODBC_DIR}/include/sql.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${UNIXODBC_DIR}/include/sql.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${UNIXODBC_DIR}/include/sql.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${UNIXODBC_DIR}/include/sql.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${UNIXODBC_DIR}/include/sql.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${UNIXODBC_DIR}/include/sql.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${UNIXODBC_DIR}/include/sql.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${UNIXODBC_DIR}/include/sql.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${UNIXODBC_DIR}/include/sql.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${UNIXODBC_DIR}/include/sql.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${UNIXODBC_DIR}/include/sql.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${UNIXODBC_DIR}/include/sql.h" >&5
-echo $ECHO_N "checking for ${UNIXODBC_DIR}/include/sql.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  UNIXODBC_HEADER_FOUND=1
-else
-  UNIXODBC_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xsql.h" != "x" ; then
-            if test "${ac_cv_header_sql_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for sql.h" >&5
-echo $ECHO_N "checking for sql.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sql_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sql_h" >&5
-echo "${ECHO_T}$ac_cv_header_sql_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sql.h usability" >&5
-echo $ECHO_N "checking sql.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <sql.h>
+#include <sql.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -24000,8 +22154,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${UNIXODBC_HEADER_FOUND}" = "x0" ; then
          if test -n "${UNIXODBC_MANDATORY}" ;
          then
       if test "x${OGG_DIR}" != "x"; then
          OGG_LIB="${pbxlibdir} ${OGG_LIB}"
         OGG_INCLUDE="-I${OGG_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${OGG_DIR}/include"
-        if test "x" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${OGG_DIR}/include/" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${OGG_DIR}/include/" >&5
-echo $ECHO_N "checking for ${OGG_DIR}/include/... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${OGG_DIR}/include/ usability" >&5
-echo $ECHO_N "checking ${OGG_DIR}/include/ usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${OGG_DIR}/include/>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${OGG_DIR}/include/ presence" >&5
-echo $ECHO_N "checking ${OGG_DIR}/include/ presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${OGG_DIR}/include/>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${OGG_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${OGG_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OGG_DIR}/include/: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${OGG_DIR}/include/: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${OGG_DIR}/include/: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${OGG_DIR}/include/: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OGG_DIR}/include/:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${OGG_DIR}/include/:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OGG_DIR}/include/: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${OGG_DIR}/include/: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OGG_DIR}/include/:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${OGG_DIR}/include/:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OGG_DIR}/include/: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${OGG_DIR}/include/: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OGG_DIR}/include/: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${OGG_DIR}/include/: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${OGG_DIR}/include/" >&5
-echo $ECHO_N "checking for ${OGG_DIR}/include/... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  OGG_HEADER_FOUND=1
-else
-  OGG_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "x" != "x" ; then
-            if test "${ac_cv_header_+set}" = set; then
+      fi
+      OGG_INCLUDE="${OGG_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${OGG_INCLUDE}"
+      if test "x" != "x" ; then
+         if test "${ac_cv_header_+set}" = set; then
   { echo "$as_me:$LINENO: checking for " >&5
 echo $ECHO_N "checking for ... $ECHO_C" >&6; }
 if test "${ac_cv_header_+set}" = set; then
@@ -24409,8 +22421,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${OGG_HEADER_FOUND}" = "x0" ; then
          if test -n "${OGG_MANDATORY}" ;
          then
       if test "x${OSS_DIR}" != "x"; then
          OSS_LIB="${pbxlibdir} ${OSS_LIB}"
         OSS_INCLUDE="-I${OSS_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${OSS_DIR}/include"
-        if test "xsoundcard.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${OSS_DIR}/include/soundcard.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/soundcard.h" >&5
-echo $ECHO_N "checking for ${OSS_DIR}/include/soundcard.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      OSS_INCLUDE="${OSS_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${OSS_INCLUDE}"
+      if test "xsoundcard.h" != "x" ; then
+         if test "${ac_cv_header_soundcard_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for soundcard.h" >&5
+echo $ECHO_N "checking for soundcard.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_soundcard_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_soundcard_h" >&5
+echo "${ECHO_T}$ac_cv_header_soundcard_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/soundcard.h usability" >&5
-echo $ECHO_N "checking ${OSS_DIR}/include/soundcard.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking soundcard.h usability" >&5
+echo $ECHO_N "checking soundcard.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24847,7 +22859,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${OSS_DIR}/include/soundcard.h>
+#include <soundcard.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -24879,157 +22891,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${OSS_DIR}/include/soundcard.h presence" >&5
-echo $ECHO_N "checking ${OSS_DIR}/include/soundcard.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking soundcard.h presence" >&5
+echo $ECHO_N "checking soundcard.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${OSS_DIR}/include/soundcard.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSS_DIR}/include/soundcard.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${OSS_DIR}/include/soundcard.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${OSS_DIR}/include/soundcard.h" >&5
-echo $ECHO_N "checking for ${OSS_DIR}/include/soundcard.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  OSS_HEADER_FOUND=1
-else
-  OSS_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xsoundcard.h" != "x" ; then
-            if test "${ac_cv_header_soundcard_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for soundcard.h" >&5
-echo $ECHO_N "checking for soundcard.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_soundcard_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_soundcard_h" >&5
-echo "${ECHO_T}$ac_cv_header_soundcard_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking soundcard.h usability" >&5
-echo $ECHO_N "checking soundcard.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <soundcard.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking soundcard.h presence" >&5
-echo $ECHO_N "checking soundcard.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <soundcard.h>
+#include <soundcard.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -25107,8 +22977,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${OSS_HEADER_FOUND}" = "x0" ; then
          if test -n "${OSS_MANDATORY}" ;
          then
       if test "x${POPT_DIR}" != "x"; then
          POPT_LIB="${pbxlibdir} ${POPT_LIB}"
         POPT_INCLUDE="-I${POPT_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${POPT_DIR}/include"
-        if test "xpopt.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${POPT_DIR}/include/popt.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${POPT_DIR}/include/popt.h" >&5
-echo $ECHO_N "checking for ${POPT_DIR}/include/popt.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${POPT_DIR}/include/popt.h usability" >&5
-echo $ECHO_N "checking ${POPT_DIR}/include/popt.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${POPT_DIR}/include/popt.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${POPT_DIR}/include/popt.h presence" >&5
-echo $ECHO_N "checking ${POPT_DIR}/include/popt.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${POPT_DIR}/include/popt.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${POPT_DIR}/include/popt.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${POPT_DIR}/include/popt.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${POPT_DIR}/include/popt.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${POPT_DIR}/include/popt.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${POPT_DIR}/include/popt.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${POPT_DIR}/include/popt.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${POPT_DIR}/include/popt.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${POPT_DIR}/include/popt.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${POPT_DIR}/include/popt.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${POPT_DIR}/include/popt.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${POPT_DIR}/include/popt.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${POPT_DIR}/include/popt.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${POPT_DIR}/include/popt.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${POPT_DIR}/include/popt.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${POPT_DIR}/include/popt.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${POPT_DIR}/include/popt.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${POPT_DIR}/include/popt.h" >&5
-echo $ECHO_N "checking for ${POPT_DIR}/include/popt.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  POPT_HEADER_FOUND=1
-else
-  POPT_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xpopt.h" != "x" ; then
-            if test "${ac_cv_header_popt_h+set}" = set; then
+      fi
+      POPT_INCLUDE="${POPT_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${POPT_INCLUDE}"
+      if test "xpopt.h" != "x" ; then
+         if test "${ac_cv_header_popt_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for popt.h" >&5
 echo $ECHO_N "checking for popt.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_popt_h+set}" = set; then
@@ -25858,8 +23586,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${POPT_HEADER_FOUND}" = "x0" ; then
          if test -n "${POPT_MANDATORY}" ;
          then
       if test "x${PRI_DIR}" != "x"; then
          PRI_LIB="${pbxlibdir} ${PRI_LIB}"
         PRI_INCLUDE="-I${PRI_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${PRI_DIR}/include"
-        if test "xlibpri.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${PRI_DIR}/include/libpri.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${PRI_DIR}/include/libpri.h" >&5
-echo $ECHO_N "checking for ${PRI_DIR}/include/libpri.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      PRI_INCLUDE="${PRI_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${PRI_INCLUDE}"
+      if test "xlibpri.h" != "x" ; then
+         if test "${ac_cv_header_libpri_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for libpri.h" >&5
+echo $ECHO_N "checking for libpri.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_libpri_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_libpri_h" >&5
+echo "${ECHO_T}$ac_cv_header_libpri_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${PRI_DIR}/include/libpri.h usability" >&5
-echo $ECHO_N "checking ${PRI_DIR}/include/libpri.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking libpri.h usability" >&5
+echo $ECHO_N "checking libpri.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -26007,7 +23735,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${PRI_DIR}/include/libpri.h>
+#include <libpri.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -26039,157 +23767,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${PRI_DIR}/include/libpri.h presence" >&5
-echo $ECHO_N "checking ${PRI_DIR}/include/libpri.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking libpri.h presence" >&5
+echo $ECHO_N "checking libpri.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${PRI_DIR}/include/libpri.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${PRI_DIR}/include/libpri.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${PRI_DIR}/include/libpri.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_DIR}/include/libpri.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${PRI_DIR}/include/libpri.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${PRI_DIR}/include/libpri.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${PRI_DIR}/include/libpri.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_DIR}/include/libpri.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${PRI_DIR}/include/libpri.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_DIR}/include/libpri.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${PRI_DIR}/include/libpri.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_DIR}/include/libpri.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${PRI_DIR}/include/libpri.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_DIR}/include/libpri.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${PRI_DIR}/include/libpri.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_DIR}/include/libpri.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${PRI_DIR}/include/libpri.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${PRI_DIR}/include/libpri.h" >&5
-echo $ECHO_N "checking for ${PRI_DIR}/include/libpri.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  PRI_HEADER_FOUND=1
-else
-  PRI_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xlibpri.h" != "x" ; then
-            if test "${ac_cv_header_libpri_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for libpri.h" >&5
-echo $ECHO_N "checking for libpri.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_libpri_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_libpri_h" >&5
-echo "${ECHO_T}$ac_cv_header_libpri_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking libpri.h usability" >&5
-echo $ECHO_N "checking libpri.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <libpri.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking libpri.h presence" >&5
-echo $ECHO_N "checking libpri.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <libpri.h>
+#include <libpri.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -26267,8 +23853,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${PRI_HEADER_FOUND}" = "x0" ; then
          if test -n "${PRI_MANDATORY}" ;
          then
       if test "x${PRI_VERSION_DIR}" != "x"; then
          PRI_VERSION_LIB="${pbxlibdir} ${PRI_VERSION_LIB}"
         PRI_VERSION_INCLUDE="-I${PRI_VERSION_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${PRI_VERSION_DIR}/include"
-        if test "xlibpri.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${PRI_VERSION_DIR}/include/libpri.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${PRI_VERSION_DIR}/include/libpri.h" >&5
-echo $ECHO_N "checking for ${PRI_VERSION_DIR}/include/libpri.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${PRI_VERSION_DIR}/include/libpri.h usability" >&5
-echo $ECHO_N "checking ${PRI_VERSION_DIR}/include/libpri.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${PRI_VERSION_DIR}/include/libpri.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${PRI_VERSION_DIR}/include/libpri.h presence" >&5
-echo $ECHO_N "checking ${PRI_VERSION_DIR}/include/libpri.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${PRI_VERSION_DIR}/include/libpri.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_VERSION_DIR}/include/libpri.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${PRI_VERSION_DIR}/include/libpri.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_VERSION_DIR}/include/libpri.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${PRI_VERSION_DIR}/include/libpri.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${PRI_VERSION_DIR}/include/libpri.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${PRI_VERSION_DIR}/include/libpri.h" >&5
-echo $ECHO_N "checking for ${PRI_VERSION_DIR}/include/libpri.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  PRI_VERSION_HEADER_FOUND=1
-else
-  PRI_VERSION_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xlibpri.h" != "x" ; then
-            if test "${ac_cv_header_libpri_h+set}" = set; then
+      fi
+      PRI_VERSION_INCLUDE="${PRI_VERSION_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${PRI_VERSION_INCLUDE}"
+      if test "xlibpri.h" != "x" ; then
+         if test "${ac_cv_header_libpri_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for libpri.h" >&5
 echo $ECHO_N "checking for libpri.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_libpri_h+set}" = set; then
@@ -26676,8 +24120,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${PRI_VERSION_HEADER_FOUND}" = "x0" ; then
          if test -n "${PRI_VERSION_MANDATORY}" ;
          then
       if test "x${RADIUS_DIR}" != "x"; then
          RADIUS_LIB="${pbxlibdir} ${RADIUS_LIB}"
         RADIUS_INCLUDE="-I${RADIUS_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${RADIUS_DIR}/include"
-        if test "xradiusclient-ng.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${RADIUS_DIR}/include/radiusclient-ng.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${RADIUS_DIR}/include/radiusclient-ng.h" >&5
-echo $ECHO_N "checking for ${RADIUS_DIR}/include/radiusclient-ng.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      RADIUS_INCLUDE="${RADIUS_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${RADIUS_INCLUDE}"
+      if test "xradiusclient-ng.h" != "x" ; then
+         if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for radiusclient-ng.h" >&5
+echo $ECHO_N "checking for radiusclient-ng.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_radiusclient_ng_h" >&5
+echo "${ECHO_T}$ac_cv_header_radiusclient_ng_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${RADIUS_DIR}/include/radiusclient-ng.h usability" >&5
-echo $ECHO_N "checking ${RADIUS_DIR}/include/radiusclient-ng.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking radiusclient-ng.h usability" >&5
+echo $ECHO_N "checking radiusclient-ng.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28894,149 +26338,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${RADIUS_DIR}/include/radiusclient-ng.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${RADIUS_DIR}/include/radiusclient-ng.h presence" >&5
-echo $ECHO_N "checking ${RADIUS_DIR}/include/radiusclient-ng.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${RADIUS_DIR}/include/radiusclient-ng.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${RADIUS_DIR}/include/radiusclient-ng.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${RADIUS_DIR}/include/radiusclient-ng.h" >&5
-echo $ECHO_N "checking for ${RADIUS_DIR}/include/radiusclient-ng.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  RADIUS_HEADER_FOUND=1
-else
-  RADIUS_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xradiusclient-ng.h" != "x" ; then
-            if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for radiusclient-ng.h" >&5
-echo $ECHO_N "checking for radiusclient-ng.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_radiusclient_ng_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_radiusclient_ng_h" >&5
-echo "${ECHO_T}$ac_cv_header_radiusclient_ng_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking radiusclient-ng.h usability" >&5
-echo $ECHO_N "checking radiusclient-ng.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <radiusclient-ng.h>
+#include <radiusclient-ng.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -29154,8 +26456,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${RADIUS_HEADER_FOUND}" = "x0" ; then
          if test -n "${RADIUS_MANDATORY}" ;
          then
       if test "x${SPEEX_DIR}" != "x"; then
          SPEEX_LIB="${pbxlibdir} ${SPEEX_LIB}"
         SPEEX_INCLUDE="-I${SPEEX_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${SPEEX_DIR}/include"
-        if test "xspeex/speex.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${SPEEX_DIR}/include/speex/speex.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${SPEEX_DIR}/include/speex/speex.h" >&5
-echo $ECHO_N "checking for ${SPEEX_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${SPEEX_DIR}/include/speex/speex.h usability" >&5
-echo $ECHO_N "checking ${SPEEX_DIR}/include/speex/speex.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${SPEEX_DIR}/include/speex/speex.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${SPEEX_DIR}/include/speex/speex.h presence" >&5
-echo $ECHO_N "checking ${SPEEX_DIR}/include/speex/speex.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${SPEEX_DIR}/include/speex/speex.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${SPEEX_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${SPEEX_DIR}/include/speex/speex.h" >&5
-echo $ECHO_N "checking for ${SPEEX_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  SPEEX_HEADER_FOUND=1
-else
-  SPEEX_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xspeex/speex.h" != "x" ; then
-            if test "${ac_cv_header_speex_speex_h+set}" = set; then
+      fi
+      SPEEX_INCLUDE="${SPEEX_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${SPEEX_INCLUDE}"
+      if test "xspeex/speex.h" != "x" ; then
+         if test "${ac_cv_header_speex_speex_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
 echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_speex_speex_h+set}" = set; then
@@ -29563,8 +26723,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${SPEEX_HEADER_FOUND}" = "x0" ; then
          if test -n "${SPEEX_MANDATORY}" ;
          then
       if test "x${SPEEX_PREPROCESS_DIR}" != "x"; then
          SPEEX_PREPROCESS_LIB="${pbxlibdir} ${SPEEX_PREPROCESS_LIB}"
         SPEEX_PREPROCESS_INCLUDE="-I${SPEEX_PREPROCESS_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${SPEEX_PREPROCESS_DIR}/include"
-        if test "xspeex/speex.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${SPEEX_PREPROCESS_DIR}/include/speex/speex.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h" >&5
-echo $ECHO_N "checking for ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      SPEEX_PREPROCESS_INCLUDE="${SPEEX_PREPROCESS_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${SPEEX_PREPROCESS_INCLUDE}"
+      if test "xspeex/speex.h" != "x" ; then
+         if test "${ac_cv_header_speex_speex_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
+echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_speex_speex_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
+echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h usability" >&5
-echo $ECHO_N "checking ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking speex/speex.h usability" >&5
+echo $ECHO_N "checking speex/speex.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29713,7 +26873,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${SPEEX_PREPROCESS_DIR}/include/speex/speex.h>
+#include <speex/speex.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -29745,157 +26905,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h presence" >&5
-echo $ECHO_N "checking ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking speex/speex.h presence" >&5
+echo $ECHO_N "checking speex/speex.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${SPEEX_PREPROCESS_DIR}/include/speex/speex.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h" >&5
-echo $ECHO_N "checking for ${SPEEX_PREPROCESS_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  SPEEX_PREPROCESS_HEADER_FOUND=1
-else
-  SPEEX_PREPROCESS_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xspeex/speex.h" != "x" ; then
-            if test "${ac_cv_header_speex_speex_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
-echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_speex_speex_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_speex_speex_h" >&5
-echo "${ECHO_T}$ac_cv_header_speex_speex_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking speex/speex.h usability" >&5
-echo $ECHO_N "checking speex/speex.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <speex/speex.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking speex/speex.h presence" >&5
-echo $ECHO_N "checking speex/speex.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <speex/speex.h>
+#include <speex/speex.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -29973,8 +26991,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${SPEEX_PREPROCESS_HEADER_FOUND}" = "x0" ; then
          if test -n "${SPEEX_PREPROCESS_MANDATORY}" ;
          then
       if test "x${SPEEXDSP_DIR}" != "x"; then
          SPEEXDSP_LIB="${pbxlibdir} ${SPEEXDSP_LIB}"
         SPEEXDSP_INCLUDE="-I${SPEEXDSP_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${SPEEXDSP_DIR}/include"
-        if test "xspeex/speex.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${SPEEXDSP_DIR}/include/speex/speex.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${SPEEXDSP_DIR}/include/speex/speex.h" >&5
-echo $ECHO_N "checking for ${SPEEXDSP_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${SPEEXDSP_DIR}/include/speex/speex.h usability" >&5
-echo $ECHO_N "checking ${SPEEXDSP_DIR}/include/speex/speex.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${SPEEXDSP_DIR}/include/speex/speex.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${SPEEXDSP_DIR}/include/speex/speex.h presence" >&5
-echo $ECHO_N "checking ${SPEEXDSP_DIR}/include/speex/speex.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${SPEEXDSP_DIR}/include/speex/speex.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${SPEEXDSP_DIR}/include/speex/speex.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${SPEEXDSP_DIR}/include/speex/speex.h" >&5
-echo $ECHO_N "checking for ${SPEEXDSP_DIR}/include/speex/speex.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  SPEEXDSP_HEADER_FOUND=1
-else
-  SPEEXDSP_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xspeex/speex.h" != "x" ; then
-            if test "${ac_cv_header_speex_speex_h+set}" = set; then
+      fi
+      SPEEXDSP_INCLUDE="${SPEEXDSP_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${SPEEXDSP_INCLUDE}"
+      if test "xspeex/speex.h" != "x" ; then
+         if test "${ac_cv_header_speex_speex_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for speex/speex.h" >&5
 echo $ECHO_N "checking for speex/speex.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_speex_speex_h+set}" = set; then
@@ -30385,8 +27261,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${SPEEXDSP_HEADER_FOUND}" = "x0" ; then
          if test -n "${SPEEXDSP_MANDATORY}" ;
          then
       if test "x${SQLITE_DIR}" != "x"; then
          SQLITE_LIB="${pbxlibdir} ${SQLITE_LIB}"
         SQLITE_INCLUDE="-I${SQLITE_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${SQLITE_DIR}/include"
-        if test "xsqlite.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${SQLITE_DIR}/include/sqlite.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${SQLITE_DIR}/include/sqlite.h" >&5
-echo $ECHO_N "checking for ${SQLITE_DIR}/include/sqlite.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+      fi
+      SQLITE_INCLUDE="${SQLITE_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${SQLITE_INCLUDE}"
+      if test "xsqlite.h" != "x" ; then
+         if test "${ac_cv_header_sqlite_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for sqlite.h" >&5
+echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sqlite_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
+echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${SQLITE_DIR}/include/sqlite.h usability" >&5
-echo $ECHO_N "checking ${SQLITE_DIR}/include/sqlite.h usability... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite.h usability" >&5
+echo $ECHO_N "checking sqlite.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30539,7 +27415,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <${SQLITE_DIR}/include/sqlite.h>
+#include <sqlite.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -30571,157 +27447,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking ${SQLITE_DIR}/include/sqlite.h presence" >&5
-echo $ECHO_N "checking ${SQLITE_DIR}/include/sqlite.h presence... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: checking sqlite.h presence" >&5
+echo $ECHO_N "checking sqlite.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <${SQLITE_DIR}/include/sqlite.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${SQLITE_DIR}/include/sqlite.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${SQLITE_DIR}/include/sqlite.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${SQLITE_DIR}/include/sqlite.h" >&5
-echo $ECHO_N "checking for ${SQLITE_DIR}/include/sqlite.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  SQLITE_HEADER_FOUND=1
-else
-  SQLITE_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xsqlite.h" != "x" ; then
-            if test "${ac_cv_header_sqlite_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for sqlite.h" >&5
-echo $ECHO_N "checking for sqlite.h... $ECHO_C" >&6; }
-if test "${ac_cv_header_sqlite_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sqlite_h" >&5
-echo "${ECHO_T}$ac_cv_header_sqlite_h" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sqlite.h usability" >&5
-echo $ECHO_N "checking sqlite.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <sqlite.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking sqlite.h presence" >&5
-echo $ECHO_N "checking sqlite.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sqlite.h>
+#include <sqlite.h>
 _ACEOF
 if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
@@ -30799,8 +27533,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${SQLITE_HEADER_FOUND}" = "x0" ; then
          if test -n "${SQLITE_MANDATORY}" ;
          then
       if test "x${OPENSSL_DIR}" != "x"; then
          OPENSSL_LIB="${pbxlibdir} ${OPENSSL_LIB}"
         OPENSSL_INCLUDE="-I${OPENSSL_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${OPENSSL_DIR}/include"
-        if test "xopenssl/ssl.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${OPENSSL_DIR}/include/openssl/ssl.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${OPENSSL_DIR}/include/openssl/ssl.h" >&5
-echo $ECHO_N "checking for ${OPENSSL_DIR}/include/openssl/ssl.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${OPENSSL_DIR}/include/openssl/ssl.h usability" >&5
-echo $ECHO_N "checking ${OPENSSL_DIR}/include/openssl/ssl.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${OPENSSL_DIR}/include/openssl/ssl.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${OPENSSL_DIR}/include/openssl/ssl.h presence" >&5
-echo $ECHO_N "checking ${OPENSSL_DIR}/include/openssl/ssl.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${OPENSSL_DIR}/include/openssl/ssl.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${OPENSSL_DIR}/include/openssl/ssl.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${OPENSSL_DIR}/include/openssl/ssl.h" >&5
-echo $ECHO_N "checking for ${OPENSSL_DIR}/include/openssl/ssl.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  OPENSSL_HEADER_FOUND=1
-else
-  OPENSSL_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xopenssl/ssl.h" != "x" ; then
-            if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
+      fi
+      OPENSSL_INCLUDE="${OPENSSL_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${OPENSSL_INCLUDE}"
+      if test "xopenssl/ssl.h" != "x" ; then
+         if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
 echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
@@ -31208,8 +27800,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${OPENSSL_HEADER_FOUND}" = "x0" ; then
          if test -n "${OPENSSL_MANDATORY}" ;
          then
       if test "x${OSPTK_DIR}" != "x"; then
          OSPTK_LIB="${pbxlibdir} ${OSPTK_LIB}"
         OSPTK_INCLUDE="-I${OSPTK_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${OSPTK_DIR}/include"
-        if test "xosp/osp.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${OSPTK_DIR}/include/osp/osp.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${OSPTK_DIR}/include/osp/osp.h" >&5
-echo $ECHO_N "checking for ${OSPTK_DIR}/include/osp/osp.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${OSPTK_DIR}/include/osp/osp.h usability" >&5
-echo $ECHO_N "checking ${OSPTK_DIR}/include/osp/osp.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${OSPTK_DIR}/include/osp/osp.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${OSPTK_DIR}/include/osp/osp.h presence" >&5
-echo $ECHO_N "checking ${OSPTK_DIR}/include/osp/osp.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${OSPTK_DIR}/include/osp/osp.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${OSPTK_DIR}/include/osp/osp.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${OSPTK_DIR}/include/osp/osp.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${OSPTK_DIR}/include/osp/osp.h" >&5
-echo $ECHO_N "checking for ${OSPTK_DIR}/include/osp/osp.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  OSPTK_HEADER_FOUND=1
-else
-  OSPTK_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xosp/osp.h" != "x" ; then
-            if test "${ac_cv_header_osp_osp_h+set}" = set; then
+      fi
+      OSPTK_INCLUDE="${OSPTK_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${OSPTK_INCLUDE}"
+      if test "xosp/osp.h" != "x" ; then
+         if test "${ac_cv_header_osp_osp_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for osp/osp.h" >&5
 echo $ECHO_N "checking for osp/osp.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_osp_osp_h+set}" = set; then
@@ -31618,8 +28068,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${OSPTK_HEADER_FOUND}" = "x0" ; then
          if test -n "${OSPTK_MANDATORY}" ;
          then
@@ -31730,168 +28180,26 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 LIBS=$ac_check_lib_save_LIBS
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_lib_tds_tds_version" >&5
-echo "${ECHO_T}$ac_cv_lib_tds_tds_version" >&6; }
-if test $ac_cv_lib_tds_tds_version = yes; then
-  AST_FREETDS_FOUND=yes
-else
-  AST_FREETDS_FOUND=no
-fi
-
-
-   if test "${AST_FREETDS_FOUND}" = "yes"; then
-      FREETDS_LIB="-ltds "
-      FREETDS_HEADER_FOUND="1"
-      if test "x${FREETDS_DIR}" != "x"; then
-         FREETDS_LIB="${pbxlibdir} ${FREETDS_LIB}"
-        FREETDS_INCLUDE="-I${FREETDS_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${FREETDS_DIR}/include"
-        if test "xtds.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${FREETDS_DIR}/include/tds.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${FREETDS_DIR}/include/tds.h" >&5
-echo $ECHO_N "checking for ${FREETDS_DIR}/include/tds.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${FREETDS_DIR}/include/tds.h usability" >&5
-echo $ECHO_N "checking ${FREETDS_DIR}/include/tds.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${FREETDS_DIR}/include/tds.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${FREETDS_DIR}/include/tds.h presence" >&5
-echo $ECHO_N "checking ${FREETDS_DIR}/include/tds.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${FREETDS_DIR}/include/tds.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${FREETDS_DIR}/include/tds.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${FREETDS_DIR}/include/tds.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${FREETDS_DIR}/include/tds.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${FREETDS_DIR}/include/tds.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${FREETDS_DIR}/include/tds.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${FREETDS_DIR}/include/tds.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${FREETDS_DIR}/include/tds.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${FREETDS_DIR}/include/tds.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${FREETDS_DIR}/include/tds.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${FREETDS_DIR}/include/tds.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${FREETDS_DIR}/include/tds.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${FREETDS_DIR}/include/tds.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${FREETDS_DIR}/include/tds.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${FREETDS_DIR}/include/tds.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${FREETDS_DIR}/include/tds.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${FREETDS_DIR}/include/tds.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${FREETDS_DIR}/include/tds.h" >&5
-echo $ECHO_N "checking for ${FREETDS_DIR}/include/tds.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  FREETDS_HEADER_FOUND=1
+echo "${ECHO_T}$ac_cv_lib_tds_tds_version" >&6; }
+if test $ac_cv_lib_tds_tds_version = yes; then
+  AST_FREETDS_FOUND=yes
 else
-  FREETDS_HEADER_FOUND=0
+  AST_FREETDS_FOUND=no
 fi
 
 
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xtds.h" != "x" ; then
-            if test "${ac_cv_header_tds_h+set}" = set; then
+   if test "${AST_FREETDS_FOUND}" = "yes"; then
+      FREETDS_LIB="-ltds "
+      FREETDS_HEADER_FOUND="1"
+      if test "x${FREETDS_DIR}" != "x"; then
+         FREETDS_LIB="${pbxlibdir} ${FREETDS_LIB}"
+        FREETDS_INCLUDE="-I${FREETDS_DIR}/include"
+      fi
+      FREETDS_INCLUDE="${FREETDS_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${FREETDS_INCLUDE}"
+      if test "xtds.h" != "x" ; then
+         if test "${ac_cv_header_tds_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for tds.h" >&5
 echo $ECHO_N "checking for tds.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_tds_h+set}" = set; then
@@ -32028,8 +28336,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${FREETDS_HEADER_FOUND}" = "x0" ; then
          if test -n "${FREETDS_MANDATORY}" ;
          then
       if test "x${TERMCAP_DIR}" != "x"; then
          TERMCAP_LIB="${pbxlibdir} ${TERMCAP_LIB}"
         TERMCAP_INCLUDE="-I${TERMCAP_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${TERMCAP_DIR}/include"
-        if test "x" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${TERMCAP_DIR}/include/" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${TERMCAP_DIR}/include/" >&5
-echo $ECHO_N "checking for ${TERMCAP_DIR}/include/... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${TERMCAP_DIR}/include/ usability" >&5
-echo $ECHO_N "checking ${TERMCAP_DIR}/include/ usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${TERMCAP_DIR}/include/>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${TERMCAP_DIR}/include/ presence" >&5
-echo $ECHO_N "checking ${TERMCAP_DIR}/include/ presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${TERMCAP_DIR}/include/>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${TERMCAP_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${TERMCAP_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TERMCAP_DIR}/include/: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${TERMCAP_DIR}/include/: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${TERMCAP_DIR}/include/: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${TERMCAP_DIR}/include/: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TERMCAP_DIR}/include/:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${TERMCAP_DIR}/include/:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TERMCAP_DIR}/include/: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${TERMCAP_DIR}/include/: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TERMCAP_DIR}/include/:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${TERMCAP_DIR}/include/:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TERMCAP_DIR}/include/: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${TERMCAP_DIR}/include/: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TERMCAP_DIR}/include/: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${TERMCAP_DIR}/include/: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${TERMCAP_DIR}/include/" >&5
-echo $ECHO_N "checking for ${TERMCAP_DIR}/include/... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  TERMCAP_HEADER_FOUND=1
-else
-  TERMCAP_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "x" != "x" ; then
-            if test "${ac_cv_header_+set}" = set; then
+      fi
+      TERMCAP_INCLUDE="${TERMCAP_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${TERMCAP_INCLUDE}"
+      if test "x" != "x" ; then
+         if test "${ac_cv_header_+set}" = set; then
   { echo "$as_me:$LINENO: checking for " >&5
 echo $ECHO_N "checking for ... $ECHO_C" >&6; }
 if test "${ac_cv_header_+set}" = set; then
@@ -32464,8 +28630,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${TERMCAP_HEADER_FOUND}" = "x0" ; then
          if test -n "${TERMCAP_MANDATORY}" ;
          then
@@ -32575,168 +28741,26 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 LIBS=$ac_check_lib_save_LIBS
 fi
 { echo "$as_me:$LINENO: result: $ac_cv_lib_tinfo_tgetent" >&5
-echo "${ECHO_T}$ac_cv_lib_tinfo_tgetent" >&6; }
-if test $ac_cv_lib_tinfo_tgetent = yes; then
-  AST_TINFO_FOUND=yes
-else
-  AST_TINFO_FOUND=no
-fi
-
-
-   if test "${AST_TINFO_FOUND}" = "yes"; then
-      TINFO_LIB="-ltinfo "
-      TINFO_HEADER_FOUND="1"
-      if test "x${TINFO_DIR}" != "x"; then
-         TINFO_LIB="${pbxlibdir} ${TINFO_LIB}"
-        TINFO_INCLUDE="-I${TINFO_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${TINFO_DIR}/include"
-        if test "x" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${TINFO_DIR}/include/" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${TINFO_DIR}/include/" >&5
-echo $ECHO_N "checking for ${TINFO_DIR}/include/... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${TINFO_DIR}/include/ usability" >&5
-echo $ECHO_N "checking ${TINFO_DIR}/include/ usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${TINFO_DIR}/include/>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${TINFO_DIR}/include/ presence" >&5
-echo $ECHO_N "checking ${TINFO_DIR}/include/ presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${TINFO_DIR}/include/>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${TINFO_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${TINFO_DIR}/include/: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TINFO_DIR}/include/: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${TINFO_DIR}/include/: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${TINFO_DIR}/include/: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${TINFO_DIR}/include/: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TINFO_DIR}/include/:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${TINFO_DIR}/include/:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TINFO_DIR}/include/: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${TINFO_DIR}/include/: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TINFO_DIR}/include/:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${TINFO_DIR}/include/:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TINFO_DIR}/include/: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${TINFO_DIR}/include/: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TINFO_DIR}/include/: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${TINFO_DIR}/include/: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${TINFO_DIR}/include/" >&5
-echo $ECHO_N "checking for ${TINFO_DIR}/include/... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  TINFO_HEADER_FOUND=1
+echo "${ECHO_T}$ac_cv_lib_tinfo_tgetent" >&6; }
+if test $ac_cv_lib_tinfo_tgetent = yes; then
+  AST_TINFO_FOUND=yes
 else
-  TINFO_HEADER_FOUND=0
+  AST_TINFO_FOUND=no
 fi
 
 
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "x" != "x" ; then
-            if test "${ac_cv_header_+set}" = set; then
+   if test "${AST_TINFO_FOUND}" = "yes"; then
+      TINFO_LIB="-ltinfo "
+      TINFO_HEADER_FOUND="1"
+      if test "x${TINFO_DIR}" != "x"; then
+         TINFO_LIB="${pbxlibdir} ${TINFO_LIB}"
+        TINFO_INCLUDE="-I${TINFO_DIR}/include"
+      fi
+      TINFO_INCLUDE="${TINFO_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${TINFO_INCLUDE}"
+      if test "x" != "x" ; then
+         if test "${ac_cv_header_+set}" = set; then
   { echo "$as_me:$LINENO: checking for " >&5
 echo $ECHO_N "checking for ... $ECHO_C" >&6; }
 if test "${ac_cv_header_+set}" = set; then
@@ -32873,8 +28897,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${TINFO_HEADER_FOUND}" = "x0" ; then
          if test -n "${TINFO_MANDATORY}" ;
          then
 if test "${PBX_DAHDI}" = "1" || test "${USE_ZAPTEL}" = "no"; then
   tonezone_dir="dahdi"
    if test "x${DAHDI_DIR}" != "x"; then
-      tonezone_extra="${tonezone_extra} -I${DAHDI_DIR}/include"
+      tonezone_extra="${tonezone_extra} ${DAHDI_INCLUDE}"
    fi
 else
   tonezone_dir="zaptel"
    if test "x${ZAPTEL_DIR}" != "x"; then
-      tonezone_extra="${tonezone_extra} -I${ZAPTEL_DIR}/include"
+      tonezone_extra="${tonezone_extra} ${ZAPTEL_INCLUDE}"
    fi
 fi
 
       if test "x${TONEZONE_DIR}" != "x"; then
          TONEZONE_LIB="${pbxlibdir} ${TONEZONE_LIB}"
         TONEZONE_INCLUDE="-I${TONEZONE_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${TONEZONE_DIR}/include"
-        if test "x${tonezone_dir}/tonezone.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h" >&5
-echo $ECHO_N "checking for ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h usability" >&5
-echo $ECHO_N "checking ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h presence" >&5
-echo $ECHO_N "checking ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h" >&5
-echo $ECHO_N "checking for ${TONEZONE_DIR}/include/${tonezone_dir}/tonezone.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  TONEZONE_HEADER_FOUND=1
-else
-  TONEZONE_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "x${tonezone_dir}/tonezone.h" != "x" ; then
-            as_ac_Header=`echo "ac_cv_header_${tonezone_dir}/tonezone.h" | $as_tr_sh`
+      fi
+      TONEZONE_INCLUDE="${TONEZONE_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${TONEZONE_INCLUDE}"
+      if test "x${tonezone_dir}/tonezone.h" != "x" ; then
+         as_ac_Header=`echo "ac_cv_header_${tonezone_dir}/tonezone.h" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   { echo "$as_me:$LINENO: checking for ${tonezone_dir}/tonezone.h" >&5
 echo $ECHO_N "checking for ${tonezone_dir}/tonezone.h... $ECHO_C" >&6; }
@@ -33301,8 +29183,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${TONEZONE_HEADER_FOUND}" = "x0" ; then
          if test -n "${TONEZONE_MANDATORY}" ;
          then
 
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_init" >&5
-echo "${ECHO_T}$ac_cv_lib_usb_usb_init" >&6; }
-if test $ac_cv_lib_usb_usb_init = yes; then
-  AST_USB_FOUND=yes
-else
-  AST_USB_FOUND=no
-fi
-
-
-   if test "${AST_USB_FOUND}" = "yes"; then
-      USB_LIB="-lusb "
-      USB_HEADER_FOUND="1"
-      if test "x${USB_DIR}" != "x"; then
-         USB_LIB="${pbxlibdir} ${USB_LIB}"
-        USB_INCLUDE="-I${USB_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${USB_DIR}/include"
-        if test "xusb.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${USB_DIR}/include/usb.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${USB_DIR}/include/usb.h" >&5
-echo $ECHO_N "checking for ${USB_DIR}/include/usb.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${USB_DIR}/include/usb.h usability" >&5
-echo $ECHO_N "checking ${USB_DIR}/include/usb.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${USB_DIR}/include/usb.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${USB_DIR}/include/usb.h presence" >&5
-echo $ECHO_N "checking ${USB_DIR}/include/usb.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${USB_DIR}/include/usb.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${USB_DIR}/include/usb.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${USB_DIR}/include/usb.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${USB_DIR}/include/usb.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${USB_DIR}/include/usb.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${USB_DIR}/include/usb.h" >&5
-echo $ECHO_N "checking for ${USB_DIR}/include/usb.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
+LIBS=$ac_check_lib_save_LIBS
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  USB_HEADER_FOUND=1
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_init" >&5
+echo "${ECHO_T}$ac_cv_lib_usb_usb_init" >&6; }
+if test $ac_cv_lib_usb_usb_init = yes; then
+  AST_USB_FOUND=yes
 else
-  USB_HEADER_FOUND=0
+  AST_USB_FOUND=no
 fi
 
 
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xusb.h" != "x" ; then
-            if test "${ac_cv_header_usb_h+set}" = set; then
+   if test "${AST_USB_FOUND}" = "yes"; then
+      USB_LIB="-lusb "
+      USB_HEADER_FOUND="1"
+      if test "x${USB_DIR}" != "x"; then
+         USB_LIB="${pbxlibdir} ${USB_LIB}"
+        USB_INCLUDE="-I${USB_DIR}/include"
+      fi
+      USB_INCLUDE="${USB_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${USB_INCLUDE}"
+      if test "xusb.h" != "x" ; then
+         if test "${ac_cv_header_usb_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for usb.h" >&5
 echo $ECHO_N "checking for usb.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_usb_h+set}" = set; then
@@ -33710,8 +29450,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${USB_HEADER_FOUND}" = "x0" ; then
          if test -n "${USB_MANDATORY}" ;
          then
       if test "x${VORBIS_DIR}" != "x"; then
          VORBIS_LIB="${pbxlibdir} ${VORBIS_LIB}"
         VORBIS_INCLUDE="-I${VORBIS_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${VORBIS_DIR}/include"
-        if test "xvorbis/codec.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${VORBIS_DIR}/include/vorbis/codec.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${VORBIS_DIR}/include/vorbis/codec.h" >&5
-echo $ECHO_N "checking for ${VORBIS_DIR}/include/vorbis/codec.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${VORBIS_DIR}/include/vorbis/codec.h usability" >&5
-echo $ECHO_N "checking ${VORBIS_DIR}/include/vorbis/codec.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${VORBIS_DIR}/include/vorbis/codec.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${VORBIS_DIR}/include/vorbis/codec.h presence" >&5
-echo $ECHO_N "checking ${VORBIS_DIR}/include/vorbis/codec.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${VORBIS_DIR}/include/vorbis/codec.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${VORBIS_DIR}/include/vorbis/codec.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${VORBIS_DIR}/include/vorbis/codec.h" >&5
-echo $ECHO_N "checking for ${VORBIS_DIR}/include/vorbis/codec.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  VORBIS_HEADER_FOUND=1
-else
-  VORBIS_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xvorbis/codec.h" != "x" ; then
-            if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
+      fi
+      VORBIS_INCLUDE="${VORBIS_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${VORBIS_INCLUDE}"
+      if test "xvorbis/codec.h" != "x" ; then
+         if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for vorbis/codec.h" >&5
 echo $ECHO_N "checking for vorbis/codec.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_vorbis_codec_h+set}" = set; then
@@ -34119,8 +29717,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${VORBIS_HEADER_FOUND}" = "x0" ; then
          if test -n "${VORBIS_MANDATORY}" ;
          then
       if test "x${ZLIB_DIR}" != "x"; then
          ZLIB_LIB="${pbxlibdir} ${ZLIB_LIB}"
         ZLIB_INCLUDE="-I${ZLIB_DIR}/include"
-        saved_cppflags="${CPPFLAGS}"
-        CPPFLAGS="${CPPFLAGS} -I${ZLIB_DIR}/include"
-        if test "xzlib.h" != "x" ; then
-           as_ac_Header=`echo "ac_cv_header_${ZLIB_DIR}/include/zlib.h" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for ${ZLIB_DIR}/include/zlib.h" >&5
-echo $ECHO_N "checking for ${ZLIB_DIR}/include/zlib.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking ${ZLIB_DIR}/include/zlib.h usability" >&5
-echo $ECHO_N "checking ${ZLIB_DIR}/include/zlib.h usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <${ZLIB_DIR}/include/zlib.h>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking ${ZLIB_DIR}/include/zlib.h presence" >&5
-echo $ECHO_N "checking ${ZLIB_DIR}/include/zlib.h presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <${ZLIB_DIR}/include/zlib.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: ${ZLIB_DIR}/include/zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: ${ZLIB_DIR}/include/zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ZLIB_DIR}/include/zlib.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: ${ZLIB_DIR}/include/zlib.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: ${ZLIB_DIR}/include/zlib.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: ${ZLIB_DIR}/include/zlib.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ZLIB_DIR}/include/zlib.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: ${ZLIB_DIR}/include/zlib.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ZLIB_DIR}/include/zlib.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: ${ZLIB_DIR}/include/zlib.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ZLIB_DIR}/include/zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: ${ZLIB_DIR}/include/zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ZLIB_DIR}/include/zlib.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: ${ZLIB_DIR}/include/zlib.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: ${ZLIB_DIR}/include/zlib.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: ${ZLIB_DIR}/include/zlib.h: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to www.asterisk.org ##
-## ------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for ${ZLIB_DIR}/include/zlib.h" >&5
-echo $ECHO_N "checking for ${ZLIB_DIR}/include/zlib.h... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-              { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  ZLIB_HEADER_FOUND=1
-else
-  ZLIB_HEADER_FOUND=0
-fi
-
-
-        fi
-        CPPFLAGS="${saved_cppflags}"
-      else
-        if test "xzlib.h" != "x" ; then
-            if test "${ac_cv_header_zlib_h+set}" = set; then
+      fi
+      ZLIB_INCLUDE="${ZLIB_INCLUDE} "
+      saved_cppflags="${CPPFLAGS}"
+      CPPFLAGS="${CPPFLAGS} ${ZLIB_INCLUDE}"
+      if test "xzlib.h" != "x" ; then
+         if test "${ac_cv_header_zlib_h+set}" = set; then
   { echo "$as_me:$LINENO: checking for zlib.h" >&5
 echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_zlib_h+set}" = set; then
@@ -34636,8 +30092,8 @@ else
 fi
 
 
-        fi
       fi
+      CPPFLAGS="${saved_cppflags}"
       if test "x${ZLIB_HEADER_FOUND}" = "x0" ; then
          if test -n "${ZLIB_MANDATORY}" ;
          then
index 09368851f2a16f5d1bf05f55709d7be688cf1b59..4408020f1415ad1c876386071c2b8a7d34e295e2 100644 (file)
@@ -1361,12 +1361,12 @@ fi
 if test "${PBX_DAHDI}" = "1" || test "${USE_ZAPTEL}" = "no"; then
   tonezone_dir="dahdi"
    if test "x${DAHDI_DIR}" != "x"; then
-      tonezone_extra="${tonezone_extra} -I${DAHDI_DIR}/include"
+      tonezone_extra="${tonezone_extra} ${DAHDI_INCLUDE}"
    fi
 else
   tonezone_dir="zaptel"
    if test "x${ZAPTEL_DIR}" != "x"; then
-      tonezone_extra="${tonezone_extra} -I${ZAPTEL_DIR}/include"
+      tonezone_extra="${tonezone_extra} ${ZAPTEL_INCLUDE}"
    fi
 fi
 
index 999881689a632d416809512163117316b9a40b18..d5dbca583901c079aafb30d89354d5c202fd1f62 100644 (file)
@@ -121,8 +121,7 @@ testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
        $(CC) -g -o testexpr2 ast_expr2f.o ast_expr2.o
        rm ast_expr2.o ast_expr2f.o 
 
-channel.o: ASTCFLAGS+=$(ZAPTEL_INCLUDE)
-asterisk.o: ASTCFLAGS+=$(ZAPTEL_INCLUDE)
+asterisk.o channel.o: ASTCFLAGS+=$(ZAPTEL_INCLUDE) $(DAHDI_INCLUDE)
 
 stdtime/localtime.o: ASTCFLAGS+=$(AST_NO_STRICT_OVERFLOW)