Imported Upstream version 2.4.3
[platform/upstream/gpg2.git] / configure
index ca1acaf..a4d03d2 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gnupg 2.2.29.
+# Generated by GNU Autoconf 2.69 for gnupg 2.4.3.
 #
 # Report bugs to <https://bugs.gnupg.org>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='gnupg'
 PACKAGE_TARNAME='gnupg'
-PACKAGE_VERSION='2.2.29'
-PACKAGE_STRING='gnupg 2.2.29'
+PACKAGE_VERSION='2.4.3'
+PACKAGE_STRING='gnupg 2.4.3'
 PACKAGE_BUGREPORT='https://bugs.gnupg.org'
 PACKAGE_URL=''
 
@@ -647,6 +647,10 @@ BUILD_GPGTAR_FALSE
 BUILD_GPGTAR_TRUE
 BUILD_DOC_FALSE
 BUILD_DOC_TRUE
+BUILD_TPM2D_FALSE
+BUILD_TPM2D_TRUE
+BUILD_KEYBOXD_FALSE
+BUILD_KEYBOXD_TRUE
 BUILD_DIRMNGR_FALSE
 BUILD_DIRMNGR_TRUE
 BUILD_G13_FALSE
@@ -660,6 +664,18 @@ BUILD_GPGSM_TRUE
 BUILD_GPG_FALSE
 BUILD_GPG_TRUE
 USE_C99_CFLAGS
+HAVE_LIBTSS
+TEST_LIBTSS_FALSE
+TEST_LIBTSS_TRUE
+HAVE_LIBTSS_FALSE
+HAVE_LIBTSS_TRUE
+LIBTSS_CFLAGS
+LIBTSS_LIBS
+TSSSTARTUP
+SWTPM_IOCTL
+SWTPM
+TPMSERVER
+TSS_INCLUDE
 W32SOCKLIBS
 NETLIBS
 CROSS_COMPILING_FALSE
@@ -668,7 +684,6 @@ LIBREADLINE
 ZLIBS
 ENABLE_BZIP2_SUPPORT_FALSE
 ENABLE_BZIP2_SUPPORT_TRUE
-SYS_SOCKET_H
 BUILD_INCLUDED_LIBINTL
 USE_INCLUDED_LIBINTL
 POSUB
@@ -704,8 +719,6 @@ NTBTLS_CONFIG
 NPTH_LIBS
 NPTH_CFLAGS
 NPTH_CONFIG
-SHRED
-LIBUTIL_LIBS
 FUSERMOUNT
 ENCFS
 SQLITE3_FALSE
@@ -728,11 +741,10 @@ GPG_ERROR_MT_LIBS
 GPG_ERROR_MT_CFLAGS
 GPG_ERROR_LIBS
 GPG_ERROR_CFLAGS
+GPGRT_CONFIG
 GPG_ERROR_CONFIG
 HAVE_ANDROID_SYSTEM_FALSE
 HAVE_ANDROID_SYSTEM_TRUE
-HAVE_W32CE_SYSTEM_FALSE
-HAVE_W32CE_SYSTEM_TRUE
 HAVE_W32_SYSTEM_FALSE
 HAVE_W32_SYSTEM_TRUE
 USE_SIMPLE_GETTEXT_FALSE
@@ -744,9 +756,6 @@ PKG_CONFIG_PATH
 PKG_CONFIG
 CC_FOR_BUILD
 AWK_HEX_NUMBER_OPTION
-HAVE_USTAR_FALSE
-HAVE_USTAR_TRUE
-TAR
 HAVE_YAT2M_FALSE
 HAVE_YAT2M_TRUE
 YAT2M
@@ -769,9 +778,15 @@ GNUPG_DIRMNGR_LDAP_PGM
 GNUPG_PROTECT_TOOL_PGM_FALSE
 GNUPG_PROTECT_TOOL_PGM_TRUE
 GNUPG_PROTECT_TOOL_PGM
+GNUPG_KEYBOXD_PGM_FALSE
+GNUPG_KEYBOXD_PGM_TRUE
+GNUPG_KEYBOXD_PGM
 GNUPG_DIRMNGR_PGM_FALSE
 GNUPG_DIRMNGR_PGM_TRUE
 GNUPG_DIRMNGR_PGM
+GNUPG_TPM2DAEMON_PGM_FALSE
+GNUPG_TPM2DAEMON_PGM_TRUE
+GNUPG_TPM2DAEMON_PGM
 GNUPG_SCDAEMON_PGM_FALSE
 GNUPG_SCDAEMON_PGM_TRUE
 GNUPG_SCDAEMON_PGM
@@ -881,18 +896,21 @@ ac_user_opts='
 enable_option_checking
 enable_silent_rules
 enable_dependency_tracking
-enable_gpg
 enable_gpgsm
 enable_scdaemon
 enable_g13
 enable_dirmngr
+enable_keyboxd
+enable_tpm2d
 enable_doc
 enable_gpgtar
 enable_wks_tools
 with_agent_pgm
 with_pinentry_pgm
 with_scdaemon_pgm
+with_tpm2daemon_pgm
 with_dirmngr_pgm
+with_keyboxd_pgm
 with_protect_tool_pgm
 with_dirmngr_ldap_pgm
 enable_gpg_is_gpg2
@@ -933,11 +951,11 @@ enable_ccid_driver
 enable_dirmngr_auto_start
 enable_maintainer_mode
 enable_largefile
-with_tar
 with_libgpg_error_prefix
 with_gpg_error_prefix
 with_libgcrypt_prefix
 with_libassuan_prefix
+with_libksba_prefix
 with_ksba_prefix
 enable_sqlite
 with_npth_prefix
@@ -958,7 +976,9 @@ enable_endian_check
 with_zlib
 with_bzip2
 with_readline
+with_tss
 enable_optimization
+enable_log_clock
 enable_werror
 enable_all_tests
 enable_tests
