Imported Upstream version 2.4.3
[platform/upstream/gpg2.git] / configure
index 829fc79..a4d03d2 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for gnupg 2.0.19.
+# Generated by GNU Autoconf 2.69 for gnupg 2.4.3.
 #
-# Report bugs to <http://bugs.gnupg.org>.
+# Report bugs to <https://bugs.gnupg.org>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -214,21 +238,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-       # neutralization value for shells without unset; and this also
-       # works around shells that cannot unset nonexistent variables.
-       # Preserve -v and -x to the replacement shell.
-       BASH_ENV=/dev/null
-       ENV=/dev/null
-       (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-       export CONFIG_SHELL
-       case $- in # ((((
-         *v*x* | *x*v* ) as_opts=-vx ;;
-         *v* ) as_opts=-v ;;
-         *x* ) as_opts=-x ;;
-         * ) as_opts= ;;
-       esac
-       exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -239,7 +267,7 @@ fi
     $as_echo "$0: be upgraded to zsh 4.3.4 or later."
   else
     $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: http://bugs.gnupg.org about your system, including any
+$0: https://bugs.gnupg.org about your system, including any
 $0: error possibly output before this message. Then install
 $0: a modern shell, or manually run the script under such a
 $0: shell if you do have one."
@@ -331,6 +359,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -452,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -486,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -507,28 +547,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -560,9 +580,9 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='gnupg'
 PACKAGE_TARNAME='gnupg'
-PACKAGE_VERSION='2.0.19'
-PACKAGE_STRING='gnupg 2.0.19'
-PACKAGE_BUGREPORT='http://bugs.gnupg.org'
+PACKAGE_VERSION='2.4.3'
+PACKAGE_STRING='gnupg 2.4.3'
+PACKAGE_BUGREPORT='https://bugs.gnupg.org'
 PACKAGE_URL=''
 
 ac_unique_file="sm/gpgsm.c"
@@ -607,16 +627,34 @@ ac_header_list=
 ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
-RUN_GPG_TESTS_FALSE
-RUN_GPG_TESTS_TRUE
+LIBOBJS
+BUILD_HOSTNAME
+BUILD_TIMESTAMP
+BUILD_FILEVERSION
+BUILD_VERSION
+BUILD_REVISION
+USE_TOFU_FALSE
+USE_TOFU_TRUE
+NO_TRUST_MODELS_FALSE
+NO_TRUST_MODELS_TRUE
+ENABLE_CARD_SUPPORT_FALSE
+ENABLE_CARD_SUPPORT_TRUE
+DISABLE_TESTS_FALSE
+DISABLE_TESTS_TRUE
+BUILD_WKS_TOOLS_FALSE
+BUILD_WKS_TOOLS_TRUE
 BUILD_GPGTAR_FALSE
 BUILD_GPGTAR_TRUE
-BUILD_SYMCRYPTRUN_FALSE
-BUILD_SYMCRYPTRUN_TRUE
 BUILD_DOC_FALSE
 BUILD_DOC_TRUE
-BUILD_TOOLS_FALSE
-BUILD_TOOLS_TRUE
+BUILD_TPM2D_FALSE
+BUILD_TPM2D_TRUE
+BUILD_KEYBOXD_FALSE
+BUILD_KEYBOXD_TRUE
+BUILD_DIRMNGR_FALSE
+BUILD_DIRMNGR_TRUE
+BUILD_G13_FALSE
+BUILD_G13_TRUE
 BUILD_SCDAEMON_FALSE
 BUILD_SCDAEMON_TRUE
 BUILD_AGENT_FALSE
@@ -625,7 +663,19 @@ BUILD_GPGSM_FALSE
 BUILD_GPGSM_TRUE
 BUILD_GPG_FALSE
 BUILD_GPG_TRUE
-GPGKEYS_KDNS
+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
@@ -634,40 +684,6 @@ LIBREADLINE
 ZLIBS
 ENABLE_BZIP2_SUPPORT_FALSE
 ENABLE_BZIP2_SUPPORT_TRUE
-DISABLE_REGEX_FALSE
-DISABLE_REGEX_TRUE
-LIBGNU_LTLIBDEPS
-LIBGNU_LIBDEPS
-UNISTD_H
-STDINT_H
-WINT_T_SUFFIX
-WCHAR_T_SUFFIX
-SIZE_T_SUFFIX
-SIG_ATOMIC_T_SUFFIX
-PTRDIFF_T_SUFFIX
-HAVE_SIGNED_WINT_T
-HAVE_SIGNED_WCHAR_T
-HAVE_SIGNED_SIG_ATOMIC_T
-BITSIZEOF_WINT_T
-BITSIZEOF_WCHAR_T
-BITSIZEOF_SIZE_T
-BITSIZEOF_SIG_ATOMIC_T
-BITSIZEOF_PTRDIFF_T
-HAVE_SYS_BITYPES_H
-HAVE_SYS_INTTYPES_H
-HAVE_STDINT_H
-ABSOLUTE_STDINT_H
-HAVE_SYS_TYPES_H
-HAVE_INTTYPES_H
-HAVE_WCHAR_H
-HAVE_UNSIGNED_LONG_LONG_INT
-HAVE_LONG_LONG_INT
-LIBOBJS
-ALLOCA_H
-ALLOCA
-GL_COND_LIBTOOL_FALSE
-GL_COND_LIBTOOL_TRUE
-SYS_SOCKET_H
 BUILD_INCLUDED_LIBINTL
 USE_INCLUDED_LIBINTL
 POSUB
@@ -687,27 +703,30 @@ GETTEXT_MACRO_VERSION
 USE_NLS
 LTLIBICONV
 LIBICONV
-GPGKEYS_MAILTO
 SENDMAIL
-GPGKEYS_CURL
-FAKE_CURL_FALSE
-FAKE_CURL_TRUE
-LIBCURL
-LIBCURL_CPPFLAGS
-_libcurl_config
+USE_LDAP_FALSE
+USE_LDAP_TRUE
+LBER_LIBS
 LDAP_CPPFLAGS
 LDAPLIBS
 GPGKEYS_LDAP
-USE_DNS_SRV_FALSE
-USE_DNS_SRV_TRUE
 DNSLIBS
-ADNSLIBS
-PTH_LIBS
-PTH_CFLAGS
-PTH_CONFIG
-SHRED
-LIBUTIL_LIBS
+LIBGNUTLS_LIBS
+LIBGNUTLS_CFLAGS
+NTBTLS_LIBS
+NTBTLS_CFLAGS
+NTBTLS_CONFIG
+NPTH_LIBS
+NPTH_CFLAGS
+NPTH_CONFIG
+FUSERMOUNT
+ENCFS
+SQLITE3_FALSE
+SQLITE3_TRUE
+SQLITE3_LIBS
+SQLITE3_CFLAGS
 DL_LIBS
+LIBUSB_CPPFLAGS
 LIBUSB_LIBS
 KSBA_LIBS
 KSBA_CFLAGS
@@ -718,38 +737,56 @@ LIBASSUAN_CONFIG
 LIBGCRYPT_LIBS
 LIBGCRYPT_CFLAGS
 LIBGCRYPT_CONFIG
+GPG_ERROR_MT_LIBS
+GPG_ERROR_MT_CFLAGS
 GPG_ERROR_LIBS
 GPG_ERROR_CFLAGS
+GPGRT_CONFIG
 GPG_ERROR_CONFIG
-GPGKEYS_FINGER
-GPGKEYS_HKP
+HAVE_ANDROID_SYSTEM_FALSE
+HAVE_ANDROID_SYSTEM_TRUE
 HAVE_W32_SYSTEM_FALSE
 HAVE_W32_SYSTEM_TRUE
 USE_SIMPLE_GETTEXT_FALSE
 USE_SIMPLE_GETTEXT_TRUE
 HAVE_DOSISH_SYSTEM_FALSE
 HAVE_DOSISH_SYSTEM_TRUE
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
 CC_FOR_BUILD
-HAVE_USTAR_FALSE
-HAVE_USTAR_TRUE
-TAR
-WORKING_FAQPROG_FALSE
-WORKING_FAQPROG_TRUE
-FAQPROG
+AWK_HEX_NUMBER_OPTION
+HAVE_YAT2M_FALSE
+HAVE_YAT2M_TRUE
+YAT2M
 WINDRES
 PERL
 AR
 RANLIB
 LN_S
+SYSROOT
 MAINT
 MAINTAINER_MODE_FALSE
 MAINTAINER_MODE_TRUE
+USE_LIBDNS_FALSE
+USE_LIBDNS_TRUE
+USE_GPG2_HACK_FALSE
+USE_GPG2_HACK_TRUE
+GNUPG_DIRMNGR_LDAP_PGM_FALSE
+GNUPG_DIRMNGR_LDAP_PGM_TRUE
+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
@@ -766,10 +803,10 @@ CPP
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
+am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
-am__quote
 am__include
 DEPDIR
 OBJEXT
@@ -787,6 +824,10 @@ build_os
 build_vendor
 build_cpu
 build
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
@@ -829,6 +870,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -847,55 +889,83 @@ PACKAGE_VERSION
 PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+enable_silent_rules
 enable_dependency_tracking
-enable_gpg
 enable_gpgsm
-enable_agent
 enable_scdaemon
-enable_tools
+enable_g13
+enable_dirmngr
+enable_keyboxd
+enable_tpm2d
 enable_doc
-enable_symcryptrun
 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
-enable_agent_only
+with_dirmngr_ldap_pgm
+enable_gpg_is_gpg2
 enable_selinux_support
+enable_large_secmem
+with_agent_s2k_calibration
+enable_trust_models
+enable_tofu
+enable_libdns
+enable_gpg_rsa
+enable_gpg_ecdh
+enable_gpg_ecdsa
+enable_gpg_eddsa
+enable_gpg_idea
+enable_gpg_cast5
+enable_gpg_blowfish
+enable_gpg_aes128
+enable_gpg_aes192
+enable_gpg_aes256
+enable_gpg_twofish
+enable_gpg_camellia128
+enable_gpg_camellia192
+enable_gpg_camellia256
+enable_gpg_md5
+enable_gpg_rmd160
+enable_gpg_sha224
+enable_gpg_sha384
+enable_gpg_sha512
+enable_zip
 enable_bzip2
 enable_exec
 enable_photo_viewers
 with_photo_viewer
-enable_keyserver_helpers
-enable_ldap
-enable_hkp
-enable_finger
-enable_generic
-enable_mailto
-enable_keyserver_path
 enable_key_cache
 with_capabilities
+enable_card_support
 enable_ccid_driver
+enable_dirmngr_auto_start
 enable_maintainer_mode
 enable_largefile
-with_tar
-enable_standard_socket
+with_libgpg_error_prefix
 with_gpg_error_prefix
 with_libgcrypt_prefix
 with_libassuan_prefix
+with_libksba_prefix
 with_ksba_prefix
-with_pth_prefix
-with_adns
-enable_dns_srv
-enable_dns_pka
-enable_dns_cert
+enable_sqlite
+with_npth_prefix
+enable_npth_debug
+enable_ntbtls
+with_ntbtls_prefix
+enable_gnutls
+with_default_trust_store_file
+enable_ldap
 with_ldap
-with_libcurl
 with_mailprog
 with_gnu_ld
 enable_rpath
@@ -903,12 +973,18 @@ with_libiconv_prefix
 enable_nls
 with_libintl_prefix
 enable_endian_check
-enable_regex
-with_regex
 with_zlib
 with_bzip2
 with_readline
+with_tss
 enable_optimization
+enable_log_clock
+enable_werror
+enable_all_tests
+enable_tests
+enable_gnupg_builddir_envvar
+enable_run_gnupg_user_socket
+enable_build_timestamp
 '
       ac_precious_vars='build_alias
 host_alias
@@ -919,7 +995,16 @@ LDFLAGS
 LIBS
 CPPFLAGS
 CPP
-CC_FOR_BUILD'
+SYSROOT
+YAT2M
+CC_FOR_BUILD
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+SQLITE3_CFLAGS
+SQLITE3_LIBS
+LIBGNUTLS_CFLAGS
+LIBGNUTLS_LIBS'
 
 
 # Initialize some variables set by options.
@@ -958,6 +1043,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1210,6 +1296,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1347,7 +1442,7 @@ fi
 for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir
+               libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1375,8 +1470,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1462,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.0.19 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]...
 
@@ -1502,6 +1595,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1532,7 +1626,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of gnupg 2.0.19:";;
+     short | recursive ) echo "Configuration of gnupg 2.4.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1540,47 +1634,83 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
-  --disable-gpg           do not build the gpg program
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
   --disable-gpgsm         do not build the gpgsm program
-  --disable-agent         do not build the agent program
   --disable-scdaemon      do not build the scdaemon program
-  --disable-tools         do not build the tools 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
-  --enable-symcryptrun    build the symcryptrun program
-  --enable-gpgtar         build the gpgtar program
-  --enable-agent-only     build only the gpg-agent
+  --disable-gpgtar        do not build the gpgtar program
+  --disable-wks-tools     do not build the wks-tools program
+  --enable-gpg-is-gpg2    Set installed name of gpg to gpg2
   --enable-selinux-support
                           enable SELinux support
+  --enable-large-secmem   allocate extra secure memory
+  --disable-trust-models  disable all trust models except "always"
+  --disable-tofu          disable the TOFU trust model
+  --disable-libdns        do not build with libdns support
+  --disable-gpg-rsa       disable the RSA public key algorithm in gpg
+  --disable-gpg-ecdh      disable the ECDH public key algorithm in gpg
+  --disable-gpg-ecdsa     disable the ECDSA public key algorithm in gpg
+  --disable-gpg-eddsa     disable the EdDSA public key algorithm in gpg
+  --disable-gpg-idea      disable the IDEA cipher algorithm in gpg
+  --disable-gpg-cast5     disable the CAST5 cipher algorithm in gpg
+  --disable-gpg-blowfish  disable the BLOWFISH cipher algorithm in gpg
+  --disable-gpg-aes128    disable the AES128 cipher algorithm in gpg
+  --disable-gpg-aes192    disable the AES192 cipher algorithm in gpg
+  --disable-gpg-aes256    disable the AES256 cipher algorithm in gpg
+  --disable-gpg-twofish   disable the TWOFISH cipher algorithm in gpg
+  --disable-gpg-camellia128
+                          disable the CAMELLIA128 cipher algorithm in gpg
+  --disable-gpg-camellia192
+                          disable the CAMELLIA192 cipher algorithm in gpg
+  --disable-gpg-camellia256
+                          disable the CAMELLIA256 cipher algorithm in gpg
+  --disable-gpg-md5       disable the MD5 hash algorithm in gpg
+  --disable-gpg-rmd160    disable the RIPE-MD160 hash algorithm in gpg
+  --disable-gpg-sha224    disable the SHA-224 hash algorithm in gpg
+  --disable-gpg-sha384    disable the SHA-384 hash algorithm in gpg
+  --disable-gpg-sha512    disable the SHA-512 hash algorithm in gpg
+  --disable-zip           disable the ZIP and ZLIB compression algorithm
   --disable-bzip2         disable the BZIP2 compression algorithm
   --disable-exec          disable all external program execution
   --disable-photo-viewers disable photo ID viewers
-  --disable-keyserver-helpers  disable all external keyserver support
-  --disable-ldap          disable LDAP keyserver interface only
-  --disable-hkp           disable HKP keyserver interface only
-  --disable-finger        disable finger key fetching interface only
-  --disable-generic       disable generic object key fetching interface only
-  --enable-mailto         enable email keyserver interface only
-  --disable-keyserver-path
-                          disable the exec-path option for keyserver helpers
   --enable-key-cache=SIZE Set key cache to SIZE (default 4096)
+  --disable-card-support  disable smartcard support
   --disable-ccid-driver   disable the internal CCID driver
-  --enable-maintainer-mode  enable make rules and dependencies not useful
-                         (and sometimes confusing) to the casual installer
+  --disable-dirmngr-auto-start
+                          disable auto starting of the dirmngr
+  --enable-maintainer-mode
+                          enable make rules and dependencies not useful (and
+                          sometimes confusing) to the casual installer
   --disable-largefile     omit support for large files
-  --enable-standard-socket
-                          use a standard socket for the agent by default
-  --disable-dns-srv       disable the use of DNS SRV in HKP and HTTP
-  --disable-dns-pka       disable the use of PKA records in DNS
-  --disable-dns-cert      disable the use of CERT records in DNS
+  --disable-sqlite        disable the use of SQLITE
+  --enable-npth-debug     build with debug version of npth
+  --disable-ntbtls        disable the use of NTBTLS as TLS library
+  --disable-gnutls        disable GNUTLS as fallback TLS library
+  --disable-ldap          disable LDAP support
   --disable-rpath         do not hardcode runtime library paths
   --disable-nls           do not use Native Language Support
   --disable-endian-check  disable the endian check and trust the OS provided
                           macros
-  --disable-regex         do not handle regular expressions in trust
-                          signatures
   --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
+
+  --enable-run-gnupg-user-socket
+                          try /run/gnupg/user for sockets prior to /run/user
+  --enable-build-timestamp
+                          set an explicit build timestamp for reproducibility.
+                          (default is the current time in ISO-8601 format)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1588,32 +1718,42 @@ 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
+                          calibrate passphrase stretching (s2k) to MSEC
+                          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-gpg-error-prefix=PFX
+  --with-libgpg-error-prefix=PFX
                           prefix where GPG Error is installed (optional)
+
   --with-libgcrypt-prefix=PFX
                           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-pth-prefix=PFX   prefix where GNU Pth is installed (optional)
-  --with-adns=DIR         look for the adns library in DIR
+  --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)
+  --with-default-trust-store-file=FILE
+                          Use FILE as system trust store
   --with-ldap=DIR         look for the LDAP library in DIR
-  --with-libcurl=DIR      look for the curl library in DIR
   --with-mailprog=NAME    use "NAME -t" for mail transport
   --with-gnu-ld           assume the C compiler uses GNU ld default=no
   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
   --without-libintl-prefix     don't search for libintl in includedir and libdir
-  --with-regex=DIR        look for regex in DIR
   --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
@@ -1624,13 +1764,28 @@ Some influential environment variables:
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  SYSROOT     locate config scripts also below that directory
+  YAT2M       tool to convert texi to man pages
   CC_FOR_BUILD
               build system C compiler
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  SQLITE3_CFLAGS
+              C compiler flags for SQLITE3, overriding pkg-config
+  SQLITE3_LIBS
+              linker flags for SQLITE3, overriding pkg-config
+  LIBGNUTLS_CFLAGS
+              C compiler flags for LIBGNUTLS, overriding pkg-config
+  LIBGNUTLS_LIBS
+              linker flags for LIBGNUTLS, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
-Report bugs to <http://bugs.gnupg.org>.
+Report bugs to <https://bugs.gnupg.org>.
 _ACEOF
 ac_status=$?
 fi
@@ -1693,10 +1848,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-gnupg configure 2.0.19
-generated by GNU Autoconf 2.68
+gnupg configure 2.4.3
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1852,9 +2007,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
 $as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ------------------------------------ ##
-## Report this to http://bugs.gnupg.org ##
-## ------------------------------------ ##"
+( $as_echo "## ------------------------------------- ##
+## Report this to https://bugs.gnupg.org ##
+## ------------------------------------- ##"
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
@@ -1973,7 +2128,7 @@ $as_echo "$ac_try_echo"; } >&5
         test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
         test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
+        test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2176,7 +2331,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2192,7 +2348,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2218,7 +2375,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2234,7 +2392,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2268,7 +2427,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -2336,12 +2496,69 @@ rm -f conftest.val
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_compute_int
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
 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.0.19, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+It was created by gnupg $as_me 2.4.3, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2622,10 +2839,6 @@ fi
 
 gt_needs="$gt_needs need-ngettext"
 as_fn_append ac_header_list " sys/socket.h"
-as_fn_append ac_header_list " sys/time.h"
-as_fn_append ac_header_list " unistd.h"
-as_fn_append ac_header_list " wchar.h"
-as_fn_append ac_header_list " stdint.h"
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
@@ -2694,29 +2907,45 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-# Set development_version to yes if the minor number is odd or you
-# feel that the default check for a development version is not
-# sufficient.
-development_version=no
 
-NEED_GPG_ERROR_VERSION=1.7
+# When changing the SWDB tag please also adjust the hard coded tags in
+# 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 "gnupg24"
+_ACEOF
+
+
+NEED_GPGRT_VERSION=1.46
 
 NEED_LIBGCRYPT_API=1
-NEED_LIBGCRYPT_VERSION=1.4.0
+NEED_LIBGCRYPT_VERSION=1.9.1
 
 NEED_LIBASSUAN_API=2
-NEED_LIBASSUAN_VERSION=2.0.0
+NEED_LIBASSUAN_VERSION=2.5.0
 
 NEED_KSBA_API=1
-NEED_KSBA_VERSION=1.0.7
+NEED_KSBA_VERSION=1.6.3
+
+NEED_NTBTLS_API=1
+NEED_NTBTLS_VERSION=0.1.0
+
+NEED_NPTH_API=1
+NEED_NPTH_VERSION=1.2
+
 
+NEED_GNUTLS_VERSION=3.0
 
+NEED_SQLITE_VERSION=3.27
+
+development_version=no
 PACKAGE=$PACKAGE_NAME
 PACKAGE_GT=${PACKAGE_NAME}2
 VERSION=$PACKAGE_VERSION
 
 ac_aux_dir=
-for ac_dir in scripts "$srcdir"/scripts; do
+for ac_dir in build-aux "$srcdir"/build-aux; do
   if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
@@ -2732,7 +2961,7 @@ for ac_dir in scripts "$srcdir"/scripts; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in scripts \"$srcdir\"/scripts" "$LINENO" 5
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
 fi
 
 # These three variables are undocumented and unsupported,
@@ -2747,7 +2976,7 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 ac_config_headers="$ac_config_headers config.h"
 
-am__api_version='1.11'
+am__api_version='1.16'
 
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -2786,7 +3015,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
          if test $ac_prog = install &&
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
@@ -2844,9 +3073,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
 $as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -2857,32 +3083,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" "$LINENO" 5
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+       # -L didn't work.
+       set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+       && test "$*" != "X conftest.file $srcdir/configure"; then
+
+       # If neither matched, then we have a broken ls.  This can happen
+       # if, for instance, CONFIG_SHELL is bash and it inherits a
+       # broken ls alias from the environment.  This has actually
+       # happened.  Such a system could not be considered "sane".
+       as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
@@ -2894,6 +3128,16 @@ Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
@@ -2904,27 +3148,22 @@ test "$program_suffix" != NONE &&
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
+  MISSING="\${SHELL} '$am_aux_dir/missing'"
 fi
 # Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
-  am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
 else
   am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\    *)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -2933,10 +3172,10 @@ if test x"${install_sh}" != xset; then
   esac
 fi
 
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
 if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
@@ -2955,7 +3194,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2995,7 +3234,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3046,7 +3285,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_prog in mkdir gmkdir; do
         for ac_exec_ext in '' $ac_executable_extensions; do
-          { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+          as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
           case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
             'mkdir (GNU coreutils) '* | \
             'mkdir (coreutils) '* | \
@@ -3075,12 +3314,6 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
 $as_echo "$MKDIR_P" >&6; }
 
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
-  [\\/$]* | ?:[\\/]*) ;;
-  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -3099,7 +3332,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3163,6 +3396,45 @@ else
 fi
 rmdir .tst 2>/dev/null
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
 if test "`cd $srcdir && pwd`" != "`pwd`"; then
   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
   # is not polluted with repeated "-I."
@@ -3184,8 +3456,8 @@ fi
 
 
 # Define the identity of the package.
- PACKAGE=$PACKAGE
- VERSION=$VERSION
+ PACKAGE='gnupg'
+ VERSION='2.4.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3213,17 +3485,70 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
 
-AMTAR=${AMTAR-"${am_missing_run}tar"}
 
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
 
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
 
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
@@ -3324,45 +3649,45 @@ DEPDIR="${am__leading_dot}deps"
 
 ac_config_commands="$ac_config_commands depfiles"
 
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  case $?:`cat confinc.out 2>/dev/null` in #(
+  '0:this is the am__doit target') :
+    case $s in #(
+  BSD) :
+    am__include='.include' am__quote='"' ;; #(
+  *) :
+    am__include='include' am__quote='' ;;
+esac ;; #(
+  *) :
      ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
 
 # Check whether --enable-dependency-tracking was given.
 if test "${enable_dependency_tracking+set}" = set; then :
@@ -3372,6 +3697,7 @@ fi
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
  if test "x$enable_dependency_tracking" != xno; then
   AMDEP_TRUE=
@@ -3404,7 +3730,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3444,7 +3770,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3497,7 +3823,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3538,7 +3864,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -3596,7 +3922,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3640,7 +3966,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4086,8 +4412,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4172,6 +4497,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 depcc="$CC"   am_compiler_list=
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
@@ -4183,8 +4567,9 @@ else
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -4218,16 +4603,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -4236,16 +4621,16 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
        continue
       else
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -4454,7 +4839,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -4520,7 +4905,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -4727,8 +5112,8 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#        define __EXTENSIONS__ 1
-         $ac_includes_default
+#         define __EXTENSIONS__ 1
+          $ac_includes_default
 int
 main ()
 {
@@ -4765,107 +5150,154 @@ have_gpg_error=no
 have_libgcrypt=no
 have_libassuan=no
 have_ksba=no
-have_pth=no
+have_ntbtls=no
+have_gnutls=no
+have_sqlite=no
+have_npth=no
 have_libusb=no
-have_adns=no
+have_libtss=no
+have_system_resolver=no
+gnupg_have_ldap="n/a"
 
+use_zip=yes
 use_bzip2=yes
 use_exec=yes
-disable_keyserver_path=no
-use_ccid_driver=yes
-use_standard_socket=no
-
+use_trust_models=yes
+use_tofu=yes
+use_libdns=yes
+card_support=yes
+use_ccid_driver=auto
+dirmngr_auto_start=yes
+use_tls_library=no
+large_secmem=no
+show_tor_support=no
+
+# gpg is a required part and can't be disabled anymore.
 build_gpg=yes
 
-      # Check whether --enable-gpg was given.
-if test "${enable_gpg+set}" = set; then :
-  enableval=$enable_gpg; build_gpg=$enableval
+   build_gpgsm=yes
+
+      # Check whether --enable-gpgsm was given.
+if test "${enable_gpgsm+set}" = set; then :
+  enableval=$enable_gpgsm; build_gpgsm=$enableval
 else
-  build_gpg=yes
+  build_gpgsm=yes
 fi
 
 
-   case "$build_gpg" in
+   case "$build_gpgsm" in
          no|yes)
            ;;
          *)
-           as_fn_error $? "only yes or no allowed for feature --enable-gpg" "$LINENO" 5
+           as_fn_error $? "only yes or no allowed for feature --enable-gpgsm" "$LINENO" 5
            ;;
    esac
 
-build_gpgsm=yes
 
-      # Check whether --enable-gpgsm was given.
-if test "${enable_gpgsm+set}" = set; then :
-  enableval=$enable_gpgsm; build_gpgsm=$enableval
+# The agent is a required part and can't be disabled anymore.
+build_agent=yes
+
+   build_scdaemon=yes
+
+      # Check whether --enable-scdaemon was given.
+if test "${enable_scdaemon+set}" = set; then :
+  enableval=$enable_scdaemon; build_scdaemon=$enableval
 else
-  build_gpgsm=yes
+  build_scdaemon=yes
 fi
 
 
-   case "$build_gpgsm" in
+   case "$build_scdaemon" in
          no|yes)
            ;;
          *)
-           as_fn_error $? "only yes or no allowed for feature --enable-gpgsm" "$LINENO" 5
+           as_fn_error $? "only yes or no allowed for feature --enable-scdaemon" "$LINENO" 5
            ;;
    esac
 
-build_agent=yes
 
-      # Check whether --enable-agent was given.
-if test "${enable_agent+set}" = set; then :
-  enableval=$enable_agent; build_agent=$enableval
+
+   build_g13=no
+
+      # Check whether --enable-g13 was given.
+if test "${enable_g13+set}" = set; then :
+  enableval=$enable_g13; build_g13=$enableval
 else
