Add support for applying direct media ACLs between differing channel technologies.
[asterisk/asterisk.git] / configure
index 2a67196..db14c6d 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 353317 .
+# From configure.ac Revision: 373120 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.68 for asterisk trunk.
 #
@@ -622,13 +622,16 @@ PBX_SYSLOG_FACILITY_LOG_AUTH
 PBX_GENERIC_ODBC
 GENERIC_ODBC_INCLUDE
 GENERIC_ODBC_LIB
+GTK2_LIBS
+GTK2_CFLAGS
 PBX_LAUNCHD
 CONFIG_SDL
 PBX_SO_NOSIGPIPE
 PBX_MSG_NOSIGNAL
 PBX_IXJUSER
 PBX_H323
-CONFIG_GMIME
+GMIME_LIBS
+GMIME_CFLAGS
 OPENH323_BUILD
 OPENH323_SUFFIX
 OPENH323_LIBDIR
@@ -646,17 +649,27 @@ CONFIG_NEON
 CONFIG_MYSQLCLIENT
 PBX_MISDN_FAC_ERROR
 PBX_MISDN_FAC_RESULT
+LIBEDIT_LIBS
+LIBEDIT_CFLAGS
+LIBEDIT_INTERNAL
+ILBC_LIBS
+ILBC_CFLAGS
+ILBC_INTERNAL
 GSM_INTERNAL
 PBX_DAHDI_HALF_FULL
-PKGCONFIG
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
 PBX_DLADDR
 PBX_IP_MTU_DISCOVER
 PBX_GLOB_BRACE
 PBX_GLOB_NOMAGIC
-AST_MARCH_NATIVE
+AST_NESTED_FUNCTIONS
+AST_NATIVE_ARCH
 AST_SHADOW_WARNINGS
 AST_NO_STRICT_OVERFLOW
 AST_FORTIFY_SOURCE
+AST_TRAMPOLINES
 AST_DECLARATION_AFTER_STATEMENT
 GC_LDFLAGS
 GC_CFLAGS
@@ -688,10 +701,6 @@ PBX_VORBIS
 VORBIS_DIR
 VORBIS_INCLUDE
 VORBIS_LIB
-PBX_USB
-USB_DIR
-USB_INCLUDE
-USB_LIB
 PBX_UNIXODBC
 UNIXODBC_DIR
 UNIXODBC_INCLUDE
@@ -929,6 +938,10 @@ PBX_LIBXML2
 LIBXML2_DIR
 LIBXML2_INCLUDE
 LIBXML2_LIB
+PBX_LIBEDIT
+LIBEDIT_DIR
+LIBEDIT_INCLUDE
+LIBEDIT_LIB
 CURL_LIB
 CURL_INCLUDE
 _libcurl_config
@@ -989,6 +1002,10 @@ PBX_GTK2
 GTK2_DIR
 GTK2_INCLUDE
 GTK2_LIB
+PBX_ILBC
+ILBC_DIR
+ILBC_INCLUDE
+ILBC_LIB
 PBX_GSM
 GSM_DIR
 GSM_INCLUDE
@@ -1001,6 +1018,10 @@ PBX_DAHDI
 DAHDI_DIR
 DAHDI_INCLUDE
 DAHDI_LIB
+PBX_OPENSSL_SRTP
+OPENSSL_SRTP_DIR
+OPENSSL_SRTP_INCLUDE
+OPENSSL_SRTP_LIB
 PBX_CRYPTO
 CRYPTO_DIR
 CRYPTO_INCLUDE
@@ -1009,6 +1030,10 @@ PBX_CURSES
 CURSES_DIR
 CURSES_INCLUDE
 CURSES_LIB
+PBX_COROSYNC_CFG_STATE_TRACK
+COROSYNC_CFG_STATE_TRACK_DIR
+COROSYNC_CFG_STATE_TRACK_INCLUDE
+COROSYNC_CFG_STATE_TRACK_LIB
 PBX_COROSYNC
 COROSYNC_DIR
 COROSYNC_INCLUDE
@@ -1034,6 +1059,7 @@ ALSA_DIR
 ALSA_INCLUDE
 ALSA_LIB
 AST_CODE_COVERAGE
+AST_DEVMODE_STRICT
 AST_DEVMODE
 NOISY_BUILD
 PTHREAD_CFLAGS
@@ -1062,6 +1088,7 @@ DIRNAME
 BASENAME
 COMPRESS
 FIND
+PYTHON
 FLEX
 CMP
 BISON
@@ -1183,6 +1210,7 @@ with_crypto
 with_dahdi
 with_avcodec
 with_gsm
+with_ilbc
 with_gtk2
 with_gmime
 with_h323
@@ -1198,6 +1226,7 @@ with_jack
 with_kqueue
 with_ldap
 with_libcurl
+with_libedit
 with_libxml2
 with_ltdl
 with_lua
@@ -1238,7 +1267,6 @@ with_timerfd
 with_tinfo
 with_tonezone
 with_unixodbc
-with_usb
 with_vorbis
 with_vpb
 with_x11
@@ -1260,7 +1288,18 @@ CPP
 CXX
 CXXFLAGS
 CCC
-CXXCPP'
+CXXCPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+ILBC_CFLAGS
+ILBC_LIBS
+LIBEDIT_CFLAGS
+LIBEDIT_LIBS
+GMIME_CFLAGS
+GMIME_LIBS
+GTK2_CFLAGS
+GTK2_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1899,6 +1938,8 @@ Optional Packages:
   --with-avcodec=PATH     use Ffmpeg and avcodec files in PATH
   --with-gsm=PATH         use External GSM files in PATH, use 'internal' GSM
                           otherwise
+  --with-ilbc=PATH        use System iLBC files in PATH, use 'internal' iLBC
+                          otherwise
   --with-gtk2=PATH        use gtk2 files in PATH
   --with-gmime=PATH       use GMime files in PATH
   --with-h323=PATH        use OpenH323 files in PATH
@@ -1914,6 +1955,8 @@ Optional Packages:
   --with-kqueue=PATH      use kqueue support files in PATH
   --with-ldap=PATH        use OpenLDAP files in PATH
   --with-libcurl=DIR      look for the curl library in DIR
+  --with-libedit=PATH     use NetBSD Editline library files in PATH, use
+                          'internal' Editline otherwise
   --with-libxml2=PATH     use LibXML2 files in PATH
   --with-ltdl=PATH        use libtool files in PATH
   --with-lua=PATH         use Lua files in PATH