@@ -1535,7 +1555,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures gnupg 2.2.29 to adapt to many kinds of systems.
+\`configure' configures gnupg 2.4.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1606,7 +1626,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gnupg 2.2.29:";;
+     short | recursive ) echo "Configuration of gnupg 2.4.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1620,11 +1640,12 @@ Optional Features:
                           do not reject slow dependency extractors
   --disable-dependency-tracking
                           speeds up one-time build
-  --disable-gpg           do not build the gpg program
   --disable-gpgsm         do not build the gpgsm program
   --disable-scdaemon      do not build the scdaemon program
   --enable-g13            build the g13 program
   --disable-dirmngr       do not build the dirmngr program
+  --disable-keyboxd       do not build the keyboxd program
+  --disable-tpm2d         do not build the tpm2d program
   --disable-doc           do not build the doc program
   --disable-gpgtar        do not build the gpgtar program
   --disable-wks-tools     do not build the wks-tools program
@@ -1680,6 +1701,7 @@ Optional Features:
   --disable-endian-check  disable the endian check and trust the OS provided
                           macros
   --disable-optimization  disable compiler optimization
+  --enable-log-clock      enable log_clock timestamps
   --enable-werror         append -Werror to CFLAGS
   --enable-all-tests      let "make check" run all tests
   --disable-tests         do not run any tests
@@ -1696,7 +1718,9 @@ Optional Packages:
   --with-agent-pgm=PATH  Use PATH as the default for the agent)
   --with-pinentry-pgm=PATH  Use PATH as the default for the pinentry)
   --with-scdaemon-pgm=PATH  Use PATH as the default for the scdaemon)
+  --with-tpm2daemon-pgm=PATH  Use PATH as the default for the tpm2daemon)
   --with-dirmngr-pgm=PATH  Use PATH as the default for the dirmngr)
+  --with-keyboxd-pgm=PATH  Use PATH as the default for the keyboxd)
   --with-protect-tool-pgm=PATH  Use PATH as the default for the protect-tool)
   --with-dirmngr-ldap-pgm=PATH  Use PATH as the default for the dirmngr ldap wrapper)
   --with-agent-s2k-calibration=MSEC
@@ -1704,7 +1728,6 @@ Optional Packages:
                           milliseconds
   --with-photo-viewer=FIXED_VIEWER  set a fixed photo ID viewer
   --with-capabilities     use linux capabilities default=no
-  --with-tar=PATH         look for a tar program in PATH
   --with-libgpg-error-prefix=PFX
                           prefix where GPG Error is installed (optional)
 
@@ -1712,7 +1735,8 @@ Optional Packages:
                           prefix where LIBGCRYPT is installed (optional)
   --with-libassuan-prefix=PFX
                           prefix where LIBASSUAN is installed (optional)
-  --with-ksba-prefix=PFX  prefix where KSBA is installed (optional)
+  --with-libksba-prefix=PFX
+                          prefix where KSBA is installed (optional)
   --with-npth-prefix=PFX  prefix where NPTH is installed (optional)
   --with-ntbtls-prefix=PFX
                           prefix where NTBTLS is installed (optional)
@@ -1728,6 +1752,8 @@ Optional Packages:
   --with-zlib=DIR         use libz in DIR
   --with-bzip2=DIR        look for bzip2 in DIR
   --with-readline=DIR     look for the readline library in DIR
+  --with-tss=TSS          use the specified TPM Software Stack (ibm, intel, or
+                          autodetect)
 
 Some influential environment variables:
   CC          C compiler command
@@ -1822,7 +1848,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-gnupg configure 2.2.29
+gnupg configure 2.4.3
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2531,7 +2557,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by gnupg $as_me 2.2.29, which was
+It was created by gnupg $as_me 2.4.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2883,23 +2909,24 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 # When changing the SWDB tag please also adjust the hard coded tags in
-# build-aux/speedo.mk and Makefile.am
+# build-aux/speedo.mk, build-aux/getswdb.sh, and Makefile.am
+# As well as the source info for the man pages.
 
 cat >>confdefs.h <<_ACEOF
-#define GNUPG_SWDB_TAG "gnupg22"
+#define GNUPG_SWDB_TAG "gnupg24"
 _ACEOF
 
 
-NEED_GPG_ERROR_VERSION=1.27
+NEED_GPGRT_VERSION=1.46
 
 NEED_LIBGCRYPT_API=1
-NEED_LIBGCRYPT_VERSION=1.8.0
+NEED_LIBGCRYPT_VERSION=1.9.1
 
 NEED_LIBASSUAN_API=2
 NEED_LIBASSUAN_VERSION=2.5.0
 
 NEED_KSBA_API=1
-NEED_KSBA_VERSION=1.3.5
+NEED_KSBA_VERSION=1.6.3
 
 NEED_NTBTLS_API=1
 NEED_NTBTLS_VERSION=0.1.0
@@ -2910,7 +2937,7 @@ NEED_NPTH_VERSION=1.2
 
 NEED_GNUTLS_VERSION=3.0
 
-NEED_SQLITE_VERSION=3.7
+NEED_SQLITE_VERSION=3.27
 
 development_version=no
 PACKAGE=$PACKAGE_NAME
@@ -3430,7 +3457,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='gnupg'
- VERSION='2.2.29'
+ VERSION='2.4.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -5118,7 +5145,6 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
 
 
 
-
 # Some status variables.
 have_gpg_error=no
 have_libgcrypt=no
@@ -5129,6 +5155,7 @@ have_gnutls=no
 have_sqlite=no
 have_npth=no
 have_libusb=no
+have_libtss=no
 have_system_resolver=no
 gnupg_have_ldap="n/a"
 
@@ -5145,26 +5172,8 @@ use_tls_library=no
 large_secmem=no
 show_tor_support=no
 
-
-   build_gpg=yes
-
-      # Check whether --enable-gpg was given.
-if test "${enable_gpg+set}" = set; then :
-  enableval=$enable_gpg; build_gpg=$enableval
-else
-  build_gpg=yes
-fi
-
-
-   case "$build_gpg" in
-         no|yes)
-           ;;
-         *)
-           as_fn_error $? "only yes or no allowed for feature --enable-gpg" "$LINENO" 5
-           ;;
-   esac
-
-
+# gpg is a required part and can't be disabled anymore.
+build_gpg=yes
 
    build_gpgsm=yes
 
@@ -5248,6 +5257,46 @@ fi
 
 
 
+   build_keyboxd=yes
+
+      # Check whether --enable-keyboxd was given.
+if test "${enable_keyboxd+set}" = set; then :
+  enableval=$enable_keyboxd; build_keyboxd=$enableval
+else
+  build_keyboxd=yes
+fi
+
+
+   case "$build_keyboxd" in
+         no|yes)
+           ;;
+         *)
+           as_fn_error $? "only yes or no allowed for feature --enable-keyboxd" "$LINENO" 5
+           ;;
+   esac
+
+
+
+   build_tpm2d=yes
+
+      # Check whether --enable-tpm2d was given.
+if test "${enable_tpm2d+set}" = set; then :
+  enableval=$enable_tpm2d; build_tpm2d=$enableval
+else
+  build_tpm2d=yes
+fi
+
+
+   case "$build_tpm2d" in
+         no|yes)
+           ;;
+         *)
+           as_fn_error $? "only yes or no allowed for feature --enable-tpm2d" "$LINENO" 5
+           ;;
+   esac
+
+
+
    build_doc=yes
 
       # Check whether --enable-doc was given.
@@ -5422,6 +5471,27 @@ test -n "$GNUPG_SCDAEMON_PGM" && show_gnupg_scdaemon_pgm="$GNUPG_SCDAEMON_PGM"
 
 
 
+# Check whether --with-tpm2daemon-pgm was given.
+if test "${with_tpm2daemon_pgm+set}" = set; then :
+  withval=$with_tpm2daemon_pgm; GNUPG_TPM2DAEMON_PGM="$withval"
+else
+  GNUPG_TPM2DAEMON_PGM=""
+fi
+
+
+ if test -n "$GNUPG_TPM2DAEMON_PGM"; then
+  GNUPG_TPM2DAEMON_PGM_TRUE=
+  GNUPG_TPM2DAEMON_PGM_FALSE='#'
+else
+  GNUPG_TPM2DAEMON_PGM_TRUE='#'
+  GNUPG_TPM2DAEMON_PGM_FALSE=
+fi
+
+show_gnupg_tpm2daemon_pgm="(default)"
+test -n "$GNUPG_TPM2DAEMON_PGM" && show_gnupg_tpm2daemon_pgm="$GNUPG_TPM2DAEMON_PGM"
+
+
+
 # Check whether --with-dirmngr-pgm was given.
 if test "${with_dirmngr_pgm+set}" = set; then :
   withval=$with_dirmngr_pgm; GNUPG_DIRMNGR_PGM="$withval"
@@ -5442,6 +5512,26 @@ show_gnupg_dirmngr_pgm="(default)"
 test -n "$GNUPG_DIRMNGR_PGM" && show_gnupg_dirmngr_pgm="$GNUPG_DIRMNGR_PGM"
 
 
+# Check whether --with-keyboxd-pgm was given.
+if test "${with_keyboxd_pgm+set}" = set; then :
+  withval=$with_keyboxd_pgm; GNUPG_KEYBOXD_PGM="$withval"
+else
+  GNUPG_KEYBOXD_PGM=""
+fi
+
+
+ if test -n "$GNUPG_KEYBOXD_PGM"; then
+  GNUPG_KEYBOXD_PGM_TRUE=
+  GNUPG_KEYBOXD_PGM_FALSE='#'
+else
+  GNUPG_KEYBOXD_PGM_TRUE='#'
+  GNUPG_KEYBOXD_PGM_FALSE=
+fi
+
+show_gnupg_keyboxd_pgm="(default)"
+test -n "$GNUPG_KEYBOXD_PGM" && show_gnupg_keyboxd_pgm="$GNUPG_KEYBOXD_PGM"
+
+
 # Check whether --with-protect-tool-pgm was given.
 if test "${with_protect_tool_pgm+set}" = set; then :
   withval=$with_protect_tool_pgm; GNUPG_PROTECT_TOOL_PGM="$withval"
@@ -7595,6 +7685,7 @@ done
   done
 IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_YAT2M" && ac_cv_path_YAT2M=""./yat2m" "
   ;;
 esac
 fi
@@ -7617,14 +7708,12 @@ else
   HAVE_YAT2M_FALSE=
 fi
 
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror in -lcposix" >&5
-$as_echo_n "checking for strerror in -lcposix... " >&6; }
-if ${ac_cv_lib_cposix_strerror+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
+$as_echo_n "checking for library containing strerror... " >&6; }
+if ${ac_cv_search_strerror+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcposix  $LIBS"
+  ac_func_search_save_LIBS=$LIBS
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -7643,22 +7732,37 @@ return strerror ();
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_cposix_strerror=yes
-else
-  ac_cv_lib_cposix_strerror=no
+for ac_lib in '' cposix; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_strerror=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cposix_strerror" >&5
-$as_echo "$ac_cv_lib_cposix_strerror" >&6; }
-if test "x$ac_cv_lib_cposix_strerror" = xyes; then :
-  LIBS="$LIBS -lcposix"
+    conftest$ac_exeext
+  if ${ac_cv_search_strerror+:} false; then :
+  break
 fi
+done
+if ${ac_cv_search_strerror+:} false; then :
 
+else
+  ac_cv_search_strerror=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
+$as_echo "$ac_cv_search_strerror" >&6; }
+ac_res=$ac_cv_search_strerror
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
+fi
 
 # Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then :
@@ -7862,91 +7966,6 @@ fi
 
 
 
-# Check whether --with-tar was given.
-if test "${with_tar+set}" = set; then :
-  withval=$with_tar; _do_tar=$withval
-fi
-
-
-  if test x$_do_tar != xno ; then
-
-     if test x$_do_tar = x ; then
-        # Extract the first word of ""tar"", so it can be a program name with args.
-set dummy "tar"; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TAR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $TAR in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-TAR=$ac_cv_path_TAR
-if test -n "$TAR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
-$as_echo "$TAR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-        _mytar=$ac_cv_path_TAR
-     fi
-
-     # Check if our tar is ustar format.  If so, it's good.  TODO: Add some
-     # code to check various options, etc, to try and create ustar
-     # format.
-
-     if test x$_mytar != x ; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $_mytar speaks USTAR" >&5
-$as_echo_n "checking whether $_mytar speaks USTAR... " >&6; }
-        echo hithere > conftest.txt
-        $_mytar -cf - conftest.txt | (dd skip=257 bs=1 count=5 2>/dev/null || cat) | grep ustar > /dev/null
-        _tar_bad=$?
-        rm conftest.txt
-
-       if test x$_tar_bad = x0 ; 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; }
-       fi
-     fi
-  fi
-
-   if test x$_tar_bad = x0; then
-  HAVE_USTAR_TRUE=
-  HAVE_USTAR_FALSE='#'
-else
-  HAVE_USTAR_TRUE='#'
-  HAVE_USTAR_FALSE=
-fi
-
-
-
-
 # GNU AWK requires -n option to interpret "0xHH" as a number
 if $AWK 'BEGIN { if (PROCINFO["version"]) exit 1 }'; then
   AWK_HEX_NUMBER_OPTION=''
@@ -8104,7 +8123,6 @@ try_gettext=yes
 require_iconv=yes
 have_dosish_system=no
 have_w32_system=no
-have_w32ce_system=no
 have_android_system=no
 use_simple_gettext=no
 mmap_needed=yes
@@ -8123,16 +8141,9 @@ $as_echo "#define USE_SIMPLE_GETTEXT 1" >>confdefs.h
         have_w32_system=yes
         require_iconv=no
         require_pipe_to_unblock_pselect=no
-        case "${host}" in
-          *-mingw32ce*)
-            have_w32ce_system=yes
-            ;;
-          *)
 
 $as_echo "#define HAVE_DRIVE_LETTERS 1" >>confdefs.h
 
-            ;;
-        esac
         try_gettext="no"
        use_simple_gettext=yes
        mmap_needed=no
@@ -8233,11 +8244,18 @@ if test "$have_w32_system" = yes; then
 
 $as_echo "#define HAVE_W32_SYSTEM 1" >>confdefs.h
 
-   if test "$have_w32ce_system" = yes; then
+   for ac_header in winsock2.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_WINSOCK2_H 1
+_ACEOF
+
+fi
 
-$as_echo "#define HAVE_W32CE_SYSTEM 1" >>confdefs.h
+done
 
-   fi
 fi
  if test "$have_w32_system" = yes; then
   HAVE_W32_SYSTEM_TRUE=
@@ -8247,14 +8265,6 @@ else
   HAVE_W32_SYSTEM_FALSE=
 fi
 
- if test "$have_w32ce_system" = yes; then
-  HAVE_W32CE_SYSTEM_TRUE=
-  HAVE_W32CE_SYSTEM_FALSE='#'
-else
-  HAVE_W32CE_SYSTEM_TRUE='#'
-  HAVE_W32CE_SYSTEM_FALSE=
-fi
-
 
 if test "$have_android_system" = yes; then
 
@@ -8287,10 +8297,9 @@ $as_echo "$as_me: checking for libraries" >&6;}
 
 
 #
-# libgpg-error is a library with error codes shared between GnuPG
-# related projects.
+# gpgrt (aka libgpg-error) is a library with error codes shared
+# between GnuPG related projects.
 #
-
   gpg_error_config_prefix=""
 
 # Check whether --with-libgpg-error-prefix was given.
@@ -8367,17 +8376,135 @@ $as_echo "no" >&6; }
 fi
 
 
-  min_gpg_error_version="$NEED_GPG_ERROR_VERSION"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPG Error - version >= $min_gpg_error_version" >&5
-$as_echo_n "checking for GPG Error - version >= $min_gpg_error_version... " >&6; }
+
+  # Extract the first word of "gpgrt-config", so it can be a program name with args.
+set dummy gpgrt-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_GPGRT_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GPGRT_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GPGRT_CONFIG="$GPGRT_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$prefix/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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GPGRT_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
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_GPGRT_CONFIG" && ac_cv_path_GPGRT_CONFIG="no"
+  ;;
+esac
+fi
+GPGRT_CONFIG=$ac_cv_path_GPGRT_CONFIG
+if test -n "$GPGRT_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPGRT_CONFIG" >&5
+$as_echo "$GPGRT_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  if test "$GPGRT_CONFIG" != "no"; then
+    # Determine gpgrt_libdir
+    #
+    # Get the prefix of gpgrt-config assuming it's something like:
+    #   <PREFIX>/bin/gpgrt-config
+    gpgrt_prefix=${GPGRT_CONFIG%/*/*}
+    possible_libdir1=${gpgrt_prefix}/lib
+    # Determine by using system libdir-format with CC, it's like:
+    #   Normal style: /usr/lib
+    #   GNU cross style: /usr/<triplet>/lib
+    #   Debian style: /usr/lib/<multiarch-name>
+    #   Fedora/openSUSE style: /usr/lib, /usr/lib32 or /usr/lib64
+    # It is assumed that CC is specified to the one of host on cross build.
+    if libdir_candidates=$(${CC:-cc} -print-search-dirs | \
+          sed -n -e "/^libraries/{s/libraries: =//;s/:/\\
+/g;p;}"); then
+      # From the output of -print-search-dirs, select valid pkgconfig dirs.
+      libdir_candidates=$(for dir in $libdir_candidates; do
+        if p=$(cd $dir 2>/dev/null && pwd); then
+          test -d "$p/pkgconfig" && echo $p;
+        fi
+      done)
+
+      for possible_libdir0 in $libdir_candidates; do
+        # possible_libdir0:
+        #   Fallback candidate, the one of system-installed (by $CC)
+        #   (/usr/<triplet>/lib, /usr/lib/<multiarch-name> or /usr/lib32)
+        # possible_libdir1:
+        #   Another candidate, user-locally-installed
+        #   (<gpgrt_prefix>/lib)
+        # possible_libdir2
+        #   Most preferred
+        #   (<gpgrt_prefix>/<triplet>/lib,
+        #    <gpgrt_prefix>/lib/<multiarch-name> or <gpgrt_prefix>/lib32)
+        if test "${possible_libdir0##*/}" = "lib"; then
+          possible_prefix0=${possible_libdir0%/lib}
+          possible_prefix0_triplet=${possible_prefix0##*/}
+          if test -z "$possible_prefix0_triplet"; then
+            continue
+          fi
+          possible_libdir2=${gpgrt_prefix}/$possible_prefix0_triplet/lib
+        else
+          possible_prefix0=${possible_libdir0%%/lib*}
+          possible_libdir2=${gpgrt_prefix}${possible_libdir0#$possible_prefix0}
+        fi
+        if test -f ${possible_libdir2}/pkgconfig/gpg-error.pc; then
+          gpgrt_libdir=${possible_libdir2}
+        elif test -f ${possible_libdir1}/pkgconfig/gpg-error.pc; then
+          gpgrt_libdir=${possible_libdir1}
+        elif test -f ${possible_libdir0}/pkgconfig/gpg-error.pc; then
+          gpgrt_libdir=${possible_libdir0}
+        fi
+        if test -n "$gpgrt_libdir"; then break; fi
+      done
+    fi
+    if test -z "$gpgrt_libdir"; then
+      # No valid pkgconfig dir in any of the system directories, fallback
+      gpgrt_libdir=${possible_libdir1}
+    fi
+  else
+    unset GPGRT_CONFIG
+  fi
+
+  if test -n "$gpgrt_libdir"; then
+    GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir"
+    if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then
+      GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Use gpgrt-config with $gpgrt_libdir as gpg-error-config" >&5
+$as_echo "$as_me: Use gpgrt-config with $gpgrt_libdir as gpg-error-config" >&6;}
+      gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion`
+    else
+      gpg_error_config_version=`$GPG_ERROR_CONFIG --version`
+      unset GPGRT_CONFIG
+    fi
+  elif test "$GPG_ERROR_CONFIG" != "no"; then
+    gpg_error_config_version=`$GPG_ERROR_CONFIG --version`
+    unset GPGRT_CONFIG
+  fi
+
+  min_gpg_error_version="$NEED_GPGRT_VERSION"
   ok=no