-  build_agent=yes
+  build_g13=no
 fi
 
 
-   case "$build_agent" in
+   case "$build_g13" in
          no|yes)
            ;;
          *)
-           as_fn_error $? "only yes or no allowed for feature --enable-agent" "$LINENO" 5
+           as_fn_error $? "only yes or no allowed for feature --enable-g13" "$LINENO" 5
            ;;
    esac
 
-build_scdaemon=yes
 
-      # Check whether --enable-scdaemon was given.
-if test "${enable_scdaemon+set}" = set; then :
-  enableval=$enable_scdaemon; build_scdaemon=$enableval
+
+   build_dirmngr=yes
+
+      # Check whether --enable-dirmngr was given.
+if test "${enable_dirmngr+set}" = set; then :
+  enableval=$enable_dirmngr; build_dirmngr=$enableval
 else
-  build_scdaemon=yes
+  build_dirmngr=yes
 fi
 
 
-   case "$build_scdaemon" in
+   case "$build_dirmngr" in
          no|yes)
            ;;
          *)
-           as_fn_error $? "only yes or no allowed for feature --enable-scdaemon" "$LINENO" 5
+           as_fn_error $? "only yes or no allowed for feature --enable-dirmngr" "$LINENO" 5
+           ;;
+   esac
+
+
+
+   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_tools=yes
 
-      # Check whether --enable-tools was given.
-if test "${enable_tools+set}" = set; then :
-  enableval=$enable_tools; build_tools=$enableval
+
+   build_tpm2d=yes
+
+      # Check whether --enable-tpm2d was given.
+if test "${enable_tpm2d+set}" = set; then :
+  enableval=$enable_tpm2d; build_tpm2d=$enableval
 else
-  build_tools=yes
+  build_tpm2d=yes
 fi
 
 
-   case "$build_tools" in
+   case "$build_tpm2d" in
          no|yes)
            ;;
          *)
-           as_fn_error $? "only yes or no allowed for feature --enable-tools" "$LINENO" 5
+           as_fn_error $? "only yes or no allowed for feature --enable-tpm2d" "$LINENO" 5
            ;;
    esac
 
-build_doc=yes
+
+
+   build_doc=yes
 
       # Check whether --enable-doc was given.
 if test "${enable_doc+set}" = set; then :
@@ -4883,39 +5315,47 @@ fi
            ;;
    esac
 
-build_symcryptrun=no
 
-      # Check whether --enable-symcryptrun was given.
-if test "${enable_symcryptrun+set}" = set; then :
-  enableval=$enable_symcryptrun; build_symcryptrun=$enableval
+# We use gpgtar to unpack test data, hence we always build it.  If the
+# user opts out, we simply don't install it.
+
+   build_gpgtar=yes
+
+      # Check whether --enable-gpgtar was given.
+if test "${enable_gpgtar+set}" = set; then :
+  enableval=$enable_gpgtar; build_gpgtar=$enableval
 else
-  build_symcryptrun=no
+  build_gpgtar=yes
 fi
 
 
-   case "$build_symcryptrun" in
+   case "$build_gpgtar" in
          no|yes)
            ;;
          *)
-           as_fn_error $? "only yes or no allowed for feature --enable-symcryptrun" "$LINENO" 5
+           as_fn_error $? "only yes or no allowed for feature --enable-gpgtar" "$LINENO" 5
            ;;
    esac
 
-build_gpgtar=no
 
-      # Check whether --enable-gpgtar was given.
-if test "${enable_gpgtar+set}" = set; then :
-  enableval=$enable_gpgtar; build_gpgtar=$enableval
+# We also install the gpg-wks-server tool by default but disable it
+# later for platforms where it can't be build.
+
+   build_wks_tools=yes
+
+      # Check whether --enable-wks-tools was given.
+if test "${enable_wks_tools+set}" = set; then :
+  enableval=$enable_wks_tools; build_wks_tools=$enableval
 else
-  build_gpgtar=no
+  build_wks_tools=yes
 fi
 
 
-   case "$build_gpgtar" in
+   case "$build_wks_tools" in
          no|yes)
            ;;
          *)
-           as_fn_error $? "only yes or no allowed for feature --enable-gpgtar" "$LINENO" 5
+           as_fn_error $? "only yes or no allowed for feature --enable-wks-tools" "$LINENO" 5
            ;;
    esac
 
@@ -4925,6 +5365,7 @@ fi
 
 
 
+
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE "$PACKAGE"
 _ACEOF
@@ -4955,6 +5396,12 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define NEED_NTBTLS_VERSION "$NEED_NTBTLS_VERSION"
+_ACEOF
+
+
+
 
 # The default is to use the modules from this package and the few
 # other packages in a standard place; i.e where this package gets
@@ -5024,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"
@@ -5044,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"
@@ -5065,15 +5553,51 @@ test -n "$GNUPG_PROTECT_TOOL_PGM" \
       && show_gnupg_protect_tool_pgm="$GNUPG_PROTECT_TOOL_PGM"
 
 
-# Some folks want to use only the agent from this packet.  Make it
-# easier for them by providing the configure option
-# --enable-only-agent.
-# Check whether --enable-agent-only was given.
-if test "${enable_agent_only+set}" = set; then :
-  enableval=$enable_agent_only; build_agent_only=$enableval
+# Check whether --with-dirmngr-ldap-pgm was given.
+if test "${with_dirmngr_ldap_pgm+set}" = set; then :
+  withval=$with_dirmngr_ldap_pgm; GNUPG_DIRMNGR_LDAP_PGM="$withval"
+else
+  GNUPG_DIRMNGR_LDAP_PGM=""
 fi
 
 
+ if test -n "$GNUPG_DIRMNGR_LDAP_PGM"; then
+  GNUPG_DIRMNGR_LDAP_PGM_TRUE=
+  GNUPG_DIRMNGR_LDAP_PGM_FALSE='#'
+else
+  GNUPG_DIRMNGR_LDAP_PGM_TRUE='#'
+  GNUPG_DIRMNGR_LDAP_PGM_FALSE=
+fi
+
+show_gnupg_dirmngr_ldap_pgm="(default)"
+test -n "$GNUPG_DIRMNGR_LDAP_PGM" \
+      && show_gnupg_dirmngr_ldap_pgm="$GNUPG_DIRMNGR_LDAP_PGM"
+
+
+#
+# For a long time gpg 2.x was installed as gpg2.  This changed with
+# 2.2.  This option can be used to install gpg under the name gpg2.
+#
+# Check whether --enable-gpg-is-gpg2 was given.
+if test "${enable_gpg_is_gpg2+set}" = set; then :
+  enableval=$enable_gpg_is_gpg2; gpg_is_gpg2=$enableval
+fi
+
+if test "$gpg_is_gpg2" = "yes"; then
+
+$as_echo "#define USE_GPG2_HACK 1" >>confdefs.h
+
+fi
+ if test "$gpg_is_gpg2" = "yes"; then
+  USE_GPG2_HACK_TRUE=
+  USE_GPG2_HACK_FALSE='#'
+else
+  USE_GPG2_HACK_TRUE='#'
+  USE_GPG2_HACK_FALSE=
+fi
+
+
+
 # SELinux support includes tracking of sensitive files to avoid
 # leaking their contents through processing these files by gpg itself
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether SELinux support is requested" >&5
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $selinux_support" >&5
 $as_echo "$selinux_support" >&6; }
 
-# Allow disabling of bzib2 support.
-# It is defined only after we confirm the library is available later
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the BZIP2 compression algorithm" >&5
-$as_echo_n "checking whether to enable the BZIP2 compression algorithm... " >&6; }
-# Check whether --enable-bzip2 was given.
-if test "${enable_bzip2+set}" = set; then :
-  enableval=$enable_bzip2; use_bzip2=$enableval
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to allocate extra secure memory" >&5
+$as_echo_n "checking whether to allocate extra secure memory... " >&6; }
+# Check whether --enable-large-secmem was given.
+if test "${enable_large_secmem+set}" = set; then :
+  enableval=$enable_large_secmem; large_secmem=$enableval
+else
+  large_secmem=no
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_bzip2" >&5
-$as_echo "$use_bzip2" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $large_secmem" >&5
+$as_echo "$large_secmem" >&6; }
+if test "$large_secmem" = yes ; then
+   SECMEM_BUFFER_SIZE=65536
+else
+   SECMEM_BUFFER_SIZE=32768
+fi
 
-# Configure option to allow or disallow execution of external
-# programs, like a photo viewer.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable external program execution" >&5
-$as_echo_n "checking whether to enable external program execution... " >&6; }
-# Check whether --enable-exec was given.
-if test "${enable_exec+set}" = set; then :
-  enableval=$enable_exec; use_exec=$enableval
+cat >>confdefs.h <<_ACEOF
+#define SECMEM_BUFFER_SIZE $SECMEM_BUFFER_SIZE
+_ACEOF
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking calibrated passphrase-stretching (s2k) duration" >&5
+$as_echo_n "checking calibrated passphrase-stretching (s2k) duration... " >&6; }
+
+# Check whether --with-agent-s2k-calibration was given.
+if test "${with_agent_s2k_calibration+set}" = set; then :
+  withval=$with_agent_s2k_calibration; agent_s2k_calibration=$withval
+else
+  agent_s2k_calibration=100
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_exec" >&5
-$as_echo "$use_exec" >&6; }
-if test "$use_exec" = no ; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $agent_s2k_calibration milliseconds" >&5
+$as_echo "$agent_s2k_calibration milliseconds" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define AGENT_S2K_CALIBRATION $agent_s2k_calibration
+_ACEOF
 
-$as_echo "#define NO_EXEC 1" >>confdefs.h
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable trust models" >&5
+$as_echo_n "checking whether to enable trust models... " >&6; }
+# Check whether --enable-trust-models was given.
+if test "${enable_trust_models+set}" = set; then :
+  enableval=$enable_trust_models; use_trust_models=$enableval
 fi
 
-if test "$use_exec" = yes ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable photo ID viewing" >&5
-$as_echo_n "checking whether to enable photo ID viewing... " >&6; }
-  # Check whether --enable-photo-viewers was given.
-if test "${enable_photo_viewers+set}" = set; then :
-  enableval=$enable_photo_viewers; if test "$enableval" = no ; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_trust_models" >&5
+$as_echo "$use_trust_models" >&6; }
+if test "$use_trust_models" = no ; then
 
-$as_echo "#define DISABLE_PHOTO_VIEWER 1" >>confdefs.h
+$as_echo "#define NO_TRUST_MODELS 1" >>confdefs.h
 
-      fi
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable TOFU" >&5
+$as_echo_n "checking whether to enable TOFU... " >&6; }
+# Check whether --enable-tofu was given.
+if test "${enable_tofu+set}" = set; then :
+  enableval=$enable_tofu; use_tofu=$enableval
 else
-  enableval=yes
+  use_tofu=$use_trust_models
 fi
 
-  gnupg_cv_enable_photo_viewers=$enableval
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
-$as_echo "$enableval" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_tofu" >&5
+$as_echo "$use_tofu" >&6; }
+if test "$use_trust_models" = no && test "$use_tofu" = yes; then
+    as_fn_error $? "both --disable-trust-models and --enable-tofu given" "$LINENO" 5
+fi
 
-  if test "$gnupg_cv_enable_photo_viewers" = yes ; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use a fixed photo ID viewer" >&5
-$as_echo_n "checking whether to use a fixed photo ID viewer... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable libdns" >&5
+$as_echo_n "checking whether to enable libdns... " >&6; }
+# Check whether --enable-libdns was given.
+if test "${enable_libdns+set}" = set; then :
+  enableval=$enable_libdns; use_libdns=$enableval
+else
+  use_libdns=yes
+fi
 
-# Check whether --with-photo-viewer was given.
-if test "${with_photo_viewer+set}" = set; then :
-  withval=$with_photo_viewer; if test "$withval" = yes ; then
-           withval=no
-        elif test "$withval" != no ; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_libdns" >&5
+$as_echo "$use_libdns" >&6; }
+if test x"$use_libdns" = xyes ; then
 
-cat >>confdefs.h <<_ACEOF
-#define FIXED_PHOTO_VIEWER "$withval"
-_ACEOF
+$as_echo "#define USE_LIBDNS 1" >>confdefs.h
 
-        fi
+fi
+ if test "$use_libdns" = yes; then
+  USE_LIBDNS_TRUE=
+  USE_LIBDNS_FALSE='#'
 else
-  withval=no
+  USE_LIBDNS_TRUE='#'
+  USE_LIBDNS_FALSE=
 fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
-$as_echo "$withval" >&6; }
-  fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable external keyserver helpers" >&5
-$as_echo_n "checking whether to enable external keyserver helpers... " >&6; }
-  # Check whether --enable-keyserver-helpers was given.
-if test "${enable_keyserver_helpers+set}" = set; then :
-  enableval=$enable_keyserver_helpers; if test "$enableval" = no ; then
 
-$as_echo "#define DISABLE_KEYSERVER_HELPERS 1" >>confdefs.h
+#
+# Options to disable algorithm
+#
 
-      fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the RSA public key for gpg" >&5
+$as_echo_n "checking whether to enable the RSA public key for gpg... " >&6; }
+   # Check whether --enable-gpg-rsa was given.
+if test "${enable_gpg_rsa+set}" = set; then :
+  enableval=$enable_gpg_rsa;
 else
   enableval=yes
 fi
 
-  gnupg_cv_enable_keyserver_helpers=$enableval
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
 $as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
 
-  if test "$gnupg_cv_enable_keyserver_helpers" = yes ; then
-    # LDAP is defined only after we confirm the library is available later
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether LDAP keyserver support is requested" >&5
-$as_echo_n "checking whether LDAP keyserver support is requested... " >&6; }
-    # Check whether --enable-ldap was given.
-if test "${enable_ldap+set}" = set; then :
-  enableval=$enable_ldap; try_ldap=$enableval
+$as_echo "#define GPG_USE_RSA 1" >>confdefs.h
+
+   fi
+
+# Elgamal is a MUST algorithm
+# DSA is a MUST algorithm
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the ECDH public key for gpg" >&5
+$as_echo_n "checking whether to enable the ECDH public key for gpg... " >&6; }
+   # Check whether --enable-gpg-ecdh was given.
+if test "${enable_gpg_ecdh+set}" = set; then :
+  enableval=$enable_gpg_ecdh;
 else
-  try_ldap=yes
+  enableval=yes
 fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try_ldap" >&5
-$as_echo "$try_ldap" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_ECDH 1" >>confdefs.h
+
+   fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HKP keyserver support is requested" >&5
-$as_echo_n "checking whether HKP keyserver support is requested... " >&6; }
-    # Check whether --enable-hkp was given.
-if test "${enable_hkp+set}" = set; then :
-  enableval=$enable_hkp; try_hkp=$enableval
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the ECDSA public key for gpg" >&5
+$as_echo_n "checking whether to enable the ECDSA public key for gpg... " >&6; }
+   # Check whether --enable-gpg-ecdsa was given.
+if test "${enable_gpg_ecdsa+set}" = set; then :
+  enableval=$enable_gpg_ecdsa;
 else
-  try_hkp=yes
+  enableval=yes
 fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try_hkp" >&5
-$as_echo "$try_hkp" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_ECDSA 1" >>confdefs.h
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether finger key fetching support is requested" >&5
-$as_echo_n "checking whether finger key fetching support is requested... " >&6; }
-    # Check whether --enable-finger was given.
-if test "${enable_finger+set}" = set; then :
-  enableval=$enable_finger; try_finger=$enableval
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the EdDSA public key for gpg" >&5
+$as_echo_n "checking whether to enable the EdDSA public key for gpg... " >&6; }
+   # Check whether --enable-gpg-eddsa was given.
+if test "${enable_gpg_eddsa+set}" = set; then :
+  enableval=$enable_gpg_eddsa;
 else
-  try_finger=yes
+  enableval=yes
 fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try_finger" >&5
-$as_echo "$try_finger" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_EDDSA 1" >>confdefs.h
+
+   fi
+
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether generic object key fetching support is requested" >&5
-$as_echo_n "checking whether generic object key fetching support is requested... " >&6; }
-    # Check whether --enable-generic was given.
-if test "${enable_generic+set}" = set; then :
-  enableval=$enable_generic; try_generic=$enableval
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the IDEA cipher for gpg" >&5
+$as_echo_n "checking whether to enable the IDEA cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-idea was given.
+if test "${enable_gpg_idea+set}" = set; then :
+  enableval=$enable_gpg_idea;
 else
-  try_generic=yes
+  enableval=yes
 fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try_generic" >&5
-$as_echo "$try_generic" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_IDEA 1" >>confdefs.h
+
+   fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether email keyserver support is requested" >&5
-$as_echo_n "checking whether email keyserver support is requested... " >&6; }
-    # Check whether --enable-mailto was given.
-if test "${enable_mailto+set}" = set; then :
-  enableval=$enable_mailto; try_mailto=$enableval
+# 3DES is a MUST algorithm
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the CAST5 cipher for gpg" >&5
+$as_echo_n "checking whether to enable the CAST5 cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-cast5 was given.
+if test "${enable_gpg_cast5+set}" = set; then :
+  enableval=$enable_gpg_cast5;
 else
-  try_mailto=no
+  enableval=yes
 fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $try_mailto" >&5
-$as_echo "$try_mailto" >&6; }
-  fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether keyserver exec-path is enabled" >&5
-$as_echo_n "checking whether keyserver exec-path is enabled... " >&6; }
-  # Check whether --enable-keyserver-path was given.
-if test "${enable_keyserver_path+set}" = set; then :
-  enableval=$enable_keyserver_path; if test "$enableval" = no ; then
-              disable_keyserver_path=yes
-           fi
+$as_echo "#define GPG_USE_CAST5 1" >>confdefs.h
+
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the BLOWFISH cipher for gpg" >&5
+$as_echo_n "checking whether to enable the BLOWFISH cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-blowfish was given.
+if test "${enable_gpg_blowfish+set}" = set; then :
+  enableval=$enable_gpg_blowfish;
 else
   enableval=yes
 fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
 $as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_BLOWFISH 1" >>confdefs.h
+
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the AES128 cipher for gpg" >&5
+$as_echo_n "checking whether to enable the AES128 cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-aes128 was given.
+if test "${enable_gpg_aes128+set}" = set; then :
+  enableval=$enable_gpg_aes128;
+else
+  enableval=yes
 fi
 
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_AES128 1" >>confdefs.h
 
-#
-# Check for the key/uid cache size.  This can't be zero, but can be
-# pretty small on embedded systems.  This is used for the gpg part.
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the size of the key and uid cache" >&5
-$as_echo_n "checking for the size of the key and uid cache... " >&6; }
-# Check whether --enable-key-cache was given.
-if test "${enable_key_cache+set}" = set; then :
-  enableval=$enable_key_cache;
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the AES192 cipher for gpg" >&5
+$as_echo_n "checking whether to enable the AES192 cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-aes192 was given.
+if test "${enable_gpg_aes192+set}" = set; then :
+  enableval=$enable_gpg_aes192;
 else
-  enableval=4096
+  enableval=yes
 fi
 
-if test "$enableval" = "no"; then
-   enableval=5
-elif test "$enableval" = "yes" || test "$enableval" = ""; then
-   enableval=4096
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_AES192 1" >>confdefs.h
+
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the AES256 cipher for gpg" >&5
+$as_echo_n "checking whether to enable the AES256 cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-aes256 was given.
+if test "${enable_gpg_aes256+set}" = set; then :
+  enableval=$enable_gpg_aes256;
+else
+  enableval=yes
 fi
-key_cache_size=`echo "$enableval" | sed 's/[A-Za-z]//g'`
-if test "$enableval" != "$key_cache_size" || test "$key_cache_size" -lt 5; then
-   as_fn_error $? "invalid key-cache size" "$LINENO" 5
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_AES256 1" >>confdefs.h
+
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the TWOFISH cipher for gpg" >&5
+$as_echo_n "checking whether to enable the TWOFISH cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-twofish was given.
+if test "${enable_gpg_twofish+set}" = set; then :
+  enableval=$enable_gpg_twofish;
+else
+  enableval=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $key_cache_size" >&5
-$as_echo "$key_cache_size" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define PK_UID_CACHE_SIZE $key_cache_size
-_ACEOF
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
 
+$as_echo "#define GPG_USE_TWOFISH 1" >>confdefs.h
 
+   fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the CAMELLIA128 cipher for gpg" >&5
+$as_echo_n "checking whether to enable the CAMELLIA128 cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-camellia128 was given.
+if test "${enable_gpg_camellia128+set}" = set; then :
+  enableval=$enable_gpg_camellia128;
+else
+  enableval=yes
+fi
 
-#
-# Check whether we want to use Linux capabilities
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of capabilities is requested" >&5
-$as_echo_n "checking whether use of capabilities is requested... " >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
 
-# Check whether --with-capabilities was given.
-if test "${with_capabilities+set}" = set; then :
-  withval=$with_capabilities; use_capabilities="$withval"
+$as_echo "#define GPG_USE_CAMELLIA128 1" >>confdefs.h
+
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the CAMELLIA192 cipher for gpg" >&5
+$as_echo_n "checking whether to enable the CAMELLIA192 cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-camellia192 was given.
+if test "${enable_gpg_camellia192+set}" = set; then :
+  enableval=$enable_gpg_camellia192;
 else
-  use_capabilities=no
+  enableval=yes
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_capabilities" >&5
-$as_echo "$use_capabilities" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
 
+$as_echo "#define GPG_USE_CAMELLIA192 1" >>confdefs.h
 
-#
-# Allow disabling of internal CCID support.
-# It is defined only after we confirm the library is available later
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the internal CCID driver" >&5
-$as_echo_n "checking whether to enable the internal CCID driver... " >&6; }
-# Check whether --enable-ccid-driver was given.
-if test "${enable_ccid_driver+set}" = set; then :
-  enableval=$enable_ccid_driver; use_ccid_driver=$enableval
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the CAMELLIA256 cipher for gpg" >&5
+$as_echo_n "checking whether to enable the CAMELLIA256 cipher for gpg... " >&6; }
+   # Check whether --enable-gpg-camellia256 was given.
+if test "${enable_gpg_camellia256+set}" = set; then :
+  enableval=$enable_gpg_camellia256;
+else
+  enableval=yes
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_ccid_driver" >&5
-$as_echo "$use_ccid_driver" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
 
+$as_echo "#define GPG_USE_CAMELLIA256 1" >>confdefs.h
 
-#
-# To avoid double inclusion of config.h which might happen at some
-# places, we add the usual double inclusion protection at the top of
-# config.h.
-#
+   fi
 
 
-#
-# Stuff which goes at the bottom of config.h.
-#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the MD5 hash for gpg" >&5
+$as_echo_n "checking whether to enable the MD5 hash for gpg... " >&6; }
+   # Check whether --enable-gpg-md5 was given.
+if test "${enable_gpg_md5+set}" = set; then :
+  enableval=$enable_gpg_md5;
+else
+  enableval=yes
+fi
 
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
 
+$as_echo "#define GPG_USE_MD5 1" >>confdefs.h
 
+   fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
-    # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
-  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+# SHA1 is a MUST algorithm
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the RIPE-MD160 hash for gpg" >&5
+$as_echo_n "checking whether to enable the RIPE-MD160 hash for gpg... " >&6; }
+   # Check whether --enable-gpg-rmd160 was given.
+if test "${enable_gpg_rmd160+set}" = set; then :
+  enableval=$enable_gpg_rmd160;
 else
-  USE_MAINTAINER_MODE=no
+  enableval=yes
 fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
-   if test $USE_MAINTAINER_MODE = yes; then
-  MAINTAINER_MODE_TRUE=
-  MAINTAINER_MODE_FALSE='#'
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_RMD160 1" >>confdefs.h
+
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the SHA-224 hash for gpg" >&5
+$as_echo_n "checking whether to enable the SHA-224 hash for gpg... " >&6; }
+   # Check whether --enable-gpg-sha224 was given.
+if test "${enable_gpg_sha224+set}" = set; then :
+  enableval=$enable_gpg_sha224;
 else
-  MAINTAINER_MODE_TRUE='#'
-  MAINTAINER_MODE_FALSE=
+  enableval=yes
 fi
 
-  MAINT=$MAINTAINER_MODE_TRUE
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
 
+$as_echo "#define GPG_USE_SHA224 1" >>confdefs.h
 
+   fi
 
-# Checks for programs.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for programs" >&5
-$as_echo "$as_me: checking for programs" >&6;}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
-  $as_echo_n "(cached) " >&6
+# SHA256 is a MUST algorithm for GnuPG.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the SHA-384 hash for gpg" >&5
+$as_echo_n "checking whether to enable the SHA-384 hash for gpg... " >&6; }
+   # Check whether --enable-gpg-sha384 was given.
+if test "${enable_gpg_sha384+set}" = set; then :
+  enableval=$enable_gpg_sha384;
 else