@@ -1956,7 +1999,6 @@ Optional Packages:
   --with-tinfo=PATH       use Term Info files in PATH
   --with-tonezone=PATH    use tonezone files in PATH
   --with-unixodbc=PATH    use unixODBC files in PATH
-  --with-usb=PATH         use usb files in PATH
   --with-vorbis=PATH      use Vorbis files in PATH
   --with-vpb=PATH         use Voicetronix API files in PATH
   --with-x11=PATH         use X11 files in PATH
@@ -1974,6 +2016,22 @@ Some influential environment variables:
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CXXCPP      C++ preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  ILBC_CFLAGS C compiler flags for ILBC, overriding pkg-config
+  ILBC_LIBS   linker flags for ILBC, overriding pkg-config
+  LIBEDIT_CFLAGS
+              C compiler flags for LIBEDIT, overriding pkg-config
+  LIBEDIT_LIBS
+              linker flags for LIBEDIT, overriding pkg-config
+  GMIME_CFLAGS
+              C compiler flags for GMIME, overriding pkg-config
+  GMIME_LIBS  linker flags for GMIME, overriding pkg-config
+  GTK2_CFLAGS C compiler flags for GTK2, overriding pkg-config
+  GTK2_LIBS   linker flags for GTK2, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -6569,6 +6627,47 @@ $as_echo "no" >&6; }
 fi
 
 
+# Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PYTHON+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PYTHON in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PYTHON" && ac_cv_path_PYTHON=":"
+  ;;
+esac
+fi
+PYTHON=$ac_cv_path_PYTHON
+if test -n "$PYTHON"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
+$as_echo "$PYTHON" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
 # Extract the first word of "find", so it can be a program name with args.
 set dummy find; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -7876,6 +7975,10 @@ if test "${enable_dev_mode+set}" = set; then :
              AST_DEVMODE=yes
              NOISY_BUILD=yes
              ;;
+             strict)
+             AST_DEVMODE=yes
+             AST_DEVMODE_STRICT=yes
+             ;;
              *) as_fn_error $? "bad value ${enableval} for --enable-dev-mode" "$LINENO" 5  ;;
        esac
 fi
@@ -7883,6 +7986,7 @@ fi
 
 
 
+
 AST_CODE_COVERAGE=no
 # Check whether --enable-coverage was given.
 if test "${enable_coverage+set}" = set; then :
@@ -8101,6 +8205,18 @@ fi
 
 
 
+COROSYNC_CFG_STATE_TRACK_DESCRIP="A callback only in corosync 1.x"
+COROSYNC_CFG_STATE_TRACK_OPTION=cfg
+COROSYNC_CFG_STATE_TRACK_DIR=${COROSYNC_DIR}
+
+PBX_COROSYNC_CFG_STATE_TRACK=0
+
+
+
+
+
+
+
     CURSES_DESCRIP="curses"
     CURSES_OPTION="curses"
     PBX_CURSES=0
@@ -8165,6 +8281,18 @@ fi
 
 
 
+OPENSSL_SRTP_DESCRIP="OpenSSL SRTP Extension Support"
+OPENSSL_SRTP_OPTION=crypto
+OPENSSL_SRTP_DIR=${CRYPTO_DIR}
+
+PBX_OPENSSL_SRTP=0
+
+
+
+
+
+
+
     DAHDI_DESCRIP="DAHDI"
     DAHDI_OPTION="dahdi"
     PBX_DAHDI=0
@@ -8261,6 +8389,38 @@ fi
 
 
 
+    ILBC_DESCRIP="System iLBC"
+    ILBC_OPTION="ilbc"
+    PBX_ILBC=0
+
+# Check whether --with-ilbc was given.
+if test "${with_ilbc+set}" = set; then :
+  withval=$with_ilbc;
+       case ${withval} in
+       n|no)
+       USE_ILBC=no
+       # -1 is a magic value used by menuselect to know that the package
+       # was disabled, other than 'not found'
+       PBX_ILBC=-1
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} ILBC"
+       ;;
+       *)
+       ILBC_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} ILBC"
+       ;;
+       esac
+
+fi
+
+
+
+
+
+
+
+
     GTK2_DESCRIP="gtk2"
     GTK2_OPTION="gtk2"
     PBX_GTK2=0
@@ -9086,6 +9246,38 @@ _ACEOF
   unset _libcurl_with
 
 
+    LIBEDIT_DESCRIP="NetBSD Editline library"
+    LIBEDIT_OPTION="libedit"
+    PBX_LIBEDIT=0
+
+# Check whether --with-libedit was given.
+if test "${with_libedit+set}" = set; then :
+  withval=$with_libedit;
+       case ${withval} in
+       n|no)
+       USE_LIBEDIT=no
+       # -1 is a magic value used by menuselect to know that the package
+       # was disabled, other than 'not found'
+       PBX_LIBEDIT=-1
+       ;;
+       y|ye|yes)
+       ac_mandatory_list="${ac_mandatory_list} LIBEDIT"
+       ;;
+       *)
+       LIBEDIT_DIR="${withval}"
+       ac_mandatory_list="${ac_mandatory_list} LIBEDIT"
+       ;;
+       esac
+
+fi
+
+
+
+
+
+
+
+
     LIBXML2_DESCRIP="LibXML2"
     LIBXML2_OPTION="libxml2"
     PBX_LIBXML2=0
 
 
 
-    USB_DESCRIP="usb"
-    USB_OPTION="usb"
-    PBX_USB=0
-
-# Check whether --with-usb was given.
-if test "${with_usb+set}" = set; then :
-  withval=$with_usb;
-       case ${withval} in
-       n|no)
-       USE_USB=no
-       # -1 is a magic value used by menuselect to know that the package
-       # was disabled, other than 'not found'
-       PBX_USB=-1
-       ;;
-       y|ye|yes)
-       ac_mandatory_list="${ac_mandatory_list} USB"
-       ;;
-       *)
-       USB_DIR="${withval}"
-       ac_mandatory_list="${ac_mandatory_list} USB"
-       ;;
-       esac
-
-fi
-
-
-
-
-
-
-
-
     VORBIS_DESCRIP="Vorbis"
     VORBIS_OPTION="vorbis"
     PBX_VORBIS=0
