# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
m4_define([mym4_package],[gnupg])
m4_define([mym4_major], [2])
m4_define([mym4_minor], [1])
-m4_define([mym4_micro], [16])
+m4_define([mym4_micro], [17])
# To start a new development series, i.e a new major or minor number
# you need to mark an arbitrary commit before the first beta release
have_sqlite=no
have_npth=no
have_libusb=no
-have_adns=no
+have_system_resolver=no
gnupg_have_ldap="n/a"
use_zip=yes
use_exec=yes
use_trust_models=yes
use_tofu=yes
+use_libdns=yes
card_support=yes
use_ccid_driver=auto
dirmngr_auto_start=yes
AC_MSG_ERROR([both --disable-trust-models and --enable-tofu given])
fi
+AC_MSG_CHECKING([whether to enable libdns])
+AC_ARG_ENABLE(libdns,
+ AC_HELP_STRING([--disable-libdns],
+ [do not build with libdns support]),
+ use_libdns=$enableval, use_libdns=yes)
+AC_MSG_RESULT($use_libdns)
+if test x"$use_libdns" = xyes ; then
+ AC_DEFINE(USE_LIBDNS, 1, [Build with integrated libdns support])
+fi
+AM_CONDITIONAL(USE_LIBDNS, test "$use_libdns" = yes)
#
#
-# Check for ADNS.
-#
-_cppflags="${CPPFLAGS}"
-_ldflags="${LDFLAGS}"
-AC_ARG_WITH(adns,
- AC_HELP_STRING([--with-adns=DIR],
- [look for the adns library in DIR]),
- [if test -d "$withval"; then
- CPPFLAGS="${CPPFLAGS} -I$withval/include"
- LDFLAGS="${LDFLAGS} -L$withval/lib"
- fi])
-if test "$with_adns" != "no"; then
- AC_CHECK_HEADERS(adns.h,AC_CHECK_LIB(adns, adns_init_strcfg,[have_adns=yes]))
- AC_CHECK_FUNCS(adns_free)
- AC_MSG_CHECKING([if adns supports adns_if_tormode])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- #include <adns.h>
- adns_initflags flags = adns_if_tormode;
- ]],[])],[adns_if_tormode=yes],[adns_if_tormode=no])
- AC_MSG_RESULT($adns_if_tormode)
- if test x"$adns_if_tormode" = xyes; then
- AC_DEFINE(HAVE_ADNS_IF_TORMODE,1,[define if adns_if_tormode is available])
- if test "$show_tor_support" != "no"; then
- show_tor_support=yes
- fi
- fi
-fi
-CPPFLAGS=${_cppflags}
-LDFLAGS=${_ldflags}
-if test "$have_adns" = "yes"; then
- ADNSLIBS="-ladns"
-fi
-
-
+# Check standard resolver functions.
#
-# Now try for the resolver functions so we can use DNS for SRV, PA and CERT.
-#
-AC_ARG_ENABLE(dns-srv,
- AC_HELP_STRING([--disable-dns-srv],
- [disable the use of DNS SRV in HKP and HTTP]),
- use_dns_srv=$enableval,use_dns_srv=yes)
-
-AC_ARG_ENABLE(dns-cert,
- AC_HELP_STRING([--disable-dns-cert],
- [disable the use of CERT records in DNS]),
- use_dns_cert=$enableval,use_dns_cert=yes)
-
-if test x"$use_dns_srv" = xyes || test x"$use_dns_cert" = xyes; then
+if test "$build_dirmngr" = "yes"; then
_dns_save_libs=$LIBS
LIBS=""
- if test x"$have_adns" = xyes ; then
- # We prefer ADNS.
- DNSLIBS="$ADNSLIBS"
- AC_DEFINE(USE_ADNS,1,[Use ADNS as resolver library.])
-
- if test x"$use_dns_srv" = xyes ; then
- AC_DEFINE(USE_DNS_SRV,1)
- fi
-
- if test x"$use_dns_cert" = xyes ; then
- AC_DEFINE(USE_DNS_CERT,1,[define to use DNS CERT])
- fi
- else
- # With no ADNS find the system resolver.
+ # Find the system resolver which can always be enabled with
+ # the dirmngr option --standard-resolver.
- # the double underscore thing is a glibc-ism?
- AC_SEARCH_LIBS(res_query,resolv bind,,
- AC_SEARCH_LIBS(__res_query,resolv bind,,have_resolver=no))
- AC_SEARCH_LIBS(dn_expand,resolv bind,,
- AC_SEARCH_LIBS(__dn_expand,resolv bind,,have_resolver=no))
+ # the double underscore thing is a glibc-ism?
+ AC_SEARCH_LIBS(res_query,resolv bind,,
+ AC_SEARCH_LIBS(__res_query,resolv bind,,have_resolver=no))
+ AC_SEARCH_LIBS(dn_expand,resolv bind,,
+ AC_SEARCH_LIBS(__dn_expand,resolv bind,,have_resolver=no))
- # 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.
- AC_SEARCH_LIBS(res_9_dn_skipname,resolv bind,,
- AC_SEARCH_LIBS(dn_skipname,resolv bind,,
- AC_SEARCH_LIBS(__dn_skipname,resolv bind,,have_resolver=no)))
+ # 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.
+ AC_SEARCH_LIBS(res_9_dn_skipname,resolv bind,,
+ AC_SEARCH_LIBS(dn_skipname,resolv bind,,
+ AC_SEARCH_LIBS(__dn_skipname,resolv bind,,have_resolver=no)))
- if test x"$have_resolver" != xno ; then
+ 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.
+ # We might also want to use libdns instead.
- AC_MSG_CHECKING([whether the resolver is usable])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ AC_MSG_CHECKING([whether the resolver is usable])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>]],
dn_skipname(0,0);
dn_expand(0,0,0,0,0);
]])],have_resolver=yes,have_resolver=no)
- AC_MSG_RESULT($have_resolver)
+ AC_MSG_RESULT($have_resolver)
- # This is Apple-specific and somewhat bizarre as they changed the
- # define in bind 8 for some reason.
+ # This is Apple-specific and somewhat bizarre as they changed the
+ # define in bind 8 for some reason.
- if test x"$have_resolver" != xyes ; then
- AC_MSG_CHECKING(
- [whether I can make the resolver usable with BIND_8_COMPAT])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define BIND_8_COMPAT
+ if test x"$have_resolver" != xyes ; then
+ AC_MSG_CHECKING(
+ [whether I can make the resolver usable with BIND_8_COMPAT])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define BIND_8_COMPAT
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
dn_skipname(0,0); dn_expand(0,0,0,0,0);
]])],[have_resolver=yes ; need_compat=yes])
- AC_MSG_RESULT($have_resolver)
- fi
+ AC_MSG_RESULT($have_resolver)
fi
+ fi
- if test x"$have_resolver" = xyes ; then
- DNSLIBS=$LIBS
-
- if test x"$use_dns_srv" = xyes ; then
- AC_DEFINE(USE_DNS_SRV,1,[define to use DNS SRV])
- fi
-
- if test x"$use_dns_cert" = xyes ; then
- AC_DEFINE(USE_DNS_CERT,1,[define to use DNS CERT])
- fi
-
- if test x"$need_compat" = xyes ; then
- AC_DEFINE(BIND_8_COMPAT,1,[an Apple OSXism])
- fi
- else
- use_dns_srv=no
- use_dns_cert=no
+ if test x"$have_resolver" = xyes ; then
+ AC_DEFINE(HAVE_SYSTEM_RESOLVER,1,[The system's resolver is usable.])
+ DNSLIBS="$DNSLIBS $LIBS"
+ if test x"$need_compat" = xyes ; then
+ AC_DEFINE(BIND_8_COMPAT,1,[an Apple OSXism])
fi
+ if test "$use_libdns" = yes; then
+ show_tor_support=yes
+ fi
+ elif test "$use_libdns" = yes; then
+ show_tor_support=yes
+ else
+ AC_MSG_WARN([[
+***
+*** The system's DNS resolver is not usable.
+*** Dirmngr functionality is limited.
+***]])
+ show_tor_support="${show_tor_support} (no system resolver)"
fi
LIBS=$_dns_save_libs
AC_SUBST(DNSLIBS)
-AM_CONDITIONAL(USE_DNS_SRV, test x"$use_dns_srv" = xyes)
-
#
# Check for LDAP
#
# Setup gcc specific options
#
+USE_C99_CFLAGS=
AC_MSG_NOTICE([checking for cc features])
if test "$GCC" = yes; then
mycflags=
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
+AC_SUBST(USE_C99_CFLAGS)
+
#
# This is handy for debugging so the compiler doesn't rearrange
[The name of the SCdaemon socket])
AC_DEFINE_UNQUOTED(DIRMNGR_SOCK_NAME, "S.dirmngr",
[The name of the dirmngr socket])
+AC_DEFINE_UNQUOTED(DIRMNGR_DEFAULT_KEYSERVER,
+ "hkps://hkps.pool.sks-keyservers.net",
+ [The default keyserver for dirmngr to use, if none is explicitly given])
AC_DEFINE_UNQUOTED(GPGEXT_GPG, "gpg", [The standard binary file suffix])
tests/gpgscm/Makefile
tests/openpgp/Makefile
tests/migrations/Makefile
+tests/gpgme/Makefile
tests/pkits/Makefile
g10/gpg.w32-manifest
])
Dirmngr auto start: $dirmngr_auto_start
Readline support: $gnupg_cv_have_readline
LDAP support: $gnupg_have_ldap
- DNS SRV support: $use_dns_srv
TLS support: $use_tls_library
TOFU support: $use_tofu
Tor support: $show_tor_support