-  cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
+  enableval=yes
+fi
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_SHA384 1" >>confdefs.h
+
+   fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the SHA-512 hash for gpg" >&5
+$as_echo_n "checking whether to enable the SHA-512 hash for gpg... " >&6; }
+   # Check whether --enable-gpg-sha512 was given.
+if test "${enable_gpg_sha512+set}" = set; then :
+  enableval=$enable_gpg_sha512;
+else
+  enableval=yes
+fi
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+   if test x"$enableval" = xyes ; then
+
+$as_echo "#define GPG_USE_SHA512 1" >>confdefs.h
+
+   fi
+
+
+
+# Allow disabling of zip support.
+# This is in general not a good idea because according to rfc4880 OpenPGP
+# implementations SHOULD support ZLIB.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the ZIP and ZLIB compression algorithm" >&5
+$as_echo_n "checking whether to enable the ZIP and ZLIB compression algorithm... " >&6; }
+# Check whether --enable-zip was given.
+if test "${enable_zip+set}" = set; then :
+  enableval=$enable_zip; use_zip=$enableval
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_zip" >&5
+$as_echo "$use_zip" >&6; }
+
+# Allow disabling of bzib2 support.
+# It is defined only after we confirm the library is available later
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the BZIP2 compression algorithm" >&5
+$as_echo_n "checking whether to enable the BZIP2 compression algorithm... " >&6; }
+# Check whether --enable-bzip2 was given.
+if test "${enable_bzip2+set}" = set; then :
+  enableval=$enable_bzip2; use_bzip2=$enableval
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_bzip2" >&5
+$as_echo "$use_bzip2" >&6; }
+
+# Configure option to allow or disallow execution of external
+# programs, like a photo viewer.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable external program execution" >&5
+$as_echo_n "checking whether to enable external program execution... " >&6; }
+# Check whether --enable-exec was given.
+if test "${enable_exec+set}" = set; then :
+  enableval=$enable_exec; use_exec=$enableval
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_exec" >&5
+$as_echo "$use_exec" >&6; }
+if test "$use_exec" = no ; then
+
+$as_echo "#define NO_EXEC 1" >>confdefs.h
+
+fi
+
+if test "$use_exec" = yes ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable photo ID viewing" >&5
+$as_echo_n "checking whether to enable photo ID viewing... " >&6; }
+  # Check whether --enable-photo-viewers was given.
+if test "${enable_photo_viewers+set}" = set; then :
+  enableval=$enable_photo_viewers; if test "$enableval" = no ; then
+
+$as_echo "#define DISABLE_PHOTO_VIEWER 1" >>confdefs.h
+
+      fi
+else
+  enableval=yes
+fi
+
+  gnupg_cv_enable_photo_viewers=$enableval
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enableval" >&5
+$as_echo "$enableval" >&6; }
+
+  if test "$gnupg_cv_enable_photo_viewers" = yes ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use a fixed photo ID viewer" >&5
+$as_echo_n "checking whether to use a fixed photo ID viewer... " >&6; }
+
+# Check whether --with-photo-viewer was given.
+if test "${with_photo_viewer+set}" = set; then :
+  withval=$with_photo_viewer; if test "$withval" = yes ; then
+           withval=no
+        elif test "$withval" != no ; then
+
+cat >>confdefs.h <<_ACEOF
+#define FIXED_PHOTO_VIEWER "$withval"
+_ACEOF
+
+        fi
+else
+  withval=no
+fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
+$as_echo "$withval" >&6; }
+  fi
+fi
+
+
+#
+# Check for the key/uid cache size.  This can't be zero, but can be
+# pretty small on embedded systems.  This is used for the gpg part.
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the size of the key and uid cache" >&5
+$as_echo_n "checking for the size of the key and uid cache... " >&6; }
+# Check whether --enable-key-cache was given.
+if test "${enable_key_cache+set}" = set; then :
+  enableval=$enable_key_cache;
+else
+  enableval=4096
+fi
+
+if test "$enableval" = "no"; then
+   enableval=5
+elif test "$enableval" = "yes" || test "$enableval" = ""; then
+   enableval=4096
+fi
+key_cache_size=`echo "$enableval" | sed 's/[A-Za-z]//g'`
+if test "$enableval" != "$key_cache_size" || test "$key_cache_size" -lt 5; then
+   as_fn_error $? "invalid key-cache size" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $key_cache_size" >&5
+$as_echo "$key_cache_size" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define PK_UID_CACHE_SIZE $key_cache_size
+_ACEOF
+
+
+
+
+#
+# Check whether we want to use Linux capabilities
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether use of capabilities is requested" >&5
+$as_echo_n "checking whether use of capabilities is requested... " >&6; }
+
+# Check whether --with-capabilities was given.
+if test "${with_capabilities+set}" = set; then :
+  withval=$with_capabilities; use_capabilities="$withval"
+else
+  use_capabilities=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_capabilities" >&5
+$as_echo "$use_capabilities" >&6; }
+
+#
+# Check whether to disable the card support
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether smartcard support is requested" >&5
+$as_echo_n "checking whether smartcard support is requested... " >&6; }
+# Check whether --enable-card-support was given.
+if test "${enable_card_support+set}" = set; then :
+  enableval=$enable_card_support; card_support=$enableval
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $card_support" >&5
+$as_echo "$card_support" >&6; }
+if test "$card_support" = yes ; then
+
+$as_echo "#define ENABLE_CARD_SUPPORT 1" >>confdefs.h
+
+else
+  build_scdaemon=no
+fi
+
+#
+# Allow disabling of internal CCID support.
+# It is defined only after we confirm the library is available later
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the internal CCID driver" >&5
+$as_echo_n "checking whether to enable the internal CCID driver... " >&6; }
+# Check whether --enable-ccid-driver was given.
+if test "${enable_ccid_driver+set}" = set; then :
+  enableval=$enable_ccid_driver; use_ccid_driver=$enableval
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_ccid_driver" >&5
+$as_echo "$use_ccid_driver" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to auto start dirmngr" >&5
+$as_echo_n "checking whether to auto start dirmngr... " >&6; }
+# Check whether --enable-dirmngr-auto-start was given.
+if test "${enable_dirmngr_auto_start+set}" = set; then :
+  enableval=$enable_dirmngr_auto_start; dirmngr_auto_start=$enableval
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dirmngr_auto_start" >&5
+$as_echo "$dirmngr_auto_start" >&6; }
+if test "$dirmngr_auto_start" = yes ; then
+
+$as_echo "#define USE_DIRMNGR_AUTO_START 1" >>confdefs.h
+
+fi
+
+
+#
+# To avoid double inclusion of config.h which might happen at some
+# places, we add the usual double inclusion protection at the top of
+# config.h.
+#
+
+
+#
+# Stuff which goes at the bottom of config.h.
+#
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+
+# Checks for programs.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for programs" >&5
+$as_echo "$as_me: checking for programs" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
        @echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
 # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
@@ -5391,9 +6301,6 @@ fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
 $as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -5404,32 +6311,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" "$LINENO" 5
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+       # -L didn't work.
+       set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+       && test "$*" != "X conftest.file $srcdir/configure"; then
+
+       # If neither matched, then we have a broken ls.  This can happen
+       # if, for instance, CONFIG_SHELL is bash and it inherits a
+       # broken ls alias from the environment.  This has actually
+       # happened.  Such a system could not be considered "sane".
+       as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
@@ -5441,6 +6356,16 @@ Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 missing_dir=`cd $ac_aux_dir && pwd`
 
 ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"}
@@ -5457,6 +6382,45 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
 
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -5475,7 +6439,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5521,7 +6485,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5561,7 +6525,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5614,7 +6578,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5655,7 +6619,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -5713,7 +6677,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5757,7 +6721,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -5953,8 +6917,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -6039,19 +7002,79 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-depcc="$CC"   am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
   # using a relative directory.
@@ -6085,16 +7108,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -6103,16 +7126,16 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
        continue
       else
        break
       fi
       ;;
-    msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -6303,131 +7326,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-if test "x$CC" != xcc; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
-                     sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } &&
-   test -f conftest2.$ac_objext && { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; };
-then
-  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
-  if test "x$CC" != xcc; then
-    # Test first that cc exists at all.
-    if { ac_try='cc -c conftest.$ac_ext >&5'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-      rm -f conftest2.*
-      if { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } &&
-        test -f conftest2.$ac_objext && { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; };
-      then
-       # cc works too.
-       :
-      else
-       # cc exists but doesn't like -o.
-       eval ac_cv_prog_cc_${ac_cc}_c_o=no
-      fi
-    fi
-  fi
-else
-  eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; 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; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
-fi
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
-   # Losing compiler, so override with the script.
-   # FIXME: It is wrong to rewrite CC.
-   # But if we don't then we get into trouble of one sort or another.
-   # A longer-term fix would be to have automake use am__CC in this case,
-   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
-   CC="$am_aux_dir/compile $CC"
-fi
-
 
 if test "x$ac_cv_prog_cc_c89" = "xno" ; then
   as_fn_error $? "No C-89 compiler found" "$LINENO" 5
@@ -6461,7 +7359,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6501,7 +7399,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6553,7 +7451,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AR="${ac_tool_prefix}ar"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6593,7 +7491,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_AR="ar"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6646,7 +7544,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_PERL="$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
@@ -6685,7 +7583,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6725,7 +7623,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_WINDRES="windres"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -6760,14 +7658,62 @@ else
   WINDRES="$ac_cv_prog_WINDRES"
 fi
 
+# Extract the first word of ""yat2m"", so it can be a program name with args.
+set dummy "yat2m"; 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_YAT2M+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $YAT2M in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_YAT2M="$YAT2M" # 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_YAT2M="$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_YAT2M" && ac_cv_path_YAT2M=""./yat2m" "
+  ;;
+esac
+fi
+YAT2M=$ac_cv_path_YAT2M
+if test -n "$YAT2M"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YAT2M" >&5
+$as_echo "$YAT2M" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ if test -n "$ac_cv_path_YAT2M"; then
+  HAVE_YAT2M_TRUE=
+  HAVE_YAT2M_FALSE='#'
+else
+  HAVE_YAT2M_TRUE='#'
+  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.  */
 
@@ -6786,25 +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 :
@@ -6831,7 +7789,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -6877,7 +7835,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -6901,7 +7859,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -6946,7 +7904,7 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -6970,7 +7928,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
@@ -7002,51 +7960,62 @@ _ACEOF
 esac
 rm -rf conftest*
   fi
+
+
 fi
 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for faqprog.pl" >&5
-$as_echo_n "checking for faqprog.pl... " >&6; }
-    if faqprog.pl -V 2>/dev/null | grep '^faqprog.pl ' >/dev/null 2>&1; then
-        working_faqprog=yes
-        FAQPROG="faqprog.pl"
-    else
-       working_faqprog=no
-        FAQPROG=": "
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $working_faqprog" >&5
-$as_echo "$working_faqprog" >&6; }
 
-     if test "$working_faqprog" = "yes" ; then
-  WORKING_FAQPROG_TRUE=
-  WORKING_FAQPROG_FALSE='#'
+
+# GNU AWK requires -n option to interpret "0xHH" as a number
+if $AWK 'BEGIN { if (PROCINFO["version"]) exit 1 }'; then
+  AWK_HEX_NUMBER_OPTION=''
+  { $as_echo "$as_me:${as_lineno-$LINENO}: awk with no option for hexadecimal" >&5
+$as_echo "$as_me: awk with no option for hexadecimal" >&6;}
+else
+  AWK_HEX_NUMBER_OPTION='-n'
+  { $as_echo "$as_me:${as_lineno-$LINENO}: awk with an option -n for hexadecimal" >&5
+$as_echo "$as_me: awk with an option -n for hexadecimal" >&6;}
+fi
+
+
+# We need to compile and run a program on the build machine.  A
+# comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
+# the AC archive is broken for autoconf 2.57.  Given that there is no
+# newer version of that macro, we assume that it is also broken for
+# autoconf 2.61 and thus we use a simple but usually sufficient
+# approach.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cc for build" >&5
+$as_echo_n "checking for cc for build... " >&6; }
+if test "$cross_compiling" = "yes"; then
+  CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
 else
-  WORKING_FAQPROG_TRUE='#'
-  WORKING_FAQPROG_FALSE=
+  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5
+$as_echo "$CC_FOR_BUILD" >&6; }
 
 
+# We need to call this macro because other pkg-config macros are
+# not always used.
 
 
 
-# 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
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_TAR+:} false; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $TAR in
+  case $PKG_CONFIG in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -7055,8 +8024,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -7067,92 +8036,118 @@ 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; }
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-        _mytar=$ac_cv_path_TAR
-     fi
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-     # 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.
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-     if test x$_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$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
 
-       if test x$_tar_bad = x0 ; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
        else
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+               PKG_CONFIG=""
        fi
-     fi
-  fi
-
-   if test x$_tar_bad = x0; then
-  HAVE_USTAR_TRUE=
-  HAVE_USTAR_FALSE='#'
-else
-  HAVE_USTAR_TRUE='#'
-  HAVE_USTAR_FALSE=
 fi
 
 
-
-# We need to compile and run a program on the build machine.  A
-# comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
-# the AC archive is broken for autoconf 2.57.  Given that tehre is no
-# newer version of that macro, we assume that it is also broken for
-# autoconf 2.61 and thus we use a simple but usually sufficient
-# approach.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cc for build" >&5
-$as_echo_n "checking for cc for build... " >&6; }
-if test "$cross_compiling" = "yes"; then
-  CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
-else
-  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_FOR_BUILD" >&5
-$as_echo "$CC_FOR_BUILD" >&6; }
-
-
-
-
-try_gettext=yes
-have_dosish_system=no
-have_w32_system=no
-use_simple_gettext=no
-case "${host}" in
-    *-mingw32*)
-        # special stuff for Windoze NT
-        ac_cv_have_dev_random=no
+try_gettext=yes
+require_iconv=yes
+have_dosish_system=no
+have_w32_system=no
+have_android_system=no
+use_simple_gettext=no
+mmap_needed=yes
+require_pipe_to_unblock_pselect=yes
+case "${host}" in
+    *-mingw32*)
+        # special stuff for Windoze NT
+        ac_cv_have_dev_random=no
 
 $as_echo "#define USE_ONLY_8DOT3 1" >>confdefs.h
 
 
-$as_echo "#define HAVE_DRIVE_LETTERS 1" >>confdefs.h
-
-
 $as_echo "#define USE_SIMPLE_GETTEXT 1" >>confdefs.h
 
-        disable_keyserver_path=yes
         have_dosish_system=yes
         have_w32_system=yes
+        require_iconv=no
+        require_pipe_to_unblock_pselect=no
+
+$as_echo "#define HAVE_DRIVE_LETTERS 1" >>confdefs.h
+
         try_gettext="no"
        use_simple_gettext=yes
+       mmap_needed=no
+        build_wks_tools=no
         ;;
     i?86-emx-os2 | i?86-*-os2*emx )
         # OS/2 with the EMX environment
@@ -7161,6 +8156,7 @@ $as_echo "#define USE_SIMPLE_GETTEXT 1" >>confdefs.h
 
         have_dosish_system=yes
         try_gettext="no"
+        build_wks_tools=no
         ;;
 
     i?86-*-msdosdjgpp*)
@@ -7170,24 +8166,19 @@ $as_echo "#define USE_SIMPLE_GETTEXT 1" >>confdefs.h
 
         have_dosish_system=yes
         try_gettext="no"
+        build_wks_tools=no
         ;;
 
-    *-*-freebsd*)
-       # FreeBSD
-       CPPFLAGS="$CPPFLAGS -I/usr/local/include"
-       LDFLAGS="$LDFLAGS -L/usr/local/lib"
-       ;;
-
     *-*-hpux*)
         if test -z "$GCC" ; then
-            CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
+            CFLAGS="-Ae -D_HPUX_SOURCE $CFLAGS"
         fi
         ;;
     *-dec-osf4*)
         if test -z "$GCC" ; then
             # Suppress all warnings
             # to get rid of the unsigned/signed char mismatch warnings.
-            CFLAGS="$CFLAGS -w"
+            CFLAGS="-w $CFLAGS"
         fi
         ;;
     *-dec-osf5*)
@@ -7196,15 +8187,36 @@ $as_echo "#define USE_SIMPLE_GETTEXT 1" >>confdefs.h
             # get rid of the unsigned/signed char mismatch warnings.
             # Using this may hide other pointer mismatch warnings, but
            # it at least lets other warning classes through
-            CFLAGS="$CFLAGS -msg_disable ptrmismatch1"
+            CFLAGS="-msg_disable ptrmismatch1 $CFLAGS"
         fi
         ;;
     m68k-atari-mint)
         ;;
+    *-linux-android*)
+        have_android_system=yes
+        # Android is fully utf-8 and we do not want to use iconv to
+        # keeps things simple
+        require_iconv=no
+        build_wks_tools=no
+        ;;
+    *-apple-darwin*)
+
+$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
+
+        ;;
+    *-*-netbsd*)
+        require_pipe_to_unblock_pselect=yes
+        ;;
     *)
-       ;;
+        ;;
 esac
 
+if test "$require_pipe_to_unblock_pselect" = yes; then
+
+$as_echo "#define HAVE_PSELECT_NO_EINTR 1" >>confdefs.h
+
+fi
+
 if test "$have_dosish_system" = yes; then
 
 $as_echo "#define HAVE_DOSISH_SYSTEM 1" >>confdefs.h
@@ -7232,6 +8244,18 @@ if test "$have_w32_system" = yes; then
 
 $as_echo "#define HAVE_W32_SYSTEM 1" >>confdefs.h
 
+   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
+
+done
+
 fi
  if test "$have_w32_system" = yes; then
   HAVE_W32_SYSTEM_TRUE=
@@ -7242,38 +8266,19 @@ else
 fi
 
 
-if test "$disable_keyserver_path" = yes; then
+if test "$have_android_system" = yes; then
 
-$as_echo "#define DISABLE_KEYSERVER_PATH 1" >>confdefs.h
+$as_echo "#define HAVE_ANDROID_SYSTEM 1" >>confdefs.h
 
 fi
-
-#
-# Allows enabling the use of a standard socket by default This is
-# gpg-agent's option --[no-]use-standard-socket.  For Windows we force
-# the use of this.
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use a standard socket by default" >&5
-$as_echo_n "checking whether to use a standard socket by default... " >&6; }
-# Check whether --enable-standard-socket was given.
-if test "${enable_standard_socket+set}" = set; then :
-  enableval=$enable_standard_socket; use_standard_socket=$enableval
-fi
-
-tmp=""
-if test "$use_standard_socket" != yes; then
-  if test "$have_w32_system" = yes; then
-    use_standard_socket=yes
-    tmp=" (forced)"
-  fi
+ if test "$have_android_system" = yes; then
+  HAVE_ANDROID_SYSTEM_TRUE=
+  HAVE_ANDROID_SYSTEM_FALSE='#'
+else
+  HAVE_ANDROID_SYSTEM_TRUE='#'
+  HAVE_ANDROID_SYSTEM_FALSE=
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_standard_socket$tmp" >&5
-$as_echo "$use_standard_socket$tmp" >&6; }
-if test "$use_standard_socket" = yes; then
 
-$as_echo "#define USE_STANDARD_SOCKET 1" >>confdefs.h
-
-fi
 
 
 # (These need to go after AC_PROG_CC so that $EXEEXT is defined)
@@ -7283,17 +8288,6 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-if test x"$try_hkp" = xyes ; then
-  GPGKEYS_HKP="gpg2keys_hkp$EXEEXT"
-
-fi
-
-if test x"$try_finger" = xyes ; then
-  GPGKEYS_FINGER="gpg2keys_finger$EXEEXT"
-
-fi
-
-
 
 #
 # Checks for libraries.
@@ -7303,20 +8297,41 @@ $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.
+if test "${with_libgpg_error_prefix+set}" = set; then :
+  withval=$with_libgpg_error_prefix; gpg_error_config_prefix="$withval"
+fi
+
+
 
 # Check whether --with-gpg-error-prefix was given.
 if test "${with_gpg_error_prefix+set}" = set; then :
   withval=$with_gpg_error_prefix; gpg_error_config_prefix="$withval"
-else
-  gpg_error_config_prefix=""
 fi
 
-  if test x$gpg_error_config_prefix != x ; then
-     if test x${GPG_ERROR_CONFIG+set} != xset ; then
-        GPG_ERROR_CONFIG=$gpg_error_config_prefix/bin/gpg-error-config
+
+  if test x"${GPG_ERROR_CONFIG}" = x ; then
+     if test x"${gpg_error_config_prefix}" != x ; then
+        GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config"
+     else
+       case "${SYSROOT}" in
+         /*)
+           if test -x "${SYSROOT}/bin/gpg-error-config" ; then
+             GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-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
 
@@ -7338,7 +8353,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_GPG_ERROR_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
@@ -7361,16 +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" ; 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 | \
@@ -7385,15 +8519,54 @@ $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_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
+    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
+*** built for $gpg_error_config_host and thus may not match the
+*** used host $host.
+*** 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
+*** built for $gpg_error_config_host and thus may not match the
+*** used host $host.
+*** 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"
+      fi
+    fi
   else
     GPG_ERROR_CFLAGS=""
     GPG_ERROR_LIBS=""
+    GPG_ERROR_MT_CFLAGS=""
+    GPG_ERROR_MT_LIBS=""
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
     have_gpg_error=no
@@ -7403,10 +8576,13 @@ $as_echo "no" >&6; }
 
 
 
+
+
 #
 # Libgcrypt is our generic crypto library
 #
 
+
 # Check whether --with-libgcrypt-prefix was given.
 if test "${with_libgcrypt_prefix+set}" = set; then :
   withval=$with_libgcrypt_prefix; libgcrypt_config_prefix="$withval"
@@ -7414,13 +8590,38 @@ else
   libgcrypt_config_prefix=""
 fi
 
-  if test x$libgcrypt_config_prefix != x ; then
-     if test x${LIBGCRYPT_CONFIG+set} != xset ; then
-        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
+  if test x"${LIBGCRYPT_CONFIG}" = x ; then
+     if test x"${libgcrypt_config_prefix}" != x ; then
+        LIBGCRYPT_CONFIG="${libgcrypt_config_prefix}/bin/libgcrypt-config"
      fi
   fi
 
-  # Extract the first word of "libgcrypt-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 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"
+           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 "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; }
@@ -7438,7 +8639,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_LIBGCRYPT_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
@@ -7461,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/'`
@@ -7480,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 | \
@@ -7514,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; }
@@ -7533,6 +8744,32 @@ $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
+    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
+*** 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
+*** to specify a matching config script or use \$SYSROOT.
+***" >&5
+$as_echo "$as_me: WARNING:
+***
+*** 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
+*** to specify a matching config script or use \$SYSROOT.
+***" >&2;}
+        gpg_config_script_warn="$gpg_config_script_warn libgcrypt"
+      fi
+    fi
   else
     LIBGCRYPT_CFLAGS=""
     LIBGCRYPT_LIBS=""
@@ -7541,12 +8778,35 @@ $as_echo "does not match. want=$req_libgcrypt_api got=$tmp" >&6; }
 
 
 
-
+# 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"
@@ -7555,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; }
@@ -7578,7 +8848,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_LIBASSUAN_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
@@ -7601,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
@@ -7611,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; }
@@ -7660,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; }
@@ -7676,10 +8952,39 @@ $as_echo "does not match.  want=$req_libassuan_api got=$tmp." >&6; }
     fi
   fi
 
+  if test $ok = yes; then
+    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 $libassuan_config_args --cflags`
-    LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG $libassuan_config_args --libs`
+    LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG --cflags`
+    LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG --libs`
     have_libassuan=yes
   else
     LIBASSUAN_CFLAGS=""
@@ -7695,14 +9000,24 @@ cat >>confdefs.h <<_ACEOF
 #define GNUPG_LIBASSUAN_VERSION "$libassuan_version"
 _ACEOF
 
+  show_tor_support="only .onion"
 fi
 
 
-
 #
 # libksba is our X.509 support library
 #
 
+
+# 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"
@@ -7710,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; }
@@ -7735,7 +9060,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_KSBA_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
@@ -7758,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/'`
@@ -7777,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 | \
@@ -7811,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; }
@@ -7827,9 +9162,34 @@ $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
+    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 \"$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
+*** to specify a matching config script.
+***" >&5
+$as_echo "$as_me: WARNING:
+***
+*** 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
+*** to specify a matching config script.
+***" >&2;}
+      fi
+    fi
   else
     KSBA_CFLAGS=""
     KSBA_LIBS=""
@@ -7844,14 +9204,37 @@ $as_echo "does not match.  want=$req_ksba_api got=$tmp." >&6; }
 # libusb allows us to use the integrated CCID smartcard reader driver.
 #
 # FiXME: Use GNUPG_CHECK_LIBUSB and modify to use separate AC_SUBSTs.
-if test "$use_ccid_driver" = yes ; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usb_bulk_write in -lusb" >&5
-$as_echo_n "checking for usb_bulk_write in -lusb... " >&6; }
-if ${ac_cv_lib_usb_usb_bulk_write+:} false; then :
+if test "$use_ccid_driver" = auto || test "$use_ccid_driver" = yes; then
+   case "${host}" in
+     *-mingw32*)
+       LIBUSB_NAME=
+       LIBUSB_LIBS=
+       LIBUSB_CPPFLAGS=
+       ;;
+     *-*-darwin*)
+       LIBUSB_NAME=usb-1.0
+       LIBUSB_LIBS="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit"
+       ;;
+     *-*-freebsd*)
+       # FreeBSD has a native 1.0 compatible library by -lusb.
+       LIBUSB_NAME=usb
+       LIBUSB_LIBS=
+       ;;
+     *)
+       LIBUSB_NAME=usb-1.0
+       LIBUSB_LIBS=
+       ;;
+   esac
+fi
+if test x"$LIBUSB_NAME" != x ; then
+   as_ac_Lib=`$as_echo "ac_cv_lib_$LIBUSB_NAME''_libusb_init" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libusb_init in -l$LIBUSB_NAME" >&5
+$as_echo_n "checking for libusb_init in -l$LIBUSB_NAME... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lusb  $LIBS"
+LIBS="-l$LIBUSB_NAME  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -7861,51 +9244,85 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char usb_bulk_write ();
+char libusb_init ();
 int
 main ()
 {
-return usb_bulk_write ();
+return libusb_init ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_usb_usb_bulk_write=yes
+  eval "$as_ac_Lib=yes"
 else
-  ac_cv_lib_usb_usb_bulk_write=no
+  eval "$as_ac_Lib=no"
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_usb_usb_bulk_write" >&5
-$as_echo "$ac_cv_lib_usb_usb_bulk_write" >&6; }
-if test "x$ac_cv_lib_usb_usb_bulk_write" = xyes; then :
-   LIBUSB_LIBS="$LIBUSB_LIBS -lusb"
-
-$as_echo "#define HAVE_LIBUSB 1" >>confdefs.h
-
+eval ac_res=\$$as_ac_Lib
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+   LIBUSB_LIBS="-l$LIBUSB_NAME $LIBUSB_LIBS"
                   have_libusb=yes
-
 fi
 
-  for ac_func in usb_create_match
-do :
-  ac_fn_c_check_func "$LINENO" "usb_create_match" "ac_cv_func_usb_create_match"
-if test "x$ac_cv_func_usb_create_match" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_USB_CREATE_MATCH 1
-_ACEOF
-
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking libusb include dir" >&5
+$as_echo_n "checking libusb include dir... " >&6; }
+   usb_incdir_found="no"
+   for _incdir in "" "/usr/include/libusb-1.0" \
+       "/usr/local/include/libusb-1.0" "/usr/pkg/include/libusb-1.0"; do
+     _libusb_save_cppflags=$CPPFLAGS
+     if test -n "${_incdir}"; then
+       CPPFLAGS="-I${_incdir} ${CPPFLAGS}"
+     fi
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <libusb.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  usb_incdir=${_incdir}; usb_incdir_found="yes"
 fi
-done
+rm -f conftest.err conftest.i conftest.$ac_ext
+     CPPFLAGS=${_libusb_save_cppflags}
+     if test "$usb_incdir_found" = "yes"; then
+       break
+     fi
+   done
+   if test "$usb_incdir_found" = "yes"; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${usb_incdir}" >&5
+$as_echo "${usb_incdir}" >&6; }
+   else
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+     usb_incdir=""
+     have_libusb=no
+     if test "$use_ccid_driver" != yes; then
+       use_ccid_driver=no
+     fi
+     LIBUSB_LIBS=""
+   fi
 
+   if test "$have_libusb" = yes; then
+
+$as_echo "#define HAVE_LIBUSB 1" >>confdefs.h
+
+   fi
+   if test x"$usb_incdir" = x; then
+     LIBUSB_CPPFLAGS=""
+   else
+     LIBUSB_CPPFLAGS="-I${usb_incdir}"
+   fi
 fi
 
 
+
 #
-# Check wether it is necessary to link against libdl.
+# Check whether it is necessary to link against libdl.
+# (For example to load libpcsclite)
 #
 gnupg_dlopen_save_libs="$LIBS"
 LIBS=""
@@ -7969,68 +9386,190 @@ DL_LIBS=$LIBS
 
 LIBS="$gnupg_dlopen_save_libs"
 
-#
-# Checks 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
+# Checks for g10
+
+# Check whether --enable-sqlite was given.
+if test "${enable_sqlite+set}" = set; then :
+  enableval=$enable_sqlite; try_sqlite=$enableval
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lutil  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  try_sqlite=yes
+fi
 
-/* 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
+
+if test x"$use_tofu" = xyes ; then
+  if test x"$try_sqlite" = xyes ; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SQLITE3" >&5
+$as_echo_n "checking for SQLITE3... " >&6; }
+
+if test -n "$SQLITE3_CFLAGS"; then
+    pkg_cv_SQLITE3_CFLAGS="$SQLITE3_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3 >= \$NEED_SQLITE_VERSION\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "sqlite3 >= $NEED_SQLITE_VERSION") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SQLITE3_CFLAGS=`$PKG_CONFIG --cflags "sqlite3 >= $NEED_SQLITE_VERSION" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
 else
-  ac_cv_lib_util_openpty=no
+  pkg_failed=yes
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ else
+    pkg_failed=untried
+fi
+if test -n "$SQLITE3_LIBS"; then
+    pkg_cv_SQLITE3_LIBS="$SQLITE3_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sqlite3 >= \$NEED_SQLITE_VERSION\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "sqlite3 >= $NEED_SQLITE_VERSION") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SQLITE3_LIBS=`$PKG_CONFIG --libs "sqlite3 >= $NEED_SQLITE_VERSION" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               SQLITE3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sqlite3 >= $NEED_SQLITE_VERSION" 2>&1`
+        else
+               SQLITE3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sqlite3 >= $NEED_SQLITE_VERSION" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$SQLITE3_PKG_ERRORS" >&5
+
+       have_sqlite=no
+elif test $pkg_failed = untried; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       have_sqlite=no
+else
+       SQLITE3_CFLAGS=$pkg_cv_SQLITE3_CFLAGS
+       SQLITE3_LIBS=$pkg_cv_SQLITE3_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       have_sqlite=yes
+fi
+  fi
+  if test "$have_sqlite" = "yes"; then
+    :
+
+
+  else
+    use_tofu=no
+    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 and Keyboxd disabled
+***
+*** $tmp" >&5
+$as_echo "$as_me: WARNING:
+***
+*** 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=
+  SQLITE3_FALSE='#'
+else
+  SQLITE3_TRUE='#'
+  SQLITE3_FALSE=
+fi
+
+
+if test x"$use_tofu" = xyes ; then
+
+$as_echo "#define USE_TOFU 1" >>confdefs.h
+
 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
 
+# Checks for g13
+
+# Extract the first word of "encfs", so it can be a program name with args.
+set dummy encfs; 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_ENCFS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ENCFS in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ENCFS="$ENCFS" # 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_ENCFS="$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_ENCFS" && ac_cv_path_ENCFS="/usr/bin/encfs"
+  ;;
+esac
+fi
+ENCFS=$ac_cv_path_ENCFS
+if test -n "$ENCFS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENCFS" >&5
+$as_echo "$ENCFS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 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
+cat >>confdefs.h <<_ACEOF
+#define ENCFS "${ENCFS}"
+_ACEOF
+
+
+# Extract the first word of "fusermount", so it can be a program name with args.
+set dummy fusermount; 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 :
+if ${ac_cv_path_FUSERMOUNT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $SHRED in
+  case $FUSERMOUNT in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_SHRED="$SHRED" # Let the user override the test with a path.
+  ac_cv_path_FUSERMOUNT="$FUSERMOUNT" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -8039,8 +9578,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_SHRED="$as_dir/$ac_word$ac_exec_ext"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_FUSERMOUNT="$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
@@ -8048,14 +9587,14 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_SHRED" && ac_cv_path_SHRED="/usr/bin/shred"
+  test -z "$ac_cv_path_FUSERMOUNT" && ac_cv_path_FUSERMOUNT="/usr/bin/fusermount"
   ;;
 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; }
+FUSERMOUNT=$ac_cv_path_FUSERMOUNT
+if test -n "$FUSERMOUNT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FUSERMOUNT" >&5
+$as_echo "$FUSERMOUNT" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -8064,37 +9603,47 @@ fi
 
 
 cat >>confdefs.h <<_ACEOF
-#define SHRED "${SHRED}"
+#define FUSERMOUNT "${FUSERMOUNT}"
 _ACEOF
 
 
 
 
 #
-# Check whether the GNU Pth library is available
-# Note, that we include a Pth emulation for W32.
+# Check whether the nPth library is available
 #
 
-# Check whether --with-pth-prefix was given.
-if test "${with_pth_prefix+set}" = set; then :
-  withval=$with_pth_prefix; pth_config_prefix="$withval"
+# Check whether --with-npth-prefix was given.
+if test "${with_npth_prefix+set}" = set; then :
+  withval=$with_npth_prefix; npth_config_prefix="$withval"
 else
-  pth_config_prefix=""
+  npth_config_prefix=""
 fi
 
-  if test x$pth_config_prefix != x ; then
-     PTH_CONFIG="$pth_config_prefix/bin/pth-config"
+  if test "x$npth_config_prefix" != x ; then
+      NPTH_CONFIG="$npth_config_prefix/bin/npth-config"
   fi
-  # Extract the first word of "pth-config", so it can be a program name with args.
-set dummy pth-config; ac_word=$2
+
+  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; }
-if ${ac_cv_path_PTH_CONFIG+:} false; then :
+if ${ac_cv_path_NPTH_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $PTH_CONFIG in
+  case $NPTH_CONFIG in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_PTH_CONFIG="$PTH_CONFIG" # Let the user override the test with a path.
+  ac_cv_path_NPTH_CONFIG="$NPTH_CONFIG" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -8103,8 +9652,8 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_PTH_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_NPTH_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
@@ -8112,203 +9661,528 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_PTH_CONFIG" && ac_cv_path_PTH_CONFIG="no"
+  test -z "$ac_cv_path_NPTH_CONFIG" && ac_cv_path_NPTH_CONFIG="no"
   ;;
 esac
 fi
-PTH_CONFIG=$ac_cv_path_PTH_CONFIG
-if test -n "$PTH_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTH_CONFIG" >&5
-$as_echo "$PTH_CONFIG" >&6; }
+NPTH_CONFIG=$ac_cv_path_NPTH_CONFIG
+if test -n "$NPTH_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NPTH_CONFIG" >&5
+$as_echo "$NPTH_CONFIG" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  tmp=1.3.7
-  if test "$PTH_CONFIG" != "no"; then
-
-    _pth_version=`$PTH_CONFIG --version | awk 'NR==1 {print $3}'`
-    _req_version="$tmp"
+  fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTH - version >= $_req_version" >&5
-$as_echo_n "checking for PTH - version >= $_req_version... " >&6; }
-    for _var in _pth_version _req_version; do
-        eval "_val=\"\$${_var}\""
-        _major=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\1/'`
-        _minor=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\2/'`
-        _rtype=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\3/'`
-        _micro=`echo $_val | sed 's/\([0-9]*\)\.\([0-9]*\)\([ab.]\)\([0-9]*\)/\4/'`
-        case $_rtype in
-            "a" ) _rtype=0 ;;
-            "b" ) _rtype=1 ;;
-            "." ) _rtype=2 ;;
-        esac
-        _hex=`echo dummy | awk '{ printf("%d%02d%1d%02d", major, minor, rtype, micro); }' \
-              "major=$_major" "minor=$_minor" "rtype=$_rtype" "micro=$_micro"`
-        eval "${_var}_hex=\"\$_hex\""
-    done
-    have_pth=no
-    if test ".$_pth_version_hex" != .; then
-        if test ".$_req_version_hex" != .; then
-            if test $_pth_version_hex -ge $_req_version_hex; then
-                have_pth=yes
-            fi
-        fi
+  if test "$NPTH_CONFIG" != "no" ; then
+    if test -z "$use_gpgrt_config"; then
+      npth_version=`$NPTH_CONFIG --version`
+    else
+      npth_version=`$NPTH_CONFIG --modversion`
     fi
-    if test $have_pth = yes; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether PTH installation is sane" >&5
-$as_echo_n "checking whether PTH installation is sane... " >&6; }
-       if ${gnupg_cv_pth_is_sane+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-         _gnupg_pth_save_cflags=$CFLAGS
-         _gnupg_pth_save_ldflags=$LDFLAGS
-         _gnupg_pth_save_libs=$LIBS
-         CFLAGS="$CFLAGS `$PTH_CONFIG --cflags`"
-         LDFLAGS="$LDFLAGS `$PTH_CONFIG --ldflags`"
-         LIBS="$LIBS `$PTH_CONFIG --libs --all`"
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pth.h>
-
-int
-main ()
-{
- pth_init ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gnupg_cv_pth_is_sane=yes
-else
-  gnupg_cv_pth_is_sane=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-         CFLAGS=$_gnupg_pth_save_cflags
-         LDFLAGS=$_gnupg_pth_save_ldflags
-         LIBS=$_gnupg_pth_save_libs
+  fi
+  npth_version_major=`echo $npth_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'`
+  npth_version_minor=`echo $npth_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\).*/\2/'`
 