@@ -15908,6 +16068,19 @@ $as_echo "no" >&6; }
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wtrampolines support" >&5
+$as_echo_n "checking for -Wtrampolines support... " >&6; }
+if $(${CC} -Wtrampolines -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       AST_TRAMPOLINES=-Wtrampolines
+else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       AST_TRAMPOLINES=
+fi
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FORTIFY_SOURCE support" >&5
 $as_echo_n "checking for _FORTIFY_SOURCE support... " >&6; }
 if $(${CC} -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
@@ -15947,17 +16120,49 @@ $as_echo "no" >&6; }
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -march=native" >&5
-$as_echo_n "checking for -march=native... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -march=native support" >&5
+$as_echo_n "checking for -march=native support... " >&6; }
 if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+       if test "${CONFIG_CFLAGS}" = ""; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-       AST_MARCH_NATIVE="-march=native"
+               AST_NATIVE_ARCH=1
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: user CFLAGS present" >&5
+$as_echo "user CFLAGS present" >&6; }
+               AST_NATIVE_ARCH=
+       fi
 else
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-       AST_MARCH_NATIVE=
+       AST_NATIVE_ARCH=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fnested-functions" >&5
+$as_echo_n "checking for -fnested-functions... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+auto void foo(void); void foo(void) {}
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       AST_NESTED_FUNCTIONS=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: required" >&5
+$as_echo "required" >&6; }
+       AST_NESTED_FUNCTIONS=-fnested-functions
+
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo" >&5
@@ -16708,25 +16913,35 @@ rm -f core conftest.err conftest.$ac_objext \
 LIBS=${old_LIBS}
 
 # PKGCONFIG is used in later tests
-if test -n "$ac_tool_prefix"; then
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_PKGCONFIG+:} false; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$PKGCONFIG"; then
-  ac_cv_prog_PKGCONFIG="$PKGCONFIG" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_PKGCONFIG="${ac_tool_prefix}pkg-config"
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -16734,12 +16949,13 @@ done
   done
 IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-PKGCONFIG=$ac_cv_prog_PKGCONFIG
-if test -n "$PKGCONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGCONFIG" >&5
-$as_echo "$PKGCONFIG" >&6; }
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 
 
 fi
-if test -z "$ac_cv_prog_PKGCONFIG"; then
-  ac_ct_PKGCONFIG=$PKGCONFIG
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_PKGCONFIG+:} false; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_PKGCONFIG"; then
-  ac_cv_prog_ac_ct_PKGCONFIG="$ac_ct_PKGCONFIG" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_PKGCONFIG="pkg-config"
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -16774,19 +16992,20 @@ done
   done
 IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-ac_ct_PKGCONFIG=$ac_cv_prog_ac_ct_PKGCONFIG
-if test -n "$ac_ct_PKGCONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKGCONFIG" >&5
-$as_echo "$ac_ct_PKGCONFIG" >&6; }
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_PKGCONFIG" = x; then
-    PKGCONFIG="No"
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -16794,12 +17013,26 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    PKGCONFIG=$ac_ct_PKGCONFIG
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
   fi
 else
-  PKGCONFIG="$ac_cv_prog_PKGCONFIG"
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
 fi
 
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
+fi
 
 
 # do the package library checks now
 
 
 
-if test "x${OSARCH}" = "xlinux-gnu" ; then
+if test "${PBX_BFD}" = "0"; then
+  # Fedora/RedHat/CentOS require extra libraries
 
-if test "x${PBX_CAP}" != "x1" -a "${USE_CAP}" != "no"; then
+if test "x${PBX_BFD}" != "x1" -a "${USE_BFD}" != "no"; then
    pbxlibdir=""
-   # if --with-CAP=DIR has been specified, use it.
-   if test "x${CAP_DIR}" != "x"; then
-      if test -d ${CAP_DIR}/lib; then
-        pbxlibdir="-L${CAP_DIR}/lib"
+   # if --with-BFD=DIR has been specified, use it.
+   if test "x${BFD_DIR}" != "x"; then
+      if test -d ${BFD_DIR}/lib; then
+        pbxlibdir="-L${BFD_DIR}/lib"
       else
-        pbxlibdir="-L${CAP_DIR}"
+        pbxlibdir="-L${BFD_DIR}"
       fi
    fi