-  if test "$GPG_ERROR_CONFIG" != "no" \
-     && test -f "$GPG_ERROR_CONFIG" ; then
+  if test "$GPG_ERROR_CONFIG" != "no"; then
     req_major=`echo $min_gpg_error_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)/\1/'`
     req_minor=`echo $min_gpg_error_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)/\2/'`
-    gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
     major=`echo $gpg_error_config_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
     minor=`echo $gpg_error_config_version | \
@@ -8392,31 +8519,44 @@ $as_echo_n "checking for GPG Error - version >= $min_gpg_error_version... " >&6;
         fi
     fi
   fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPG Error - version >= $min_gpg_error_version" >&5
+$as_echo_n "checking for GPG Error - version >= $min_gpg_error_version... " >&6; }
   if test $ok = yes; then
-    GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
-    GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
-    GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
-    GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
+    GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG --cflags`
+    GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG --libs`
+    if test -z "$GPGRT_CONFIG"; then
+      GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --mt --cflags 2>/dev/null`
+      GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --mt --libs 2>/dev/null`
+    else
+      GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null`
+      GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS"
+      GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null`
+      GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS"
+    fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($gpg_error_config_version)" >&5
 $as_echo "yes ($gpg_error_config_version)" >&6; }
     have_gpg_error=yes
-    gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
+    if test -z "$GPGRT_CONFIG"; then
+      gpg_error_config_host=`$GPG_ERROR_CONFIG --host 2>/dev/null || echo none`
+    else
+      gpg_error_config_host=`$GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none`
+    fi
     if test x"$gpg_error_config_host" != xnone ; then
       if test x"$gpg_error_config_host" != x"$host" ; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 ***
-*** The config script $GPG_ERROR_CONFIG was
+*** The config script \"$GPG_ERROR_CONFIG\" was
 *** built for $gpg_error_config_host and thus may not match the
 *** used host $host.
-*** You may want to use the configure option --with-gpg-error-prefix
+*** You may want to use the configure option --with-libgpg-error-prefix
 *** to specify a matching config script or use \$SYSROOT.
 ***" >&5
 $as_echo "$as_me: WARNING:
 ***
-*** The config script $GPG_ERROR_CONFIG was
+*** The config script \"$GPG_ERROR_CONFIG\" was
 *** built for $gpg_error_config_host and thus may not match the
 *** used host $host.
-*** You may want to use the configure option --with-gpg-error-prefix
+*** You may want to use the configure option --with-libgpg-error-prefix
 *** to specify a matching config script or use \$SYSROOT.
 ***" >&2;}
         gpg_config_script_warn="$gpg_config_script_warn libgpg-error"
@@ -8453,8 +8593,21 @@ fi
   if test x"${LIBGCRYPT_CONFIG}" = x ; then
      if test x"${libgcrypt_config_prefix}" != x ; then
         LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