-fi
+   tmp="$NEED_NPTH_API:$NEED_NPTH_VERSION"
+  if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+     req_npth_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
+     min_npth_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
+  else
+     req_npth_api=1
+     min_npth_version="$tmp"
+  fi
 
-       if test $gnupg_cv_pth_is_sane != yes; then
-          have_pth=no
-       fi
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_pth_is_sane" >&5
-$as_echo "$gnupg_cv_pth_is_sane" >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NPTH - version >= $min_npth_version" >&5
+$as_echo_n "checking for NPTH - version >= $min_npth_version... " >&6; }
+  ok=no
+  if test "$NPTH_CONFIG" != "no" ; then
+    req_major=`echo $min_npth_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)/\1/'`
+    req_minor=`echo $min_npth_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)/\2/'`
+    if test "$npth_version_major" -gt "$req_major"; then
+        ok=yes
     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+        if test "$npth_version_major" -eq "$req_major"; then
+            if test "$npth_version_minor" -gt "$req_minor"; then
+               ok=yes
+            else
+               if test "$npth_version_minor" -eq "$req_minor"; then
+                  ok=yes
+               fi
+            fi
+        fi
+    fi
+  fi
+  if test $ok = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($npth_version)" >&5
+$as_echo "yes ($npth_version)" >&6; }
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $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 test -z "$use_gpgrt_config"; then
+        tmp=`$NPTH_CONFIG --api-version 2>/dev/null || echo 0`
+      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
+$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
+$as_echo "does not match. want=$req_npth_api got=$tmp" >&6; }
+        fi
+      fi
     fi
-
-    if test $have_pth = yes; then
-       PTH_CFLAGS=`$PTH_CONFIG --cflags`
-       PTH_LIBS=`$PTH_CONFIG --ldflags`
-       PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs --all`"
-
-$as_echo "#define HAVE_PTH 1" >>confdefs.h
-
+  fi
+  if test $ok = yes; then
+    NPTH_CFLAGS=`$NPTH_CONFIG --cflags`
+    NPTH_LIBS=`$NPTH_CONFIG --libs`
+    have_npth=yes
+    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
+*** 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
+*** to specify a matching config script.
+***" >&5
+$as_echo "$as_me: WARNING:
+***
+*** 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
+*** to specify a matching config script.
+***" >&2;}
+      fi
     fi
+  else
+    NPTH_CFLAGS=""
+    NPTH_LIBS=""
+    have_npth=no
   fi
 
 
 
-if test "$have_pth" = "yes"; then
+if test "$have_npth" = "yes"; then
 
-$as_echo "#define USE_GNU_PTH 1" >>confdefs.h
+$as_echo "#define HAVE_NPTH 1" >>confdefs.h
+
+
+$as_echo "#define USE_NPTH 1" >>confdefs.h
 
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
 ***
-*** To support concurrent access to the gpg-agent and the SCdaemon
-*** we need the support of the GNU Portable Threads Library.
-*** Download it from ftp://ftp.gnu.org/gnu/pth/
-*** On a Debian GNU/Linux system you might want to try
-***   apt-get install libpth-dev
+*** To support concurrent access for example in gpg-agent and the SCdaemon
+*** we need the support of the New Portable Threads Library.
 ***" >&5
 $as_echo "$as_me: WARNING:
 ***
-*** To support concurrent access to the gpg-agent and the SCdaemon
-*** we need the support of the GNU Portable Threads Library.
-*** Download it from ftp://ftp.gnu.org/gnu/pth/
-*** On a Debian GNU/Linux system you might want to try
-***   apt-get install libpth-dev
+*** To support concurrent access for example in gpg-agent and the SCdaemon
+*** we need the support of the New Portable Threads Library.
 ***" >&2;}
 fi
+#
+# Enable debugging of nPth
+#
+# Check whether --enable-npth-debug was given.
+if test "${enable_npth_debug+set}" = set; then :
+  enableval=$enable_npth_debug; if test $enableval = yes ; then
 
+$as_echo "#define NPTH_ENABLE_DEBUG 1" >>confdefs.h
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for networking options" >&5
-$as_echo "$as_me: checking for networking options" >&6;}
+                  fi
+fi
 
-#
-# Must check for network library requirements before doing link tests
-# for ldap, for example. If ldap libs are static (or dynamic and without
-# ELF runtime link paths), then link will fail and LDAP support won't
-# be detected.
-#
-ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes; then :
 
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $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 gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_nsl_gethostbyname=yes
+
+#
+# NTBTLS is our TLS library.  If it is not available we fall back to
+# GNUTLS.
+#
+# Check whether --enable-ntbtls was given.
+if test "${enable_ntbtls+set}" = set; then :
+  enableval=$enable_ntbtls; try_ntbtls=$enableval
 else
-  ac_cv_lib_nsl_gethostbyname=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_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
-  NETLIBS="-lnsl $NETLIBS"
+  try_ntbtls=yes
 fi
 
-fi
+if test x"$try_ntbtls" = xyes ; then
 
-ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
-if test "x$ac_cv_func_setsockopt" = xyes; then :
 
+# Check whether --with-ntbtls-prefix was given.
+if test "${with_ntbtls_prefix+set}" = set; then :
+  withval=$with_ntbtls_prefix; ntbtls_config_prefix="$withval"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
-$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_setsockopt+:} false; then :
+  ntbtls_config_prefix=""
+fi
+
+  if test x"${NTBTLS_CONFIG}" = x ; then
+     if test x"${ntbtls_config_prefix}" != x ; then
+        NTBTLS_CONFIG="${ntbtls_config_prefix}/bin/ntbtls-config"
+     fi
+  fi
+
+  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; }
+if ${ac_cv_path_NTBTLS_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $NTBTLS_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_NTBTLS_CONFIG="$NTBTLS_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_NTBTLS_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_NTBTLS_CONFIG" && ac_cv_path_NTBTLS_CONFIG="no"
+  ;;
+esac
+fi
+NTBTLS_CONFIG=$ac_cv_path_NTBTLS_CONFIG
+if test -n "$NTBTLS_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NTBTLS_CONFIG" >&5
+$as_echo "$NTBTLS_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$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/'`
+     min_ntbtls_version=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\2/'`
+  else
+     req_ntbtls_api=0
+     min_ntbtls_version="$tmp"
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NTBTLS - version >= $min_ntbtls_version" >&5
+$as_echo_n "checking for NTBTLS - version >= $min_ntbtls_version... " >&6; }
+  ok=no
+  if test "$NTBTLS_CONFIG" != "no" ; then
+    req_major=`echo $min_ntbtls_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'`
+    req_minor=`echo $min_ntbtls_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'`
+    req_micro=`echo $min_ntbtls_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'`
+    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 | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'`
+    micro=`echo $ntbtls_config_version | \
+               sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'`
+    if test "$major" -gt "$req_major"; then
+        ok=yes
+    else
+        if test "$major" -eq "$req_major"; then
+            if test "$minor" -gt "$req_minor"; then
+               ok=yes
+            else
+               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 ($ntbtls_config_version)" >&5
+$as_echo "yes ($ntbtls_config_version)" >&6; }
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  fi
+  if test $ok = yes; then
+     # If we have a recent ntbtls, we should also check that the
+     # API is compatible
+     if test "$req_ntbtls_api" -gt 0 ; then
+        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; }
+           if test "$req_ntbtls_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_ntbtls_api got=$tmp" >&5
+$as_echo "does not match. want=$req_ntbtls_api got=$tmp" >&6; }
+           fi
+        fi
+     fi
+  fi
+  if test $ok = yes; then
+    NTBTLS_CFLAGS=`$NTBTLS_CONFIG --cflags`
+    NTBTLS_LIBS=`$NTBTLS_CONFIG --libs`
+    have_ntbtls=yes
+    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
+*** 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
+*** to specify a matching config script or use \$SYSROOT.
+***" >&5
+$as_echo "$as_me: WARNING:
+***
+*** 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
+*** to specify a matching config script or use \$SYSROOT.
+***" >&2;}
+        gpg_config_script_warn="$gpg_config_script_warn ntbtls"
+      fi
+    fi
+  else
+    NTBTLS_CFLAGS=""
+    NTBTLS_LIBS=""
+    have_ntbtls=no
+  fi
+
+
+
+fi
+if test "$have_ntbtls" = yes ; then
+   use_tls_library=ntbtls
+
+$as_echo "#define HTTP_USE_NTBTLS 1" >>confdefs.h
+
+else
+  # Check whether --enable-gnutls was given.
+if test "${enable_gnutls+set}" = set; then :
+  enableval=$enable_gnutls; try_gnutls=$enableval
+else
+  try_gnutls=yes
+fi
+
+  if test x"$try_gnutls" = xyes ; then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBGNUTLS" >&5
+$as_echo_n "checking for LIBGNUTLS... " >&6; }
+
+if test -n "$LIBGNUTLS_CFLAGS"; then
+    pkg_cv_LIBGNUTLS_CFLAGS="$LIBGNUTLS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= \$NEED_GNUTLS_VERSION\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gnutls >= $NEED_GNUTLS_VERSION") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBGNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= $NEED_GNUTLS_VERSION" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$LIBGNUTLS_LIBS"; then
+    pkg_cv_LIBGNUTLS_LIBS="$LIBGNUTLS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= \$NEED_GNUTLS_VERSION\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "gnutls >= $NEED_GNUTLS_VERSION") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBGNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= $NEED_GNUTLS_VERSION" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               LIBGNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= $NEED_GNUTLS_VERSION" 2>&1`
+        else
+               LIBGNUTLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= $NEED_GNUTLS_VERSION" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$LIBGNUTLS_PKG_ERRORS" >&5
+
+       have_gnutls=no
+elif test $pkg_failed = untried; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       have_gnutls=no
+else
+       LIBGNUTLS_CFLAGS=$pkg_cv_LIBGNUTLS_CFLAGS
+       LIBGNUTLS_LIBS=$pkg_cv_LIBGNUTLS_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       have_gnutls=yes
+fi
+  fi
+  if test "$have_gnutls" = "yes"; then
+
+
+    use_tls_library=gnutls
+
+$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:
+***
+*** Neither NTBTLS nor GNUTLS available - not building dirmngr.
+***
+*** $tmp" >&5
+$as_echo "$as_me: WARNING:
+***
+*** Neither NTBTLS nor GNUTLS available - not building dirmngr.
+***
+*** $tmp" >&2;}
+  fi
+fi
+
+#
+# Allow to set a fixed trust store file for system provided certificates.
+#
+
+# Check whether --with-default-trust-store-file was given.
+if test "${with_default_trust_store_file+set}" = set; then :
+  withval=$with_default_trust_store_file; default_trust_store_file="$withval"
+else
+  default_trust_store_file=""
+fi
+
+if test x"$default_trust_store_file" = xno;then
+  default_trust_store_file=""
+fi
+if test x"$default_trust_store_file" != x ; then
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_TRUST_STORE_FILE "$default_trust_store_file"
+_ACEOF
+
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for networking options" >&5
+$as_echo "$as_me: checking for networking options" >&6;}
+
+#
+# Must check for network library requirements before doing link tests
+# for ldap, for example. If ldap libs are static (or dynamic and without
+# ELF runtime link paths), then link will fail and LDAP support won't
+# be detected.
+#
+ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
+if test "x$ac_cv_func_gethostbyname" = xyes; then :
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
+if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
+LIBS="-lnsl  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8318,63 +10192,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char setsockopt ();
+char gethostbyname ();
 int
 main ()
 {
-return setsockopt ();
+return gethostbyname ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_socket_setsockopt=yes
+  ac_cv_lib_nsl_gethostbyname=yes
 else
-  ac_cv_lib_socket_setsockopt=no
+  ac_cv_lib_nsl_gethostbyname=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_socket_setsockopt" >&5
-$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
-if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
-  NETLIBS="-lsocket $NETLIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
+  NETLIBS="-lnsl $NETLIBS"
 fi
 
 fi
 
+ac_fn_c_check_func "$LINENO" "setsockopt" "ac_cv_func_setsockopt"
+if test "x$ac_cv_func_setsockopt" = xyes; then :
 
-
-#
-# Check for ADNS.
-#
-_cppflags="${CPPFLAGS}"
-_ldflags="${LDFLAGS}"
-
-# Check whether --with-adns was given.
-if test "${with_adns+set}" = set; then :
-  withval=$with_adns; if test -d "$withval"; then
-               CPPFLAGS="${CPPFLAGS} -I$withval/include"
-               LDFLAGS="${LDFLAGS} -L$withval/lib"
-             fi
-fi
-
-if test "$with_adns" != "no"; then
-  for ac_header in adns.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "adns.h" "ac_cv_header_adns_h" "$ac_includes_default"
-if test "x$ac_cv_header_adns_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ADNS_H 1
-_ACEOF
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for adns_init in -ladns" >&5
-$as_echo_n "checking for adns_init in -ladns... " >&6; }
-if ${ac_cv_lib_adns_adns_init+:} false; then :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setsockopt in -lsocket" >&5
+$as_echo_n "checking for setsockopt in -lsocket... " >&6; }
+if ${ac_cv_lib_socket_setsockopt+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-ladns  $LIBS"
+LIBS="-lsocket  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -8384,99 +10238,53 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 #ifdef __cplusplus
 extern "C"
 #endif
-char adns_init ();
+char setsockopt ();
 int
 main ()
 {
-return adns_init ();
+return setsockopt ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_adns_adns_init=yes
+  ac_cv_lib_socket_setsockopt=yes
 else
-  ac_cv_lib_adns_adns_init=no
+  ac_cv_lib_socket_setsockopt=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_adns_adns_init" >&5
-$as_echo "$ac_cv_lib_adns_adns_init" >&6; }
-if test "x$ac_cv_lib_adns_adns_init" = xyes; then :
-  have_adns=yes
-else
-  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
-fi
-
-else
-  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
-fi
-
-done
-
-fi
-if test "$have_adns" = "yes"; then
-  ADNSLIBS="-ladns"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_setsockopt" >&5
+$as_echo "$ac_cv_lib_socket_setsockopt" >&6; }
+if test "x$ac_cv_lib_socket_setsockopt" = xyes; then :
+  NETLIBS="-lsocket $NETLIBS"
 fi
 
-# Newer adns versions feature a free function to be used under W32.
-for ac_func in adns_free
-do :
-  ac_fn_c_check_func "$LINENO" "adns_free" "ac_cv_func_adns_free"
-if test "x$ac_cv_func_adns_free" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ADNS_FREE 1
-_ACEOF
-
 fi
-done
 
 
 
 #
-# Now try for the resolver functions so we can use DNS for SRV, PA and CERT.
+# Check standard resolver functions.
 #
-if test x"$try_hkp" = xyes || test x"$try_http" = xyes ; then
-  # Check whether --enable-dns-srv was given.
-if test "${enable_dns_srv+set}" = set; then :
-  enableval=$enable_dns_srv; use_dns_srv=$enableval
-else
-  use_dns_srv=yes
-fi
+if test "$build_dirmngr" = "yes"; then
+  _dns_save_libs=$LIBS
+  LIBS=""
 
-fi
+  # Find the system resolver which can always be enabled with
+  # the dirmngr option --standard-resolver.
 
-# Check whether --enable-dns-pka was given.
-if test "${enable_dns_pka+set}" = set; then :
-  enableval=$enable_dns_pka; use_dns_pka=$enableval
+  # the double underscore thing is a glibc-ism?
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_query" >&5
+$as_echo_n "checking for library containing res_query... " >&6; }
+if ${ac_cv_search_res_query+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  use_dns_pka=yes
-fi
-
-
-# Check whether --enable-dns-cert was given.
-if test "${enable_dns_cert+set}" = set; then :
-  enableval=$enable_dns_cert; use_dns_cert=$enableval
-else
-  use_dns_cert=yes
-fi
-
-
-if test x"$use_dns_pka" = xyes || test x"$use_dns_srv" = xyes \
-   || test x"$use_dns_cert" = xyes; then
-  _dns_save_libs=$LIBS
-  LIBS=""
-  # the double underscore thing is a glibc-ism?
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_query" >&5
-$as_echo_n "checking for library containing res_query... " >&6; }
-if ${ac_cv_search_res_query+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  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
@@ -8699,6 +10507,67 @@ fi
 
 fi
 
+
+  # macOS renames dn_skipname into res_9_dn_skipname in <resolv.h>,
+  # and for some reason fools us into believing we don't need
+  # -lresolv even if we do.  Since the test program checking for the
+  # symbol does not include <resolv.h>, we need to check for the
+  # renamed symbol explicitly.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_dn_skipname" >&5
+$as_echo_n "checking for library containing res_9_dn_skipname... " >&6; }
+if ${ac_cv_search_res_9_dn_skipname+:} 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 res_9_dn_skipname ();
+int
+main ()
+{
+return res_9_dn_skipname ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' resolv bind; 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_res_9_dn_skipname=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_res_9_dn_skipname+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_res_9_dn_skipname+:} false; then :
+
+else
+  ac_cv_search_res_9_dn_skipname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_dn_skipname" >&5
+$as_echo "$ac_cv_search_res_9_dn_skipname" >&6; }
+ac_res=$ac_cv_search_res_9_dn_skipname
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dn_skipname" >&5
 $as_echo_n "checking for library containing dn_skipname... " >&6; }
 if ${ac_cv_search_dn_skipname+:} false; then :
 
 fi
 
+fi
+
 
   if test x"$have_resolver" != xno ; then
 
-    # Make sure that the BIND 4 resolver interface is workable before
-    # enabling any code that calls it.  At some point I'll rewrite the
-    # code to use the BIND 8 resolver API.
-    # We might also want to use adns instead.  Problem with ADNS is that
-    # it does not support v6.
+      # Make sure that the BIND 4 resolver interface is workable before
+      # enabling any code that calls it.  At some point I'll rewrite the
+      # code to use the BIND 8 resolver API.
+      # We might also want to use libdns instead.
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the resolver is usable" >&5
 $as_echo_n "checking whether the resolver is usable... " >&6; }
@@ -8857,9 +10727,9 @@ $as_echo "$have_resolver" >&6; }
     # define in bind 8 for some reason.
 
     if test x"$have_resolver" != xyes ; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether I can make the resolver usable with BIND_8_COMPAT" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether I can make the resolver usable with BIND_8_COMPAT" >&5
 $as_echo_n "checking whether I can make the resolver usable with BIND_8_COMPAT... " >&6; }
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #define BIND_8_COMPAT
 #include <sys/types.h>
@@ -8882,66 +10752,44 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_resolver" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_resolver" >&5
 $as_echo "$have_resolver" >&6; }
     fi
   fi
 
   if test x"$have_resolver" = xyes ; then
-     DNSLIBS=$LIBS
 
-     if test x"$use_dns_srv" = xyes ; then
+$as_echo "#define HAVE_SYSTEM_RESOLVER 1" >>confdefs.h
 
-$as_echo "#define USE_DNS_SRV 1" >>confdefs.h
-
-     fi
-
-     if test x"$use_dns_pka" = xyes ; then
-
-$as_echo "#define USE_DNS_PKA 1" >>confdefs.h
-
-     fi
-
-     if test x"$use_dns_cert" = xyes ; then
-
-$as_echo "#define USE_DNS_CERT 1" >>confdefs.h
-
-     fi
-
-     if test x"$need_compat" = xyes ; then
+    DNSLIBS="$DNSLIBS $LIBS"
+    if test x"$need_compat" = xyes ; then
 
 $as_echo "#define BIND_8_COMPAT 1" >>confdefs.h
 
-     fi
+    fi
+    if test "$use_libdns" = yes; then
+     show_tor_support=yes
+    fi
+  elif test "$use_libdns" = yes; then
+    show_tor_support=yes
   else
-     # If we have no resolver library but ADNS (e.g. under W32) enable the
-     # code parts which can be used with ADNS.
-     if test x"$have_adns" = xyes ; then
-        DNSLIBS="$ADNSLIBS"
-
-$as_echo "#define USE_ADNS 1" >>confdefs.h
-
-
-        if test x"$use_dns_srv" = xyes ; then
-           $as_echo "#define USE_DNS_SRV 1" >>confdefs.h
-
-        fi
-
-        if test x"$use_dns_pka" = xyes ; then
-           $as_echo "#define USE_DNS_PKA 1" >>confdefs.h
-
-        fi
-
-        if test x"$use_dns_cert" = xyes ; then
-
-$as_echo "#define USE_DNS_CERT 1" >>confdefs.h
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+***
+*** The system's DNS resolver is not usable.
+*** Dirmngr functionality is limited.
+***" >&5
+$as_echo "$as_me: WARNING:
+***
+*** The system's DNS resolver is not usable.
+*** Dirmngr functionality is limited.
+***" >&2;}
+    show_tor_support="${show_tor_support} (no system resolver)"
+  fi
 
-        fi
-     else
-        use_dns_srv=no
-        use_dns_pka=no
-        use_dns_cert=no
-     fi
+  if test "$have_w32_system" = yes; then
+    if test "$use_libdns" = yes; then
+      DNSLIBS="$DNSLIBS -liphlpapi"
+    fi
   fi
 
   LIBS=$_dns_save_libs
 
 
 