-   pbxfuncname="cap_from_text"
+   pbxfuncname="bfd_check_format"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_CAP_FOUND=yes
+      AST_BFD_FOUND=yes
    else
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_cap_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lcap" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lcap... " >&6; }
+      as_ac_Lib=`$as_echo "ac_cv_lib_bfd_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lbfd" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lbfd... " >&6; }
 if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcap ${pbxlibdir}  $LIBS"
+LIBS="-lbfd ${pbxlibdir} -ldl -liberty $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -17071,47 +17305,47 @@ eval ac_res=\$$as_ac_Lib
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
-  AST_CAP_FOUND=yes
+  AST_BFD_FOUND=yes
 else
-  AST_CAP_FOUND=no
+  AST_BFD_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    fi
 
    # now check for the header.
-   if test "${AST_CAP_FOUND}" = "yes"; then
-      CAP_LIB="${pbxlibdir} -lcap "
-      # if --with-CAP=DIR has been specified, use it.
-      if test "x${CAP_DIR}" != "x"; then
-         CAP_INCLUDE="-I${CAP_DIR}/include"
+   if test "${AST_BFD_FOUND}" = "yes"; then
+      BFD_LIB="${pbxlibdir} -lbfd -ldl -liberty"
+      # if --with-BFD=DIR has been specified, use it.
+      if test "x${BFD_DIR}" != "x"; then
+         BFD_INCLUDE="-I${BFD_DIR}/include"
       fi
-      CAP_INCLUDE="${CAP_INCLUDE} "
-      if test "xsys/capability.h" = "x" ; then # no header, assume found
-         CAP_HEADER_FOUND="1"
+      BFD_INCLUDE="${BFD_INCLUDE} "
+      if test "xbfd.h" = "x" ; then    # no header, assume found
+         BFD_HEADER_FOUND="1"
       else                             # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${CAP_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_capability_h" = xyes; then :
-  CAP_HEADER_FOUND=1
+         CPPFLAGS="${CPPFLAGS} ${BFD_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default"
+if test "x$ac_cv_header_bfd_h" = xyes; then :
+  BFD_HEADER_FOUND=1
 else
-  CAP_HEADER_FOUND=0
+  BFD_HEADER_FOUND=0
 fi
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
       fi
-      if test "x${CAP_HEADER_FOUND}" = "x0" ; then
-         CAP_LIB=""
-         CAP_INCLUDE=""
+      if test "x${BFD_HEADER_FOUND}" = "x0" ; then
+         BFD_LIB=""
+         BFD_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            CAP_LIB=""
+            BFD_LIB=""
          fi
-         PBX_CAP=1
+         PBX_BFD=1
          cat >>confdefs.h <<_ACEOF
-#define HAVE_CAP 1
+#define HAVE_BFD 1
 _ACEOF
 
       fi
 
 fi
 
+if test "x${OSARCH}" = "xlinux-gnu" ; then
 
-    if test "x${PBX_DAHDI}" != "x1"; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAHDI_RESET_COUNTERS in dahdi/user.h" >&5
-$as_echo_n "checking for DAHDI_RESET_COUNTERS in dahdi/user.h... " >&6; }
-       saved_cppflags="${CPPFLAGS}"
-       if test "x${DAHDI_DIR}" != "x"; then
-           DAHDI_INCLUDE="-I${DAHDI_DIR}/include"
-       fi
-       CPPFLAGS="${CPPFLAGS} ${DAHDI_INCLUDE}"
-
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+if test "x${PBX_CAP}" != "x1" -a "${USE_CAP}" != "no"; then
+   pbxlibdir=""
+   # if --with-CAP=DIR has been specified, use it.
+   if test "x${CAP_DIR}" != "x"; then
+      if test -d ${CAP_DIR}/lib; then
+        pbxlibdir="-L${CAP_DIR}/lib"
+      else
+        pbxlibdir="-L${CAP_DIR}"
+      fi
+   fi
+   pbxfuncname="cap_from_text"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_CAP_FOUND=yes
+   else
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} "
+      as_ac_Lib=`$as_echo "ac_cv_lib_cap_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lcap" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lcap... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcap ${pbxlibdir}  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  AST_CAP_FOUND=yes
+else
+  AST_CAP_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   if test "${AST_CAP_FOUND}" = "yes"; then
+      CAP_LIB="${pbxlibdir} -lcap "
+      # if --with-CAP=DIR has been specified, use it.
+      if test "x${CAP_DIR}" != "x"; then
+         CAP_INCLUDE="-I${CAP_DIR}/include"
+      fi
+      CAP_INCLUDE="${CAP_INCLUDE} "
+      if test "xsys/capability.h" = "x" ; then # no header, assume found
+         CAP_HEADER_FOUND="1"
+      else                             # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${CAP_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "sys/capability.h" "ac_cv_header_sys_capability_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_capability_h" = xyes; then :
+  CAP_HEADER_FOUND=1
+else
+  CAP_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      if test "x${CAP_HEADER_FOUND}" = "x0" ; then
+         CAP_LIB=""
+         CAP_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
+            CAP_LIB=""
+         fi
+         PBX_CAP=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_CAP 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+fi
+
+
+    if test "x${PBX_DAHDI}" != "x1"; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAHDI_RESET_COUNTERS in dahdi/user.h" >&5
+$as_echo_n "checking for DAHDI_RESET_COUNTERS in dahdi/user.h... " >&6; }
+       saved_cppflags="${CPPFLAGS}"
+       if test "x${DAHDI_DIR}" != "x"; then
+           DAHDI_INCLUDE="-I${DAHDI_DIR}/include"
+       fi
+       CPPFLAGS="${CPPFLAGS} ${DAHDI_INCLUDE}"
+
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
  #include <dahdi/user.h>
 int
 main ()
@@ -17650,6 +17991,220 @@ _ACEOF
    fi
 fi
 
+ILBC_INTERNAL="yes"
+
+ILBC_SYSTEM="yes"
+if test "${USE_ILBC}" != "no"; then
+   if test "${ILBC_DIR}" = "internal"; then
+      ILBC_SYSTEM="no"
+   elif test "${ILBC_DIR}" != ""; then
+      ILBC_INTERNAL="no"
+   fi
+   if test "${ILBC_SYSTEM}" = "yes"; then
+
+   if test "x${PBX_ILBC}" != "x1" -a "${USE_ILBC}" != "no"; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ILBC" >&5
+$as_echo_n "checking for ILBC... " >&6; }
+
+if test -n "$ILBC_CFLAGS"; then
+    pkg_cv_ILBC_CFLAGS="$ILBC_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libilbc\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libilbc") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ILBC_CFLAGS=`$PKG_CONFIG --cflags "libilbc" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$ILBC_LIBS"; then
+    pkg_cv_ILBC_LIBS="$ILBC_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libilbc\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libilbc") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_ILBC_LIBS=`$PKG_CONFIG --libs "libilbc" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               ILBC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libilbc" 2>&1`
+        else
+               ILBC_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libilbc" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$ILBC_PKG_ERRORS" >&5
+
+
+            PBX_ILBC=0
+
+
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+            PBX_ILBC=0
+
+
+else
+       ILBC_CFLAGS=$pkg_cv_ILBC_CFLAGS
+       ILBC_LIBS=$pkg_cv_ILBC_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+            PBX_ILBC=1
+            ILBC_INCLUDE="$ILBC_CFLAGS"
+            ILBC_LIB="$ILBC_LIBS"
+
+$as_echo "#define HAVE_ILBC 1" >>confdefs.h
+
+
+fi
+   fi
+
+      if test "$PBX_ILBC" = "1"; then
+        ILBC_INTERNAL="no"
+      fi
+   fi
+   if test "${ILBC_INTERNAL}" = "yes"; then
+      PBX_ILBC=1
+   fi
+fi
+
+LIBEDIT_INTERNAL="yes"
+
+LIBEDIT_SYSTEM="yes"
+if test "${USE_LIBEDIT}" != "no"; then
+   if test "${LIBEDIT_DIR}" = "internal"; then
+      LIBEDIT_SYSTEM="no"
+   elif test "${LIBEDIT_DIR}" != ""; then
+      LIBEDIT_INTERNAL="no"
+   fi
+   if test "${LIBEDIT_SYSTEM}" = "yes"; then
+
+   if test "x${PBX_LIBEDIT}" != "x1" -a "${USE_LIBEDIT}" != "no"; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBEDIT" >&5
+$as_echo_n "checking for LIBEDIT... " >&6; }
+
+if test -n "$LIBEDIT_CFLAGS"; then
+    pkg_cv_LIBEDIT_CFLAGS="$LIBEDIT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libedit") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBEDIT_CFLAGS=`$PKG_CONFIG --cflags "libedit" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$LIBEDIT_LIBS"; then
+    pkg_cv_LIBEDIT_LIBS="$LIBEDIT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libedit") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBEDIT_LIBS=`$PKG_CONFIG --libs "libedit" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               LIBEDIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libedit" 2>&1`
+        else
+               LIBEDIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libedit" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$LIBEDIT_PKG_ERRORS" >&5
+
+
+            PBX_LIBEDIT=0
+
+
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+            PBX_LIBEDIT=0
+
+
+else
+       LIBEDIT_CFLAGS=$pkg_cv_LIBEDIT_CFLAGS
+       LIBEDIT_LIBS=$pkg_cv_LIBEDIT_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+            PBX_LIBEDIT=1
+            LIBEDIT_INCLUDE="$LIBEDIT_CFLAGS"
+            LIBEDIT_LIB="$LIBEDIT_LIBS"
+
+$as_echo "#define HAVE_LIBEDIT 1" >>confdefs.h
+
+
+fi
+   fi
+
+      if test "$PBX_LIBEDIT" = "1"; then
+        LIBEDIT_INTERNAL="no"
+      fi
+   fi
+   if test "${LIBEDIT_INTERNAL}" = "yes"; then
+      PBX_LIBEDIT=1
+   fi
+fi
+
 
 if test "x${PBX_ICONV}" != "x1" -a "${USE_ICONV}" != "no"; then
    pbxlibdir=""
