Add support for applying direct media ACLs between differing channel technologies.
[asterisk/asterisk.git] / configure
index 459f6ea..db14c6d 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 360490 .
+# 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_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
@@ -925,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
@@ -985,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
@@ -997,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
@@ -1005,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
@@ -1059,6 +1088,7 @@ DIRNAME
 BASENAME
 COMPRESS
 FIND
+PYTHON
 FLEX
 CMP
 BISON
@@ -1180,6 +1210,7 @@ with_crypto
 with_dahdi
 with_avcodec
 with_gsm
+with_ilbc
 with_gtk2
 with_gmime
 with_h323
@@ -1195,6 +1226,7 @@ with_jack
 with_kqueue
 with_ldap
 with_libcurl
+with_libedit
 with_libxml2
 with_ltdl
 with_lua
@@ -1256,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.
@@ -1895,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
@@ -1910,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
@@ -1969,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.
@@ -6564,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
@@ -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
@@ -15876,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
@@ -15934,6 +16139,32 @@ $as_echo "no" >&6; }
 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
 $as_echo_n "checking for sysinfo... " >&6; }
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -16682,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
@@ -16708,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
@@ -16748,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:)
@@ -16768,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
@@ -17732,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=""
@@ -24624,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=""
@@ -24635,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="-lcfg ${pbxlibdir} -lcfg $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_COROSYNC_CFG_STATE_TRACK_FOUND=yes
+else
+  AST_COROSYNC_CFG_STATE_TRACK_FOUND=no
+fi
+
+      CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+   fi
+
+   # now check for the header.
+   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} ${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
+  COROSYNC_CFG_STATE_TRACK_HEADER_FOUND=0
+fi
+
+
+         CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+      fi
+      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
+            COROSYNC_CFG_STATE_TRACK_LIB=""
+         fi
+         PBX_COROSYNC_CFG_STATE_TRACK=1
+         cat >>confdefs.h <<_ACEOF
+#define HAVE_COROSYNC_CFG_STATE_TRACK 1
+_ACEOF
+
+      fi
+   fi
+fi
+
+
+
+
+if test "x${PBX_SPEEX}" != "x1" -a "${USE_SPEEX}" != "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"
+      else
+        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
@@ -26886,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
 
 
@@ -27056,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 2.6; 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
 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)