- if test x"$use_dns_srv" = xyes; then
-  USE_DNS_SRV_TRUE=
-  USE_DNS_SRV_FALSE='#'
-else
-  USE_DNS_SRV_TRUE='#'
-  USE_DNS_SRV_FALSE=
-fi
-
-
 
 #
 # Check for LDAP
 #
-if test "$try_ldap" = yes ; then
+# Note that running the check changes the variable
+# gnupg_have_ldap from "n/a" to "no" or "yes".
+
+# Check whether --enable-ldap was given.
+if test "${enable_ldap+set}" = set; then :
+  enableval=$enable_ldap; if test "$enableval" = "no"; then gnupg_have_ldap=no; fi
+fi
+
+
+if test "$gnupg_have_ldap" != "no" ; then
+  if test "$build_dirmngr" = "yes" ; then
 
 # Try and link a LDAP test program to weed out unusable LDAP
 # libraries.  -lldap [-llber [-lresolv]] is for older OpenLDAPs.
 # OpenLDAP, circa 1999, was terrible with creating weird dependencies.
 # If all else fails, the user can play guess-the-dependency by using
 # something like ./configure LDAPLIBS="-Lfoo -lbar"
-
+gnupg_have_ldap=no
 
 # Check whether --with-ldap was given.
 if test "${with_ldap+set}" = set; then :
@@ -9002,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
 
@@ -9029,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 ()
@@ -9059,6 +10910,7 @@ $as_echo "#define NEED_LBER_H 1" >>confdefs.h
         test "$gnupg_cv_func_ldaplber_init" = yes ; then
        LDAPLIBS="$LDAP_LDFLAGS $MY_LDAPLIBS"
        GPGKEYS_LDAP="gpg2keys_ldap$EXEEXT"
+       gnupg_have_ldap=yes
 
        for ac_func in ldap_get_option ldap_set_option
 do :
@@ -9132,154 +10984,119 @@ $as_echo "#define HAVE_LDAP_LD_ERRNO 1" >>confdefs.h
   LDFLAGS=$_ldap_save_ldflags
 fi
 
-fi
-
-#
-# Check for curl.  We fake the curl API if libcurl isn't installed.
-# We require 7.10 or later as we use curl_version_info().
-#
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ber_free in -llber" >&5
+$as_echo_n "checking for ber_free in -llber... " >&6; }
+if ${ac_cv_lib_lber_ber_free+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llber  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-# Check whether --with-libcurl was given.
-if test "${with_libcurl+set}" = set; then :
-  withval=$with_libcurl; _libcurl_with=$withval
+/* 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 ber_free ();
+int
+main ()
+{
+return ber_free ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lber_ber_free=yes
 else
-  _libcurl_with=yes
+  ac_cv_lib_lber_ber_free=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_lber_ber_free" >&5
+$as_echo "$ac_cv_lib_lber_ber_free" >&6; }
+if test "x$ac_cv_lib_lber_ber_free" = xyes; then :
+   LBER_LIBS="$LBER_LIBS -llber"
 
+$as_echo "#define HAVE_LBER 1" >>confdefs.h
 
-  if test "$_libcurl_with" != "no" ; then
+                    have_lber=yes
 
-     for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AWK="$ac_prog"
-    $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
+fi
 
+  fi
 fi
+
+if test "$gnupg_have_ldap" = "no"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:
+***
+*** Building without LDAP support.
+*** No CRL access or X.509 certificate search available.
+***" >&5
+$as_echo "$as_me: WARNING:
+***
+*** Building without LDAP support.
+*** No CRL access or X.509 certificate search available.
+***" >&2;}
 fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+
+ if test "$gnupg_have_ldap" = yes; then
+  USE_LDAP_TRUE=
+  USE_LDAP_FALSE='#'
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  USE_LDAP_TRUE='#'
+  USE_LDAP_FALSE=
 fi
 
+if test "$gnupg_have_ldap" = yes ; then
 
-  test -n "$AWK" && break
-done
+$as_echo "#define USE_LDAP 1" >>confdefs.h
 
+fi
 
-     _libcurl_version_parse="eval $AWK '{split(\$NF,A,\".\"); X=256*256*A[1]+256*A[2]+A[3]; print X;}'"
 
-     _libcurl_try_link=yes
 
-     if test -d "$_libcurl_with" ; then
-        LIBCURL_CPPFLAGS="-I$withval/include"
-        _libcurl_ldflags="-L$withval/lib"
-        # Extract the first word of ""$withval/bin/curl-config"", so it can be a program name with args.
-set dummy "$withval/bin/curl-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__libcurl_config+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $_libcurl_config in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path__libcurl_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
+#
+# Check for sendmail
+#
+# This isn't necessarily sendmail itself, but anything that gives a
+# sendmail-ish interface to the outside world.  That includes Exim,
+# Postfix, etc.  Basically, anything that can handle "sendmail -t".
 
-  ;;
-esac
-fi
-_libcurl_config=$ac_cv_path__libcurl_config
-if test -n "$_libcurl_config"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
-$as_echo "$_libcurl_config" >&6; }
+# Check whether --with-mailprog was given.
+if test "${with_mailprog+set}" = set; then :
+  withval=$with_mailprog;
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  with_mailprog=yes
 fi
 
-
-     else
-       # Extract the first word of "curl-config", so it can be a program name with args.
-set dummy curl-config; ac_word=$2
+if test x"$with_mailprog" = xyes ; then
+    # Extract the first word of "sendmail", so it can be a program name with args.
+set dummy sendmail; 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__libcurl_config+:} false; then :
+if ${ac_cv_path_SENDMAIL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  case $_libcurl_config in
+  case $SENDMAIL in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+  ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+as_dummy=""$PATH":/usr/sbin:/usr/libexec:/usr/lib"
+for as_dir in $as_dummy
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_SENDMAIL="$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
@@ -9290,314 +11107,28 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-_libcurl_config=$ac_cv_path__libcurl_config
-if test -n "$_libcurl_config"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_libcurl_config" >&5
-$as_echo "$_libcurl_config" >&6; }
+SENDMAIL=$ac_cv_path_SENDMAIL
+if test -n "$SENDMAIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SENDMAIL" >&5
+$as_echo "$SENDMAIL" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-     fi
+elif test x"$with_mailprog" != xno ; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a mail transport program" >&5
+$as_echo_n "checking for a mail transport program... " >&6; }
+    SENDMAIL=$with_mailprog
 
-     if test x$_libcurl_config != "x" ; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the version of libcurl" >&5
-$as_echo_n "checking for the version of libcurl... " >&6; }
-if ${libcurl_cv_lib_curl_version+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_mailprog" >&5
+$as_echo "$with_mailprog" >&6; }
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_version" >&5
-$as_echo "$libcurl_cv_lib_curl_version" >&6; }
 
-       _libcurl_version=`echo $libcurl_cv_lib_curl_version | $_libcurl_version_parse`
-       _libcurl_wanted=`echo 7.10 | $_libcurl_version_parse`
-
-        if test $_libcurl_wanted -gt 0 ; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcurl >= version 7.10" >&5
-$as_echo_n "checking for libcurl >= version 7.10... " >&6; }
-if ${libcurl_cv_lib_version_ok+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-             if test $_libcurl_version -ge $_libcurl_wanted ; then
-                libcurl_cv_lib_version_ok=yes
-             else
-                libcurl_cv_lib_version_ok=no
-             fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_version_ok" >&5
-$as_echo "$libcurl_cv_lib_version_ok" >&6; }
-        fi
-
-       if test $_libcurl_wanted -eq 0 || test x$libcurl_cv_lib_version_ok = xyes ; then
-           if test x"$LIBCURL_CPPFLAGS" = "x" ; then
-              LIBCURL_CPPFLAGS=`$_libcurl_config --cflags`
-           fi
-           if test x"$LIBCURL" = "x" ; then
-              LIBCURL=`$_libcurl_config --libs`
-
-              # This is so silly, but Apple actually has a bug in their
-             # curl-config script.  Fixed in Tiger, but there are still
-             # lots of Panther installs around.
-              case "${host}" in
-                 powerpc-apple-darwin7*)
-                    LIBCURL=`echo $LIBCURL | sed -e 's|-arch i386||g'`
-                 ;;
-              esac
-           fi
-
-          # All curl-config scripts support --feature
-          _libcurl_features=`$_libcurl_config --feature`
-
-           # Is it modern enough to have --protocols? (7.12.4)
-          if test $_libcurl_version -ge 461828 ; then
-              _libcurl_protocols=`$_libcurl_config --protocols`
-           fi
-       else
-           _libcurl_try_link=no
-       fi
-
-       unset _libcurl_wanted
-     fi
-
-     if test $_libcurl_try_link = yes ; then
-
-        # we didn't find curl-config, so let's see if the user-supplied
-        # link line (or failing that, "-lcurl") is enough.
-        LIBCURL=${LIBCURL-"$_libcurl_ldflags -lcurl"}
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcurl is usable" >&5
-$as_echo_n "checking whether libcurl is usable... " >&6; }
-if ${libcurl_cv_lib_curl_usable+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-           _libcurl_save_cppflags=$CPPFLAGS
-           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
-           _libcurl_save_libs=$LIBS
-           LIBS="$LIBCURL $LIBS"
-
-           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <curl/curl.h>
-int
-main ()
-{
-
-/* Try and use a few common options to force a failure if we are
-   missing symbols or cannot link. */
-int x;
-curl_easy_setopt(NULL,CURLOPT_URL,NULL);
-x=CURL_ERROR_SIZE;
-x=CURLOPT_WRITEFUNCTION;
-x=CURLOPT_FILE;
-x=CURLOPT_ERRORBUFFER;
-x=CURLOPT_STDERR;
-x=CURLOPT_VERBOSE;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  libcurl_cv_lib_curl_usable=yes
-else
-  libcurl_cv_lib_curl_usable=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-           CPPFLAGS=$_libcurl_save_cppflags
-           LIBS=$_libcurl_save_libs
-           unset _libcurl_save_cppflags
-           unset _libcurl_save_libs
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libcurl_cv_lib_curl_usable" >&5
-$as_echo "$libcurl_cv_lib_curl_usable" >&6; }
-
-        if test $libcurl_cv_lib_curl_usable = yes ; then
-
-          # Does curl_free() exist in this version of libcurl?
-          # If not, fake it with free()
-
-           _libcurl_save_cppflags=$CPPFLAGS
-           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
-           _libcurl_save_libs=$LIBS
-           LIBS="$LIBS $LIBCURL"
-
-           ac_fn_c_check_func "$LINENO" "curl_free" "ac_cv_func_curl_free"
-if test "x$ac_cv_func_curl_free" = xyes; then :
-
-else
-
-$as_echo "#define curl_free free" >>confdefs.h
-
-fi
-
-
-           CPPFLAGS=$_libcurl_save_cppflags
-           LIBS=$_libcurl_save_libs
-           unset _libcurl_save_cppflags
-           unset _libcurl_save_libs
-
-
-$as_echo "#define HAVE_LIBCURL 1" >>confdefs.h
-
-
-
-
-           for _libcurl_feature in $_libcurl_features ; do
-             cat >>confdefs.h <<_ACEOF
-#define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1
-_ACEOF
-
-             eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes
-           done
-
-          if test "x$_libcurl_protocols" = "x" ; then
-
-             # We don't have --protocols, so just assume that all
-             # protocols are available
-             _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
-
-             if test x$libcurl_feature_SSL = xyes ; then
-                _libcurl_protocols="$_libcurl_protocols HTTPS"
-
-                # FTPS wasn't standards-compliant until version
-                # 7.11.0
-                if test $_libcurl_version -ge 461568; then
-                   _libcurl_protocols="$_libcurl_protocols FTPS"
-                fi
-             fi
-          fi
-
-          for _libcurl_protocol in $_libcurl_protocols ; do
-             cat >>confdefs.h <<_ACEOF
-#define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1
-_ACEOF
-
-             eval `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_sh`=yes
-           done
-       else
-          unset LIBCURL
-          unset LIBCURL_CPPFLAGS
-        fi
-     fi
-
-     unset _libcurl_try_link
-     unset _libcurl_version_parse
-     unset _libcurl_config
-     unset _libcurl_feature
-     unset _libcurl_features
-     unset _libcurl_protocol
-     unset _libcurl_protocols
-     unset _libcurl_version
-     unset _libcurl_ldflags
-  fi
-
-  if test x$_libcurl_with = xno || test x$libcurl_cv_lib_curl_usable != xyes ; then
-     # This is the IF-NO path
-     fake_curl=yes
-  else
-     # This is the IF-YES path
-     :
-  fi
-
-  unset _libcurl_with
-
- if test x"$fake_curl" = xyes; then
-  FAKE_CURL_TRUE=
-  FAKE_CURL_FALSE='#'
-else
-  FAKE_CURL_TRUE='#'
-  FAKE_CURL_FALSE=
-fi
-
-
-# Generic, for us, means curl
-
-if test x"$try_generic" = xyes ; then
-   GPGKEYS_CURL="gpg2keys_curl$EXEEXT"
-
-fi
-
-#
-# Check for sendmail
-#
-# This isn't necessarily sendmail itself, but anything that gives a
-# sendmail-ish interface to the outside world.  That includes Exim,
-# Postfix, etc.  Basically, anything that can handle "sendmail -t".
-if test "$try_mailto" = yes ; then
-
-# Check whether --with-mailprog was given.
-if test "${with_mailprog+set}" = set; then :
-  withval=$with_mailprog;
-else
-  with_mailprog=yes
-fi
-
-
-  if test x"$with_mailprog" = xyes ; then
-    # Extract the first word of "sendmail", so it can be a program name with args.
-set dummy sendmail; 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_SENDMAIL+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $SENDMAIL in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="$PATH:/usr/sbin:/usr/libexec:/usr/lib"
-for as_dir in $as_dummy
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_path_SENDMAIL="$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
-SENDMAIL=$ac_cv_path_SENDMAIL
-if test -n "$SENDMAIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SENDMAIL" >&5
-$as_echo "$SENDMAIL" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    if test "$ac_cv_path_SENDMAIL" ; then
-      GPGKEYS_MAILTO="gpg2keys_mailto"
-    fi
-  elif test x"$with_mailprog" != xno ; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a mail transport program" >&5
-$as_echo_n "checking for a mail transport program... " >&6; }
-    SENDMAIL=$with_mailprog
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_mailprog" >&5
-$as_echo "$with_mailprog" >&6; }
-    GPGKEYS_MAILTO="gpg2keys_mailto"
-  fi
-fi
+cat >>confdefs.h <<_ACEOF
+#define NAME_OF_SENDMAIL "$SENDMAIL"
+_ACEOF
 
 
 
@@ -9635,6 +11166,7 @@ _ACEOF
 #
 # Checking for iconv
 #
+if test "$require_iconv" = yes; then
 
       if test "X$prefix" = "XNONE"; then
     acl_final_prefix="$ac_default_prefix"
@@ -10297,14 +11829,16 @@ else
     am_cv_lib_iconv=no
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <stdlib.h>
 #include <iconv.h>
+
 int
 main ()
 {
 iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);
   ;
   return 0;
 }
@@ -10319,14 +11853,16 @@ rm -f core conftest.err conftest.$ac_objext \
       LIBS="$LIBS $LIBICONV"
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <stdlib.h>
 #include <iconv.h>
+
 int
 main ()
 {
 iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);
   ;
   return 0;
 }
@@ -10350,40 +11886,89 @@ if ${am_cv_func_iconv_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-            am_save_LIBS="$LIBS"
+                  am_save_LIBS="$LIBS"
       if test $am_cv_lib_iconv = yes; then
         LIBS="$LIBS $LIBICONV"
       fi
-      if test "$cross_compiling" = yes; then :
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        if test "$cross_compiling" = yes; then :
   case "$host_os" in
-           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
-           *)            am_cv_func_iconv_works="guessing yes" ;;
-         esac
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <iconv.h>
 #include <string.h>
-int main ()
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main ()
 {
+int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
     if (cd_utf8_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\342\202\254"; /* EURO SIGN */
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_utf8_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
+      }
+  }
+  /* Test against Solaris 10 bug: Failures are not distinguishable from
+     successful returns.  */
+  {
+    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+    if (cd_ascii_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\263";
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_ascii_to_88591,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #if 0 /* This bug could be worked around by the caller.  */
@@ -10392,43 +11977,59 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
         char buf[50];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
-          return 1;
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #endif
   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
      provided.  */
-  if (/* Try standardized names.  */
-      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
-      /* Try IRIX, OSF/1 names.  */
-      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
-      /* Try AIX names.  */
-      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
-      /* Try HP-UX names.  */
-      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
-    return 1;
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
+
+  ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   am_cv_func_iconv_works=yes
-else
-  am_cv_func_iconv_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+        test "$am_cv_func_iconv_works" = no || break
+      done
       LIBS="$am_save_LIBS"
 
 fi
@@ -10475,7 +12076,7 @@ extern
 #ifdef __cplusplus
 "C"
 #endif
-#if defined(__STDC__) || defined(__cplusplus)
+#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
 #else
 size_t iconv();
@@ -10499,18 +12100,27 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
     am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:-
-         }$am_cv_proto_iconv" >&5
-$as_echo "${ac_t:-
-         }$am_cv_proto_iconv" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result:
+         $am_cv_proto_iconv" >&5
+$as_echo "
+         $am_cv_proto_iconv" >&6; }
+  else
+            am_cv_proto_iconv_arg1=""
+  fi
 
 cat >>confdefs.h <<_ACEOF
 #define ICONV_CONST $am_cv_proto_iconv_arg1
 _ACEOF
 
-  fi
 
 
+else
+  LIBICONV=
+  LTLIBICONV=
+
+
+fi
+
 
 #
 # Check for gettext
@@ -10628,7 +12238,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_path_GMSGFMT="$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
@@ -10879,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"
@@ -10892,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
 
@@ -10962,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;
 }
@@ -11028,14 +12648,16 @@ else
     am_cv_lib_iconv=no
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <stdlib.h>
 #include <iconv.h>
+
 int
 main ()
 {
 iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);
   ;
   return 0;
 }
@@ -11050,14 +12672,16 @@ rm -f core conftest.err conftest.$ac_objext \
       LIBS="$LIBS $LIBICONV"
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <stdlib.h>
 #include <iconv.h>
+
 int
 main ()
 {
 iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);
   ;
   return 0;
 }
@@ -11081,40 +12705,89 @@ if ${am_cv_func_iconv_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-            am_save_LIBS="$LIBS"
+                  am_save_LIBS="$LIBS"
       if test $am_cv_lib_iconv = yes; then
         LIBS="$LIBS $LIBICONV"
       fi
-      if test "$cross_compiling" = yes; then :
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        if test "$cross_compiling" = yes; then :
   case "$host_os" in
-           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
-           *)            am_cv_func_iconv_works="guessing yes" ;;
-         esac
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <iconv.h>
 #include <string.h>
-int main ()
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main ()
 {
+int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
     if (cd_utf8_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\342\202\254"; /* EURO SIGN */
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_utf8_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
+      }
+  }
+  /* Test against Solaris 10 bug: Failures are not distinguishable from
+     successful returns.  */
+  {
+    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+    if (cd_ascii_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\263";
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_ascii_to_88591,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
-          return 1;
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #if 0 /* This bug could be worked around by the caller.  */
@@ -11123,43 +12796,59 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
         char buf[50];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
-          return 1;
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
       }
   }
 #endif
   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
      provided.  */
-  if (/* Try standardized names.  */
-      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
-      /* Try IRIX, OSF/1 names.  */
-      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
-      /* Try AIX names.  */
-      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
-      /* Try HP-UX names.  */
-      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
-    return 1;
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
+
+  ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   am_cv_func_iconv_works=yes
-else
-  am_cv_func_iconv_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+        test "$am_cv_func_iconv_works" = no || break
+      done
       LIBS="$am_save_LIBS"
 
 fi
@@ -11637,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;
 }
@@ -11665,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 \
@@ -11866,7 +13573,7 @@ $as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
   fi
 
 
-# Checks required for our use locales
+# Checks required for our use of locales
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
 $as_echo_n "checking for LC_MESSAGES... " >&6; }
 #
 { $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 :
-  $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
+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"
 
 done
 
-for ac_header in pty.h utmp.h pwd.h inttypes.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
-
 
 
 #
@@ -12108,11 +13658,11 @@ else
 int
 main ()
 {
-/* FIXME: Include the comments suggested by Paul. */
+
 #ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
+  /* Ultrix mips cc rejects this sort of thing.  */
   typedef int charset[2];
-  const charset cs;
+  const charset cs = { 0, 0 };
   /* SunOS 4.1.1 cc rejects this.  */
   char const *const *pcpcc;
   char **ppc;
@@ -12129,8 +13679,9 @@ main ()
   ++pcpcc;
   ppc = (char**) pcpcc;
   pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
+  { /* 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;
@@ -12146,10 +13697,10 @@ main ()
     iptr p = 0;
     ++p;
   }
-  { /* AIX XL C 1.02.0.0 rejects this saying
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
     const int foo = 10;
@@ -12275,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.  */
@@ -12347,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;
 }
@@ -12407,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
@@ -12427,6 +13954,63 @@ _ACEOF
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_addr" >&5
+$as_echo_n "checking for library containing inet_addr... " >&6; }
+if ${ac_cv_search_inet_addr+:} 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 inet_addr ();
+int
+main ()
+{
+return inet_addr ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; 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_inet_addr=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_inet_addr+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_inet_addr+:} false; then :
+
+else
+  ac_cv_search_inet_addr=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_addr" >&5
+$as_echo "$ac_cv_search_inet_addr" >&6; }
+ac_res=$ac_cv_search_inet_addr
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
 # Check whether --enable-endian-check was given.
 if test "${enable_endian_check+set}" = set; then :
   enableval=$enable_endian_check; endiancheck=$enableval
@@ -12438,6 +14022,7 @@ fi
 if test x"$endiancheck" = xyes ; then
 
     tmp_assumed_endian=big
+    tmp_assume_warn=""
     if test "$cross_compiling" = yes; then
       case "$host_cpu" in
          i[345678]* )
@@ -12446,11 +14031,9 @@ if test x"$endiancheck" = xyes ; then
          *)
             ;;
       esac
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling; assuming $tmp_assumed_endian endianess" >&5
-$as_echo "$as_me: WARNING: cross compiling; assuming $tmp_assumed_endian endianess" >&2;}
     fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking endianess" >&5
-$as_echo_n "checking endianess... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking endianness" >&5
+$as_echo_n "checking endianness... " >&6; }
     if ${gnupg_cv_c_endian+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -12499,6 +14082,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
         if test "$gnupg_cv_c_endian" = unknown; then
             if test "$cross_compiling" = yes; then :
   gnupg_cv_c_endian=$tmp_assumed_endian
+              tmp_assumed_warn=" (assumed)"
 
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -12527,8 +14111,8 @@ fi
 
 fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_c_endian" >&5
-$as_echo "$gnupg_cv_c_endian" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${gnupg_cv_c_endian}${tmp_assumed_warn}" >&5
+$as_echo "${gnupg_cv_c_endian}${tmp_assumed_warn}" >&6; }
     if test "$gnupg_cv_c_endian" = little; then
 
 $as_echo "#define LITTLE_ENDIAN_HOST 1" >>confdefs.h
@@ -12542,192 +14126,52 @@ $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 ()
-{
-
-    #undef byte
-    int a = sizeof(byte);
+ac_fn_c_check_type "$LINENO" "byte" "ac_cv_type_byte" "$ac_includes_default"
+if test "x$ac_cv_type_byte" = xyes; then :
 
-  ;
-  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
+ac_fn_c_check_type "$LINENO" "ushort" "ac_cv_type_ushort" "$ac_includes_default"
+if test "x$ac_cv_type_ushort" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_USHORT 1
+_ACEOF
+
+
 fi
+ac_fn_c_check_type "$LINENO" "ulong" "ac_cv_type_ulong" "$ac_includes_default"
+if test "x$ac_cv_type_ulong" = xyes; then :
 
-    { $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
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ULONG 1
+_ACEOF
 
-$as_echo "#define HAVE_BYTE_TYPEDEF 1" >>confdefs.h
 
-    fi
+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}: 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);
-
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_U16 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
-
-    { $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
-
-$as_echo "#define HAVE_USHORT_TYPEDEF 1" >>confdefs.h
-
-    fi
-
- { $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 ()
-{
 
-    #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 ()
-{
+ac_fn_c_check_type "$LINENO" "u32" "ac_cv_type_u32" "$ac_includes_default"
+if test "x$ac_cv_type_u32" = xyes; then :
 
-    #undef u16
-    int a = sizeof(u16);
-
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_U32 1
 _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
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -12864,6 +14308,39 @@ _ACEOF
 # 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
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t"        "$ac_includes_default"; then :
+
+else
+  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
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
+
+
+
+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
+# 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 time_t" >&5
 $as_echo_n "checking size of time_t... " >&6; }
 if ${ac_cv_sizeof_time_t+:} false; then :
@@ -12871,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 :
@@ -12906,70 +14378,47 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-
-
-# Ensure that we have UINT64_C before we bother to check for uint64_t
-# Fixme: really needed in gnupg?  I think it is only useful in libcgrypt.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UINT64_C" >&5
-$as_echo_n "checking for UINT64_C... " >&6; }
-if ${gnupg_cv_uint64_c_works+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time_t is unsigned" >&5
+$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
 /* end confdefs.h.  */
-#include <inttypes.h>
+$ac_includes_default
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#else
+# include <time.h>
+#endif
+
 int
 main ()
 {
-uint64_t foo=UINT64_C(42);
+static int test_array [1 - 2 * !(((time_t)-1) < 0)];
+test_array [0] = 0;
+return test_array [0];
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gnupg_cv_uint64_c_works=yes
+  gnupg_cv_time_t_unsigned=no
 else
-  gnupg_cv_uint64_c_works=no
+  gnupg_cv_time_t_unsigned=yes
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_uint64_c_works" >&5
-$as_echo "$gnupg_cv_uint64_c_works" >&6; }
-if test "$gnupg_cv_uint64_c_works" = "yes" ; 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 uint64_t" >&5
-$as_echo_n "checking size of uint64_t... " >&6; }
-if ${ac_cv_sizeof_uint64_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uint64_t))" "ac_cv_sizeof_uint64_t"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_uint64_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 (uint64_t)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_uint64_t=0
-   fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uint64_t" >&5
-$as_echo "$ac_cv_sizeof_uint64_t" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_time_t_unsigned" >&5
+$as_echo "$gnupg_cv_time_t_unsigned" >&6; }
+    if test $gnupg_cv_time_t_unsigned = yes; then
 
+$as_echo "#define HAVE_UNSIGNED_TIME_T 1" >>confdefs.h
 
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UINT64_T $ac_cv_sizeof_uint64_t
-_ACEOF
+    fi
 
 
-fi
 
 if test "$ac_cv_sizeof_unsigned_short" = "0" \
    || test "$ac_cv_sizeof_unsigned_int" = "0" \
@@ -13306,7 +14755,17 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
 
 fi
 
-for ac_func in strerror strlwr tcgetattr mmap
+for ac_func in atexit canonicalize_file_name clock_gettime ctermid  \
+                explicit_bzero fcntl flockfile fsync ftello          \
+                ftruncate funlockfile getaddrinfo getenv getpagesize \
+                getpwnam getpwuid getrlimit getrusage gettimeofday   \
+                gmtime_r inet_ntop inet_pton isascii lstat memicmp   \
+                memmove memrchr mmap nl_langinfo pipe raise rand     \
+                setenv setlocale setrlimit sigaction sigprocmask     \
+                stat stpcpy strcasecmp strerror strftime stricmp     \
+                strlwr strncasecmp strpbrk strsep strtol strtoul     \
+                strtoull tcgetattr timegm times ttyname unsetenv     \
+                wait4 waitpid
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -13318,78 +14777,96 @@ _ACEOF
 fi
 done
 