@@ -24542,6 +25097,7 @@ fi
 
 fi
 
+# Check for libss7 v1.0 branch compatible version.
 
 if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
    pbxlibdir=""
@@ -24553,7 +25109,7 @@ if test "x${PBX_SS7}" != "x1" -a "${USE_SS7}" != "no"; then
         pbxlibdir="-L${SS7_DIR}"
       fi
    fi
-   pbxfuncname="ss7_pollflags"
+   pbxfuncname="ss7_set_adjpc"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
       AST_SS7_FOUND=yes
    else
 
 
 
-
-if test "x${PBX_SPEEX}" != "x1" -a "${USE_SPEEX}" != "no"; then
+if test "x${PBX_COROSYNC_CFG_STATE_TRACK}" != "x1" -a "${USE_COROSYNC_CFG_STATE_TRACK}" != "no"; then
    pbxlibdir=""
-   # if --with-SPEEX=DIR has been specified, use it.
-   if test "x${SPEEX_DIR}" != "x"; then
-      if test -d ${SPEEX_DIR}/lib; then
-        pbxlibdir="-L${SPEEX_DIR}/lib"
+   # if --with-COROSYNC_CFG_STATE_TRACK=DIR has been specified, use it.
+   if test "x${COROSYNC_CFG_STATE_TRACK_DIR}" != "x"; then
+      if test -d ${COROSYNC_CFG_STATE_TRACK_DIR}/lib; then
+        pbxlibdir="-L${COROSYNC_CFG_STATE_TRACK_DIR}/lib"
       else
-        pbxlibdir="-L${SPEEX_DIR}"
+        pbxlibdir="-L${COROSYNC_CFG_STATE_TRACK_DIR}"
       fi
    fi
-   pbxfuncname="speex_encode"
+   pbxfuncname="corosync_cfg_state_track"
    if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_SPEEX_FOUND=yes
+      AST_COROSYNC_CFG_STATE_TRACK_FOUND=yes
    else
       ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
       CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_speex_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lspeex" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lspeex... " >&6; }