-     else
-       case "${SYSROOT}" in
+     fi
+  fi
+
+  use_gpgrt_config=""
+  if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+    if $GPGRT_CONFIG libgcrypt --exists; then
+      LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Use gpgrt-config as libgcrypt-config" >&5
+$as_echo "$as_me: Use gpgrt-config as libgcrypt-config" >&6;}
+      use_gpgrt_config=yes
+    fi
+  fi
+  if test -z "$use_gpgrt_config"; then
+    if test x"${LIBGCRYPT_CONFIG}" = x ; then
+      case "${SYSROOT}" in
          /*)
            if test -x "${SYSROOT}/bin/libgcrypt-config" ; then
              LIBGCRYPT_CONFIG="${SYSROOT}/bin/libgcrypt-config"
@@ -8466,11 +8619,9 @@ fi
            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring \$SYSROOT as it is not an absolute path." >&5
 $as_echo "$as_me: WARNING: Ignoring \$SYSROOT as it is not an absolute path." >&2;}
            ;;
-       esac
-     fi
-  fi
-
-  # Extract the first word of "libgcrypt-config", so it can be a program name with args.
+      esac
+    fi
+    # Extract the first word of "libgcrypt-config", so it can be a program name with args.
 set dummy libgcrypt-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
@@ -8511,6 +8662,8 @@ $as_echo "no" >&6; }
 fi
 
 
+  fi
+
   tmp="$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION"
   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
      req_libgcrypt_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
@@ -8530,7 +8683,11 @@ $as_echo_n "checking for LIBGCRYPT - version >= $min_libgcrypt_version... " >&6;
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
     req_micro=`echo $min_libgcrypt_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
-    libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
+    if test -z "$use_gpgrt_config"; then
+      libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
+    else
+      libgcrypt_config_version=`$LIBGCRYPT_CONFIG --modversion`
+    fi
     major=`echo $libgcrypt_config_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
     minor=`echo $libgcrypt_config_version | \
@@ -8564,7 +8721,11 @@ $as_echo "no" >&6; }
      # If we have a recent libgcrypt, we should also check that the
      # API is compatible
      if test "$req_libgcrypt_api" -gt 0 ; then
-        tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
+        if test -z "$use_gpgrt_config"; then
+           tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
+       else
+           tmp=`$LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0`
+       fi
         if test "$tmp" -gt 0 ; then
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBGCRYPT API version" >&5
 $as_echo_n "checking LIBGCRYPT API version... " >&6; }
@@ -8583,12 +8744,16 @@ $as_echo "does not match. want=$req_libgcrypt_api got=$tmp" >&6; }
     LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
     LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
     have_libgcrypt=yes
-    libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
+    if test -z "$use_gpgrt_config"; then
+      libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
+    else
+      libgcrypt_config_host=`$LIBGCRYPT_CONFIG --variable=host 2>/dev/null || echo none`
+    fi
     if test x"$libgcrypt_config_host" != xnone ; then
       if test x"$libgcrypt_config_host" != x"$host" ; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 ***
-*** The config script $LIBGCRYPT_CONFIG was
+*** The config script \"$LIBGCRYPT_CONFIG\" was
 *** built for $libgcrypt_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-libgcrypt-prefix
@@ -8596,7 +8761,7 @@ $as_echo "does not match. want=$req_libgcrypt_api got=$tmp" >&6; }
 ***" >&5
 $as_echo "$as_me: WARNING:
 ***
-*** The config script $LIBGCRYPT_CONFIG was
+*** The config script \"$LIBGCRYPT_CONFIG\" was
 *** built for $libgcrypt_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-libgcrypt-prefix
@@ -8613,12 +8778,35 @@ $as_echo "$as_me: WARNING:
 
 
 
-
+# And, then, check if it's newer than 1.9.0 so that we can
+# conditionally build some programs.
+# Note: This is not anymore needed but keep the code commented in case
+# we need it again with some future libgcrypt.
+#have_libgcrypt_newer=no
+#if test $ok = yes; then
+#    if test "$major" -gt 1; then
+#        have_libgcrypt_newer=yes
+#    else
+#        if test "$major" -eq 1; then
+#            if test "$minor" -gt 9; then
+#               have_libgcrypt_newer=yes
+#            else
+#               if test "$minor" -eq 9; then
+#                   if test "$micro" -ge 0; then
+#                     have_libgcrypt_newer=yes
+#                   fi
+#               fi
+#            fi
+#        fi
+#    fiy
+#fi
+#AM_CONDITIONAL(HAVE_NEWER_LIBGCRYPT, [test $have_libgcrypt_newer = yes])
 
 #
 # libassuan is used for IPC
 #
 
+
 # Check whether --with-libassuan-prefix was given.
 if test "${with_libassuan_prefix+set}" = set; then :
   withval=$with_libassuan_prefix; libassuan_config_prefix="$withval"
@@ -8627,12 +8815,22 @@ else
 fi
 
   if test x$libassuan_config_prefix != x ; then
-    libassuan_config_args="$libassuan_config_args --prefix=$libassuan_config_prefix"
     if test x${LIBASSUAN_CONFIG+set} != xset ; then
       LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config
     fi
   fi
-  # Extract the first word of "libassuan-config", so it can be a program name with args.
+
+  use_gpgrt_config=""
+  if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+    if $GPGRT_CONFIG libassuan --exists; then
+      LIBASSUAN_CONFIG="$GPGRT_CONFIG libassuan"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Use gpgrt-config as libassuan-config" >&5
+$as_echo "$as_me: Use gpgrt-config as libassuan-config" >&6;}
+      use_gpgrt_config=yes
+    fi
+  fi
+  if test -z "$use_gpgrt_config"; then
+    # Extract the first word of "libassuan-config", so it can be a program name with args.
 set dummy libassuan-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
@@ -8673,6 +8871,7 @@ $as_echo "no" >&6; }
 fi
 
 
+  fi
 
   tmp="$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION"
   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
@@ -8683,48 +8882,49 @@ fi
     min_libassuan_version="$tmp"
   fi
 
-  if test "$LIBASSUAN_CONFIG" != "no" ; then
-    libassuan_version=`$LIBASSUAN_CONFIG --version`
-  fi
-  libassuan_version_major=`echo $libassuan_version | \
-               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
-  libassuan_version_minor=`echo $libassuan_version | \
-               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'`
-  libassuan_version_micro=`echo $libassuan_version | \
-               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'`
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBASSUAN - version >= $min_libassuan_version" >&5
 $as_echo_n "checking for LIBASSUAN - version >= $min_libassuan_version... " >&6; }
   ok=no
-  if test "$LIBASSUAN_CONFIG" != "no" ; then
-
+  if test "$LIBASSUAN_CONFIG" != "no"; then
     req_major=`echo $min_libassuan_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
     req_minor=`echo $min_libassuan_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
     req_micro=`echo $min_libassuan_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
-    if test "$libassuan_version_major" -gt "$req_major"; then
+
+    if test -z "$use_gpgrt_config"; then
+      libassuan_config_version=`$LIBASSUAN_CONFIG --version`
+    else
+      libassuan_config_version=`$LIBASSUAN_CONFIG --modversion`
+    fi
+    major=`echo $libassuan_config_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
+    minor=`echo $libassuan_config_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'`
+    micro=`echo $libassuan_config_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'`
+
+    if test "$major" -gt "$req_major"; then
         ok=yes
     else
-        if test "$libassuan_version_major" -eq "$req_major"; then
-            if test "$libassuan_version_minor" -gt "$req_minor"; then
+        if test "$major" -eq "$req_major"; then
+            if test "$minor" -gt "$req_minor"; then
                ok=yes
             else
-               if test "$libassuan_version_minor" -eq "$req_minor"; then
-                   if test "$libassuan_version_micro" -ge "$req_micro"; then
+               if test "$minor" -eq "$req_minor"; then
+                   if test "$micro" -ge "$req_micro"; then
                      ok=yes
                    fi
                fi
             fi
         fi
     fi
-
   fi
 
   if test $ok = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($libassuan_version)" >&5
-$as_echo "yes ($libassuan_version)" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($libassuan_config_version)" >&5
+$as_echo "yes ($libassuan_config_version)" >&6; }
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -8732,7 +8932,11 @@ $as_echo "no" >&6; }
 
   if test $ok = yes; then
     if test "$req_libassuan_api" -gt 0 ; then
-      tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0`
+      if test -z "$use_gpgrt_config"; then
+        tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0`
+      else
+        tmp=`$LIBASSUAN_CONFIG --variable=api_version 2>/dev/null || echo 0`
+      fi
       if test "$tmp" -gt 0 ; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBASSUAN API version" >&5
 $as_echo_n "checking LIBASSUAN API version... " >&6; }
@@ -8748,11 +8952,40 @@ $as_echo "does not match.  want=$req_libassuan_api got=$tmp." >&6; }
     fi
   fi
 
-
   if test $ok = yes; then
-    LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG $libassuan_config_args --cflags`
-    LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG $libassuan_config_args --libs`
-    have_libassuan=yes
+    if test x"$host" != x ; then
+      if test -z "$use_gpgrt_config"; then
+        libassuan_config_host=`$LIBASSUAN_CONFIG --host 2>/dev/null || echo none`
+      else
+        libassuan_config_host=`$LIBASSUAN_CONFIG --variable=host 2>/dev/null || echo none`
+      fi
+      if test x"$libassuan_config_host" != xnone ; then
+        if test x"$libassuan_config_host" != x"$host" ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+***
+*** The config script \"$LIBASSUAN_CONFIG\" was
+*** built for $libassuan_config_host and thus may not match the
+*** used host $host.
+*** You may want to use the configure option --with-libassuan-prefix
+*** to specify a matching config script.
+***" >&5
+$as_echo "$as_me: WARNING:
+***
+*** The config script \"$LIBASSUAN_CONFIG\" was
+*** built for $libassuan_config_host and thus may not match the
+*** used host $host.
+*** You may want to use the configure option --with-libassuan-prefix
+*** to specify a matching config script.
+***" >&2;}
+        fi
+      fi
+    fi
+  fi
+
+  if test $ok = yes; then
+    LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG --cflags`
+    LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG --libs`
+    have_libassuan=yes
   else
     LIBASSUAN_CFLAGS=""
     LIBASSUAN_LIBS=""
@@ -8776,6 +9009,15 @@ fi
 #
 
 
+# Check whether --with-libksba-prefix was given.
+if test "${with_libksba_prefix+set}" = set; then :
+  withval=$with_libksba_prefix; ksba_config_prefix="$withval"
+else
+  ksba_config_prefix=""
+fi
+
+
+
 # Check whether --with-ksba-prefix was given.
 if test "${with_ksba_prefix+set}" = set; then :
   withval=$with_ksba_prefix; ksba_config_prefix="$withval"
@@ -8783,14 +9025,24 @@ else
   ksba_config_prefix=""
 fi
 
+
   if test x$ksba_config_prefix != x ; then
-     ksba_config_args="$ksba_config_args --prefix=$ksba_config_prefix"
-     if test x${KSBA_CONFIG+set} != xset ; then
-        KSBA_CONFIG=$ksba_config_prefix/bin/ksba-config
-     fi
+    if test x${KSBA_CONFIG+set} != xset ; then
+      KSBA_CONFIG=$ksba_config_prefix/bin/ksba-config
+    fi
   fi
 
-  # Extract the first word of "ksba-config", so it can be a program name with args.
+  use_gpgrt_config=""
+  if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+    if $GPGRT_CONFIG ksba --exists; then
+      KSBA_CONFIG="$GPGRT_CONFIG ksba"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Use gpgrt-config as ksba-config" >&5
+$as_echo "$as_me: Use gpgrt-config as ksba-config" >&6;}
+      use_gpgrt_config=yes
+    fi
+  fi
+  if test -z "$use_gpgrt_config"; then
+    # Extract the first word of "ksba-config", so it can be a program name with args.
 set dummy ksba-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
@@ -8831,6 +9083,8 @@ $as_echo "no" >&6; }
 fi
 
 
+  fi
+
   tmp="$NEED_KSBA_API:$NEED_KSBA_VERSION"
   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
      req_ksba_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
@@ -8850,7 +9104,11 @@ $as_echo_n "checking for KSBA - version >= $min_ksba_version... " >&6; }
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
     req_micro=`echo $min_ksba_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
-    ksba_config_version=`$KSBA_CONFIG $ksba_config_args --version`
+    if test -z "$use_gpgrt_config"; then
+      ksba_config_version=`$KSBA_CONFIG --version`
+    else
+      ksba_config_version=`$KSBA_CONFIG --modversion`
+    fi
     major=`echo $ksba_config_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
     minor=`echo $ksba_config_version | \
@@ -8884,7 +9142,11 @@ $as_echo "no" >&6; }
      # Even if we have a recent libksba, we should check that the
      # API is compatible.
      if test "$req_ksba_api" -gt 0 ; then
-        tmp=`$KSBA_CONFIG --api-version 2>/dev/null || echo 0`
+        if test -z "$use_gpgrt_config"; then
+          tmp=`$KSBA_CONFIG --api-version 2>/dev/null || echo 0`
+       else
+          tmp=`$KSBA_CONFIG --variable=api_version 2>/dev/null || echo 0`
+       fi
         if test "$tmp" -gt 0 ; then
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking KSBA API version" >&5
 $as_echo_n "checking KSBA API version... " >&6; }
@@ -8900,15 +9162,19 @@ $as_echo "does not match.  want=$req_ksba_api got=$tmp." >&6; }
      fi
   fi
   if test $ok = yes; then
-    KSBA_CFLAGS=`$KSBA_CONFIG $ksba_config_args --cflags`
-    KSBA_LIBS=`$KSBA_CONFIG $ksba_config_args --libs`
+    KSBA_CFLAGS=`$KSBA_CONFIG --cflags`
+    KSBA_LIBS=`$KSBA_CONFIG --libs`
     have_ksba=yes
-    libksba_config_host=`$LIBKSBA_CONFIG $ksba_config_args --host 2>/dev/null || echo none`
+    if test -z "$use_gpgrt_config"; then
+      libksba_config_host=`$KSBA_CONFIG --host 2>/dev/null || echo none`
+    else
+      libksba_config_host=`$KSBA_CONFIG --variable=host 2>/dev/null || echo none`
+    fi
     if test x"$libksba_config_host" != xnone ; then
       if test x"$libksba_config_host" != x"$host" ; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 ***
-*** The config script $LIBKSBA_CONFIG was
+*** The config script \"$KSBA_CONFIG\" was
 *** built for $libksba_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-libksba-prefix
@@ -8916,7 +9182,7 @@ $as_echo "does not match.  want=$req_ksba_api got=$tmp." >&6; }
 ***" >&5
 $as_echo "$as_me: WARNING:
 ***
-*** The config script $LIBKSBA_CONFIG was
+*** The config script \"$KSBA_CONFIG\" was
 *** built for $libksba_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-libksba-prefix
@@ -9214,16 +9480,20 @@ fi
     tmp=$(echo "$SQLITE3_PKG_ERRORS" | tr '\n' '\v' | sed 's/\v/\n*** /g')
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 ***
-*** Building without SQLite support - TOFU disabled
+*** Building without SQLite support - TOFU and Keyboxd disabled
 ***
 *** $tmp" >&5
 $as_echo "$as_me: WARNING:
 ***
-*** Building without SQLite support - TOFU disabled
+*** Building without SQLite support - TOFU and Keyboxd disabled
 ***
 *** $tmp" >&2;}
   fi
 fi
+if test "$have_sqlite" != "yes"; then
+    build_keyboxd=no
+fi
+
 
  if test "$have_sqlite" = "yes"; then
   SQLITE3_TRUE=
@@ -9338,108 +9608,6 @@ _ACEOF
 
 
 
-# Checks for dirmngr
-
-
-#
-# Checks formerly used for symcryptrun.
-#
-
-# libutil has openpty() and login_tty().
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil" >&5
-$as_echo_n "checking for openpty in -lutil... " >&6; }
-if ${ac_cv_lib_util_openpty+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lutil  $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 openpty ();
-int
-main ()
-{
-return openpty ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_util_openpty=yes
-else
-  ac_cv_lib_util_openpty=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty" >&5
-$as_echo "$ac_cv_lib_util_openpty" >&6; }
-if test "x$ac_cv_lib_util_openpty" = xyes; then :
-   LIBUTIL_LIBS="$LIBUTIL_LIBS -lutil"
-
-$as_echo "#define HAVE_LIBUTIL 1" >>confdefs.h
-
-
-fi
-
-
-
-# shred is used to clean temporary plain text files.
-# Extract the first word of "shred", so it can be a program name with args.
-set dummy shred; 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_SHRED+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $SHRED in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_SHRED="$SHRED" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_SHRED="$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_SHRED" && ac_cv_path_SHRED="/usr/bin/shred"
-  ;;
-esac
-fi
-SHRED=$ac_cv_path_SHRED
-if test -n "$SHRED"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHRED" >&5
-$as_echo "$SHRED" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SHRED "${SHRED}"
-_ACEOF
-
-
 
 #
 # Check whether the nPth library is available
@@ -9455,7 +9623,18 @@ fi
   if test "x$npth_config_prefix" != x ; then
       NPTH_CONFIG="$npth_config_prefix/bin/npth-config"
   fi
-  # Extract the first word of "npth-config", so it can be a program name with args.
+
+  use_gpgrt_config=""
+  if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+    if $GPGRT_CONFIG npth --exists; then
+      NPTH_CONFIG="$GPGRT_CONFIG npth"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Use gpgrt-config as npth-config" >&5
+$as_echo "$as_me: Use gpgrt-config as npth-config" >&6;}
+      use_gpgrt_config=yes
+    fi
+  fi
+  if test -z "$use_gpgrt_config"; then
+    # Extract the first word of "npth-config", so it can be a program name with args.
 set dummy npth-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
@@ -9496,9 +9675,14 @@ $as_echo "no" >&6; }
 fi
 
 
+  fi
 
   if test "$NPTH_CONFIG" != "no" ; then
-    npth_version=`$NPTH_CONFIG --version`
+    if test -z "$use_gpgrt_config"; then
+      npth_version=`$NPTH_CONFIG --version`
+    else
+      npth_version=`$NPTH_CONFIG --modversion`
+    fi
   fi
   npth_version_major=`echo $npth_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
@@ -9544,34 +9728,42 @@ $as_echo "yes ($npth_version)" >&6; }
 $as_echo "no" >&6; }
   fi
   if test $ok = yes; then
-     # If we have a recent NPTH, we should also check that the
-     # API is compatible.
-     if test "$req_npth_api" -gt 0 ; then
+    # If we have a recent NPTH, we should also check that the
+    # API is compatible.
+    if test "$req_npth_api" -gt 0 ; then
+      if test -z "$use_gpgrt_config"; then
         tmp=`$NPTH_CONFIG --api-version 2>/dev/null || echo 0`
-        if test "$tmp" -gt 0 ; then
-           { $as_echo "$as_me:${as_lineno-$LINENO}: checking NPTH API version" >&5
+      else
+        tmp=`$NPTH_CONFIG --variable=api_version 2>/dev/null || echo 0`
+      fi
+      if test "$tmp" -gt 0 ; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking NPTH API version" >&5
 $as_echo_n "checking NPTH API version... " >&6; }
-           if test "$req_npth_api" -eq "$tmp" ; then
-             { $as_echo "$as_me:${as_lineno-$LINENO}: result: okay" >&5
+        if test "$req_npth_api" -eq "$tmp" ; then
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: okay" >&5
 $as_echo "okay" >&6; }
-           else
-             ok=no
-             { $as_echo "$as_me:${as_lineno-$LINENO}: result: does not match. want=$req_npth_api got=$tmp" >&5
+        else
+          ok=no
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: does not match. want=$req_npth_api got=$tmp" >&5
 $as_echo "does not match. want=$req_npth_api got=$tmp" >&6; }
-           fi
         fi
-     fi
+      fi
+    fi
   fi
   if test $ok = yes; then
     NPTH_CFLAGS=`$NPTH_CONFIG --cflags`
     NPTH_LIBS=`$NPTH_CONFIG --libs`
     have_npth=yes
-    npth_config_host=`$NPTH_CONFIG --host 2>/dev/null || echo none`
+    if test -z "$use_gpgrt_config"; then
+      npth_config_host=`$NPTH_CONFIG --host 2>/dev/null || echo none`
+    else
+      npth_config_host=`$NPTH_CONFIG --variable=host 2>/dev/null || echo none`
+    fi
     if test x"$npth_config_host" != xnone ; then
       if test x"$npth_config_host" != x"$host" ; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 ***
-*** The config script $NPTH_CONFIG was
+*** The config script \"$NPTH_CONFIG\" was
 *** built for $npth_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-npth-prefix
@@ -9579,7 +9771,7 @@ $as_echo "does not match. want=$req_npth_api got=$tmp" >&6; }
 ***" >&5
 $as_echo "$as_me: WARNING:
 ***
-*** The config script $NPTH_CONFIG was
+*** The config script \"$NPTH_CONFIG\" was
 *** built for $npth_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-npth-prefix
@@ -9630,7 +9822,7 @@ fi
 
 
 #
-# NTBTLS is our TLS library.  If it is not available fallback to
+# NTBTLS is our TLS library.  If it is not available we fall back to
 # GNUTLS.
 #
 # Check whether --enable-ntbtls was given.
@@ -9653,24 +9845,35 @@ fi
   if test x"${NTBTLS_CONFIG}" = x ; then
      if test x"${ntbtls_config_prefix}" != x ; then
         NTBTLS_CONFIG="${ntbtls_config_prefix}/bin/ntbtls-config"
-     else
-       case "${SYSROOT}" in
-         /*)
-           if test -x "${SYSROOT}/bin/ntbtls-config" ; then
-             NTBTLS_CONFIG="${SYSROOT}/bin/ntbtls-config"
-           fi
-           ;;
-         '')
-           ;;
-          *)
-           { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring \$SYSROOT as it is not an absolute path." >&5
-$as_echo "$as_me: WARNING: Ignoring \$SYSROOT as it is not an absolute path." >&2;}
-           ;;
-       esac
      fi
   fi
 
-  # Extract the first word of "ntbtls-config", so it can be a program name with args.
+  use_gpgrt_config=""
+  if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then
+    if $GPGRT_CONFIG ntbtls --exists; then
+      NTBTLS_CONFIG="$GPGRT_CONFIG ntbtls"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Use gpgrt-config as ntbtls-config" >&5
+$as_echo "$as_me: Use gpgrt-config as ntbtls-config" >&6;}
+      use_gpgrt_config=yes
+    fi
+  fi
+  if test -z "$use_gpgrt_config"; then
+    if test x"${NTBTLS_CONFIG}" = x ; then
+      case "${SYSROOT}" in
+        /*)
+          if test -x "${SYSROOT}/bin/ntbtls-config" ; then
+            NTBTLS_CONFIG="${SYSROOT}/bin/ntbtls-config"
+          fi
+          ;;
+        '')
+          ;;
+         *)
+          { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring \$SYSROOT as it is not an absolute path." >&5
+$as_echo "$as_me: WARNING: Ignoring \$SYSROOT as it is not an absolute path." >&2;}
+          ;;
+      esac
+    fi
+    # Extract the first word of "ntbtls-config", so it can be a program name with args.
 set dummy ntbtls-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
@@ -9711,6 +9914,8 @@ $as_echo "no" >&6; }
 fi
 
 
+  fi
+
   tmp="$NEED_NTBTLS_API:$NEED_NTBTLS_VERSION"
   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
      req_ntbtls_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
@@ -9730,7 +9935,11 @@ $as_echo_n "checking for NTBTLS - version >= $min_ntbtls_version... " >&6; }
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
     req_micro=`echo $min_ntbtls_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
-    ntbtls_config_version=`$NTBTLS_CONFIG --version`
+    if test -z "$use_gpgrt_config"; then
+      ntbtls_config_version=`$NTBTLS_CONFIG --version`
+    else
+      ntbtls_config_version=`$NTBTLS_CONFIG --modversion`
+    fi
     major=`echo $ntbtls_config_version | \
                sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
     minor=`echo $ntbtls_config_version | \
@@ -9764,7 +9973,11 @@ $as_echo "no" >&6; }
      # If we have a recent ntbtls, we should also check that the
      # API is compatible
      if test "$req_ntbtls_api" -gt 0 ; then
-        tmp=`$NTBTLS_CONFIG --api-version 2>/dev/null || echo 0`
+        if test -z "$use_gpgrt_config"; then
+          tmp=`$NTBTLS_CONFIG --api-version 2>/dev/null || echo 0`
+        else
+          tmp=`$NTBTLS_CONFIG --variable=api_version 2>/dev/null || echo 0`
+       fi
         if test "$tmp" -gt 0 ; then
            { $as_echo "$as_me:${as_lineno-$LINENO}: checking NTBTLS API version" >&5
 $as_echo_n "checking NTBTLS API version... " >&6; }
@@ -9783,12 +9996,16 @@ $as_echo "does not match. want=$req_ntbtls_api got=$tmp" >&6; }
     NTBTLS_CFLAGS=`$NTBTLS_CONFIG --cflags`
     NTBTLS_LIBS=`$NTBTLS_CONFIG --libs`
     have_ntbtls=yes
-    ntbtls_config_host=`$NTBTLS_CONFIG --host 2>/dev/null || echo none`
+    if test -z "$use_gpgrt_config"; then
+      ntbtls_config_host=`$NTBTLS_CONFIG --host 2>/dev/null || echo none`
+    else
+      ntbtls_config_host=`$NTBTLS_CONFIG --variable=host 2>/dev/null || echo none`
+    fi
     if test x"$ntbtls_config_host" != xnone ; then
       if test x"$ntbtls_config_host" != x"$host" ; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 ***
-*** The config script $NTBTLS_CONFIG was
+*** The config script \"$NTBTLS_CONFIG\" was
 *** built for $ntbtls_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-ntbtls-prefix
@@ -9796,7 +10013,7 @@ $as_echo "does not match. want=$req_ntbtls_api got=$tmp" >&6; }
 ***" >&5
 $as_echo "$as_me: WARNING:
 ***
-*** The config script $NTBTLS_CONFIG was
+*** The config script \"$NTBTLS_CONFIG\" was
 *** built for $ntbtls_config_host and thus may not match the
 *** used host $host.
 *** You may want to use the configure option --with-ntbtls-prefix
@@ -9909,14 +10126,15 @@ $as_echo "#define HTTP_USE_GNUTLS 1" >>confdefs.h
 
   else
     tmp=$(echo "$LIBGNUTLS_PKG_ERRORS" | tr '\n' '\v' | sed 's/\v/\n*** /g')
+    build_dirmngr=no
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 ***
-*** Building without NTBTLS and GNUTLS - no TLS access to keyservers.
+*** Neither NTBTLS nor GNUTLS available - not building dirmngr.
 ***
 *** $tmp" >&5
 $as_echo "$as_me: WARNING:
 ***
-*** Building without NTBTLS and GNUTLS - no TLS access to keyservers.
+*** Neither NTBTLS nor GNUTLS available - not building dirmngr.
 ***
 *** $tmp" >&2;}
   fi
@@ -10633,6 +10851,7 @@ $as_echo_n "checking whether LDAP via \"$MY_LDAPLIBS\" is present and sane... "
 #include <winsock2.h>
 #include <winldap.h>
 #else
+#define LDAP_DEPRECATED 1
 #include <ldap.h>
 #endif
 
@@ -10660,6 +10879,7 @@ $as_echo_n "checking whether I can make LDAP be sane with lber.h... " >&6; }
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <lber.h>
+#define LDAP_DEPRECATED 1
 #include <ldap.h>
 int
 main ()
@@ -10840,6 +11060,7 @@ $as_echo "#define USE_LDAP 1" >>confdefs.h
 fi
 
 
+
 #
 # Check for sendmail
 #
@@ -10915,9 +11136,6 @@ _ACEOF
 # Construct a printable name of the OS
 #
 case "${host}" in
-    *-mingw32ce*)
-        PRINTABLE_OS_NAME="W32CE"
-        ;;
     *-mingw32*)
         PRINTABLE_OS_NAME="MingW32"
         ;;
@@ -12271,9 +12489,9 @@ $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
 $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
 
   fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5
-$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; }
-if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then :
+                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5
+$as_echo_n "checking for CFLocaleCopyPreferredLanguages... " >&6; }
+if ${gt_cv_func_CFLocaleCopyPreferredLanguages+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   gt_save_LIBS="$LIBS"
@@ -12284,29 +12502,30 @@ else
 int
 main ()
 {
-CFLocaleCopyCurrent();
+CFLocaleCopyPreferredLanguages();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_func_CFLocaleCopyCurrent=yes
+  gt_cv_func_CFLocaleCopyPreferredLanguages=yes
 else
-  gt_cv_func_CFLocaleCopyCurrent=no
+  gt_cv_func_CFLocaleCopyPreferredLanguages=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
      LIBS="$gt_save_LIBS"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5
-$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; }
-  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5
+$as_echo "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; }
+  if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
 
-$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
+$as_echo "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h
 
   fi
   INTL_MACOSX_LIBS=
-  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
     INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
   fi
 
@@ -12354,15 +12573,24 @@ if eval \${$gt_func_gnugettext_libc+:} false; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <libintl.h>
-$gt_revision_test_code
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern int *_nl_domain_bindings;
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
 int
 main ()
 {
+
 bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
   ;
   return 0;
 }
@@ -13098,19 +13326,28 @@ else
             LIBS="$LIBS $LIBINTL"
                         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <libintl.h>
-$gt_revision_test_code
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
 const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
 int
 main ()
 {
+
 bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
   ;
   return 0;
 }
@@ -13126,27 +13363,36 @@ rm -f core conftest.err conftest.$ac_objext \
               LIBS="$LIBS $LIBICONV"
               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <libintl.h>
-$gt_revision_test_code
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
 const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
 int
 main ()
 {
+
 bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   LIBINTL="$LIBINTL $LIBICONV"
-                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
-                eval "$gt_func_gnugettext_libintl=yes"
+                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                 eval "$gt_func_gnugettext_libintl=yes"
 
 fi
 rm -f core conftest.err conftest.$ac_objext \
 #
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for header files" >&5
 $as_echo "$as_me: checking for header files" >&6;}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+for ac_header in unistd.h langinfo.h termio.h locale.h \
+                  pwd.h inttypes.h signal.h sys/select.h sys/time.h \
+                  stdint.h signal.h termios.h \
+                  ucred.h sys/ucred.h sys/sysmacros.h sys/mkdev.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+#
+# Checks for typedefs, structures, and compiler characteristics.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for system characteristics" >&5
+$as_echo "$as_me: checking for system characteristics" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if ${ac_cv_c_const+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
 
 int
 main ()
 {
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-for ac_header in string.h unistd.h langinfo.h termio.h locale.h getopt.h \
-                  pty.h utmp.h pwd.h inttypes.h signal.h sys/select.h     \
-                  stdint.h signal.h util.h libutil.h termios.h \
-                  ucred.h sys/ucred.h sys/sysmacros.h sys/mkdev.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
-$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if ${ac_cv_header_time+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_time=yes
-else
-  ac_cv_header_time=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
-$as_echo "$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
-
-$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
-
-fi
-
-
-
-#
-# Checks for typedefs, structures, and compiler characteristics.
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for system characteristics" >&5
-$as_echo "$as_me: checking for system characteristics" >&6;}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this sort of thing.  */
-  typedef int charset[2];
-  const charset cs = { 0, 0 };
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *pcpcc;
-  char **ppc;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  pcpcc = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++pcpcc;
-  ppc = (char**) pcpcc;
-  pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this sort of thing.  */
-    char tx;
-    char *t = &tx;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this sort of thing.  */
+  typedef int charset[2];
+  const charset cs = { 0, 0 };
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *pcpcc;
+  char **ppc;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero = {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g = "string";
+  pcpcc = &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
+    char const *s = 0 ? (char *) 0 : (char const *) 0;
 
     *t++ = 0;
     if (s) return 0;
@@ -13728,38 +13826,16 @@ _ACEOF
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
-$as_echo_n "checking return type of signal handlers... " >&6; }
-if ${ac_cv_type_signal+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <signal.h>
-
-int
-main ()
-{
-return *(signal (0, 0)) (0) == 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_type_signal=int
-else
-  ac_cv_type_signal=void
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
-$as_echo "$ac_cv_type_signal" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define RETSIGTYPE $ac_cv_type_signal
+for ac_func in sigdescr_np
+do :
+  ac_fn_c_check_func "$LINENO" "sigdescr_np" "ac_cv_func_sigdescr_np"
+if test "x$ac_cv_func_sigdescr_np" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGDESCR_NP 1
 _ACEOF
 
+fi
+done
 
 ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
 /* NetBSD declares sys_siglist in unistd.h.  */
@@ -13800,58 +13876,57 @@ done
 
 
 
-
-  if test $ac_cv_header_sys_socket_h = yes; then
-    SYS_SOCKET_H=''
-  else
-                    for ac_header in winsock2.h ws2tcpip.h
+   if test $ac_cv_header_sys_socket_h = no; then
+                         for ac_header in ws2tcpip.h
 do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
+if test "x$ac_cv_header_ws2tcpip_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_WS2TCPIP_H 1
 _ACEOF
 
 fi
 
 done
 
-    SYS_SOCKET_H='sys/socket.h'
-  fi
+   fi
 
+   ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
+/* <sys/types.h> is not needed according to POSIX, but the
+   <sys/socket.h> in i386-unknown-freebsd4.10 and
+   powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+#endif
 
-   ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include <sys/types.h>
-      #if HAVE_SYS_SOCKET_H
-      # include <sys/socket.h>
-      #elif HAVE_WS2TCPIP_H
-      # include <ws2tcpip.h>
-      #endif
 "
 if test "x$ac_cv_type_socklen_t" = xyes; then :
 
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
 $as_echo_n "checking for socklen_t equivalent... " >&6; }
-      if ${gl_cv_gl_cv_socklen_t_equiv+:} false; then :
+if ${gl_cv_socklen_t_equiv+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   # Systems have either "struct sockaddr *" or
-        # "void *" as the second argument to getpeername
-        gl_cv_socklen_t_equiv=
-        for arg2 in "struct sockaddr" void; do
-          for t in int size_t "unsigned int" "long int" "unsigned long int"; do
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+         # "void *" as the second argument to getpeername
+         gl_cv_socklen_t_equiv=
+         for arg2 in "struct sockaddr" void; do
+           for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
-               #include <sys/socket.h>
+                   #include <sys/socket.h>
 
-               int getpeername (int, $arg2 *, $t *);
+                   int getpeername (int, $arg2 *, $t *);
 int
 main ()
 {
 $t len;
-               getpeername (0, 0, &len);
+                  getpeername (0, 0, &len);
   ;
   return 0;
 }
@@ -13860,17 +13935,16 @@ if ac_fn_c_try_compile "$LINENO"; then :
   gl_cv_socklen_t_equiv="$t"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            test "$gl_cv_socklen_t_equiv" != "" && break
-          done
-          test "$gl_cv_socklen_t_equiv" != "" && break
-        done
+             test "$gl_cv_socklen_t_equiv" != "" && break
+           done
+           test "$gl_cv_socklen_t_equiv" != "" && break
+         done
+         if test "$gl_cv_socklen_t_equiv" = ""; then
+           as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
+         fi
 
 fi
-
-      if test "$gl_cv_socklen_t_equiv" = ""; then
-       as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
-      fi
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
 $as_echo "$gl_cv_socklen_t_equiv" >&6; }
 
 cat >>confdefs.h <<_ACEOF
@@ -14052,191 +14126,51 @@ $as_echo "#define BIG_ENDIAN_HOST 1" >>confdefs.h
 fi
 
 # fixme: we should get rid of the byte type
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for byte typedef" >&5
-$as_echo_n "checking for byte typedef... " >&6; }
-    if ${gnupg_cv_typedef_byte+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _GNU_SOURCE 1
-    #include <stdlib.h>
-    #include <sys/types.h>
-int
-main ()
-{
+ac_fn_c_check_type "$LINENO" "byte" "ac_cv_type_byte" "$ac_includes_default"
+if test "x$ac_cv_type_byte" = xyes; then :
 
-    #undef byte
-    int a = sizeof(byte);
-
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_BYTE 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gnupg_cv_typedef_byte=yes
-else
-  gnupg_cv_typedef_byte=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_typedef_byte" >&5
-$as_echo "$gnupg_cv_typedef_byte" >&6; }
-    if test "$gnupg_cv_typedef_byte" = yes; then
 
-$as_echo "#define HAVE_BYTE_TYPEDEF 1" >>confdefs.h
+fi
+ac_fn_c_check_type "$LINENO" "ushort" "ac_cv_type_ushort" "$ac_includes_default"
+if test "x$ac_cv_type_ushort" = xyes; then :
 
-    fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_USHORT 1
+_ACEOF
 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ushort typedef" >&5
-$as_echo_n "checking for ushort typedef... " >&6; }
-    if ${gnupg_cv_typedef_ushort+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _GNU_SOURCE 1
-    #include <stdlib.h>
-    #include <sys/types.h>
-int
-main ()
-{
 
-    #undef ushort
-    int a = sizeof(ushort);
+fi
+ac_fn_c_check_type "$LINENO" "ulong" "ac_cv_type_ulong" "$ac_includes_default"
+if test "x$ac_cv_type_ulong" = xyes; then :
 
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ULONG 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gnupg_cv_typedef_ushort=yes
-else
-  gnupg_cv_typedef_ushort=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
 fi
+ac_fn_c_check_type "$LINENO" "u16" "ac_cv_type_u16" "$ac_includes_default"
+if test "x$ac_cv_type_u16" = xyes; then :
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_typedef_ushort" >&5
-$as_echo "$gnupg_cv_typedef_ushort" >&6; }
-    if test "$gnupg_cv_typedef_ushort" = yes; then
+cat >>confdefs.h <<_ACEOF
+#define HAVE_U16 1
+_ACEOF
 
-$as_echo "#define HAVE_USHORT_TYPEDEF 1" >>confdefs.h
 
-    fi
+fi
+ac_fn_c_check_type "$LINENO" "u32" "ac_cv_type_u32" "$ac_includes_default"
+if test "x$ac_cv_type_u32" = xyes; then :
 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ulong typedef" >&5
-$as_echo_n "checking for ulong typedef... " >&6; }
-    if ${gnupg_cv_typedef_ulong+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _GNU_SOURCE 1
-    #include <stdlib.h>
-    #include <sys/types.h>
-int
-main ()
-{
+cat >>confdefs.h <<_ACEOF
+#define HAVE_U32 1
+_ACEOF
 
-    #undef ulong
-    int a = sizeof(ulong);
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gnupg_cv_typedef_ulong=yes
-else
-  gnupg_cv_typedef_ulong=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_typedef_ulong" >&5
-$as_echo "$gnupg_cv_typedef_ulong" >&6; }
-    if test "$gnupg_cv_typedef_ulong" = yes; then
-
-$as_echo "#define HAVE_ULONG_TYPEDEF 1" >>confdefs.h
-
-    fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u16 typedef" >&5
-$as_echo_n "checking for u16 typedef... " >&6; }
-    if ${gnupg_cv_typedef_u16+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _GNU_SOURCE 1
-    #include <stdlib.h>
-    #include <sys/types.h>
-int
-main ()
-{
-
-    #undef u16
-    int a = sizeof(u16);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gnupg_cv_typedef_u16=yes
-else
-  gnupg_cv_typedef_u16=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_typedef_u16" >&5
-$as_echo "$gnupg_cv_typedef_u16" >&6; }
-    if test "$gnupg_cv_typedef_u16" = yes; then
-
-$as_echo "#define HAVE_U16_TYPEDEF 1" >>confdefs.h
-
-    fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for u32 typedef" >&5
-$as_echo_n "checking for u32 typedef... " >&6; }
-    if ${gnupg_cv_typedef_u32+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _GNU_SOURCE 1
-    #include <stdlib.h>
-    #include <sys/types.h>
-int
-main ()
-{
-
-    #undef u32
-    int a = sizeof(u32);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gnupg_cv_typedef_u32=yes
-else
-  gnupg_cv_typedef_u32=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_typedef_u32" >&5
-$as_echo "$gnupg_cv_typedef_u32" >&6; }
-    if test "$gnupg_cv_typedef_u32" = yes; then
-
-$as_echo "#define HAVE_U32_TYPEDEF 1" >>confdefs.h
-
-    fi
-
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
@@ -14370,40 +14304,38 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
-$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if ${ac_cv_header_time+:} false; then :
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
+if ${ac_cv_sizeof_size_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
 
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_time=yes
 else
-  ac_cv_header_time=no
+  if test "$ac_cv_type_size_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (size_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_size_t=0
+   fi
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
-$as_echo "$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
 
-$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
 
-fi
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+_ACEOF
+
 
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
@@ -14416,15 +14348,10 @@ if ${ac_cv_sizeof_time_t+:} false; then :
 else
   if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t"        "
 #include <stdio.h>
-#if TIME_WITH_SYS_TIME
+#ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
-# include <time.h>
 #else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
+# include <time.h>
 #endif
 
 "; then :
@@ -14456,18 +14383,13 @@ $as_echo_n "checking whether time_t is unsigned... " >&6; }
 if ${gnupg_cv_time_t_unsigned+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
-#if TIME_WITH_SYS_TIME
+#if HAVE_SYS_TIME_H
 # include <sys/time.h>
-# include <time.h>
 #else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
+# include <time.h>
 #endif
 
 int
@@ -15029,60 +14951,6 @@ done
 #
 # W32 specific test
 #
-for ac_header in sys/stat.h unistd.h direct.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if mkdir takes one argument" >&5
-$as_echo_n "checking if mkdir takes one argument... " >&6; }
-if ${gnupg_cv_mkdir_takes_one_arg+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <sys/types.h>
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#ifdef HAVE_DIRECT_H
-# include <direct.h>
-#endif
-int
-main ()
-{
-mkdir ("foo", 0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gnupg_cv_mkdir_takes_one_arg=no
-else
-  gnupg_cv_mkdir_takes_one_arg=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_mkdir_takes_one_arg" >&5
-$as_echo "$gnupg_cv_mkdir_takes_one_arg" >&6; }
-if test $gnupg_cv_mkdir_takes_one_arg = yes ; then
-
-$as_echo "#define MKDIR_TAKES_ONE_ARG 1" >>confdefs.h
-
-fi
-
 
 
 #
@@ -15304,93 +15172,634 @@ rl_completion_matches(NULL,NULL);
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  _found_readline=yes
+  _found_readline=yes
+else
+  _found_readline=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_found_readline" >&5
+$as_echo "$_found_readline" >&6; }
+
+        LIBS=$_readline_save_libs
+
+        if test $_found_readline = yes ; then
+
+$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
+
+           LIBREADLINE=$_combo
+
+           gnupg_cv_have_readline=yes
+           break
+        fi
+     done
+
+     unset _termcap
+     unset _readline_save_libs
+     unset _combo
+     unset _found_readline
+  fi
+
+
+
+if test "$development_version" = yes; then
+
+$as_echo "#define IS_DEVELOPMENT_VERSION 1" >>confdefs.h
+
+fi
+
+if test "$USE_MAINTAINER_MODE" = "yes"; then
+
+$as_echo "#define MAINTAINER_MODE 1" >>confdefs.h
+
+fi
+
+ if test x$cross_compiling = xyes; then
+  CROSS_COMPILING_TRUE=
+  CROSS_COMPILING_FALSE='#'
+else
+  CROSS_COMPILING_TRUE='#'
+  CROSS_COMPILING_FALSE=
+fi
+
+
+
+    if ${MAKE-make} --version 2>/dev/null | grep '^GNU ' >/dev/null 2>&1; then
+        :
+    else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+***
+*** It seems that you are not using GNU make.  Some make tools have serious
+*** flaws and you may not be able to build this software at all. Before you
+*** complain, please try GNU make:  GNU make is easy to build and available
+*** at all GNU archives.  It is always available from ftp.gnu.org:/gnu/make.
+***" >&5
+$as_echo "$as_me: WARNING:
+***
+*** It seems that you are not using GNU make.  Some make tools have serious
+*** flaws and you may not be able to build this software at all. Before you
+*** complain, please try GNU make:  GNU make is easy to build and available
+*** at all GNU archives.  It is always available from ftp.gnu.org:/gnu/make.
+***" >&2;}
+    fi
+
+
+# Add some extra libs here so that previous tests don't fail for
+# mysterious reasons - the final link step should bail out.
+# W32SOCKLIBS is also defined so that if can be used for tools not
+# requiring any network stuff but linking to code in libcommon which
+# tracks in winsock stuff (e.g. init_common_subsystems).
+if test "$have_w32_system" = yes; then
+   W32SOCKLIBS="-lws2_32"
+   NETLIBS="${NETLIBS} ${W32SOCKLIBS}"
+fi
+
+
+
+
+#
+# TPM libtss library .. don't compile TPM support if we don't have it
+#
+
+# Check whether --with-tss was given.
+if test "${with_tss+set}" = set; then :
+  withval=$with_tss; with_tss=$withval
+else
+  with_tss=autodetect
+fi
+
+LIBTSS_LIBS=
+LIBTSS_CFLAGS=
+if test "$build_tpm2d" = "yes"; then
+  _save_libs="$LIBS"
+  _save_cflags="$CFLAGS"
+  LIBS=""
+  if test "$with_tss" = autodetect; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing TSS_Create" >&5
+$as_echo_n "checking for library containing TSS_Create... " >&6; }
+if ${ac_cv_search_TSS_Create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$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 TSS_Create ();
+int
+main ()
+{
+return TSS_Create ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' tss ibmtss; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_TSS_Create=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_TSS_Create+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_TSS_Create+:} false; then :
+
+else
+  ac_cv_search_TSS_Create=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_TSS_Create" >&5
+$as_echo "$ac_cv_search_TSS_Create" >&6; }
+ac_res=$ac_cv_search_TSS_Create
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  have_libtss=IBM
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing Esys_Initialize" >&5
+$as_echo_n "checking for library containing Esys_Initialize... " >&6; }
+if ${ac_cv_search_Esys_Initialize+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$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 Esys_Initialize ();
+int
+main ()
+{
+return Esys_Initialize ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' tss2-esys; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_Esys_Initialize=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_Esys_Initialize+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_Esys_Initialize+:} false; then :
+
+else
+  ac_cv_search_Esys_Initialize=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_Esys_Initialize" >&5
+$as_echo "$ac_cv_search_Esys_Initialize" >&6; }
+ac_res=$ac_cv_search_Esys_Initialize
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  have_libtss=Intel
+else
+  have_libtss=no
+fi
+
+fi
+
+  elif test "$with_tss" = ibm; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing TSS_Create" >&5
+$as_echo_n "checking for library containing TSS_Create... " >&6; }
+if ${ac_cv_search_TSS_Create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$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 TSS_Create ();
+int
+main ()
+{
+return TSS_Create ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' tss ibmtss; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_TSS_Create=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_TSS_Create+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_TSS_Create+:} false; then :
+
+else
+  ac_cv_search_TSS_Create=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_TSS_Create" >&5
+$as_echo "$ac_cv_search_TSS_Create" >&6; }
+ac_res=$ac_cv_search_TSS_Create
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  have_libtss=IBM
+else
+  as_fn_error $? "IBM TPM Software Stack requested but not found" "$LINENO" 5
+fi
+
+  elif test "$with_tss" = intel; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing Esys_Initialize" >&5
+$as_echo_n "checking for library containing Esys_Initialize... " >&6; }
+if ${ac_cv_search_Esys_Initialize+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$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 Esys_Initialize ();
+int
+main ()
+{
+return Esys_Initialize ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' tss2-esys; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_Esys_Initialize=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_Esys_Initialize+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_Esys_Initialize+:} false; then :
+
+else
+  ac_cv_search_Esys_Initialize=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_Esys_Initialize" >&5
+$as_echo "$ac_cv_search_Esys_Initialize" >&6; }
+ac_res=$ac_cv_search_Esys_Initialize
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  have_libtss=Intel
+else
+  as_fn_error $? "Intel TPM Software Stack requested but not found" "$LINENO" 5
+fi
+
+  else
+    as_fn_error $? "Invalid TPM Software Stack requested: $with_tss" "$LINENO" 5
+  fi
+
+  if test "$have_libtss" = IBM; then
+    LIBTSS_CFLAGS="-DTPM_POSIX"
+    CFLAGS="$CFLAGS ${LIBTSS_CFLAGS}"
+    ac_fn_c_check_header_mongrel "$LINENO" "tss2/tss.h" "ac_cv_header_tss2_tss_h" "$ac_includes_default"
+if test "x$ac_cv_header_tss2_tss_h" = xyes; then :
+
+$as_echo "#define TSS_INCLUDE tss2" >>confdefs.h
+
+else
+
+      ac_fn_c_check_header_mongrel "$LINENO" "ibmtss/tss.h" "ac_cv_header_ibmtss_tss_h" "$ac_includes_default"
+if test "x$ac_cv_header_ibmtss_tss_h" = xyes; then :
+
+$as_echo "#define TSS_INCLUDE ibmtss" >>confdefs.h
+
+else
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No TSS2 include directory found, disabling TPM support" >&5
+$as_echo "$as_me: WARNING: No TSS2 include directory found, disabling TPM support" >&2;}
+        have_libtss=no
+
+fi
+
+
+
+fi
+
+
+    LIBTSS_LIBS=$LIBS
+
+  elif test "$have_libtss" = Intel; then
+    ##
+    # Intel TSS has an API issue: Esys_TR_GetTpmHandle wasn't introduced
+    # until version 2.4.0.
+    #
+    # Note: the missing API is fairly serious and is also easily backportable
+    # so keep the check below as is intead of going by library version number.
+    ##
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Esys_TR_GetTpmHandle in -ltss2-esys" >&5
+$as_echo_n "checking for Esys_TR_GetTpmHandle in -ltss2-esys... " >&6; }
+if ${ac_cv_lib_tss2_esys_Esys_TR_GetTpmHandle+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltss2-esys  $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 Esys_TR_GetTpmHandle ();
+int
+main ()
+{
+return Esys_TR_GetTpmHandle ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_tss2_esys_Esys_TR_GetTpmHandle=yes
 else
-  _found_readline=no
+  ac_cv_lib_tss2_esys_Esys_TR_GetTpmHandle=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tss2_esys_Esys_TR_GetTpmHandle" >&5
+$as_echo "$ac_cv_lib_tss2_esys_Esys_TR_GetTpmHandle" >&6; }
+if test "x$ac_cv_lib_tss2_esys_Esys_TR_GetTpmHandle" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBTSS2_ESYS 1
+_ACEOF
 
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_found_readline" >&5
-$as_echo "$_found_readline" >&6; }
+  LIBS="-ltss2-esys $LIBS"
 
-        LIBS=$_readline_save_libs
+else
 
-        if test $_found_readline = yes ; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Need Esys_TR_GetTpmHandle API (usually requires Intel TSS 2.4.0 or later, disabling TPM support)" >&5
+$as_echo "$as_me: WARNING: Need Esys_TR_GetTpmHandle API (usually requires Intel TSS 2.4.0 or later, disabling TPM support)" >&2;}
+       have_libtss=no
 
-$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
+fi
 
-           LIBREADLINE=$_combo
+    LIBTSS_LIBS="$LIBS -ltss2-mu -ltss2-rc -ltss2-tctildr"
 
-           gnupg_cv_have_readline=yes
-           break
-        fi
-     done
+$as_echo "#define HAVE_INTEL_TSS 1" >>confdefs.h
 
-     unset _termcap
-     unset _readline_save_libs
-     unset _combo
-     unset _found_readline
   fi
+  LIBS="$_save_libs"
+  CFLAGS="$_save_cflags"
+  if test "$have_libtss" != no; then
 
+$as_echo "#define HAVE_LIBTSS 1" >>confdefs.h
+
+    # look for a TPM emulator for testing
+    # Extract the first word of "tpm_server", so it can be a program name with args.
+set dummy tpm_server; 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_TPMSERVER+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $TPMSERVER in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_TPMSERVER="$TPMSERVER" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss"
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_TPMSERVER="$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
+TPMSERVER=$ac_cv_path_TPMSERVER
+if test -n "$TPMSERVER"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TPMSERVER" >&5
+$as_echo "$TPMSERVER" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-if test "$development_version" = yes; then
 
-$as_echo "#define IS_DEVELOPMENT_VERSION 1" >>confdefs.h
+    # Extract the first word of "swtpm", so it can be a program name with args.
+set dummy swtpm; 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_SWTPM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $SWTPM in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWTPM="$SWTPM" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss"
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_SWTPM="$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
+SWTPM=$ac_cv_path_SWTPM
+if test -n "$SWTPM"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWTPM" >&5
+$as_echo "$SWTPM" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-if test "$USE_MAINTAINER_MODE" = "yes"; then
 
-$as_echo "#define MAINTAINER_MODE 1" >>confdefs.h
+    # Extract the first word of "swtpm_ioctl", so it can be a program name with args.
+set dummy swtpm_ioctl; 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_SWTPM_IOCTL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $SWTPM_IOCTL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SWTPM_IOCTL="$SWTPM_IOCTL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss"
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_SWTPM_IOCTL="$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
-
- if test x$cross_compiling = xyes; then
-  CROSS_COMPILING_TRUE=
-  CROSS_COMPILING_FALSE='#'
+SWTPM_IOCTL=$ac_cv_path_SWTPM_IOCTL
+if test -n "$SWTPM_IOCTL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWTPM_IOCTL" >&5
+$as_echo "$SWTPM_IOCTL" >&6; }
 else
-  CROSS_COMPILING_TRUE='#'
-  CROSS_COMPILING_FALSE=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
+    # Extract the first word of "tssstartup", so it can be a program name with args.
+set dummy tssstartup; 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_TSSSTARTUP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $TSSSTARTUP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_TSSSTARTUP="$TSSSTARTUP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss"
+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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_TSSSTARTUP="$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
+TSSSTARTUP=$ac_cv_path_TSSSTARTUP
+if test -n "$TSSSTARTUP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TSSSTARTUP" >&5
+$as_echo "$TSSSTARTUP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
 
-    if ${MAKE-make} --version 2>/dev/null | grep '^GNU ' >/dev/null 2>&1; then
-        :
-    else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
-***
-*** It seems that you are not using GNU make.  Some make tools have serious
-*** flaws and you may not be able to build this software at all. Before you
-*** complain, please try GNU make:  GNU make is easy to build and available
-*** at all GNU archives.  It is always available from ftp.gnu.org:/gnu/make.
-***" >&5
-$as_echo "$as_me: WARNING:
-***
-*** It seems that you are not using GNU make.  Some make tools have serious
-*** flaws and you may not be able to build this software at all. Before you
-*** complain, please try GNU make:  GNU make is easy to build and available
-*** at all GNU archives.  It is always available from ftp.gnu.org:/gnu/make.
-***" >&2;}
-    fi
+  fi
+fi
+if test "$have_libtss" = no; then
+  build_tpm2d=no
+fi
 
 
-# Add some extra libs here so that previous tests don't fail for
-# mysterious reasons - the final link step should bail out.
-# W32SOCKLIBS is also defined so that if can be used for tools not
-# requiring any network stuff but linking to code in libcommon which
-# tracks in winsock stuff (e.g. init_common_subsystems).
-if test "$have_w32_system" = yes; then
-   if test "$have_w32ce_system" = yes; then
-     W32SOCKLIBS="-lws2"
-   else
-     W32SOCKLIBS="-lws2_32"
-   fi
-   NETLIBS="${NETLIBS} ${W32SOCKLIBS}"
+ if test "$have_libtss" != no; then
+  HAVE_LIBTSS_TRUE=
+  HAVE_LIBTSS_FALSE='#'
+else
+  HAVE_LIBTSS_TRUE='#'
+  HAVE_LIBTSS_FALSE=
 fi
 
+ if test -n "$TPMSERVER" || test -n "$SWTPM" && test -n "$TSSSTARTUP"; then
+  TEST_LIBTSS_TRUE=
+  TEST_LIBTSS_FALSE='#'
+else
+  TEST_LIBTSS_TRUE='#'
+  TEST_LIBTSS_FALSE=
+fi
 
 
 
@@ -15466,7 +15875,6 @@ $as_echo "$_gcc_wopt" >&6; }
         if test x"$_gcc_wopt" = xyes ; then
           mycflags="$mycflags -W -Wno-sign-compare -Wno-format-zero-length"
           mycflags="$mycflags -Wno-missing-field-initializers"
-          mycflags="$mycflags -Wno-format-zero-length"
         fi
 
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wdeclaration-after-statement" >&5
 
 
 #
+# log_debug has certain requirements which might hamper portability.
+# Thus we use an option to enable it.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable log_clock" >&5
+$as_echo_n "checking whether to enable log_clock... " >&6; }
+# Check whether --enable-log_clock was given.
+if test "${enable_log_clock+set}" = set; then :
+  enableval=$enable_log_clock; enable_log_clock=$enableval
+else
+  enable_log_clock=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_log_clock" >&5
+$as_echo "$enable_log_clock" >&6; }
+if test "$enable_log_clock" = yes ; then
+
+$as_echo "#define ENABLE_LOG_CLOCK 1" >>confdefs.h
+
+fi
+
 # Add -Werror to CFLAGS.  This hack can be used to avoid problems with
 # misbehaving autoconf tests in case the user supplied -Werror.
 #
@@ -15782,6 +16210,22 @@ else
   BUILD_DIRMNGR_FALSE=
 fi
 
+ if test "$build_keyboxd" = "yes"; then
+  BUILD_KEYBOXD_TRUE=
+  BUILD_KEYBOXD_FALSE='#'
+else
+  BUILD_KEYBOXD_TRUE='#'
+  BUILD_KEYBOXD_FALSE=
+fi
+
+ if test "$build_tpm2d" = "yes"; then
+  BUILD_TPM2D_TRUE=
+  BUILD_TPM2D_FALSE='#'
+else
+  BUILD_TPM2D_TRUE='#'
+  BUILD_TPM2D_FALSE=
+fi
+
  if test "$build_doc" = "yes"; then
   BUILD_DOC_TRUE=
   BUILD_DOC_FALSE='#'
@@ -15868,6 +16312,16 @@ if test "$build_dirmngr" = yes ; then
 $as_echo "#define BUILD_WITH_DIRMNGR 1" >>confdefs.h
 
 fi
+if test "$build_keyboxd" = yes ; then
+
+$as_echo "#define BUILD_WITH_KEYBOXD 1" >>confdefs.h
+
+fi
+if test "$build_tpm2d" = yes ; then
+
+$as_echo "#define BUILD_WITH_TPM2D 1" >>confdefs.h
+
+fi
 if test "$build_g13" = yes ; then
 
 $as_echo "#define BUILD_WITH_G13 1" >>confdefs.h
@@ -15919,6 +16373,17 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
+#define TPM2DAEMON_NAME "tpm2daemon"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define TPM2DAEMON_DISP_NAME "TPM2 Daemon"
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
 #define SCDAEMON_NAME "scdaemon"
 _ACEOF
 
@@ -15941,6 +16406,17 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
+#define KEYBOXD_NAME "keyboxd"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define KEYBOXD_DISP_NAME "Keyboxd"
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
 #define G13_NAME "g13"
 _ACEOF
 
@@ -15999,6 +16475,16 @@ _ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
+#define KEYBOXD_SOCK_NAME "S.keyboxd"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define TPM2DAEMON_SOCK_NAME "S.tpm2daemon"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
 #define DIRMNGR_SOCK_NAME "S.dirmngr"
 _ACEOF
 
@@ -16026,7 +16512,7 @@ fi
 #
 # Provide information about the build.
 #
-BUILD_REVISION="695a879af"
+BUILD_REVISION="d073f26d8"
 
 
 cat >>confdefs.h <<_ACEOF
@@ -16035,7 +16521,7 @@ _ACEOF
 
 
 BUILD_VERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'`
-BUILD_VERSION="${BUILD_VERSION}26970"
+BUILD_VERSION="${BUILD_VERSION}53363"
 BUILD_FILEVERSION=`echo "${BUILD_VERSION}" | tr . ,`
 
 
@@ -16073,15 +16559,15 @@ if test "$have_gpg_error" = "no"; then
 ***
 *** You need libgpg-error to build this program.
 **  This library is for example available at
-***   https://gnupg.org/ftp/gcrypt/libgpg-error
-*** (at least version $NEED_GPG_ERROR_VERSION is required.)
+***   https://gnupg.org/ftp/gcrypt/gpgrt
+*** (at least version $NEED_GPGRT_VERSION is required.)
 ***" >&5
 $as_echo "$as_me:
 ***
 *** You need libgpg-error to build this program.
 **  This library is for example available at
-***   https://gnupg.org/ftp/gcrypt/libgpg-error
-*** (at least version $NEED_GPG_ERROR_VERSION is required.)
+***   https://gnupg.org/ftp/gcrypt/gpgrt
+*** (at least version $NEED_GPGRT_VERSION is required.)
 ***" >&6;}
 fi
 if test "$have_libgcrypt" = "no"; then
@@ -16135,22 +16621,6 @@ $as_echo "$as_me:
 *** (at least version $NEED_KSBA_VERSION using API $NEED_KSBA_API is required).
 ***" >&6;}
 fi
-if test "$gnupg_have_ldap" = yes; then
-  if test "$have_w32ce_system" = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}:
-*** Note that CeGCC might be broken, a package fixing this is:
-***    http://files.kolab.org/local/windows-ce/
-***                           source/wldap32_0.1-mingw32ce.orig.tar.gz
-***                           binary/wldap32-ce-arm-dev_0.1-1_all.deb
-***" >&5
-$as_echo "$as_me:
-*** Note that CeGCC might be broken, a package fixing this is:
-***    http://files.kolab.org/local/windows-ce/
-***                           source/wldap32_0.1-mingw32ce.orig.tar.gz
-***                           binary/wldap32-ce-arm-dev_0.1-1_all.deb
-***" >&6;}
-   fi
-fi
 if test "$have_npth" = "no"; then
     die=yes
     { $as_echo "$as_me:${as_lineno-$LINENO}:
@@ -16217,7 +16687,7 @@ fi
 
 
 
-ac_config_files="$ac_config_files m4/Makefile Makefile po/Makefile.in common/Makefile common/w32info-rc.h regexp/Makefile kbx/Makefile g10/Makefile sm/Makefile agent/Makefile scd/Makefile g13/Makefile dirmngr/Makefile tools/gpg-zip tools/Makefile doc/Makefile tests/Makefile tests/gpgscm/Makefile tests/openpgp/Makefile tests/migrations/Makefile tests/gpgsm/Makefile tests/gpgme/Makefile tests/pkits/Makefile agent/gpg-agent.w32-manifest g10/gpg.w32-manifest g10/gpgv.w32-manifest sm/gpgsm.w32-manifest scd/scdaemon.w32-manifest dirmngr/dirmngr.w32-manifest tools/gpgconf.w32-manifest tools/gpgtar.w32-manifest tools/gpg-connect-agent.w32-manifest tools/gpg-check-pattern.w32-manifest tools/gpg-wks-client.w32-manifest"
+ac_config_files="$ac_config_files m4/Makefile Makefile po/Makefile.in common/Makefile common/w32info-rc.h regexp/Makefile kbx/Makefile g10/Makefile sm/Makefile agent/Makefile scd/Makefile tpm2d/Makefile g13/Makefile dirmngr/Makefile tools/Makefile doc/Makefile tests/Makefile tests/gpgscm/Makefile tests/openpgp/Makefile tests/cms/Makefile tests/migrations/Makefile tests/tpm2dtests/Makefile tests/gpgme/Makefile tests/pkits/Makefile g10/gpg.w32-manifest g10/gpgv.w32-manifest sm/gpgsm.w32-manifest kbx/keyboxd.w32-manifest agent/gpg-agent.w32-manifest scd/scdaemon.w32-manifest dirmngr/dirmngr.w32-manifest dirmngr/dirmngr_ldap.w32-manifest dirmngr/dirmngr-client.w32-manifest tools/gpg-connect-agent.w32-manifest tools/gpgconf.w32-manifest tools/gpgtar.w32-manifest tools/gpg-check-pattern.w32-manifest tools/gpg-wks-client.w32-manifest tools/gpg-card.w32-manifest"
 
 
 
@@ -16366,10 +16836,18 @@ if test -z "${GNUPG_SCDAEMON_PGM_TRUE}" && test -z "${GNUPG_SCDAEMON_PGM_FALSE}"
   as_fn_error $? "conditional \"GNUPG_SCDAEMON_PGM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${GNUPG_TPM2DAEMON_PGM_TRUE}" && test -z "${GNUPG_TPM2DAEMON_PGM_FALSE}"; then
+  as_fn_error $? "conditional \"GNUPG_TPM2DAEMON_PGM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${GNUPG_DIRMNGR_PGM_TRUE}" && test -z "${GNUPG_DIRMNGR_PGM_FALSE}"; then
   as_fn_error $? "conditional \"GNUPG_DIRMNGR_PGM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${GNUPG_KEYBOXD_PGM_TRUE}" && test -z "${GNUPG_KEYBOXD_PGM_FALSE}"; then
+  as_fn_error $? "conditional \"GNUPG_KEYBOXD_PGM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${GNUPG_PROTECT_TOOL_PGM_TRUE}" && test -z "${GNUPG_PROTECT_TOOL_PGM_FALSE}"; then
   as_fn_error $? "conditional \"GNUPG_PROTECT_TOOL_PGM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -16406,10 +16884,6 @@ if test -z "${HAVE_YAT2M_TRUE}" && test -z "${HAVE_YAT2M_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_YAT2M\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${HAVE_USTAR_TRUE}" && test -z "${HAVE_USTAR_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_USTAR\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${HAVE_DOSISH_SYSTEM_TRUE}" && test -z "${HAVE_DOSISH_SYSTEM_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_DOSISH_SYSTEM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -16422,10 +16896,6 @@ if test -z "${HAVE_W32_SYSTEM_TRUE}" && test -z "${HAVE_W32_SYSTEM_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_W32_SYSTEM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${HAVE_W32CE_SYSTEM_TRUE}" && test -z "${HAVE_W32CE_SYSTEM_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_W32CE_SYSTEM\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${HAVE_ANDROID_SYSTEM_TRUE}" && test -z "${HAVE_ANDROID_SYSTEM_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_ANDROID_SYSTEM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -16446,6 +16916,14 @@ if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then
   as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HAVE_LIBTSS_TRUE}" && test -z "${HAVE_LIBTSS_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_LIBTSS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${TEST_LIBTSS_TRUE}" && test -z "${TEST_LIBTSS_FALSE}"; then
+  as_fn_error $? "conditional \"TEST_LIBTSS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${BUILD_GPG_TRUE}" && test -z "${BUILD_GPG_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_GPG\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -16470,6 +16948,14 @@ if test -z "${BUILD_DIRMNGR_TRUE}" && test -z "${BUILD_DIRMNGR_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_DIRMNGR\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${BUILD_KEYBOXD_TRUE}" && test -z "${BUILD_KEYBOXD_FALSE}"; then
+  as_fn_error $? "conditional \"BUILD_KEYBOXD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${BUILD_TPM2D_TRUE}" && test -z "${BUILD_TPM2D_FALSE}"; then
+  as_fn_error $? "conditional \"BUILD_TPM2D\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${BUILD_DOC_TRUE}" && test -z "${BUILD_DOC_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_DOC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -16895,7 +17381,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by gnupg $as_me 2.2.29, which was
+This file was extended by gnupg $as_me 2.4.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16961,7 +17447,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-gnupg config.status 2.2.29
+gnupg config.status 2.4.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
     "sm/Makefile") CONFIG_FILES="$CONFIG_FILES sm/Makefile" ;;
     "agent/Makefile") CONFIG_FILES="$CONFIG_FILES agent/Makefile" ;;
     "scd/Makefile") CONFIG_FILES="$CONFIG_FILES scd/Makefile" ;;
+    "tpm2d/Makefile") CONFIG_FILES="$CONFIG_FILES tpm2d/Makefile" ;;
     "g13/Makefile") CONFIG_FILES="$CONFIG_FILES g13/Makefile" ;;
     "dirmngr/Makefile") CONFIG_FILES="$CONFIG_FILES dirmngr/Makefile" ;;
-    "tools/gpg-zip") CONFIG_FILES="$CONFIG_FILES tools/gpg-zip" ;;
     "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;;
     "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
     "tests/gpgscm/Makefile") CONFIG_FILES="$CONFIG_FILES tests/gpgscm/Makefile" ;;
     "tests/openpgp/Makefile") CONFIG_FILES="$CONFIG_FILES tests/openpgp/Makefile" ;;
+    "tests/cms/Makefile") CONFIG_FILES="$CONFIG_FILES tests/cms/Makefile" ;;
     "tests/migrations/Makefile") CONFIG_FILES="$CONFIG_FILES tests/migrations/Makefile" ;;
-    "tests/gpgsm/Makefile") CONFIG_FILES="$CONFIG_FILES tests/gpgsm/Makefile" ;;
+    "tests/tpm2dtests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tpm2dtests/Makefile" ;;
     "tests/gpgme/Makefile") CONFIG_FILES="$CONFIG_FILES tests/gpgme/Makefile" ;;
     "tests/pkits/Makefile") CONFIG_FILES="$CONFIG_FILES tests/pkits/Makefile" ;;
-    "agent/gpg-agent.w32-manifest") CONFIG_FILES="$CONFIG_FILES agent/gpg-agent.w32-manifest" ;;
     "g10/gpg.w32-manifest") CONFIG_FILES="$CONFIG_FILES g10/gpg.w32-manifest" ;;
     "g10/gpgv.w32-manifest") CONFIG_FILES="$CONFIG_FILES g10/gpgv.w32-manifest" ;;
     "sm/gpgsm.w32-manifest") CONFIG_FILES="$CONFIG_FILES sm/gpgsm.w32-manifest" ;;
+    "kbx/keyboxd.w32-manifest") CONFIG_FILES="$CONFIG_FILES kbx/keyboxd.w32-manifest" ;;
+    "agent/gpg-agent.w32-manifest") CONFIG_FILES="$CONFIG_FILES agent/gpg-agent.w32-manifest" ;;
     "scd/scdaemon.w32-manifest") CONFIG_FILES="$CONFIG_FILES scd/scdaemon.w32-manifest" ;;
     "dirmngr/dirmngr.w32-manifest") CONFIG_FILES="$CONFIG_FILES dirmngr/dirmngr.w32-manifest" ;;
+    "dirmngr/dirmngr_ldap.w32-manifest") CONFIG_FILES="$CONFIG_FILES dirmngr/dirmngr_ldap.w32-manifest" ;;
+    "dirmngr/dirmngr-client.w32-manifest") CONFIG_FILES="$CONFIG_FILES dirmngr/dirmngr-client.w32-manifest" ;;
+    "tools/gpg-connect-agent.w32-manifest") CONFIG_FILES="$CONFIG_FILES tools/gpg-connect-agent.w32-manifest" ;;
     "tools/gpgconf.w32-manifest") CONFIG_FILES="$CONFIG_FILES tools/gpgconf.w32-manifest" ;;
     "tools/gpgtar.w32-manifest") CONFIG_FILES="$CONFIG_FILES tools/gpgtar.w32-manifest" ;;
-    "tools/gpg-connect-agent.w32-manifest") CONFIG_FILES="$CONFIG_FILES tools/gpg-connect-agent.w32-manifest" ;;
     "tools/gpg-check-pattern.w32-manifest") CONFIG_FILES="$CONFIG_FILES tools/gpg-check-pattern.w32-manifest" ;;
     "tools/gpg-wks-client.w32-manifest") CONFIG_FILES="$CONFIG_FILES tools/gpg-wks-client.w32-manifest" ;;
+    "tools/gpg-card.w32-manifest") CONFIG_FILES="$CONFIG_FILES tools/gpg-card.w32-manifest" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
@@ -17977,28 +18468,36 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
 
+show_tss_type=
+if test "$build_tpm2d" = "yes"; then
+  show_tss_type="($have_libtss)"
+fi
 
 echo "
         GnuPG v${VERSION} has been configured as follows:
 
-        Revision:  695a879af  (26970)
+        Revision:  d073f26d8  (53363)
         Platform:  $PRINTABLE_OS_NAME ($host)
 
         OpenPGP:   $build_gpg
         S/MIME:    $build_gpgsm
         Agent:     $build_agent
         Smartcard: $build_scdaemon $build_scdaemon_extra
+        TPM:       $build_tpm2d $show_tss_type
         G13:       $build_g13
         Dirmngr:   $build_dirmngr
+        Keyboxd:   $build_keyboxd
         Gpgtar:    $build_gpgtar
         WKS tools: $build_wks_tools
 
-        Protect tool:      $show_gnupg_protect_tool_pgm
-        LDAP wrapper:      $show_gnupg_dirmngr_ldap_pgm
-        Default agent:     $show_gnupg_agent_pgm
-        Default pinentry:  $show_gnupg_pinentry_pgm
-        Default scdaemon:  $show_gnupg_scdaemon_pgm
-        Default dirmngr:   $show_gnupg_dirmngr_pgm
+        Protect tool:       $show_gnupg_protect_tool_pgm
+        LDAP wrapper:       $show_gnupg_dirmngr_ldap_pgm
+        Default agent:      $show_gnupg_agent_pgm
+        Default pinentry:   $show_gnupg_pinentry_pgm
+        Default scdaemon:   $show_gnupg_scdaemon_pgm
+        Default keyboxd:    $show_gnupg_keyboxd_pgm
+        Default tpm2daemon: $show_gnupg_tpm2daemon_pgm
+        Default dirmngr:    $show_gnupg_dirmngr_pgm
 
         Dirmngr auto start:  $dirmngr_auto_start
         Readline support:    $gnupg_cv_have_readline
@@ -18007,6 +18506,13 @@ echo "
         TOFU support:        $use_tofu
         Tor support:         $show_tor_support
 "
+if test "$have_libtss" != no -a -z "$TPMSERVER" -a -z "$SWTPM"; then
+cat <<G10EOF
+        Warning: TPM support is compiled in but no software TPM
+                 for testing was discovered. TPM tests are disabled
+
+G10EOF
+fi
 if test "x${gpg_config_script_warn}" != x; then
 cat <<G10EOF
         Warning: Mismatches between the target platform and the