-for ac_func in strcasecmp strncasecmp ctermid times gmtime_r
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
-fi
-done
+# On some systems (e.g. Solaris) nanosleep requires linking to librl.
+# Given that we use nanosleep only as an optimization over a select
+# based wait function we want it only if it is available in libc.
+_save_libs="$LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5
+$as_echo_n "checking for library containing nanosleep... " >&6; }
+if ${ac_cv_search_nanosleep+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-for ac_func in unsetenv fcntl ftruncate
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+/* 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 nanosleep ();
+int
+main ()
+{
+return nanosleep ();
+  ;
+  return 0;
+}
 _ACEOF
-
+for ac_lib in '' ; 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_nanosleep=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_nanosleep+:} false; then :
+  break
 fi
 done
+if ${ac_cv_search_nanosleep+:} false; then :
 
-for ac_func in gettimeofday getrusage getrlimit setrlimit clock_gettime
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+else
+  ac_cv_search_nanosleep=no
 fi
-done
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5
+$as_echo "$ac_cv_search_nanosleep" >&6; }
+ac_res=$ac_cv_search_nanosleep
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 
-for ac_func in atexit raise getpagesize strftime nl_langinfo setlocale
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+$as_echo "#define HAVE_NANOSLEEP 1" >>confdefs.h
 
 fi
-done
 
-for ac_func in waitpid wait4 sigaction sigprocmask pipe stat getaddrinfo
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+LIBS="$_save_libs"
 
-fi
-done
 
-for ac_func in ttyname rand ftello fsync stat
+# See whether libc supports the Linux inotify interface
+case "${host}" in
+    *-*-linux*)
+        for ac_func in inotify_init
 do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  ac_fn_c_check_func "$LINENO" "inotify_init" "ac_cv_func_inotify_init"
+if test "x$ac_cv_func_inotify_init" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_INOTIFY_INIT 1
 _ACEOF
 
 fi
 done
 
+        ;;
+esac
+
+
+if test "$have_android_system" = yes; then
+   # On Android ttyname is a stub but prints an error message.
+
+$as_echo "#define HAVE_BROKEN_TTYNAME 1" >>confdefs.h
+
+fi
 
 ac_fn_c_check_type "$LINENO" "struct sigaction" "ac_cv_type_struct_sigaction" "#include <signal.h>
 "
@@ -13413,798 +14890,998 @@ _ACEOF
 fi
 
 
+# Dirmngr requires mmap on Unix systems.
+if test $ac_cv_func_mmap != yes -a $mmap_needed = yes; then
+  as_fn_error $? "Sorry, the current implementation requires mmap." "$LINENO" 5
+fi
+
+
 #
-# These are needed by libjnlib - fixme: we should use a jnlib.m4
-# Note:  We already checked pwd.h.
-for ac_func in memicmp stpcpy strsep strlwr strtoul memmove stricmp strtol
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+# Check for the getsockopt SO_PEERCRED, etc.
+#
+ac_fn_c_check_member "$LINENO" "struct ucred" "pid" "ac_cv_member_struct_ucred_pid" "#include <sys/types.h>
+#include <sys/socket.h>
+"
+if test "x$ac_cv_member_struct_ucred_pid" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UCRED_PID 1
 _ACEOF
 
+
 fi
-done
+ac_fn_c_check_member "$LINENO" "struct ucred" "cr_pid" "ac_cv_member_struct_ucred_cr_pid" "#include <sys/types.h>
+#include <sys/socket.h>
+"
+if test "x$ac_cv_member_struct_ucred_cr_pid" = xyes; then :
 
-for ac_func in memrchr isascii timegm getrusage setrlimit stat setlocale
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UCRED_CR_PID 1
 _ACEOF
 
+
 fi
-done
+ac_fn_c_check_member "$LINENO" "struct sockpeercred" "pid" "ac_cv_member_struct_sockpeercred_pid" "#include <sys/types.h>
+#include <sys/socket.h>
+"
+if test "x$ac_cv_member_struct_sockpeercred_pid" = xyes; then :
 
-for ac_func in flockfile funlockfile fopencookie funopen getpwnam getpwuid
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_SOCKPEERCRED_PID 1
+_ACEOF
+
+
+fi
+
+
+# (Open)Solaris
+for ac_func in getpeerucred
+do :
+  ac_fn_c_check_func "$LINENO" "getpeerucred" "ac_cv_func_getpeerucred"
+if test "x$ac_cv_func_getpeerucred" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_GETPEERUCRED 1
 _ACEOF
 
 fi
 done
 
 
+
 #
-# gnulib checks
+# W32 specific test
 #
 
 
+#
+# Do we have zlib? Must do it here because Solaris failed
+# when compiling a conftest (due to the "-lz" from LIBS).
+# Note that we combine zlib and bzlib2 in ZLIBS.
+#
+if test "$use_zip" = yes ; then
+  _cppflags="${CPPFLAGS}"
+  _ldflags="${LDFLAGS}"
 
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments.  Useless!
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
-$as_echo_n "checking for working alloca.h... " >&6; }
-if ${ac_cv_working_alloca_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <alloca.h>
-int
-main ()
-{
-char *p = (char *) alloca (2 * sizeof (int));
-                         if (p) return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_working_alloca_h=yes
-else
-  ac_cv_working_alloca_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
-$as_echo "$ac_cv_working_alloca_h" >&6; }
-if test $ac_cv_working_alloca_h = yes; then
-
-$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+  withval=$with_zlib;
+      if test -d "$withval"; then
+        CPPFLAGS="${CPPFLAGS} -I$withval/include"
+        LDFLAGS="${LDFLAGS} -L$withval/lib"
+      fi
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if ${ac_cv_func_alloca_works+:} false; then :
+
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateInit2_ in -lz" >&5
+$as_echo_n "checking for deflateInit2_ in -lz... " >&6; }
+if ${ac_cv_lib_z_deflateInit2_+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-#  include <malloc.h>
-#  define alloca _alloca
-# else
-#  ifdef HAVE_ALLOCA_H
-#   include <alloca.h>
-#  else
-#   ifdef _AIX
- #pragma alloca
-#   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca (size_t);
-#    endif
-#   endif
-#  endif
-# endif
-#endif
 
+/* 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 deflateInit2_ ();
 int
 main ()
 {
-char *p = (char *) alloca (1);
-                                   if (p) return 0;
+return deflateInit2_ ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_alloca_works=yes
+  ac_cv_lib_z_deflateInit2_=yes
 else
-  ac_cv_func_alloca_works=no
+  ac_cv_lib_z_deflateInit2_=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_func_alloca_works" >&5
-$as_echo "$ac_cv_func_alloca_works" >&6; }
-
-if test $ac_cv_func_alloca_works = yes; then
-
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
-
-else
-  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble.  Some versions do not even contain alloca or
-# contain a buggy version.  If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflateInit2_" >&5
+$as_echo "$ac_cv_lib_z_deflateInit2_" >&6; }
+if test "x$ac_cv_lib_z_deflateInit2_" = xyes; then :
 
-ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+       ZLIBS="-lz"
 
-$as_echo "#define C_ALLOCA 1" >>confdefs.h
+$as_echo "#define HAVE_ZIP 1" >>confdefs.h
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if ${ac_cv_os_cray+:} false; then :
-  $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
+  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
+fi
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then :
-  ac_cv_os_cray=yes
 else
-  ac_cv_os_cray=no
+  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
 fi
-rm -f conftest*
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
 
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
 
-    break
-fi
+#
+# Check whether we can support bzip2
+#
+if test "$use_bzip2" = yes ; then
+  _cppflags="${CPPFLAGS}"
+  _ldflags="${LDFLAGS}"
 
-  done
+# Check whether --with-bzip2 was given.
+if test "${with_bzip2+set}" = set; then :
+  withval=$with_bzip2;
+      if test -d "$withval" ; then
+        CPPFLAGS="${CPPFLAGS} -I$withval/include"
+        LDFLAGS="${LDFLAGS} -L$withval/lib"
+      fi
+
+else
+  withval=""
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if ${ac_cv_c_stack_direction+:} false; then :
+
+  # Checking alongside stdio.h as an early version of bzip2 (1.0)
+  # required stdio.h to be included before bzlib.h, and Solaris 9 is
+  # woefully out of date.
+  if test "$withval" != no ; then
+     ac_fn_c_check_header_compile "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "#include <stdio.h>
+"
+if test "x$ac_cv_header_bzlib_h" = xyes; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzCompressInit in -lbz2" >&5
+$as_echo_n "checking for BZ2_bzCompressInit in -lbz2... " >&6; }
+if ${ac_cv_lib_bz2_BZ2_bzCompressInit+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_c_stack_direction=0
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbz2  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
-int
-find_stack_direction ()
-{
-  static char *addr = 0;
-  auto char dummy;
-  if (addr == 0)
-    {
-      addr = &dummy;
-      return find_stack_direction ();
-    }
-  else
-    return (&dummy > addr) ? 1 : -1;
-}
 
+/* 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 BZ2_bzCompressInit ();
 int
 main ()
 {
-  return find_stack_direction () < 0;
+return BZ2_bzCompressInit ();
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_stack_direction=1
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_bz2_BZ2_bzCompressInit=yes
 else
-  ac_cv_c_stack_direction=-1
+  ac_cv_lib_bz2_BZ2_bzCompressInit=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+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_bz2_BZ2_bzCompressInit" >&5
+$as_echo "$ac_cv_lib_bz2_BZ2_bzCompressInit" >&6; }
+if test "x$ac_cv_lib_bz2_BZ2_bzCompressInit" = xyes; then :
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
+         have_bz2=yes
+         ZLIBS="$ZLIBS -lbz2"
+
+$as_echo "#define HAVE_BZIP2 1" >>confdefs.h
 
 
+else
+  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
 fi
 
+else
+  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
+fi
 
-  for ac_header in stdlib.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDLIB_H 1
-_ACEOF
 
+  fi
+fi
+ if test x"$have_bz2" = "xyes"; then
+  ENABLE_BZIP2_SUPPORT_TRUE=
+  ENABLE_BZIP2_SUPPORT_FALSE='#'
+else
+  ENABLE_BZIP2_SUPPORT_TRUE='#'
+  ENABLE_BZIP2_SUPPORT_FALSE=
 fi
 
-done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
-$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if ${ac_cv_func_malloc_0_nonnull+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_malloc_0_nonnull=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
 
-int
-main ()
-{
-return ! malloc (0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_malloc_0_nonnull=yes
-else
-  ac_cv_func_malloc_0_nonnull=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
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then :
-  gl_cv_func_malloc_0_nonnull=1
+# Check for readline support
+
+
+# Check whether --with-readline was given.
+if test "${with_readline+set}" = set; then :
+  withval=$with_readline; _do_readline=$withval
 else
-  gl_cv_func_malloc_0_nonnull=0
+  _do_readline=yes
 fi
 
 
-cat >>confdefs.h <<_ACEOF
-#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
-_ACEOF
+  gnupg_cv_have_readline=no
+  if test "$_do_readline" != "no" ; then
+     if test -d "$withval" ; then
+        CPPFLAGS="${CPPFLAGS} -I$withval/include"
+        LDFLAGS="${LDFLAGS} -L$withval/lib"
+     fi
 
+     for _termcap in "" "-ltermcap" "-lcurses" "-lncurses" ; do
+        _readline_save_libs=$LIBS
+        _combo="-lreadline${_termcap:+ $_termcap}"
+        LIBS="$LIBS $_combo"
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline via \"$_combo\" is present and sane" >&5
+$as_echo_n "checking whether readline via \"$_combo\" is present and sane... " >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
-$as_echo_n "checking for long long int... " >&6; }
-if ${ac_cv_type_long_long_int+:} 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.  */
 
-  /* Test preprocessor.  */
-      #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-        error in preprocessor;
-      #endif
-      #if ! (18446744073709551615ULL <= -1ull)
-        error in preprocessor;
-      #endif
-      /* Test literals.  */
-      long long int ll = 9223372036854775807ll;
-      long long int nll = -9223372036854775807LL;
-      unsigned long long int ull = 18446744073709551615ULL;
-      /* Test constant expressions.   */
-      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                    ? 1 : -1)];
-      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                    ? 1 : -1)];
-      int i = 63;
-int
-main ()
-{
-/* Test availability of runtime routines for shift and division.  */
-      long long int llmax = 9223372036854775807ll;
-      unsigned long long int ullmax = 18446744073709551615ull;
-      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-             | (llmax / ll) | (llmax % ll)
-             | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-             | (ullmax / ull) | (ullmax % ull));
-  ;
-  return 0;
-}
+#include <stdio.h>
+#include <readline/readline.h>
+#include <readline/history.h>
 
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-                       if test "$cross_compiling" = yes; then :
-  ac_cv_type_long_long_int=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-              #ifndef LLONG_MAX
-              # define HALF \
-                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-              # define LLONG_MAX (HALF - 1 + HALF)
-              #endif
 int
 main ()
 {
-long long int n = 1;
-              int i;
-              for (i = 0; ; i++)
-                {
-                  long long int m = n << i;
-                  if (m >> i != n)
-                    return 1;
-                  if (LLONG_MAX / 2 < m)
-                    break;
-                }
-              return 0;
+
+rl_completion_func_t *completer;
+add_history("foobar");
+rl_catch_signals=0;
+rl_inhibit_completion=0;
+rl_attempted_completion_function=NULL;
+rl_completion_matches(NULL,NULL);
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_type_long_long_int=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  _found_readline=yes
 else
-  ac_cv_type_long_long_int=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-else
-  ac_cv_type_long_long_int=no
+  _found_readline=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
-$as_echo "$ac_cv_type_long_long_int" >&6; }
-  if test $ac_cv_type_long_long_int = yes; then
 
-$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_found_readline" >&5
+$as_echo "$_found_readline" >&6; }
 
-  fi
+        LIBS=$_readline_save_libs
 
+        if test $_found_readline = yes ; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5
-$as_echo_n "checking for long double... " >&6; }
-if ${gt_cv_c_long_double+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$GCC" = yes; then
-       gt_cv_c_long_double=yes
-     else
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h
 
-         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
-         long double foo = 0.0;
-         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
-         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
+           LIBREADLINE=$_combo
 
-int
-main ()
-{
+           gnupg_cv_have_readline=yes
+           break
+        fi
+     done
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_c_long_double=yes
-else
-  gt_cv_c_long_double=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_long_double" >&5
-$as_echo "$gt_cv_c_long_double" >&6; }
-  if test $gt_cv_c_long_double = yes; then
+     unset _termcap
+     unset _readline_save_libs
+     unset _combo
+     unset _found_readline
+  fi
 
-$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
 
-  fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
-$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
-if ${ac_cv_header_stat_broken+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/stat.h>
+if test "$development_version" = yes; then
 
-#if defined S_ISBLK && defined S_IFDIR
-extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
-#endif
+$as_echo "#define IS_DEVELOPMENT_VERSION 1" >>confdefs.h
 
-#if defined S_ISBLK && defined S_IFCHR
-extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
-#endif
+fi
 
-#if defined S_ISLNK && defined S_IFREG
-extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
-#endif
+if test "$USE_MAINTAINER_MODE" = "yes"; then
 
-#if defined S_ISSOCK && defined S_IFREG
-extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
-#endif
+$as_echo "#define MAINTAINER_MODE 1" >>confdefs.h
 
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stat_broken=no
-else
-  ac_cv_header_stat_broken=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ if test x$cross_compiling = xyes; then
+  CROSS_COMPILING_TRUE=
+  CROSS_COMPILING_FALSE='#'
+else
+  CROSS_COMPILING_TRUE='#'
+  CROSS_COMPILING_FALSE=
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
-$as_echo "$ac_cv_header_stat_broken" >&6; }
-if test $ac_cv_header_stat_broken = yes; then
 
-$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
 
+
+    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
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
-$as_echo_n "checking for unsigned long long int... " >&6; }
-if ${ac_cv_type_unsigned_long_long_int+:} false; then :
+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
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-  /* Test preprocessor.  */
-      #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-        error in preprocessor;
-      #endif
-      #if ! (18446744073709551615ULL <= -1ull)
-        error in preprocessor;
-      #endif
-      /* Test literals.  */
-      long long int ll = 9223372036854775807ll;
-      long long int nll = -9223372036854775807LL;
-      unsigned long long int ull = 18446744073709551615ULL;
-      /* Test constant expressions.   */
-      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                    ? 1 : -1)];
-      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                    ? 1 : -1)];
-      int i = 63;
+/* 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 ()
 {
-/* Test availability of runtime routines for shift and division.  */
-      long long int llmax = 9223372036854775807ll;
-      unsigned long long int ullmax = 18446744073709551615ull;
-      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-             | (llmax / ll) | (llmax % ll)
-             | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-             | (ullmax / ull) | (ullmax % ull));
+return TSS_Create ();
   ;
   return 0;
 }
-
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_type_unsigned_long_long_int=yes
-else
-  ac_cv_type_unsigned_long_long_int=no
+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 conftest.$ac_ext
+    conftest$ac_exeext
+  if ${ac_cv_search_TSS_Create+:} false; then :
+  break
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
-$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
-  if test $ac_cv_type_unsigned_long_long_int = yes; then
+done
+if ${ac_cv_search_TSS_Create+:} false; then :
 
-$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+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 :
 
-
-
-
-
-
-   if false; then
-  GL_COND_LIBTOOL_TRUE=
-  GL_COND_LIBTOOL_FALSE='#'
 else
-  GL_COND_LIBTOOL_TRUE='#'
-  GL_COND_LIBTOOL_FALSE=
+  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
 
-  gl_cond_libtool=false
-  gl_libdeps=
-  gl_ltlibdeps=
-  gl_source_base='gl'
-
-
-
+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.  */
 
-  if test $ac_cv_func_alloca_works = no; then
-    :
+/* 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 :
 
-  # Define an additional variable used in the Makefile substitution.
-  if test $ac_cv_working_alloca_h = yes; then
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+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.  */
 