+      as_ac_Lib=`$as_echo "ac_cv_lib_cfg_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lcfg" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lcfg... " >&6; }
 if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lspeex ${pbxlibdir} -lm $LIBS"
+LIBS="-lcfg ${pbxlibdir} -lcfg $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -25976,47 +26531,47 @@ eval ac_res=\$$as_ac_Lib
               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
-  AST_SPEEX_FOUND=yes
+  AST_COROSYNC_CFG_STATE_TRACK_FOUND=yes
 else
-  AST_SPEEX_FOUND=no
+  AST_COROSYNC_CFG_STATE_TRACK_FOUND=no
 fi
 
       CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
    fi
 
    # now check for the header.
-   if test "${AST_SPEEX_FOUND}" = "yes"; then
-      SPEEX_LIB="${pbxlibdir} -lspeex -lm"
-      # if --with-SPEEX=DIR has been specified, use it.
-      if test "x${SPEEX_DIR}" != "x"; then
-         SPEEX_INCLUDE="-I${SPEEX_DIR}/include"
-      fi
-      SPEEX_INCLUDE="${SPEEX_INCLUDE} "
-      if test "xspeex/speex.h" = "x" ; then    # no header, assume found
-         SPEEX_HEADER_FOUND="1"
+   if test "${AST_COROSYNC_CFG_STATE_TRACK_FOUND}" = "yes"; then
+      COROSYNC_CFG_STATE_TRACK_LIB="${pbxlibdir} -lcfg -lcfg"
+      # if --with-COROSYNC_CFG_STATE_TRACK=DIR has been specified, use it.
+      if test "x${COROSYNC_CFG_STATE_TRACK_DIR}" != "x"; then
+         COROSYNC_CFG_STATE_TRACK_INCLUDE="-I${COROSYNC_CFG_STATE_TRACK_DIR}/include"
+      fi
+      COROSYNC_CFG_STATE_TRACK_INCLUDE="${COROSYNC_CFG_STATE_TRACK_INCLUDE} "
+      if test "xcorosync/cfg.h" = "x" ; then   # no header, assume found
+         COROSYNC_CFG_STATE_TRACK_HEADER_FOUND="1"
       else                             # check for the header
          ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${SPEEX_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "speex/speex.h" "ac_cv_header_speex_speex_h" "$ac_includes_default"
-if test "x$ac_cv_header_speex_speex_h" = xyes; then :
-  SPEEX_HEADER_FOUND=1
+         CPPFLAGS="${CPPFLAGS} ${COROSYNC_CFG_STATE_TRACK_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "corosync/cfg.h" "ac_cv_header_corosync_cfg_h" "$ac_includes_default"
+if test "x$ac_cv_header_corosync_cfg_h" = xyes; then :
+  COROSYNC_CFG_STATE_TRACK_HEADER_FOUND=1
 else
-  SPEEX_HEADER_FOUND=0
+  COROSYNC_CFG_STATE_TRACK_HEADER_FOUND=0
 fi
 
 
          CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
       fi
-      if test "x${SPEEX_HEADER_FOUND}" = "x0" ; then
-         SPEEX_LIB=""
-         SPEEX_INCLUDE=""
+      if test "x${COROSYNC_CFG_STATE_TRACK_HEADER_FOUND}" = "x0" ; then
+         COROSYNC_CFG_STATE_TRACK_LIB=""
+         COROSYNC_CFG_STATE_TRACK_INCLUDE=""
       else
          if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            SPEEX_LIB=""
+            COROSYNC_CFG_STATE_TRACK_LIB=""
          fi
-         PBX_SPEEX=1
+         PBX_COROSYNC_CFG_STATE_TRACK=1
          cat >>confdefs.h <<_ACEOF
-#define HAVE_SPEEX 1
+#define HAVE_COROSYNC_CFG_STATE_TRACK 1
 _ACEOF
 
       fi
 
 
 
-# See if the main speex library contains the preprocess functions
 
-if test "x${PBX_SPEEX_PREPROCESS}" != "x1" -a "${USE_SPEEX_PREPROCESS}" != "no"; then
+if test "x${PBX_SPEEX}" != "x1" -a "${USE_SPEEX}" != "no"; then
    pbxlibdir=""
-   # if --with-SPEEX_PREPROCESS=DIR has been specified, use it.
-   if test "x${SPEEX_PREPROCESS_DIR}" != "x"; then
-      if test -d ${SPEEX_PREPROCESS_DIR}/lib; then
-        pbxlibdir="-L${SPEEX_PREPROCESS_DIR}/lib"
+   # if --with-SPEEX=DIR has been specified, use it.
+   if test "x${SPEEX_DIR}" != "x"; then
+      if test -d ${SPEEX_DIR}/lib; then
+        pbxlibdir="-L${SPEEX_DIR}/lib"
       else
-        pbxlibdir="-L${SPEEX_PREPROCESS_DIR}"
+        pbxlibdir="-L${SPEEX_DIR}"
+      fi
+   fi
+   pbxfuncname="speex_encode"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_SPEEX_FOUND=yes
+   else
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} "
+      as_ac_Lib=`$as_echo "ac_cv_lib_speex_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lspeex" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lspeex... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lspeex ${pbxlibdir} -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  AST_SPEEX_FOUND=yes
+else
+  AST_SPEEX_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   if test "${AST_SPEEX_FOUND}" = "yes"; then
+      SPEEX_LIB="${pbxlibdir} -lspeex -lm"
+      # if --with-SPEEX=DIR has been specified, use it.
+      if test "x${SPEEX_DIR}" != "x"; then
+         SPEEX_INCLUDE="-I${SPEEX_DIR}/include"
+      fi
+      SPEEX_INCLUDE="${SPEEX_INCLUDE} "
+      if test "xspeex/speex.h" = "x" ; then    # no header, assume found
+         SPEEX_HEADER_FOUND="1"
+      else                             # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${SPEEX_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "speex/speex.h" "ac_cv_header_speex_speex_h" "$ac_includes_default"
+if test "x$ac_cv_header_speex_speex_h" = xyes; then :
+  SPEEX_HEADER_FOUND=1
+else
+  SPEEX_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      if test "x${SPEEX_HEADER_FOUND}" = "x0" ; then
+         SPEEX_LIB=""
+         SPEEX_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
+            SPEEX_LIB=""
+         fi
+         PBX_SPEEX=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_SPEEX 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
+# See if the main speex library contains the preprocess functions
+
+if test "x${PBX_SPEEX_PREPROCESS}" != "x1" -a "${USE_SPEEX_PREPROCESS}" != "no"; then
+   pbxlibdir=""
+   # if --with-SPEEX_PREPROCESS=DIR has been specified, use it.
+   if test "x${SPEEX_PREPROCESS_DIR}" != "x"; then
+      if test -d ${SPEEX_PREPROCESS_DIR}/lib; then
+        pbxlibdir="-L${SPEEX_PREPROCESS_DIR}/lib"
+      else
+        pbxlibdir="-L${SPEEX_PREPROCESS_DIR}"
       fi
    fi
    pbxfuncname="speex_preprocess_ctl"
@@ -26804,6 +27464,110 @@ $as_echo "no" >&6; }
                fi
        fi
 
+
+if test "x${PBX_OPENSSL_SRTP}" != "x1" -a "${USE_OPENSSL_SRTP}" != "no"; then
+   pbxlibdir=""
+   # if --with-OPENSSL_SRTP=DIR has been specified, use it.
+   if test "x${OPENSSL_SRTP_DIR}" != "x"; then
+      if test -d ${OPENSSL_SRTP_DIR}/lib; then
+        pbxlibdir="-L${OPENSSL_SRTP_DIR}/lib"
+      else
+        pbxlibdir="-L${OPENSSL_SRTP_DIR}"
+      fi
+   fi
+   pbxfuncname="SSL_CTX_set_tlsext_use_srtp"
+   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
+      AST_OPENSSL_SRTP_FOUND=yes
+   else
+      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+      CFLAGS="${CFLAGS} "
+      as_ac_Lib=`$as_echo "ac_cv_lib_ssl_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lssl" >&5
+$as_echo_n "checking for ${pbxfuncname} in -lssl... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lssl ${pbxlibdir} -lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  AST_OPENSSL_SRTP_FOUND=yes
+else
+  AST_OPENSSL_SRTP_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   if test "${AST_OPENSSL_SRTP_FOUND}" = "yes"; then
+      OPENSSL_SRTP_LIB="${pbxlibdir} -lssl -lcrypto"
+      # if --with-OPENSSL_SRTP=DIR has been specified, use it.
+      if test "x${OPENSSL_SRTP_DIR}" != "x"; then
+         OPENSSL_SRTP_INCLUDE="-I${OPENSSL_SRTP_DIR}/include"
+      fi
+      OPENSSL_SRTP_INCLUDE="${OPENSSL_SRTP_INCLUDE} "
+      if test "xopenssl/ssl.h" = "x" ; then    # no header, assume found
+         OPENSSL_SRTP_HEADER_FOUND="1"
+      else                             # check for the header
+         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+         CPPFLAGS="${CPPFLAGS} ${OPENSSL_SRTP_INCLUDE}"
+         ac_fn_c_check_header_mongrel "$LINENO" "openssl/ssl.h" "ac_cv_header_openssl_ssl_h" "$ac_includes_default"
+if test "x$ac_cv_header_openssl_ssl_h" = xyes; then :
+  OPENSSL_SRTP_HEADER_FOUND=1
+else
+  OPENSSL_SRTP_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      if test "x${OPENSSL_SRTP_HEADER_FOUND}" = "x0" ; then
+         OPENSSL_SRTP_LIB=""
+         OPENSSL_SRTP_INCLUDE=""
+      else
+         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
+            OPENSSL_SRTP_LIB=""
+         fi
+         PBX_OPENSSL_SRTP=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENSSL_SRTP 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
 fi
 
 
@@ -26974,171 +27738,99 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 
 
-    if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then
-       PBX_GMIME=0
-       if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gmime-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gmime-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CONFIG_GMIME+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $CONFIG_GMIME in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_CONFIG_GMIME="$CONFIG_GMIME" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="${GMIME_DIR}/bin:$PATH"
-for as_dir in $as_dummy
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_CONFIG_GMIME="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+for ver in 2.0 2.2 2.4 2.6; do
 
-  ;;
-esac
+   if test "x${PBX_GMIME}" != "x1" -a "${USE_GMIME}" != "no"; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GMIME" >&5
+$as_echo_n "checking for GMIME... " >&6; }
+
+if test -n "$GMIME_CFLAGS"; then
+    pkg_cv_GMIME_CFLAGS="$GMIME_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmime-\$ver\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gmime-$ver") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GMIME_CFLAGS=`$PKG_CONFIG --cflags "gmime-$ver" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
 fi
-CONFIG_GMIME=$ac_cv_path_CONFIG_GMIME
-if test -n "$CONFIG_GMIME"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONFIG_GMIME" >&5
-$as_echo "$CONFIG_GMIME" >&6; }
+ else
+    pkg_failed=untried
+fi
+if test -n "$GMIME_LIBS"; then
+    pkg_cv_GMIME_LIBS="$GMIME_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gmime-\$ver\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gmime-$ver") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GMIME_LIBS=`$PKG_CONFIG --libs "gmime-$ver" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
 
 
-fi
-if test -z "$ac_cv_path_CONFIG_GMIME"; then
-  ac_pt_CONFIG_GMIME=$CONFIG_GMIME
-  # Extract the first word of "gmime-config", so it can be a program name with args.
-set dummy gmime-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_CONFIG_GMIME+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_CONFIG_GMIME in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_CONFIG_GMIME="$ac_pt_CONFIG_GMIME" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="${GMIME_DIR}/bin:$PATH"
-for as_dir in $as_dummy
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_ac_pt_CONFIG_GMIME="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-  ;;
-esac
-fi
-ac_pt_CONFIG_GMIME=$ac_cv_path_ac_pt_CONFIG_GMIME
-if test -n "$ac_pt_CONFIG_GMIME"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CONFIG_GMIME" >&5
-$as_echo "$ac_pt_CONFIG_GMIME" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-fi
 
-  if test "x$ac_pt_CONFIG_GMIME" = x; then
-    CONFIG_GMIME="No"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CONFIG_GMIME=$ac_pt_CONFIG_GMIME
-  fi
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
 else
-  CONFIG_GMIME="$ac_cv_path_CONFIG_GMIME"
+        _pkg_short_errors_supported=no
 fi
+        if test $_pkg_short_errors_supported = yes; then
+               GMIME_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gmime-$ver" 2>&1`
+        else
+               GMIME_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gmime-$ver" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$GMIME_PKG_ERRORS" >&5
 
-       if test ! "x${CONFIG_GMIME}" = xNo; then
-           if test x"" = x ; then A=--cflags ; else A="" ; fi
-           GMIME_INCLUDE=$(${CONFIG_GMIME} $A)
-           if test x"" = x ; then A=--libs ; else A="" ; fi
-           GMIME_LIB=$(${CONFIG_GMIME} $A)
-           if test x"#include <gmime/gmime.h>" != x ; then
-               saved_cppflags="${CPPFLAGS}"
-               if test "x${GMIME_DIR}" != "x"; then
-                   GMIME_INCLUDE="-I${GMIME_DIR}/include"
-               fi
-               CPPFLAGS="${CPPFLAGS} ${GMIME_INCLUDE}"
 
-               saved_libs="${LIBS}"
-               LIBS="${GMIME_LIB}"
+            PBX_GMIME=0
 