-#if defined __GNUC__ || defined _AIX || defined _MSC_VER
-       Need own alloca
+/* 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
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Need own alloca" >/dev/null 2>&1; then :
-
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+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 :
 
-       ALLOCA_H=alloca.h
 else
-  ALLOCA_H=
+  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
-rm -f conftest*
 
   else
-    ALLOCA_H=alloca.h
+    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
 
-$as_echo "#define HAVE_ALLOCA_H 1" >>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
+
 
-  ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
-if test "x$ac_cv_func_mkdtemp" = xyes; then :
-  $as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
+    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
-  case " $LIBOBJS " in
-  *" mkdtemp.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS mkdtemp.$ac_objext"
- ;;
-esac
+  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
+  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
 
+  LIBS="-ltss2-esys $LIBS"
 
-  if test $ac_cv_func_mkdtemp = no; then
-
-
+else
 
-  for ac_header in time.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default"
-if test "x$ac_cv_header_time_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_TIME_H 1
-_ACEOF
+       { $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
 
 fi
 
-done
+    LIBTSS_LIBS="$LIBS -ltss2-mu -ltss2-rc -ltss2-tctildr"
 
-  for ac_func in gettimeofday
-do :
-  ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday"
-if test "x$ac_cv_func_gettimeofday" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETTIMEOFDAY 1
-_ACEOF
+$as_echo "#define HAVE_INTEL_TSS 1" >>confdefs.h
 
-fi
-done
+  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
 
-  ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv"
-if test "x$ac_cv_func_setenv" = xyes; then :
-  $as_echo "#define HAVE_SETENV 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 " $LIBOBJS " in
-  *" setenv.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS setenv.$ac_objext"
- ;;
-esac
+  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
 
-ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
-if test "x$ac_cv_func_unsetenv" = xyes; then :
-  $as_echo "#define HAVE_UNSETENV 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 " $LIBOBJS " in
-  *" unsetenv.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS unsetenv.$ac_objext"
- ;;
-esac
+  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
+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
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-  if test $ac_cv_func_setenv = no; then
-
+    # 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
 
-  for ac_header in search.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
-if test "x$ac_cv_header_search_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SEARCH_H 1
-_ACEOF
 
+  fi
+fi
+if test "$have_libtss" = no; then
+  build_tpm2d=no
 fi
 
-done
 
-  for ac_func in tsearch
-do :
-  ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
-if test "x$ac_cv_func_tsearch" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_TSEARCH 1
-_ACEOF
+ 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
-done
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
-$as_echo_n "checking if environ is properly declared... " >&6; }
-  if ${gt_cv_var_environ_declaration+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+#
+# Setup gcc specific options
+#
+USE_C99_CFLAGS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cc features" >&5
+$as_echo "$as_me: checking for cc features" >&6;}
+if test "$GCC" = yes; then
+    mycflags=
+    mycflags_save=$CFLAGS
 
+    # Check whether gcc does not emit a diagnositc for unknown -Wno-*
+    # options.  This is the case for gcc >= 4.6
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc ignores unknown -Wno-* options" >&5
+$as_echo_n "checking if gcc ignores unknown -Wno-* options... " >&6; }
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
-      extern struct { int foo; } environ;
+
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6 )
+#kickerror
+#endif
 int
 main ()
 {
-environ.foo = 1;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_var_environ_declaration=no
+  _gcc_silent_wno=yes
 else
-  gt_cv_var_environ_declaration=yes
+  _gcc_silent_wno=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
-$as_echo "$gt_cv_var_environ_declaration" >&6; }
-  if test $gt_cv_var_environ_declaration = yes; then
-
-$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
-
-  fi
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gcc_silent_wno" >&5
+$as_echo "$_gcc_silent_wno" >&6; }
 
-
-  fi
-  if test $ac_cv_func_unsetenv = no; then
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
-$as_echo_n "checking if environ is properly declared... " >&6; }
-  if ${gt_cv_var_environ_declaration+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    # Note that it is okay to use CFLAGS here because these are just
+    # warning options and the user should have a chance of overriding
+    # them.
+    if test "$USE_MAINTAINER_MODE" = "yes"; then
+        mycflags="$mycflags -O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
+        mycflags="$mycflags -Wformat -Wno-format-y2k -Wformat-security"
+        if test x"$_gcc_silent_wno" = xyes ; then
+          _gcc_wopt=yes
+        else
+          { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wno-missing-field-initializers" >&5
+$as_echo_n "checking if gcc supports -Wno-missing-field-initializers... " >&6; }
+          CFLAGS="-Wno-missing-field-initializers"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
-      extern struct { int foo; } environ;
+
 int
 main ()
 {
-environ.foo = 1;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_var_environ_declaration=no
+  _gcc_wopt=yes
 else
-  gt_cv_var_environ_declaration=yes
+  _gcc_wopt=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
-$as_echo "$gt_cv_var_environ_declaration" >&6; }
-  if test $gt_cv_var_environ_declaration = yes; then
-
-$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
-
-  fi
-
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gcc_wopt" >&5
+$as_echo "$_gcc_wopt" >&6; }
+        fi
+        if test x"$_gcc_wopt" = xyes ; then
+          mycflags="$mycflags -W -Wno-sign-compare -Wno-format-zero-length"
+          mycflags="$mycflags -Wno-missing-field-initializers"
+        fi
 
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
-$as_echo_n "checking for unsetenv() return type... " >&6; }
-if ${gt_cv_func_unsetenv_ret+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wdeclaration-after-statement" >&5
+$as_echo_n "checking if gcc supports -Wdeclaration-after-statement... " >&6; }
+        CFLAGS="-Wdeclaration-after-statement"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdlib.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-#if defined(__STDC__) || defined(__cplusplus)
-int unsetenv (const char *name);
-#else
-int unsetenv();
-#endif
 
 int
 main ()
@@ -14215,1133 +15892,20 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_func_unsetenv_ret='int'
+  _gcc_wopt=yes
 else
-  gt_cv_func_unsetenv_ret='void'
+  _gcc_wopt=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
-$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
-    if test $gt_cv_func_unsetenv_ret = 'void'; then
-
-$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
-
-    fi
-  fi
-
-
-  for ac_header in stdint.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H 1
-_ACEOF
-
-fi
-
-done
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5
-$as_echo_n "checking for SIZE_MAX... " >&6; }
-  if ${gl_cv_size_max+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    gl_cv_size_max=
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <limits.h>
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef SIZE_MAX
-Found it
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Found it" >/dev/null 2>&1; then :
-  gl_cv_size_max=yes
-fi
-rm -f conftest*
-
-    if test -z "$gl_cv_size_max"; then
-                        if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1"        "#include <stddef.h>
-#include <limits.h>"; then :
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gcc_wopt" >&5
+$as_echo "$_gcc_wopt" >&6; }
+        if test x"$_gcc_wopt" = xyes ; then
+          mycflags="$mycflags -Wdeclaration-after-statement"
+        fi
 
-else
-  size_t_bits_minus_1=
-fi
-
-
-      if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint"        "#include <stddef.h>"; then :
-
-else
-  fits_in_uint=
-fi
-
-
-      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
-        if test $fits_in_uint = 1; then
-                              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stddef.h>
-            extern size_t foo;
-            extern unsigned long foo;
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  fits_in_uint=0
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        fi
-                                if test $fits_in_uint = 1; then
-          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
-        else
-          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
-        fi
-      else
-                gl_cv_size_max='((size_t)~(size_t)0)'
-      fi
-    fi
-
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5
-$as_echo "$gl_cv_size_max" >&6; }
-  if test "$gl_cv_size_max" != yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define SIZE_MAX $gl_cv_size_max
-_ACEOF
-
-  fi
-
-
-
-
-  if test $ac_cv_type_long_long_int = yes; then
-    HAVE_LONG_LONG_INT=1
-  else
-    HAVE_LONG_LONG_INT=0
-  fi
-
-
-  if test $ac_cv_type_unsigned_long_long_int = yes; then
-    HAVE_UNSIGNED_LONG_LONG_INT=1
-  else
-    HAVE_UNSIGNED_LONG_LONG_INT=0
-  fi
-
-
-
-  if test $ac_cv_header_wchar_h = yes; then
-    HAVE_WCHAR_H=1
-  else
-    HAVE_WCHAR_H=0
-  fi
-
-
-      if test $ac_cv_header_inttypes_h = yes; then
-    HAVE_INTTYPES_H=1
-  else
-    HAVE_INTTYPES_H=0
-  fi
-
-
-      if test $ac_cv_header_sys_types_h = yes; then
-    HAVE_SYS_TYPES_H=1
-  else
-    HAVE_SYS_TYPES_H=0
-  fi
-
-
-    if test $ac_cv_header_stdint_h = yes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
-$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
-if ${gl_cv_absolute_stdint_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-          if test $ac_cv_header_stdint_h = yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdint.h>
-_ACEOF
-      gl_cv_absolute_stdint_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-sed -n '\#/stdint.h#{s#.*"\(.*/stdint.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'`
-    fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_absolute_stdint_h" >&5
-$as_echo "$gl_cv_absolute_stdint_h" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define ABSOLUTE_STDINT_H "$gl_cv_absolute_stdint_h"
-_ACEOF
-
-
-    ABSOLUTE_STDINT_H=\"$gl_cv_absolute_stdint_h\"
-    HAVE_STDINT_H=1
-  else
-    ABSOLUTE_STDINT_H=\"no/such/file/stdint.h\"
-    HAVE_STDINT_H=0
-  fi
-
-
-
-          if test $ac_cv_header_stdint_h = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
-$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
-if ${gl_cv_header_working_stdint_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  gl_cv_header_working_stdint_h=no
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-
-#include <stddef.h>
-#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
-#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
-#include ABSOLUTE_STDINT_H
-#ifdef INT8_MAX
-int8_t a1 = INT8_MAX;
-int8_t a1min = INT8_MIN;
-#endif
-#ifdef INT16_MAX
-int16_t a2 = INT16_MAX;
-int16_t a2min = INT16_MIN;
-#endif
-#ifdef INT32_MAX
-int32_t a3 = INT32_MAX;
-int32_t a3min = INT32_MIN;
-#endif
-#ifdef INT64_MAX
-int64_t a4 = INT64_MAX;
-int64_t a4min = INT64_MIN;
-#endif
-#ifdef UINT8_MAX
-uint8_t b1 = UINT8_MAX;
-#else
-typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
-#endif
-#ifdef UINT16_MAX
-uint16_t b2 = UINT16_MAX;
-#endif
-#ifdef UINT32_MAX
-uint32_t b3 = UINT32_MAX;
-#endif
-#ifdef UINT64_MAX
-uint64_t b4 = UINT64_MAX;
-#endif
-int_least8_t c1 = INT8_C (0x7f);
-int_least8_t c1max = INT_LEAST8_MAX;
-int_least8_t c1min = INT_LEAST8_MIN;
-int_least16_t c2 = INT16_C (0x7fff);
-int_least16_t c2max = INT_LEAST16_MAX;
-int_least16_t c2min = INT_LEAST16_MIN;
-int_least32_t c3 = INT32_C (0x7fffffff);
-int_least32_t c3max = INT_LEAST32_MAX;
-int_least32_t c3min = INT_LEAST32_MIN;
-int_least64_t c4 = INT64_C (0x7fffffffffffffff);
-int_least64_t c4max = INT_LEAST64_MAX;
-int_least64_t c4min = INT_LEAST64_MIN;
-uint_least8_t d1 = UINT8_C (0xff);
-uint_least8_t d1max = UINT_LEAST8_MAX;
-uint_least16_t d2 = UINT16_C (0xffff);
-uint_least16_t d2max = UINT_LEAST16_MAX;
-uint_least32_t d3 = UINT32_C (0xffffffff);
-uint_least32_t d3max = UINT_LEAST32_MAX;
-uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
-uint_least64_t d4max = UINT_LEAST64_MAX;
-int_fast8_t e1 = INT_FAST8_MAX;
-int_fast8_t e1min = INT_FAST8_MIN;
-int_fast16_t e2 = INT_FAST16_MAX;
-int_fast16_t e2min = INT_FAST16_MIN;
-int_fast32_t e3 = INT_FAST32_MAX;
-int_fast32_t e3min = INT_FAST32_MIN;
-int_fast64_t e4 = INT_FAST64_MAX;
-int_fast64_t e4min = INT_FAST64_MIN;
-uint_fast8_t f1 = UINT_FAST8_MAX;
-uint_fast16_t f2 = UINT_FAST16_MAX;
-uint_fast32_t f3 = UINT_FAST32_MAX;
-uint_fast64_t f4 = UINT_FAST64_MAX;
-#ifdef INTPTR_MAX
-intptr_t g = INTPTR_MAX;
-intptr_t gmin = INTPTR_MIN;
-#endif
-#ifdef UINTPTR_MAX
-uintptr_t h = UINTPTR_MAX;
-#endif
-intmax_t i = INTMAX_MAX;
-uintmax_t j = UINTMAX_MAX;
-struct s {
-  int check_PTRDIFF: PTRDIFF_MIN < 0 && 0 < PTRDIFF_MAX ? 1 : -1;
-  int check_SIG_ATOMIC: SIG_ATOMIC_MIN <= 0 && 0 < SIG_ATOMIC_MAX ? 1 : -1;
-  int check_SIZE: 0 < SIZE_MAX ? 1 : -1;
-  int check_WCHAR: WCHAR_MIN <= 0 && 0 < WCHAR_MAX ? 1 : -1;
-  int check_WINT: WINT_MIN <= 0 && 0 < WINT_MAX ? 1 : -1;
-
-  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
-  int check_UINT8_C:
-       (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
-  int check_UINT16_C:
-       (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
-
-  /* Detect bugs in OpenBSD 3.9 stdint.h.  */
-#ifdef UINT8_MAX
-  int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
-#endif
-#ifdef UINT16_MAX
-  int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
-#endif
-#ifdef UINT32_MAX
-  int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
-#endif
-#ifdef UINT64_MAX
-  int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
-#endif
-  int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
-  int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
-  int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
-  int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
-  int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
-  int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
-  int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
-  int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
-  int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
-  int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
-  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
-};
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_working_stdint_h=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
-$as_echo "$gl_cv_header_working_stdint_h" >&6; }
-  fi
-  if test "$gl_cv_header_working_stdint_h" != yes; then
-
-            for ac_header in sys/inttypes.h sys/bitypes.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
-
-    if test $ac_cv_header_sys_inttypes_h = yes; then
-      HAVE_SYS_INTTYPES_H=1
-    else
-      HAVE_SYS_INTTYPES_H=0
-    fi
-
-    if test $ac_cv_header_sys_bitypes_h = yes; then
-      HAVE_SYS_BITYPES_H=1
-    else
-      HAVE_SYS_BITYPES_H=0
-    fi
-
-
-
-
-
-  for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
-$as_echo_n "checking for bit size of $gltype... " >&6; }
-if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-    /* BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
-       <wchar.h>.  */
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
-
-#include <limits.h>"; then :
-
-else
-  result=unknown
-fi
-
-
-       eval gl_cv_bitsizeof_${gltype}=\$result
-
-fi
-eval ac_res=\$gl_cv_bitsizeof_${gltype}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    eval result=\$gl_cv_bitsizeof_${gltype}
-    if test $result = unknown; then
-                                                result=0
-    fi
-    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    cat >>confdefs.h <<_ACEOF
-#define BITSIZEOF_${GLTYPE} $result
-_ACEOF
-
-    eval BITSIZEOF_${GLTYPE}=\$result
-  done
-
-
-
-
-  for gltype in sig_atomic_t wchar_t wint_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
-$as_echo_n "checking whether $gltype is signed... " >&6; }
-if eval \${gl_cv_type_${gltype}_signed+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-    /* BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
-       <wchar.h>.  */
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
-
-            int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  result=yes
-else
-  result=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-       eval gl_cv_type_${gltype}_signed=\$result
-
-fi
-eval ac_res=\$gl_cv_type_${gltype}_signed
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    eval result=\$gl_cv_type_${gltype}_signed
-    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    if test "$result" = yes; then
-      cat >>confdefs.h <<_ACEOF
-#define HAVE_SIGNED_${GLTYPE} 1
-_ACEOF
-
-      eval HAVE_SIGNED_${GLTYPE}=1
-    else
-      eval HAVE_SIGNED_${GLTYPE}=0
-    fi
-  done
-
-
-  gl_cv_type_ptrdiff_t_signed=yes
-  gl_cv_type_size_t_signed=no
-
-
-  for gltype in ptrdiff_t sig_atomic_t size_t wchar_t wint_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
-$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
-if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval gl_cv_type_${gltype}_suffix=no
-       eval result=\$gl_cv_type_${gltype}_signed
-       if test "$result" = yes; then
-        glsufu=
-       else
-        glsufu=u
-       fi
-       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
-        case $glsuf in
-          '')  gltype1='int';;
-          l)   gltype1='long int';;
-          ll)  gltype1='long long int';;
-          i64) gltype1='__int64';;
-          u)   gltype1='unsigned int';;
-          ul)  gltype1='unsigned long int';;
-          ull) gltype1='unsigned long long int';;
-          ui64)gltype1='unsigned __int64';;
-        esac
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-  #include <stddef.h>
-  #include <signal.h>
-  #if HAVE_WCHAR_H
-    /* BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
-       <wchar.h>.  */
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
-
-             extern $gltype foo;
-             extern $gltype1 foo;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval gl_cv_type_${gltype}_suffix=\$glsuf
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        eval result=\$gl_cv_type_${gltype}_suffix
-        test "$result" != no && break
-       done
-fi
-eval ac_res=\$gl_cv_type_${gltype}_suffix
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    eval result=\$gl_cv_type_${gltype}_suffix
-    test "$result" = no && result=
-    eval ${GLTYPE}_SUFFIX=\$result
-    cat >>confdefs.h <<_ACEOF
-#define ${GLTYPE}_SUFFIX $result
-_ACEOF
-
-  done
-
-
-
-    STDINT_H=stdint.h
-  fi
-
-
-
-  ac_fn_c_check_func "$LINENO" "strpbrk" "ac_cv_func_strpbrk"
-if test "x$ac_cv_func_strpbrk" = xyes; then :
-  $as_echo "#define HAVE_STRPBRK 1" >>confdefs.h
-
-else
-  case " $LIBOBJS " in
-  *" strpbrk.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS strpbrk.$ac_objext"
- ;;
-esac
-
-fi
-
-
-  if test $ac_cv_func_strpbrk = no; then
-    :
-  fi
-
-
-    for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-    UNISTD_H=''
-
-else
-
-    UNISTD_H='unistd.h'
-
-fi
-
-done
-
-
-
-
-
-
-  for ac_header in stdint.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H 1
-_ACEOF
-
-fi
-
-done
-
-
-  LIBGNU_LIBDEPS="$gl_libdeps"
-
-  LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
-
-
-
-
-#
-# 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
-
-
-#
-# Sanity check regex.  Tests adapted from mutt.
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether regular expression support is requested" >&5
-$as_echo_n "checking whether regular expression support is requested... " >&6; }
-# Check whether --enable-regex was given.
-if test "${enable_regex+set}" = set; then :
-  enableval=$enable_regex; use_regex=$enableval
-else
-  use_regex=yes
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_regex" >&5
-$as_echo "$use_regex" >&6; }
-
-if test "$use_regex" = yes ; then
-  _cppflags="${CPPFLAGS}"
-  _ldflags="${LDFLAGS}"
-
-# Check whether --with-regex was given.
-if test "${with_regex+set}" = set; then :
-  withval=$with_regex;
-      if test -d "$withval" ; then
-        CPPFLAGS="${CPPFLAGS} -I$withval/include"
-        LDFLAGS="${LDFLAGS} -L$withval/lib"
-      fi
-
-else
-  withval=""
-fi
-
-
-  # Does the system have regex functions at all?
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing regcomp" >&5
-$as_echo_n "checking for library containing regcomp... " >&6; }
-if ${ac_cv_search_regcomp+:} 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 regcomp ();
-int
-main ()
-{
-return regcomp ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' regex; 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_regcomp=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_regcomp+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_regcomp+:} false; then :
-
-else
-  ac_cv_search_regcomp=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_regcomp" >&5
-$as_echo "$ac_cv_search_regcomp" >&6; }
-ac_res=$ac_cv_search_regcomp
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-  ac_fn_c_check_func "$LINENO" "regcomp" "ac_cv_func_regcomp"
-if test "x$ac_cv_func_regcomp" = xyes; then :
-  gnupg_cv_have_regex=yes
-else
-  gnupg_cv_have_regex=no
-fi
-
-
-  if test $gnupg_cv_have_regex = no; then
-    use_regex=no
-  else
-    if test x"$cross_compiling" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling; assuming regexp libray is not broken" >&5
-$as_echo "$as_me: WARNING: cross compiling; assuming regexp libray is not broken" >&2;}
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether your system's regexp library is broken" >&5
-$as_echo_n "checking whether your system's regexp library is broken... " >&6; }
-if ${gnupg_cv_regex_broken+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gnupg_cv_regex_broken=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <unistd.h>
-#include <regex.h>
-main() { regex_t blah ; regmatch_t p; p.rm_eo = p.rm_eo; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec (&blah, "foobar", 0, NULL, 0); }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gnupg_cv_regex_broken=no
-else
-  gnupg_cv_regex_broken=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gnupg_cv_regex_broken" >&5
-$as_echo "$gnupg_cv_regex_broken" >&6; }
-
-      if test $gnupg_cv_regex_broken = yes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: your regex is broken - disabling regex use" >&5
-$as_echo "$as_me: WARNING: your regex is broken - disabling regex use" >&2;}
-        use_regex=no
-      fi
-    fi
-  fi
-  CPPFLAGS="${_cppflags}"
-  LDFLAGS="${_ldflags}"
-fi
-
-if test "$use_regex" != yes ; then
-
-$as_echo "#define DISABLE_REGEX 1" >>confdefs.h
-
-fi
- if test x"$use_regex" != xyes; then
-  DISABLE_REGEX_TRUE=
-  DISABLE_REGEX_FALSE='#'
-else
-  DISABLE_REGEX_TRUE='#'
-  DISABLE_REGEX_FALSE=
-fi
-
-
-
-
-#
-# Do we have zlib? Must do it here because Solaris failed
-# when compiling a conftest (due to the "-lz" from LIBS).
-# Note that we combine zlib and bzlib2 in ZLIBS.
-#
-_cppflags="${CPPFLAGS}"
-_ldflags="${LDFLAGS}"
-
-# Check whether --with-zlib was given.
-if test "${with_zlib+set}" = set; then :
-  withval=$with_zlib;
-    if test -d "$withval"; then
-      CPPFLAGS="${CPPFLAGS} -I$withval/include"
-      LDFLAGS="${LDFLAGS} -L$withval/lib"
-    fi
-
-fi
-
-
-ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_zlib_h" = xyes; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateInit2_ in -lz" >&5
-$as_echo_n "checking for deflateInit2_ in -lz... " >&6; }
-if ${ac_cv_lib_z_deflateInit2_+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lz  $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 deflateInit2_ ();
-int
-main ()
-{
-return deflateInit2_ ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_z_deflateInit2_=yes
-else
-  ac_cv_lib_z_deflateInit2_=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_z_deflateInit2_" >&5
-$as_echo "$ac_cv_lib_z_deflateInit2_" >&6; }
-if test "x$ac_cv_lib_z_deflateInit2_" = xyes; then :
-  ZLIBS="-lz"
-else
-  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
-fi
-
-else
-  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
-fi
-
-
-
-#
-# Check whether we can support bzip2
-#
-if test "$use_bzip2" = yes ; then
-  _cppflags="${CPPFLAGS}"
-  _ldflags="${LDFLAGS}"
-
-# Check whether --with-bzip2 was given.
-if test "${with_bzip2+set}" = set; then :
-  withval=$with_bzip2;
-      if test -d "$withval" ; then
-        CPPFLAGS="${CPPFLAGS} -I$withval/include"
-        LDFLAGS="${LDFLAGS} -L$withval/lib"
-      fi
-
-else
-  withval=""
-fi
-
-
-  # Checking alongside stdio.h as an early version of bzip2 (1.0)
-  # required stdio.h to be included before bzlib.h, and Solaris 9 is
-  # woefully out of date.
-  if test "$withval" != no ; then
-     ac_fn_c_check_header_compile "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "#include <stdio.h>
-"
-if test "x$ac_cv_header_bzlib_h" = xyes; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzCompressInit in -lbz2" >&5
-$as_echo_n "checking for BZ2_bzCompressInit in -lbz2... " >&6; }
-if ${ac_cv_lib_bz2_BZ2_bzCompressInit+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbz2  $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 BZ2_bzCompressInit ();
-int
-main ()
-{
-return BZ2_bzCompressInit ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_bz2_BZ2_bzCompressInit=yes
-else
-  ac_cv_lib_bz2_BZ2_bzCompressInit=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_bz2_BZ2_bzCompressInit" >&5
-$as_echo "$ac_cv_lib_bz2_BZ2_bzCompressInit" >&6; }
-if test "x$ac_cv_lib_bz2_BZ2_bzCompressInit" = xyes; then :
-
-         have_bz2=yes
-         ZLIBS="$ZLIBS -lbz2"
-
-$as_echo "#define HAVE_BZIP2 1" >>confdefs.h
-
-
-else
-  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
-fi
-
-else
-  CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}
-fi
-
-
-  fi
-fi
- if test x"$have_bz2" = "xyes"; then
-  ENABLE_BZIP2_SUPPORT_TRUE=
-  ENABLE_BZIP2_SUPPORT_FALSE='#'
-else
-  ENABLE_BZIP2_SUPPORT_TRUE='#'
-  ENABLE_BZIP2_SUPPORT_FALSE=
-fi
-
-
-
-
-# Check for readline support
-
-
-# Check whether --with-readline was given.
-if test "${with_readline+set}" = set; then :
-  withval=$with_readline; _do_readline=$withval
-else
-  _do_readline=yes
-fi
-
-
-  if test "$_do_readline" != "no" ; then
-     if test -d "$withval" ; then
-        CPPFLAGS="${CPPFLAGS} -I$withval/include"
-        LDFLAGS="${LDFLAGS} -L$withval/lib"
-     fi
-
-     for _termcap in "" "-ltermcap" "-lcurses" "-lncurses" ; do
-        _readline_save_libs=$LIBS
-        _combo="-lreadline${_termcap:+ $_termcap}"
-        LIBS="$LIBS $_combo"
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline via \"$_combo\" is present and sane" >&5
-$as_echo_n "checking whether readline via \"$_combo\" is present and sane... " >&6; }
-
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdio.h>
-#include <readline/readline.h>
-#include <readline/history.h>
-
-int
-main ()
-{
-
-rl_completion_func_t *completer;
-add_history("foobar");
-rl_catch_signals=0;
-rl_inhibit_completion=0;
-rl_attempted_completion_function=NULL;
-rl_completion_matches(NULL,NULL);
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  _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
-
-           break
-        fi
-     done
-
-     unset _termcap
-     unset _readline_save_libs
-     unset _combo
-     unset _found_readline
-  fi
-
-
-#
-# Allow users to append something to the version string without
-# flagging it as development version.  The user version parts is
-# considered everything after a dash.
-#
-if test "$development_version" != yes; then
-    tmp_pat='[a-zA-Z]'
-    if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
-    development_version=yes
-  fi
-fi
-if test "$development_version" = yes; then
-
-$as_echo "#define IS_DEVELOPMENT_VERSION 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
-
-
-
-
-#
-# Setup gcc specific options
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cc features" >&5
-$as_echo "$as_me: checking for cc features" >&6;}
-if test "$GCC" = yes; then
-    # Note that it is okay to use CFLAGS here because this are just
-    # warning options and the user should have a chance of overriding
-    # them.
-    if test "$USE_MAINTAINER_MODE" = "yes"; then
-        CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
-        CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wno-missing-field-initializers" >&5
-$as_echo_n "checking if gcc supports -Wno-missing-field-initializers... " >&6; }
-        _gcc_cflags_save=$CFLAGS
-        CFLAGS="-Wno-missing-field-initializers"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wlogical-op" >&5
+$as_echo_n "checking if gcc supports -Wlogical-op... " >&6; }
+        CFLAGS="-Wlogical-op -Werror"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gcc_wopt" >&5
 $as_echo "$_gcc_wopt" >&6; }
-        CFLAGS=$_gcc_cflags_save;
         if test x"$_gcc_wopt" = xyes ; then
-          CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
+          mycflags="$mycflags -Wlogical-op"
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wdeclaration-after-statement" >&5
-$as_echo_n "checking if gcc supports -Wdeclaration-after-statement... " >&6; }
-        _gcc_cflags_save=$CFLAGS
-        CFLAGS="-Wdeclaration-after-statement"
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wvla" >&5
+$as_echo_n "checking if gcc supports -Wvla... " >&6; }
+        CFLAGS="-Wvla"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gcc_wopt" >&5
 $as_echo "$_gcc_wopt" >&6; }
-        CFLAGS=$_gcc_cflags_save;
         if test x"$_gcc_wopt" = xyes ; then
-          CFLAGS="$CFLAGS -Wdeclaration-after-statement"
+          mycflags="$mycflags -Wvla"
         fi
+
     else
-        CFLAGS="$CFLAGS -Wall"
+        mycflags="$mycflags -Wall"
+        if test x"$_gcc_silent_wno" = xyes ; then
+          mycflags="$mycflags -Wno-format-zero-length"
+        fi
     fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wno-pointer-sign" >&5
+    if test x"$_gcc_silent_wno" = xyes ; then
+      _gcc_psign=yes
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wno-pointer-sign" >&5
 $as_echo_n "checking if gcc supports -Wno-pointer-sign... " >&6; }
-    _gcc_cflags_save=$CFLAGS
-    CFLAGS="-Wno-pointer-sign"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      CFLAGS="-Wno-pointer-sign"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
@@ -15417,16 +15985,15 @@ else
   _gcc_psign=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gcc_psign" >&5
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gcc_psign" >&5
 $as_echo "$_gcc_psign" >&6; }
-    CFLAGS=$_gcc_cflags_save;
+    fi
     if test x"$_gcc_psign" = xyes ; then
-       CFLAGS="$CFLAGS -Wno-pointer-sign"
+       mycflags="$mycflags -Wno-pointer-sign"
     fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc supports -Wpointer-arith" >&5
 $as_echo_n "checking if gcc supports -Wpointer-arith... " >&6; }
-    _gcc_cflags_save=$CFLAGS
     CFLAGS="-Wpointer-arith"
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_gcc_psign" >&5
 $as_echo "$_gcc_psign" >&6; }
-    CFLAGS=$_gcc_cflags_save;
     if test x"$_gcc_psign" = xyes ; then
-       CFLAGS="$CFLAGS -Wpointer-arith"
+       mycflags="$mycflags -Wpointer-arith"
+    fi
+
+    CFLAGS="$mycflags $mycflags_save"
+    if test "$use_libdns" = yes; then
+       # dirmngr/dns.{c,h} require C99 and GNU extensions.  */
+       USE_C99_CFLAGS="-std=gnu99"
     fi
 fi
 
 
+
+
 #
 # This is handy for debugging so the compiler doesn't rearrange
 # things and eliminate variables.
 # Check whether --enable-optimization was given.
 if test "${enable_optimization+set}" = set; then :
   enableval=$enable_optimization; if test $enableval = no ; then
-                      CFLAGS=`echo $CFLAGS | sed 's/-O[0-9]//'`
+                      CFLAGS=`echo $CFLAGS | sed s/-O[1-9]\ /-O0\ /g`
                    fi
 fi
 
 
 #
-# Prepare building of estream
+# 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}: checking system features for estream-printf" >&5
-$as_echo "$as_me: checking system features for estream-printf" >&6;}
-  for ac_header in stdint.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H 1
-_ACEOF
+{ $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
 
-done
+# Add -Werror to CFLAGS.  This hack can be used to avoid problems with
+# misbehaving autoconf tests in case the user supplied -Werror.
+#
+# Check whether --enable-werror was given.
+if test "${enable_werror+set}" = set; then :
+  enableval=$enable_werror; if test $enableval = yes ; then
+                      CFLAGS="$CFLAGS -Werror"
+                   fi
+fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
-$as_echo_n "checking for long long int... " >&6; }
-if ${ac_cv_type_long_long_int+:} false; then :
-  $as_echo_n "(cached) " >&6
+#
+# Configure option --enable-all-tests
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \"make check\" shall run all tests" >&5
+$as_echo_n "checking whether \"make check\" shall run all tests... " >&6; }
+# Check whether --enable-all-tests was given.
+if test "${enable_all_tests+set}" = set; then :
+  enableval=$enable_all_tests; run_all_tests=$enableval
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  run_all_tests=no
+fi
 
-  /* Test preprocessor.  */
-      #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-        error in preprocessor;
-      #endif
-      #if ! (18446744073709551615ULL <= -1ull)
-        error in preprocessor;
-      #endif
-      /* Test literals.  */
-      long long int ll = 9223372036854775807ll;
-      long long int nll = -9223372036854775807LL;
-      unsigned long long int ull = 18446744073709551615ULL;
-      /* Test constant expressions.   */
-      typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
-                    ? 1 : -1)];
-      typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
-                    ? 1 : -1)];
-      int i = 63;
-int
-main ()
-{
-/* Test availability of runtime routines for shift and division.  */
-      long long int llmax = 9223372036854775807ll;
-      unsigned long long int ullmax = 18446744073709551615ull;
-      return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
-             | (llmax / ll) | (llmax % ll)
-             | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
-             | (ullmax / ull) | (ullmax % ull));
-  ;
-  return 0;
-}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $run_all_tests" >&5
+$as_echo "$run_all_tests" >&6; }
+if test "$run_all_tests" = "yes"; then
 
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-                       if test "$cross_compiling" = yes; then :
-  ac_cv_type_long_long_int=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-              #ifndef LLONG_MAX
-              # define HALF \
-                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
-              # define LLONG_MAX (HALF - 1 + HALF)
-              #endif
-int
-main ()
-{
-long long int n = 1;
-              int i;
-              for (i = 0; ; i++)
-                {
-                  long long int m = n << i;
-                  if (m >> i != n)
-                    return 1;
-                  if (LLONG_MAX / 2 < m)
-                    break;
-                }
-              return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_type_long_long_int=yes
+$as_echo "#define RUN_ALL_TESTS 1" >>confdefs.h
+
+fi
+
+#
+# Configure option --disable-tests
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether tests should be run" >&5
+$as_echo_n "checking whether tests should be run... " >&6; }
+# Check whether --enable-tests was given.
+if test "${enable_tests+set}" = set; then :
+  enableval=$enable_tests; run_tests=$enableval
 else
-  ac_cv_type_long_long_int=no
+  run_tests=yes
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $run_tests" >&5
+$as_echo "$run_tests" >&6; }
+
+#
+# We do not want support for the GNUPG_BUILDDIR environment variable
+# in a released version.  However, our regression tests suite requires
+# this and thus we build with support for it during "make distcheck".
+# This configure option implements this along with the top Makefile's
+# AM_DISTCHECK_CONFIGURE_FLAGS.
+#
+gnupg_builddir_envvar=no
+# Check whether --enable-gnupg-builddir-envvar was given.
+if test "${enable_gnupg_builddir_envvar+set}" = set; then :
+  enableval=$enable_gnupg_builddir_envvar; gnupg_builddir_envvar=$enableval
 fi
 
-else
-  ac_cv_type_long_long_int=no
+if test x"$gnupg_builddir_envvar" = x"yes"; then
+
+$as_echo "#define ENABLE_GNUPG_BUILDDIR_ENVVAR 1" >>confdefs.h
+
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+
+
+#
+# To avoid problems with systemd cleaning up the /run/user directory,
+# this option will make GnuPG try to use /run/gnupg/user as socket dir
+# before /run/user
+#
+# Check whether --enable-run-gnupg-user-socket was given.
+if test "${enable_run_gnupg_user_socket+set}" = set; then :
+  enableval=$enable_run_gnupg_user_socket; use_run_gnupg_user_socket=$enableval
+fi
+
+if test x"$use_run_gnupg_user_socket" = x"yes"; then
+
+$as_echo "#define USE_RUN_GNUPG_USER_SOCKET 1" >>confdefs.h
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
-$as_echo "$ac_cv_type_long_long_int" >&6; }
-  if test $ac_cv_type_long_long_int = yes; then
 
-$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
 
+#
+# Decide what to build
+#
+
+build_scdaemon_extra=""
+if test "$build_scdaemon" = "yes"; then
+  if test $have_libusb = no; then
+     build_scdaemon_extra="without internal CCID driver"
+  fi
+  if test -n "$build_scdaemon_extra"; then
+     build_scdaemon_extra="(${build_scdaemon_extra})"
   fi
+fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5
-$as_echo_n "checking for long double... " >&6; }
-if ${ac_cv_type_long_double+:} false; then :
-  $as_echo_n "(cached) " >&6
+#
+# Set variables for use by automake makefiles.
+#
+ if test "$build_gpg" = "yes"; then
+  BUILD_GPG_TRUE=
+  BUILD_GPG_FALSE='#'
 else
-  if test "$GCC" = yes; then
-       ac_cv_type_long_double=yes
-     else
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* The Stardent Vistra knows sizeof (long double), but does
-                not support it.  */
-             long double foo = 0.0L;
-int
-main ()
-{
-static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
-             sizeof (double) <= sizeof (long double))];
-test_array [0] = 0
+  BUILD_GPG_TRUE='#'
+  BUILD_GPG_FALSE=
+fi
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_type_long_double=yes
+ if test "$build_gpgsm" = "yes"; then
+  BUILD_GPGSM_TRUE=
+  BUILD_GPGSM_FALSE='#'
 else
-  ac_cv_type_long_double=no
+  BUILD_GPGSM_TRUE='#'
+  BUILD_GPGSM_FALSE=
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     fi
+
+ if test "$build_agent" = "yes"; then
+  BUILD_AGENT_TRUE=
+  BUILD_AGENT_FALSE='#'
+else
+  BUILD_AGENT_TRUE='#'
+  BUILD_AGENT_FALSE=
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5
-$as_echo "$ac_cv_type_long_double" >&6; }
-  if test $ac_cv_type_long_double = yes; then
 
-$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
+ if test "$build_scdaemon" = "yes"; then
+  BUILD_SCDAEMON_TRUE=
+  BUILD_SCDAEMON_FALSE='#'
+else
+  BUILD_SCDAEMON_TRUE='#'
+  BUILD_SCDAEMON_FALSE=
+fi
 
-  fi
+ if test "$build_g13" = "yes"; then
+  BUILD_G13_TRUE=
+  BUILD_G13_FALSE='#'
+else
+  BUILD_G13_TRUE='#'
+  BUILD_G13_FALSE=
+fi
+
+ if test "$build_dirmngr" = "yes"; then
+  BUILD_DIRMNGR_TRUE=
+  BUILD_DIRMNGR_FALSE='#'
+else
+  BUILD_DIRMNGR_TRUE='#'
+  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='#'
+else
+  BUILD_DOC_TRUE='#'
+  BUILD_DOC_FALSE=
+fi
+
+ if test "$build_gpgtar" = "yes"; then
+  BUILD_GPGTAR_TRUE=
+  BUILD_GPGTAR_FALSE='#'
+else
+  BUILD_GPGTAR_TRUE='#'
+  BUILD_GPGTAR_FALSE=
+fi
+
+ if test "$build_wks_tools" = "yes"; then
+  BUILD_WKS_TOOLS_TRUE=
+  BUILD_WKS_TOOLS_FALSE='#'
+else
+  BUILD_WKS_TOOLS_TRUE='#'
+  BUILD_WKS_TOOLS_FALSE=
+fi
 
 
+ if test "$run_tests" != yes; then
+  DISABLE_TESTS_TRUE=
+  DISABLE_TESTS_FALSE='#'
+else
+  DISABLE_TESTS_TRUE='#'
+  DISABLE_TESTS_FALSE=
+fi
 
-  ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "$ac_includes_default"
-if test "x$ac_cv_type_intmax_t" = xyes; then :
+ if test "$card_support" = yes; then
+  ENABLE_CARD_SUPPORT_TRUE=
+  ENABLE_CARD_SUPPORT_FALSE='#'
+else
+  ENABLE_CARD_SUPPORT_TRUE='#'
+  ENABLE_CARD_SUPPORT_FALSE=
+fi
 
-$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
+ if test "$use_trust_models" = no; then
+  NO_TRUST_MODELS_TRUE=
+  NO_TRUST_MODELS_FALSE='#'
+else
+  NO_TRUST_MODELS_TRUE='#'
+  NO_TRUST_MODELS_FALSE=
+fi
 
+ if test "$use_tofu" = yes; then
+  USE_TOFU_TRUE=
+  USE_TOFU_FALSE='#'
 else
-  test $ac_cv_type_long_long_int = yes \
-       && ac_type='long long int' \
-       || ac_type='long int'
+  USE_TOFU_TRUE='#'
+  USE_TOFU_FALSE=
+fi
+
+
+#
+# Set some defines for use gpgconf.
+#
+if test "$build_gpg" = yes ; then
+
+$as_echo "#define BUILD_WITH_GPG 1" >>confdefs.h
+
+fi
+if test "$build_gpgsm" = yes ; then
+
+$as_echo "#define BUILD_WITH_GPGSM 1" >>confdefs.h
+
+fi
+if test "$build_agent" = yes ; then
+
+$as_echo "#define BUILD_WITH_AGENT 1" >>confdefs.h
+
+fi
+if test "$build_scdaemon" = yes ; then
+
+$as_echo "#define BUILD_WITH_SCDAEMON 1" >>confdefs.h
+
+fi
+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
+
+fi
+
+
+#
+# Define Name strings
+#
 
 cat >>confdefs.h <<_ACEOF
-#define intmax_t $ac_type
+#define GNUPG_NAME "GnuPG"
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GPG_NAME "gpg"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define GPG_DISP_NAME "GnuPG"
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GPGSM_NAME "gpgsm"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define GPGSM_DISP_NAME "GPGSM"
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define GPG_AGENT_NAME "gpg-agent"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define GPG_AGENT_DISP_NAME "GPG Agent"
 _ACEOF
 
-fi
 
 
+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
+
+
+cat >>confdefs.h <<_ACEOF
+#define SCDAEMON_DISP_NAME "SCDaemon"
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define DIRMNGR_NAME "dirmngr"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define DIRMNGR_DISP_NAME "DirMngr"
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define KEYBOXD_NAME "keyboxd"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define KEYBOXD_DISP_NAME "Keyboxd"
+_ACEOF
 
 
-  ac_fn_c_check_type "$LINENO" "uintmax_t" "ac_cv_type_uintmax_t" "$ac_includes_default"
-if test "x$ac_cv_type_uintmax_t" = xyes; then :
 
-$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define G13_NAME "g13"
+_ACEOF
 
-else
-  test $ac_cv_type_unsigned_long_long_int = yes \
-       && ac_type='unsigned long long int' \
-       || ac_type='unsigned long int'
 
 cat >>confdefs.h <<_ACEOF
-#define uintmax_t $ac_type
+#define G13_DISP_NAME "G13"
 _ACEOF
 
-fi
-
 
-  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PTRDIFF_T 1
+#define GPGCONF_NAME "gpgconf"
 _ACEOF
 
 
-fi
+cat >>confdefs.h <<_ACEOF
+#define GPGCONF_DISP_NAME "GPGConf"
+_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
-# 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 unsigned long" >&5
-$as_echo_n "checking size of unsigned long... " >&6; }
-if ${ac_cv_sizeof_unsigned_long+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long"        "$ac_includes_default"; then :
 
-else
-  if test "$ac_cv_type_unsigned_long" = 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 (unsigned long)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_unsigned_long=0
-   fi
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5
-$as_echo "$ac_cv_sizeof_unsigned_long" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define GPGTAR_NAME "gpgtar"
+_ACEOF
 
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long
+#define GPG_AGENT_SOCK_NAME "S.gpg-agent"
 _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
-# 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 void *" >&5
-$as_echo_n "checking size of void *... " >&6; }
-if ${ac_cv_sizeof_void_p+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p"        "$ac_includes_default"; then :
+cat >>confdefs.h <<_ACEOF
+#define GPG_AGENT_EXTRA_SOCK_NAME "S.gpg-agent.extra"
+_ACEOF
 
-else
-  if test "$ac_cv_type_void_p" = 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 (void *)
-See \`config.log' for more details" "$LINENO" 5; }
-   else
-     ac_cv_sizeof_void_p=0
-   fi
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5
-$as_echo "$ac_cv_sizeof_void_p" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define GPG_AGENT_BROWSER_SOCK_NAME "S.gpg-agent.browser"
+_ACEOF
+
 
+cat >>confdefs.h <<_ACEOF
+#define GPG_AGENT_SSH_SOCK_NAME "S.gpg-agent.ssh"
+_ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+#define DIRMNGR_INFO_NAME "DIRMNGR_INFO"
 _ACEOF
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and THOUSANDS_SEP" >&5
-$as_echo_n "checking for nl_langinfo and THOUSANDS_SEP... " >&6; }
-if ${estream_cv_langinfo_thousands_sep+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <langinfo.h>
-int
-main ()
-{
-char* cs = nl_langinfo(THOUSANDS_SEP); return !cs;
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define SCDAEMON_SOCK_NAME "S.scdaemon"
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  estream_cv_langinfo_thousands_sep=yes
-else
-  estream_cv_langinfo_thousands_sep=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $estream_cv_langinfo_thousands_sep" >&5
-$as_echo "$estream_cv_langinfo_thousands_sep" >&6; }
-  if test $estream_cv_langinfo_thousands_sep = yes; then
 
-$as_echo "#define HAVE_LANGINFO_THOUSANDS_SEP 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define KEYBOXD_SOCK_NAME "S.keyboxd"
+_ACEOF
 
-  fi
 
+cat >>confdefs.h <<_ACEOF
+#define TPM2DAEMON_SOCK_NAME "S.tpm2daemon"
+_ACEOF
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking system features for estream" >&5
-$as_echo "$as_me: checking system features for estream" >&6;}
+cat >>confdefs.h <<_ACEOF
+#define DIRMNGR_SOCK_NAME "S.dirmngr"
+_ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define DIRMNGR_DEFAULT_KEYSERVER "hkps://keyserver.ubuntu.com"
+_ACEOF
 
 
-#
-# Decide what to build
-#
-if test "$have_adns" = "yes"; then
-  GPGKEYS_KDNS="gpg2keys_kdns$EXEEXT"
 
-fi
+cat >>confdefs.h <<_ACEOF
+#define GPGEXT_GPG "gpg"
+_ACEOF
 
 
-missing_pth=no
-if test $have_ksba = no; then
-  build_gpgsm=no
-  build_scdaemon=no
-fi
+if test "$have_w32_system" = yes; then
 
-build_agent_threaded=""
-if test "$build_agent" = "yes"; then
-  if test $have_pth = no; then
-     build_agent_threaded="(not multi-threaded)"
-     missing_pth=yes
-  fi
-fi
+cat >>confdefs.h <<_ACEOF
+#define GNUPG_REGISTRY_DIR "Software\\\\GNU\\\\GnuPG"
+_ACEOF
 
-build_scdaemon_extra=""
-if test "$build_scdaemon" = "yes"; then
-  tmp=""
-  if test $have_pth = no; then
-     build_scdaemon_extra="not multi-threaded"
-     tmp=", "
-     missing_pth=yes
-  fi
-  if test $have_libusb = no; then
-     build_scdaemon_extra="${tmp}without internal CCID driver"
-     tmp=", "
-  fi
-  if test -n "$build_scdaemon_extra"; then
-     build_scdaemon_extra="(${build_scdaemon_extra})"
-  fi
 fi
 
 
-if test "$build_agent_only" = "yes" ; then
-  build_gpg=no
-  build_gpgsm=no
-  build_scdaemon=no
-  build_tools=no
-  build_doc=no
-fi
+#
+# Provide information about the build.
+#
+BUILD_REVISION="d073f26d8"
 
 
- if test "$build_gpg" = "yes"; then
-  BUILD_GPG_TRUE=
-  BUILD_GPG_FALSE='#'
-else
-  BUILD_GPG_TRUE='#'
-  BUILD_GPG_FALSE=
-fi
+cat >>confdefs.h <<_ACEOF
+#define BUILD_REVISION "$BUILD_REVISION"
+_ACEOF
 
- if test "$build_gpgsm" = "yes"; then
-  BUILD_GPGSM_TRUE=
-  BUILD_GPGSM_FALSE='#'
-else
-  BUILD_GPGSM_TRUE='#'
-  BUILD_GPGSM_FALSE=
-fi
 
- if test "$build_agent" = "yes"; then
-  BUILD_AGENT_TRUE=
-  BUILD_AGENT_FALSE='#'
-else
-  BUILD_AGENT_TRUE='#'
-  BUILD_AGENT_FALSE=
-fi
+BUILD_VERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'`
+BUILD_VERSION="${BUILD_VERSION}53363"
+BUILD_FILEVERSION=`echo "${BUILD_VERSION}" | tr . ,`
 
- if test "$build_scdaemon" = "yes"; then
-  BUILD_SCDAEMON_TRUE=
-  BUILD_SCDAEMON_FALSE='#'
-else
-  BUILD_SCDAEMON_TRUE='#'
-  BUILD_SCDAEMON_FALSE=
-fi
 
- if test "$build_tools" = "yes"; then
-  BUILD_TOOLS_TRUE=
-  BUILD_TOOLS_FALSE='#'
-else
-  BUILD_TOOLS_TRUE='#'
-  BUILD_TOOLS_FALSE=
-fi
 
- if test "$build_doc" = "yes"; then
-  BUILD_DOC_TRUE=
-  BUILD_DOC_FALSE='#'
+# Check whether --enable-build-timestamp was given.
+if test "${enable_build_timestamp+set}" = set; then :
+  enableval=$enable_build_timestamp; if test "$enableval" = "yes"; then
+        BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
+      else
+        BUILD_TIMESTAMP="$enableval"
+      fi
+      BUILD_HOSTNAME="$ac_hostname"
 else
-  BUILD_DOC_TRUE='#'
-  BUILD_DOC_FALSE=
+  BUILD_TIMESTAMP="<none>"
+      BUILD_HOSTNAME="<anon>"
 fi
 
- if test "$build_symcryptrun" = "yes"; then
-  BUILD_SYMCRYPTRUN_TRUE=
-  BUILD_SYMCRYPTRUN_FALSE='#'
-else
-  BUILD_SYMCRYPTRUN_TRUE='#'
-  BUILD_SYMCRYPTRUN_FALSE=
-fi
 
- if test "$build_gpgtar" = "yes"; then
-  BUILD_GPGTAR_TRUE=
-  BUILD_GPGTAR_FALSE='#'
-else
-  BUILD_GPGTAR_TRUE='#'
-  BUILD_GPGTAR_FALSE=
-fi
 
+cat >>confdefs.h <<_ACEOF
+#define BUILD_TIMESTAMP "$BUILD_TIMESTAMP"
+_ACEOF
 
- if test x$cross_compiling = xno -a "$build_gpg" = yes ; then
-  RUN_GPG_TESTS_TRUE=
-  RUN_GPG_TESTS_FALSE='#'
-else
-  RUN_GPG_TESTS_TRUE='#'
-  RUN_GPG_TESTS_FALSE=
-fi
 
 
 
@@ -15910,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
-***   ftp://ftp.gnupg.org/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
-***   ftp://ftp.gnupg.org/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
@@ -15927,15 +16576,15 @@ if test "$have_libgcrypt" = "no"; then
 ***
 *** You need libgcrypt to build this program.
 **  This library is for example available at
-***   ftp://ftp.gnupg.org/gcrypt/libgcrypt/
-*** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API is required.)
+***   https://gnupg.org/ftp/gcrypt/libgcrypt/
+*** (at least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API) is required.)
 ***" >&5
 $as_echo "$as_me:
 ***
 *** You need libgcrypt to build this program.
 **  This library is for example available at
-***   ftp://ftp.gnupg.org/gcrypt/libgcrypt/
-*** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API is required.)
+***   https://gnupg.org/ftp/gcrypt/libgcrypt/
+*** (at least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API) is required.)
 ***" >&6;}
 fi
 if test "$have_libassuan" = "no"; then
@@ -15944,59 +16593,88 @@ if test "$have_libassuan" = "no"; then
 ***
 *** You need libassuan to build this program.
 *** This library is for example available at
-***   ftp://ftp.gnupg.org/gcrypt/libassuan/
+***   https://gnupg.org/ftp/gcrypt/libassuan/
 *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
 ***" >&5
 $as_echo "$as_me:
 ***
 *** You need libassuan to build this program.
 *** This library is for example available at
-***   ftp://ftp.gnupg.org/gcrypt/libassuan/
+***   https://gnupg.org/ftp/gcrypt/libassuan/
 *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
 ***" >&6;}
 fi
 if test "$have_ksba" = "no"; then
+    die=yes
     { $as_echo "$as_me:${as_lineno-$LINENO}:
 ***
 *** You need libksba to build this program.
 *** This library is for example available at
-***   ftp://ftp.gnupg.org/gcrypt/libksba/
+***   https://gnupg.org/ftp/gcrypt/libksba/
 *** (at least version $NEED_KSBA_VERSION using API $NEED_KSBA_API is required).
 ***" >&5
 $as_echo "$as_me:
 ***
 *** You need libksba to build this program.
 *** This library is for example available at
-***   ftp://ftp.gnupg.org/gcrypt/libksba/
+***   https://gnupg.org/ftp/gcrypt/libksba/
 *** (at least version $NEED_KSBA_VERSION using API $NEED_KSBA_API is required).
 ***" >&6;}
 fi
-if test "$missing_pth" = "yes"; then
+if test "$have_npth" = "no"; then
+    die=yes
     { $as_echo "$as_me:${as_lineno-$LINENO}:
 ***
 *** It is now required to build with support for the
-*** GNU Portable Threads Library (Pth). Please install this
+*** New Portable Threads Library (nPth). Please install this
 *** library first.  The library is for example available at
-***   ftp://ftp.gnu.org/gnu/pth/
-*** On a Debian GNU/Linux system you can install it using
-***   apt-get install libpth-dev
-*** To build GnuPG for Windows you need to use the W32PTH
-*** package; available at:
-***   ftp://ftp.g10code.com/g10code/w32pth/
+***   https://gnupg.org/ftp/gcrypt/npth/
+*** (at least version $NEED_NPTH_VERSION (API $NEED_NPTH_API) is required).
 ***" >&5
 $as_echo "$as_me:
 ***
 *** It is now required to build with support for the
-*** GNU Portable Threads Library (Pth). Please install this
+*** New Portable Threads Library (nPth). Please install this
 *** library first.  The library is for example available at
-***   ftp://ftp.gnu.org/gnu/pth/
-*** On a Debian GNU/Linux system you can install it using
-***   apt-get install libpth-dev
-*** To build GnuPG for Windows you need to use the W32PTH
-*** package; available at:
-***   ftp://ftp.g10code.com/g10code/w32pth/
+***   https://gnupg.org/ftp/gcrypt/npth/
+*** (at least version $NEED_NPTH_VERSION (API $NEED_NPTH_API) is required).
 ***" >&6;}
-   die=yes
+fi
+
+if test "$require_iconv" = yes; then
+  if test "$am_func_iconv" != yes; then
+    die=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}:
+***
+*** The system does not provide a working iconv function.  Please
+*** install a suitable library; for example GNU Libiconv which is
+*** available at:
+***   https://ftp.gnu.org/gnu/libiconv/
+***" >&5
+$as_echo "$as_me:
+***
+*** The system does not provide a working iconv function.  Please
+*** install a suitable library; for example GNU Libiconv which is
+*** available at:
+***   https://ftp.gnu.org/gnu/libiconv/
+***" >&6;}
+  fi
+fi
+
+if test "$use_ccid_driver" = yes; then
+  if test "$have_libusb" != yes; then
+    die=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}:
+***
+*** You need libusb to build the internal ccid driver.  Please
+*** install a libusb suitable for your system.
+***" >&5
+$as_echo "$as_me:
+***
+*** You need libusb to build the internal ccid driver.  Please
+*** install a libusb suitable for your system.
+***" >&6;}
+  fi
 fi
 
 if test "$die" = "yes"; then
@@ -16009,7 +16687,9 @@ fi
 
 
 
-ac_config_files="$ac_config_files m4/Makefile Makefile po/Makefile.in gl/Makefile include/Makefile jnlib/Makefile common/Makefile kbx/Makefile g10/Makefile sm/Makefile agent/Makefile scd/Makefile keyserver/Makefile keyserver/gpg2keys_mailto keyserver/gpg2keys_test tools/gpg-zip tools/Makefile doc/Makefile tests/Makefile tests/openpgp/Makefile tests/pkits/Makefile"
+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"
+
+
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -16120,6 +16800,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
  if test -n "$EXEEXT"; then
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
@@ -16148,28 +16836,52 @@ 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
 fi
+if test -z "${GNUPG_DIRMNGR_LDAP_PGM_TRUE}" && test -z "${GNUPG_DIRMNGR_LDAP_PGM_FALSE}"; then
+  as_fn_error $? "conditional \"GNUPG_DIRMNGR_LDAP_PGM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_GPG2_HACK_TRUE}" && test -z "${USE_GPG2_HACK_FALSE}"; then
+  as_fn_error $? "conditional \"USE_GPG2_HACK\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_LIBDNS_TRUE}" && test -z "${USE_LIBDNS_FALSE}"; then
+  as_fn_error $? "conditional \"USE_LIBDNS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
   as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${WORKING_FAQPROG_TRUE}" && test -z "${WORKING_FAQPROG_FALSE}"; then
-  as_fn_error $? "conditional \"WORKING_FAQPROG\" 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.
+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_DOSISH_SYSTEM_TRUE}" && test -z "${HAVE_DOSISH_SYSTEM_FALSE}"; then
@@ -16184,20 +16896,16 @@ 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 "${USE_DNS_SRV_TRUE}" && test -z "${USE_DNS_SRV_FALSE}"; then
-  as_fn_error $? "conditional \"USE_DNS_SRV\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${FAKE_CURL_TRUE}" && test -z "${FAKE_CURL_FALSE}"; then
-  as_fn_error $? "conditional \"FAKE_CURL\" was never defined.
+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
 fi
-if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
-  as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
+if test -z "${SQLITE3_TRUE}" && test -z "${SQLITE3_FALSE}"; then
+  as_fn_error $? "conditional \"SQLITE3\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${DISABLE_REGEX_TRUE}" && test -z "${DISABLE_REGEX_FALSE}"; then
-  as_fn_error $? "conditional \"DISABLE_REGEX\" was never defined.
+if test -z "${USE_LDAP_TRUE}" && test -z "${USE_LDAP_FALSE}"; then
+  as_fn_error $? "conditional \"USE_LDAP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${ENABLE_BZIP2_SUPPORT_TRUE}" && test -z "${ENABLE_BZIP2_SUPPORT_FALSE}"; then
@@ -16208,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
@@ -16224,24 +16940,48 @@ if test -z "${BUILD_SCDAEMON_TRUE}" && test -z "${BUILD_SCDAEMON_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_SCDAEMON\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${BUILD_TOOLS_TRUE}" && test -z "${BUILD_TOOLS_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_TOOLS\" was never defined.
+if test -z "${BUILD_G13_TRUE}" && test -z "${BUILD_G13_FALSE}"; then
+  as_fn_error $? "conditional \"BUILD_G13\" 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.
+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_SYMCRYPTRUN_TRUE}" && test -z "${BUILD_SYMCRYPTRUN_FALSE}"; then
-  as_fn_error $? "conditional \"BUILD_SYMCRYPTRUN\" was never defined.
+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
 fi
 if test -z "${BUILD_GPGTAR_TRUE}" && test -z "${BUILD_GPGTAR_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_GPGTAR\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${RUN_GPG_TESTS_TRUE}" && test -z "${RUN_GPG_TESTS_FALSE}"; then
-  as_fn_error $? "conditional \"RUN_GPG_TESTS\" was never defined.
+if test -z "${BUILD_WKS_TOOLS_TRUE}" && test -z "${BUILD_WKS_TOOLS_FALSE}"; then
+  as_fn_error $? "conditional \"BUILD_WKS_TOOLS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DISABLE_TESTS_TRUE}" && test -z "${DISABLE_TESTS_FALSE}"; then
+  as_fn_error $? "conditional \"DISABLE_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_CARD_SUPPORT_TRUE}" && test -z "${ENABLE_CARD_SUPPORT_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_CARD_SUPPORT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${NO_TRUST_MODELS_TRUE}" && test -z "${NO_TRUST_MODELS_FALSE}"; then
+  as_fn_error $? "conditional \"NO_TRUST_MODELS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_TOFU_TRUE}" && test -z "${USE_TOFU_FALSE}"; then
+  as_fn_error $? "conditional \"USE_TOFU\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
@@ -16542,16 +17282,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -16611,28 +17351,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-       test -d "$1/.";
-      else
-       case $1 in #(
-       -*)set "./$1";;
-       esac;
-       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-       ???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -16653,8 +17381,8 @@ 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.0.19, which was
-generated by GNU Autoconf 2.68.  Invocation command line 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
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -16713,17 +17441,17 @@ $config_headers
 Configuration commands:
 $config_commands
 
-Report bugs to <http://bugs.gnupg.org>."
+Report bugs to <https://bugs.gnupg.org>."
 
 _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.0.19
-configured by $0, generated by GNU Autoconf 2.68,
+gnupg config.status 2.4.3
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -16814,7 +17542,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -16838,7 +17566,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
 # Capture the value of obsolete ALL_LINGUAS because we need it to compute
     # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
     # from automake < 1.5.
     "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
-    "gl/Makefile") CONFIG_FILES="$CONFIG_FILES gl/Makefile" ;;
-    "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
-    "jnlib/Makefile") CONFIG_FILES="$CONFIG_FILES jnlib/Makefile" ;;
     "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;;
+    "common/w32info-rc.h") CONFIG_FILES="$CONFIG_FILES common/w32info-rc.h" ;;
+    "regexp/Makefile") CONFIG_FILES="$CONFIG_FILES regexp/Makefile" ;;
     "kbx/Makefile") CONFIG_FILES="$CONFIG_FILES kbx/Makefile" ;;
     "g10/Makefile") CONFIG_FILES="$CONFIG_FILES g10/Makefile" ;;
     "sm/Makefile") CONFIG_FILES="$CONFIG_FILES sm/Makefile" ;;
     "agent/Makefile") CONFIG_FILES="$CONFIG_FILES agent/Makefile" ;;
     "scd/Makefile") CONFIG_FILES="$CONFIG_FILES scd/Makefile" ;;
-    "keyserver/Makefile") CONFIG_FILES="$CONFIG_FILES keyserver/Makefile" ;;
-    "keyserver/gpg2keys_mailto") CONFIG_FILES="$CONFIG_FILES keyserver/gpg2keys_mailto" ;;
-    "keyserver/gpg2keys_test") CONFIG_FILES="$CONFIG_FILES keyserver/gpg2keys_test" ;;
-    "tools/gpg-zip") CONFIG_FILES="$CONFIG_FILES tools/gpg-zip" ;;
+    "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/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/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" ;;
+    "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-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
@@ -17475,32 +18221,38 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
   case $ac_file$ac_mode in
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$mf" : 'X\(//\)[^/]' \| \
-        X"$mf" : 'X\(//\)$' \| \
-        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$am_mf" : 'X\(//\)[^/]' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -17518,55 +18270,50 @@ $as_echo X"$mf" |
            q
          }
          s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$file" : 'X\(//\)[^/]' \| \
-        X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
+    am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
            s//\1/
            q
          }
-         /^X\(\/\/\)$/{
+         /^X\/\(\/\/\)$/{
            s//\1/
            q
          }
-         /^X\(\/\).*/{
+         /^X\/\(\/\).*/{
            s//\1/
            q
          }
          s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles" >&5
+   (cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } || am_rc=$?
   done
+  if test $am_rc -ne 0; 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 $? "Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  If GNU make was not used, consider
+    re-running the configure script with MAKE=\"gmake\" (or whatever is
+    necessary).  You can also try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+  { am_dirpart=; unset am_dirpart;}
+  { am_filepart=; unset am_filepart;}
+  { am_mf=; unset am_mf;}
+  { am_rc=; unset am_rc;}
+  rm -f conftest-deps.mk
 }
  ;;
     "po-directories":C)
@@ -17606,12 +18353,12 @@ $as_echo X"$file" |
               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
             fi
             ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
-            # Hide the ALL_LINGUAS assigment from automake < 1.5.
+            # Hide the ALL_LINGUAS assignment from automake < 1.5.
             eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
           else
             # The set of available languages was given in configure.in.
-            # Hide the ALL_LINGUAS assigment from automake < 1.5.
+            # Hide the ALL_LINGUAS assignment from automake < 1.5.
             eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
           fi
           # Compute POFILES
@@ -17721,28 +18468,72 @@ $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:  d073f26d8  (53363)
         Platform:  $PRINTABLE_OS_NAME ($host)
 
         OpenPGP:   $build_gpg
         S/MIME:    $build_gpgsm
-        Agent:     $build_agent $build_agent_threaded
+        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
-
-        Protect tool:      $show_gnupg_protect_tool_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
-"
-if test x"$use_regex" != xyes ; then
-echo "
-        Warning: No regular expression support available.
-                 OpenPGP trust signatures won't work.
-                 gpg-check-pattern will not be build.
+        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 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
+        LDAP support:        $gnupg_have_ldap
+        TLS support:         $use_tls_library
+        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
+                 to be used libraries have been detected for:
+                  ${gpg_config_script_warn}
+                 Please check above for more warning messages.
+
+G10EOF
+fi
+if test "${build_gpg}" != "yes"; then
+cat <<G10EOF
+        Warning: The component "gpg" is used by other components as
+                 well as for the test suite.  You have disabled
+                 this component and thus other things won't work.
+
+G10EOF
+fi
+if test "${run_tests}" != "yes"; then
+cat <<G10EOF
+        Warning: The use of the test suite has been disabled!
+                 This is in almost all cases a bad idea.  Take care.
+
+G10EOF
 fi