-               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-  #include <gmime/gmime.h>
-int
-main ()
-{
- gboolean q = g_mime_check_version(0,0,0);;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-     PBX_GMIME=1
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 
-$as_echo "#define HAVE_GMIME 1" >>confdefs.h
+            PBX_GMIME=0
 
 
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-               CPPFLAGS="${saved_cppflags}"
-               LIBS="${saved_libs}"
-           else
-               PBX_GMIME=1
+else
+       GMIME_CFLAGS=$pkg_cv_GMIME_CFLAGS
+       GMIME_LIBS=$pkg_cv_GMIME_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 
-$as_echo "#define HAVE_GMIME 1" >>confdefs.h
+            PBX_GMIME=1
+            GMIME_INCLUDE="$GMIME_CFLAGS"
+            GMIME_LIB="$GMIME_LIBS"
 
-           fi
-       fi
-    fi
+$as_echo "#define HAVE_GMIME 1" >>confdefs.h
 
-if test "x${PBX_GMIME}" = "x0" -a "${PKGCONFIG}" != "No"; then
-       # Later versions of GMime use pkg-config
-       for ver in 2.0 2.2 2.4; do
-               if ! ${PKGCONFIG} --exists gmime-$ver; then
-                       continue
-               fi
-               # If we got here, we have this version:
-               GMIME_INCLUDE=$(${PKGCONFIG} gmime-$ver --cflags 2>/dev/null)
-               GMIME_LIB=$(${PKGCONFIG} gmime-$ver --libs)
-               PBX_GMIME=1
 
-$as_echo "#define HAVE_GMIME 1" >>confdefs.h
+fi
+   fi
 
+       if test "$PBX_GMIME" = 1; then
                break;
-       done
-fi
+       fi
+done
 
 
 if test "x${PBX_HOARD}" != "x1" -a "${USE_HOARD}" != "no"; then
 
 
 
-
-if test "x${PBX_USB}" != "x1" -a "${USE_USB}" != "no"; then
-   pbxlibdir=""
-   # if --with-USB=DIR has been specified, use it.
-   if test "x${USB_DIR}" != "x"; then
-      if test -d ${USB_DIR}/lib; then
-        pbxlibdir="-L${USB_DIR}/lib"
-      else
-        pbxlibdir="-L${USB_DIR}"
-      fi
-   fi
-   pbxfuncname="usb_init"
-   if test "x${pbxfuncname}" = "x" ; then   # empty lib, assume only headers
-      AST_USB_FOUND=yes
-   else
-      ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
-      CFLAGS="${CFLAGS} "
-      as_ac_Lib=`$as_echo "ac_cv_lib_usb_${pbxfuncname}" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -lusb" >&5
-$as_echo_n "checking for ${pbxfuncname} in -lusb... " >&6; }
-if eval \${$as_ac_Lib+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lusb ${pbxlibdir}  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char ${pbxfuncname} ();
-int
-main ()
-{
-return ${pbxfuncname} ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_ac_Lib=yes"
-else
-  eval "$as_ac_Lib=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-eval ac_res=\$$as_ac_Lib
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
-  AST_USB_FOUND=yes
-else
-  AST_USB_FOUND=no
-fi
-
-      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
-   fi
-
-   # now check for the header.
-   if test "${AST_USB_FOUND}" = "yes"; then
-      USB_LIB="${pbxlibdir} -lusb "
-      # if --with-USB=DIR has been specified, use it.
-      if test "x${USB_DIR}" != "x"; then
-         USB_INCLUDE="-I${USB_DIR}/include"
-      fi
-      USB_INCLUDE="${USB_INCLUDE} "
-      if test "xusb.h" = "x" ; then    # no header, assume found
-         USB_HEADER_FOUND="1"
-      else                             # check for the header
-         ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
-         CPPFLAGS="${CPPFLAGS} ${USB_INCLUDE}"
-         ac_fn_c_check_header_mongrel "$LINENO" "usb.h" "ac_cv_header_usb_h" "$ac_includes_default"
-if test "x$ac_cv_header_usb_h" = xyes; then :
-  USB_HEADER_FOUND=1
-else
-  USB_HEADER_FOUND=0
-fi
-
-
-         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
-      fi
-      if test "x${USB_HEADER_FOUND}" = "x0" ; then
-         USB_LIB=""
-         USB_INCLUDE=""
-      else
-         if test "x${pbxfuncname}" = "x" ; then                # only checking headers -> no library
-            USB_LIB=""
-         fi
-         PBX_USB=1
-         cat >>confdefs.h <<_ACEOF
-#define HAVE_USB 1
-_ACEOF
-
-      fi
-   fi
-fi
-
-
-
 if test "${OSARCH}" = "OpenBSD";
 then
 
@@ -27633,7 +28220,7 @@ if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lvorbis ${pbxlibdir} -lm -lvorbisenc -logg $LIBS"
+LIBS="-lvorbis ${pbxlibdir} -lm -lvorbisenc -lvorbisfile -logg $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -27675,7 +28262,7 @@ fi
 
    # now check for the header.
    if test "${AST_VORBIS_FOUND}" = "yes"; then
-      VORBIS_LIB="${pbxlibdir} -lvorbis -lm -lvorbisenc -logg"
+      VORBIS_LIB="${pbxlibdir} -lvorbis -lm -lvorbisenc -lvorbisfile -logg"
       # if --with-VORBIS=DIR has been specified, use it.
       if test "x${VORBIS_DIR}" != "x"; then
          VORBIS_INCLUDE="-I${VORBIS_DIR}/include"
@@ -27738,7 +28325,7 @@ if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lvorbis ${pbxlibdir} -lm -lvorbisenc $LIBS"
+LIBS="-lvorbis ${pbxlibdir} -lm -lvorbisenc -lvorbisfile $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -27780,7 +28367,7 @@ fi
 
    # now check for the header.
    if test "${AST_VORBIS_FOUND}" = "yes"; then
-      VORBIS_LIB="${pbxlibdir} -lvorbis -lm -lvorbisenc"
+      VORBIS_LIB="${pbxlibdir} -lvorbis -lm -lvorbisenc -lvorbisfile"
       # if --with-VORBIS=DIR has been specified, use it.
       if test "x${VORBIS_DIR}" != "x"; then
          VORBIS_INCLUDE="-I${VORBIS_DIR}/include"
 
 fi
 
+    if test "x${PBX_VORBIS_OPEN_CALLBACKS}" != "x1" -a "${USE_VORBIS_OPEN_CALLBACKS}" != "no"; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OV_CALLBACKS_NOCLOSE declared in vorbis/vorbisfile.h" >&5
+$as_echo_n "checking for OV_CALLBACKS_NOCLOSE declared in vorbis/vorbisfile.h... " >&6; }
+        saved_cppflags="${CPPFLAGS}"
+        if test "x${VORBIS_OPEN_CALLBACKS_DIR}" != "x"; then
+            VORBIS_OPEN_CALLBACKS_INCLUDE="-I${VORBIS_OPEN_CALLBACKS_DIR}/include"
+        fi
+        CPPFLAGS="${CPPFLAGS} ${VORBIS_OPEN_CALLBACKS_INCLUDE}"
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+ #include <vorbis/vorbisfile.h>
+int
+main ()
+{
+#if !defined(OV_CALLBACKS_NOCLOSE)
+                                    (void) OV_CALLBACKS_NOCLOSE;
+                                #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                PBX_VORBIS_OPEN_CALLBACKS=1
+
+$as_echo "#define HAVE_VORBIS_OPEN_CALLBACKS 1" >>confdefs.h
+
+
+
+else
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+        CPPFLAGS="${saved_cppflags}"
+    fi
+
+
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 fi
 
 
-PBX_GTK2=0
-if test "${PKGCONFIG}" != "No"; then
-   GTK2_INCLUDE=$(${PKGCONFIG} gtk+-2.0 --cflags 2>/dev/null)
-   GTK2_LIB=$(${PKGCONFIG} gtk+-2.0 --libs)
-   PBX_GTK2=1
 
-$as_echo "#define HAVE_GTK2 1" >>confdefs.h
+   if test "x${PBX_GTK2}" != "x1" -a "${USE_GTK2}" != "no"; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK2" >&5
+$as_echo_n "checking for GTK2... " >&6; }
 
+if test -n "$GTK2_CFLAGS"; then
+    pkg_cv_GTK2_CFLAGS="$GTK2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
 fi
+if test -n "$GTK2_LIBS"; then
+    pkg_cv_GTK2_LIBS="$GTK2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_GTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               GTK2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0" 2>&1`
+        else
+               GTK2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$GTK2_PKG_ERRORS" >&5
+
+
+            PBX_GTK2=0
 
 
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+            PBX_GTK2=0
+
+
+else
+       GTK2_CFLAGS=$pkg_cv_GTK2_CFLAGS
+       GTK2_LIBS=$pkg_cv_GTK2_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+            PBX_GTK2=1
+            GTK2_INCLUDE="$GTK2_CFLAGS"
+            GTK2_LIB="$GTK2_LIBS"
+
+$as_echo "#define HAVE_GTK2 1" >>confdefs.h
+
+
+fi
+   fi
 
 
 # build a GENERIC_ODBC result based on the presence of either UnixODBC (preferred)