1 # configure.ac - for GnuPG 2.1
2 # Copyright (C) 1998-2019 Werner Koch
3 # Copyright (C) 1998-2021 Free Software Foundation, Inc.
4 # Copyright (C) 2003-2023 g10 Code GmbH
6 # This file is part of GnuPG.
8 # GnuPG is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # GnuPG is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, see <https://www.gnu.org/licenses/>.
21 # Process this file with autoconf to produce a configure script.
23 min_automake_version="1.16.3"
25 # To build a release you need to create a tag with the version number
26 # (git tag -s gnupg-2.n.m) and run "./autogen.sh --force". Please
27 # bump the version number immediately *after* the release and do
28 # another commit and push so that the git magic is able to work.
29 m4_define([mym4_package],[gnupg])
30 m4_define([mym4_major], [2])
31 m4_define([mym4_minor], [4])
32 m4_define([mym4_micro], [3])
34 # To start a new development series, i.e a new major or minor number
35 # you need to mark an arbitrary commit before the first beta release
36 # with an annotated tag. For example the 2.1 branch starts off with
37 # the tag "gnupg-2.1-base". This is used as the base for counting
38 # beta numbers before the first release of a series.
40 # Below is m4 magic to extract and compute the git revision number,
41 # the decimalized short revision number, a beta version string and a
42 # flag indicating a development version (mym4_isbeta). Note that the
43 # m4 processing is done by autoconf and not during the configure run.
44 m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \
45 mym4_package mym4_major mym4_minor mym4_micro),[:]))
46 m4_define([mym4_isbeta], m4_argn(2, mym4_verslist))
47 m4_define([mym4_version], m4_argn(4, mym4_verslist))
48 m4_define([mym4_revision], m4_argn(7, mym4_verslist))
49 m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
50 m4_esyscmd([echo ]mym4_version[>VERSION])
51 AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
53 # When changing the SWDB tag please also adjust the hard coded tags in
54 # build-aux/speedo.mk, build-aux/getswdb.sh, and Makefile.am
55 # As well as the source info for the man pages.
56 AC_DEFINE_UNQUOTED(GNUPG_SWDB_TAG, "gnupg24", [swdb tag for this branch])
58 NEED_GPGRT_VERSION=1.46
61 NEED_LIBGCRYPT_VERSION=1.9.1
64 NEED_LIBASSUAN_VERSION=2.5.0
67 NEED_KSBA_VERSION=1.6.3
70 NEED_NTBTLS_VERSION=0.1.0
76 NEED_GNUTLS_VERSION=3.0
78 NEED_SQLITE_VERSION=3.27
80 development_version=mym4_isbeta
82 PACKAGE_GT=${PACKAGE_NAME}2
83 VERSION=$PACKAGE_VERSION
85 AC_CONFIG_AUX_DIR([build-aux])
86 AC_CONFIG_SRCDIR([sm/gpgsm.c])
87 AC_CONFIG_HEADERS([config.h])
88 AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
92 AC_USE_SYSTEM_EXTENSIONS
95 # Some status variables.
106 have_system_resolver=no
107 gnupg_have_ldap="n/a"
117 dirmngr_auto_start=yes
122 # gpg is a required part and can't be disabled anymore.
124 GNUPG_BUILD_PROGRAM(gpgsm, yes)
125 # The agent is a required part and can't be disabled anymore.
127 GNUPG_BUILD_PROGRAM(scdaemon, yes)
128 GNUPG_BUILD_PROGRAM(g13, no)
129 GNUPG_BUILD_PROGRAM(dirmngr, yes)
130 GNUPG_BUILD_PROGRAM(keyboxd, yes)
131 GNUPG_BUILD_PROGRAM(tpm2d, yes)
132 GNUPG_BUILD_PROGRAM(doc, yes)
133 # We use gpgtar to unpack test data, hence we always build it. If the
134 # user opts out, we simply don't install it.
135 GNUPG_BUILD_PROGRAM(gpgtar, yes)
136 # We also install the gpg-wks-server tool by default but disable it
137 # later for platforms where it can't be build.
138 GNUPG_BUILD_PROGRAM(wks-tools, yes)
144 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
145 AC_DEFINE_UNQUOTED(PACKAGE_GT, "$PACKAGE_GT",
146 [Name of this package for gettext])
147 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
148 AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",
149 [Bug report address])
150 AC_DEFINE_UNQUOTED(NEED_LIBGCRYPT_VERSION, "$NEED_LIBGCRYPT_VERSION",
151 [Required version of Libgcrypt])
152 AC_DEFINE_UNQUOTED(NEED_KSBA_VERSION, "$NEED_KSBA_VERSION",
153 [Required version of Libksba])
154 AC_DEFINE_UNQUOTED(NEED_NTBTLS_VERSION, "$NEED_NTBTLS_VERSION",
155 [Required version of NTBTLS])
159 # The default is to use the modules from this package and the few
160 # other packages in a standard place; i.e where this package gets
161 # installed. With these options it is possible to override these
162 # ${prefix} depended values with fixed paths, which can't be replaced
163 # at make time. See also am/cmacros.am and the defaults in AH_BOTTOM.
164 AC_ARG_WITH(agent-pgm,
165 [ --with-agent-pgm=PATH Use PATH as the default for the agent)],
166 GNUPG_AGENT_PGM="$withval", GNUPG_AGENT_PGM="" )
167 AC_SUBST(GNUPG_AGENT_PGM)
168 AM_CONDITIONAL(GNUPG_AGENT_PGM, test -n "$GNUPG_AGENT_PGM")
169 show_gnupg_agent_pgm="(default)"
170 test -n "$GNUPG_AGENT_PGM" && show_gnupg_agent_pgm="$GNUPG_AGENT_PGM"
172 AC_ARG_WITH(pinentry-pgm,
173 [ --with-pinentry-pgm=PATH Use PATH as the default for the pinentry)],
174 GNUPG_PINENTRY_PGM="$withval", GNUPG_PINENTRY_PGM="" )
175 AC_SUBST(GNUPG_PINENTRY_PGM)
176 AM_CONDITIONAL(GNUPG_PINENTRY_PGM, test -n "$GNUPG_PINENTRY_PGM")
177 show_gnupg_pinentry_pgm="(default)"
178 test -n "$GNUPG_PINENTRY_PGM" && show_gnupg_pinentry_pgm="$GNUPG_PINENTRY_PGM"
181 AC_ARG_WITH(scdaemon-pgm,
182 [ --with-scdaemon-pgm=PATH Use PATH as the default for the scdaemon)],
183 GNUPG_SCDAEMON_PGM="$withval", GNUPG_SCDAEMON_PGM="" )
184 AC_SUBST(GNUPG_SCDAEMON_PGM)
185 AM_CONDITIONAL(GNUPG_SCDAEMON_PGM, test -n "$GNUPG_SCDAEMON_PGM")
186 show_gnupg_scdaemon_pgm="(default)"
187 test -n "$GNUPG_SCDAEMON_PGM" && show_gnupg_scdaemon_pgm="$GNUPG_SCDAEMON_PGM"
190 AC_ARG_WITH(tpm2daemon-pgm,
191 [ --with-tpm2daemon-pgm=PATH Use PATH as the default for the tpm2daemon)],
192 GNUPG_TPM2DAEMON_PGM="$withval", GNUPG_TPM2DAEMON_PGM="" )
193 AC_SUBST(GNUPG_TPM2DAEMON_PGM)
194 AM_CONDITIONAL(GNUPG_TPM2DAEMON_PGM, test -n "$GNUPG_TPM2DAEMON_PGM")
195 show_gnupg_tpm2daemon_pgm="(default)"
196 test -n "$GNUPG_TPM2DAEMON_PGM" && show_gnupg_tpm2daemon_pgm="$GNUPG_TPM2DAEMON_PGM"
199 AC_ARG_WITH(dirmngr-pgm,
200 [ --with-dirmngr-pgm=PATH Use PATH as the default for the dirmngr)],
201 GNUPG_DIRMNGR_PGM="$withval", GNUPG_DIRMNGR_PGM="" )
202 AC_SUBST(GNUPG_DIRMNGR_PGM)
203 AM_CONDITIONAL(GNUPG_DIRMNGR_PGM, test -n "$GNUPG_DIRMNGR_PGM")
204 show_gnupg_dirmngr_pgm="(default)"
205 test -n "$GNUPG_DIRMNGR_PGM" && show_gnupg_dirmngr_pgm="$GNUPG_DIRMNGR_PGM"
207 AC_ARG_WITH(keyboxd-pgm,
208 [ --with-keyboxd-pgm=PATH Use PATH as the default for the keyboxd)],
209 GNUPG_KEYBOXD_PGM="$withval", GNUPG_KEYBOXD_PGM="" )
210 AC_SUBST(GNUPG_KEYBOXD_PGM)
211 AM_CONDITIONAL(GNUPG_KEYBOXD_PGM, test -n "$GNUPG_KEYBOXD_PGM")
212 show_gnupg_keyboxd_pgm="(default)"
213 test -n "$GNUPG_KEYBOXD_PGM" && show_gnupg_keyboxd_pgm="$GNUPG_KEYBOXD_PGM"
215 AC_ARG_WITH(protect-tool-pgm,
216 [ --with-protect-tool-pgm=PATH Use PATH as the default for the protect-tool)],
217 GNUPG_PROTECT_TOOL_PGM="$withval", GNUPG_PROTECT_TOOL_PGM="" )
218 AC_SUBST(GNUPG_PROTECT_TOOL_PGM)
219 AM_CONDITIONAL(GNUPG_PROTECT_TOOL_PGM, test -n "$GNUPG_PROTECT_TOOL_PGM")
220 show_gnupg_protect_tool_pgm="(default)"
221 test -n "$GNUPG_PROTECT_TOOL_PGM" \
222 && show_gnupg_protect_tool_pgm="$GNUPG_PROTECT_TOOL_PGM"
224 AC_ARG_WITH(dirmngr-ldap-pgm,
225 [ --with-dirmngr-ldap-pgm=PATH Use PATH as the default for the dirmngr ldap wrapper)],
226 GNUPG_DIRMNGR_LDAP_PGM="$withval", GNUPG_DIRMNGR_LDAP_PGM="" )
227 AC_SUBST(GNUPG_DIRMNGR_LDAP_PGM)
228 AM_CONDITIONAL(GNUPG_DIRMNGR_LDAP_PGM, test -n "$GNUPG_DIRMNGR_LDAP_PGM")
229 show_gnupg_dirmngr_ldap_pgm="(default)"
230 test -n "$GNUPG_DIRMNGR_LDAP_PGM" \
231 && show_gnupg_dirmngr_ldap_pgm="$GNUPG_DIRMNGR_LDAP_PGM"
235 # For a long time gpg 2.x was installed as gpg2. This changed with
236 # 2.2. This option can be used to install gpg under the name gpg2.
238 AC_ARG_ENABLE(gpg-is-gpg2,
239 AS_HELP_STRING([--enable-gpg-is-gpg2],[Set installed name of gpg to gpg2]),
240 gpg_is_gpg2=$enableval)
241 if test "$gpg_is_gpg2" = "yes"; then
242 AC_DEFINE(USE_GPG2_HACK, 1, [Define to install gpg as gpg2])
244 AM_CONDITIONAL(USE_GPG2_HACK, test "$gpg_is_gpg2" = "yes")
247 # SELinux support includes tracking of sensitive files to avoid
248 # leaking their contents through processing these files by gpg itself
249 AC_MSG_CHECKING([whether SELinux support is requested])
250 AC_ARG_ENABLE(selinux-support,
251 AS_HELP_STRING([--enable-selinux-support],
252 [enable SELinux support]),
253 selinux_support=$enableval, selinux_support=no)
254 AC_MSG_RESULT($selinux_support)
257 AC_MSG_CHECKING([whether to allocate extra secure memory])
258 AC_ARG_ENABLE(large-secmem,
259 AS_HELP_STRING([--enable-large-secmem],
260 [allocate extra secure memory]),
261 large_secmem=$enableval, large_secmem=no)
262 AC_MSG_RESULT($large_secmem)
263 if test "$large_secmem" = yes ; then
264 SECMEM_BUFFER_SIZE=65536
266 SECMEM_BUFFER_SIZE=32768
268 AC_DEFINE_UNQUOTED(SECMEM_BUFFER_SIZE,$SECMEM_BUFFER_SIZE,
269 [Size of secure memory buffer])
271 AC_MSG_CHECKING([calibrated passphrase-stretching (s2k) duration])
272 AC_ARG_WITH(agent-s2k-calibration,
273 AS_HELP_STRING([--with-agent-s2k-calibration=MSEC],
274 [calibrate passphrase stretching (s2k) to MSEC milliseconds]),
275 agent_s2k_calibration=$withval, agent_s2k_calibration=100)
276 AC_MSG_RESULT($agent_s2k_calibration milliseconds)
277 AC_DEFINE_UNQUOTED(AGENT_S2K_CALIBRATION, $agent_s2k_calibration,
278 [Agent s2k calibration time (ms)])
280 AC_MSG_CHECKING([whether to enable trust models])
281 AC_ARG_ENABLE(trust-models,
282 AS_HELP_STRING([--disable-trust-models],
283 [disable all trust models except "always"]),
284 use_trust_models=$enableval)
285 AC_MSG_RESULT($use_trust_models)
286 if test "$use_trust_models" = no ; then
287 AC_DEFINE(NO_TRUST_MODELS, 1,
288 [Define to include only trust-model always])
291 AC_MSG_CHECKING([whether to enable TOFU])
293 AS_HELP_STRING([--disable-tofu],
294 [disable the TOFU trust model]),
295 use_tofu=$enableval, use_tofu=$use_trust_models)
296 AC_MSG_RESULT($use_tofu)
297 if test "$use_trust_models" = no && test "$use_tofu" = yes; then
298 AC_MSG_ERROR([both --disable-trust-models and --enable-tofu given])
301 AC_MSG_CHECKING([whether to enable libdns])
302 AC_ARG_ENABLE(libdns,
303 AS_HELP_STRING([--disable-libdns],
304 [do not build with libdns support]),
305 use_libdns=$enableval, use_libdns=yes)
306 AC_MSG_RESULT($use_libdns)
307 if test x"$use_libdns" = xyes ; then
308 AC_DEFINE(USE_LIBDNS, 1, [Build with integrated libdns support])
310 AM_CONDITIONAL(USE_LIBDNS, test "$use_libdns" = yes)
314 # Options to disable algorithm
317 GNUPG_GPG_DISABLE_ALGO([rsa],[RSA public key])
318 # Elgamal is a MUST algorithm
319 # DSA is a MUST algorithm
320 GNUPG_GPG_DISABLE_ALGO([ecdh],[ECDH public key])
321 GNUPG_GPG_DISABLE_ALGO([ecdsa],[ECDSA public key])
322 GNUPG_GPG_DISABLE_ALGO([eddsa],[EdDSA public key])
324 GNUPG_GPG_DISABLE_ALGO([idea],[IDEA cipher])
325 # 3DES is a MUST algorithm
326 GNUPG_GPG_DISABLE_ALGO([cast5],[CAST5 cipher])
327 GNUPG_GPG_DISABLE_ALGO([blowfish],[BLOWFISH cipher])
328 GNUPG_GPG_DISABLE_ALGO([aes128],[AES128 cipher])
329 GNUPG_GPG_DISABLE_ALGO([aes192],[AES192 cipher])
330 GNUPG_GPG_DISABLE_ALGO([aes256],[AES256 cipher])
331 GNUPG_GPG_DISABLE_ALGO([twofish],[TWOFISH cipher])
332 GNUPG_GPG_DISABLE_ALGO([camellia128],[CAMELLIA128 cipher])
333 GNUPG_GPG_DISABLE_ALGO([camellia192],[CAMELLIA192 cipher])
334 GNUPG_GPG_DISABLE_ALGO([camellia256],[CAMELLIA256 cipher])
336 GNUPG_GPG_DISABLE_ALGO([md5],[MD5 hash])
337 # SHA1 is a MUST algorithm
338 GNUPG_GPG_DISABLE_ALGO([rmd160],[RIPE-MD160 hash])
339 GNUPG_GPG_DISABLE_ALGO([sha224],[SHA-224 hash])
340 # SHA256 is a MUST algorithm for GnuPG.
341 GNUPG_GPG_DISABLE_ALGO([sha384],[SHA-384 hash])
342 GNUPG_GPG_DISABLE_ALGO([sha512],[SHA-512 hash])
345 # Allow disabling of zip support.
346 # This is in general not a good idea because according to rfc4880 OpenPGP
347 # implementations SHOULD support ZLIB.
348 AC_MSG_CHECKING([whether to enable the ZIP and ZLIB compression algorithm])
350 AS_HELP_STRING([--disable-zip],
351 [disable the ZIP and ZLIB compression algorithm]),
353 AC_MSG_RESULT($use_zip)
355 # Allow disabling of bzib2 support.
356 # It is defined only after we confirm the library is available later
357 AC_MSG_CHECKING([whether to enable the BZIP2 compression algorithm])
359 AS_HELP_STRING([--disable-bzip2],[disable the BZIP2 compression algorithm]),
360 use_bzip2=$enableval)
361 AC_MSG_RESULT($use_bzip2)
363 # Configure option to allow or disallow execution of external
364 # programs, like a photo viewer.
365 AC_MSG_CHECKING([whether to enable external program execution])
367 AS_HELP_STRING([--disable-exec],[disable all external program execution]),
369 AC_MSG_RESULT($use_exec)
370 if test "$use_exec" = no ; then
371 AC_DEFINE(NO_EXEC,1,[Define to disable all external program execution])
374 if test "$use_exec" = yes ; then
375 AC_MSG_CHECKING([whether to enable photo ID viewing])
376 AC_ARG_ENABLE(photo-viewers,
377 [ --disable-photo-viewers disable photo ID viewers],
378 [if test "$enableval" = no ; then
379 AC_DEFINE(DISABLE_PHOTO_VIEWER,1,[define to disable photo viewing])
381 gnupg_cv_enable_photo_viewers=$enableval
382 AC_MSG_RESULT($enableval)
384 if test "$gnupg_cv_enable_photo_viewers" = yes ; then
385 AC_MSG_CHECKING([whether to use a fixed photo ID viewer])
386 AC_ARG_WITH(photo-viewer,
387 [ --with-photo-viewer=FIXED_VIEWER set a fixed photo ID viewer],
388 [if test "$withval" = yes ; then
390 elif test "$withval" != no ; then
391 AC_DEFINE_UNQUOTED(FIXED_PHOTO_VIEWER,"$withval",
392 [if set, restrict photo-viewer to this])
394 AC_MSG_RESULT($withval)
400 # Check for the key/uid cache size. This can't be zero, but can be
401 # pretty small on embedded systems. This is used for the gpg part.
403 AC_MSG_CHECKING([for the size of the key and uid cache])
404 AC_ARG_ENABLE(key-cache,
405 AS_HELP_STRING([--enable-key-cache=SIZE],
406 [Set key cache to SIZE (default 4096)]),,enableval=4096)
407 if test "$enableval" = "no"; then
409 elif test "$enableval" = "yes" || test "$enableval" = ""; then
413 key_cache_size=`echo "$enableval" | sed 's/[A-Za-z]//g'`
415 if test "$enableval" != "$key_cache_size" || test "$key_cache_size" -lt 5; then
416 AC_MSG_ERROR([invalid key-cache size])
418 AC_MSG_RESULT($key_cache_size)
419 AC_DEFINE_UNQUOTED(PK_UID_CACHE_SIZE,$key_cache_size,
420 [Size of the key and UID caches])
425 # Check whether we want to use Linux capabilities
427 AC_MSG_CHECKING([whether use of capabilities is requested])
428 AC_ARG_WITH(capabilities,
429 [ --with-capabilities use linux capabilities [default=no]],
430 [use_capabilities="$withval"],[use_capabilities=no])
431 AC_MSG_RESULT($use_capabilities)
434 # Check whether to disable the card support
435 AC_MSG_CHECKING([whether smartcard support is requested])
436 AC_ARG_ENABLE(card-support,
437 AS_HELP_STRING([--disable-card-support],
438 [disable smartcard support]),
439 card_support=$enableval)
440 AC_MSG_RESULT($card_support)
441 if test "$card_support" = yes ; then
442 AC_DEFINE(ENABLE_CARD_SUPPORT,1,[Define to include smartcard support])
448 # Allow disabling of internal CCID support.
449 # It is defined only after we confirm the library is available later
451 AC_MSG_CHECKING([whether to enable the internal CCID driver])
452 AC_ARG_ENABLE(ccid-driver,
453 AS_HELP_STRING([--disable-ccid-driver],
454 [disable the internal CCID driver]),
455 use_ccid_driver=$enableval)
456 AC_MSG_RESULT($use_ccid_driver)
458 AC_MSG_CHECKING([whether to auto start dirmngr])
459 AC_ARG_ENABLE(dirmngr-auto-start,
460 AS_HELP_STRING([--disable-dirmngr-auto-start],
461 [disable auto starting of the dirmngr]),
462 dirmngr_auto_start=$enableval)
463 AC_MSG_RESULT($dirmngr_auto_start)
464 if test "$dirmngr_auto_start" = yes ; then
465 AC_DEFINE(USE_DIRMNGR_AUTO_START,1,
466 [Define to enable auto starting of the dirmngr])
471 # To avoid double inclusion of config.h which might happen at some
472 # places, we add the usual double inclusion protection at the top of
476 #ifndef GNUPG_CONFIG_H_INCLUDED
477 #define GNUPG_CONFIG_H_INCLUDED
481 # Stuff which goes at the bottom of config.h.
484 /* This is the major version number of GnuPG so that
485 source included files can test for this. Note, that
486 we use 2 here even for GnuPG 1.9.x. */
487 #define GNUPG_MAJOR_VERSION 2
489 /* Now to separate file name parts.
490 Please note that the string version must not contain more
491 than one character because the code assumes strlen()==1 */
492 #ifdef HAVE_DOSISH_SYSTEM
493 #define DIRSEP_C '\\'
494 #define DIRSEP_S "\\"
497 #define PATHSEP_C ';'
498 #define PATHSEP_S ";"
499 #define EXEEXT_S ".exe"
505 #define PATHSEP_C ':'
506 #define PATHSEP_S ":"
510 /* Some global constants.
511 * Note that the homedir must not end in a slash. */
512 #ifdef HAVE_DOSISH_SYSTEM
513 # ifdef HAVE_DRIVE_LETTERS
514 # define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
516 # define GNUPG_DEFAULT_HOMEDIR "/gnupg"
519 #define GNUPG_DEFAULT_HOMEDIR "/SYS$LOGIN/gnupg"
521 #define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
523 #define GNUPG_PRIVATE_KEYS_DIR "private-keys-v1.d"
524 #define GNUPG_PUBLIC_KEYS_DIR "public-keys.d"
525 #define GNUPG_OPENPGP_REVOC_DIR "openpgp-revocs.d"
526 #define GNUPG_CACHE_DIR "cache.d"
528 #define GNUPG_DEF_COPYRIGHT_LINE "Copyright (C) 2023 g10 Code GmbH"
530 /* For some systems (DOS currently), we hardcode the path here. For
531 POSIX systems the values are constructed by the Makefiles, so that
532 the values may be overridden by the make invocations; this is to
533 comply with the GNU coding standards. Note that these values are
535 #ifdef HAVE_DOSISH_SYSTEM
536 # ifdef HAVE_DRIVE_LETTERS
537 # define GNUPG_BINDIR "c:\\gnupg"
538 # define GNUPG_LIBEXECDIR "c:\\gnupg"
539 # define GNUPG_LIBDIR "c:\\gnupg"
540 # define GNUPG_DATADIR "c:\\gnupg"
541 # define GNUPG_SYSCONFDIR "c:\\gnupg"
543 # define GNUPG_BINDIR "\\gnupg"
544 # define GNUPG_LIBEXECDIR "\\gnupg"
545 # define GNUPG_LIBDIR "\\gnupg"
546 # define GNUPG_DATADIR "\\gnupg"
547 # define GNUPG_SYSCONFDIR "\\gnupg"
551 /* Derive some other constants. */
552 #if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
553 #define EXEC_TEMPFILE_ONLY
557 /* We didn't define endianness above, so get it from OS macros. This
558 is intended for making fat binary builds on OS X. */
559 #if !defined(BIG_ENDIAN_HOST) && !defined(LITTLE_ENDIAN_HOST)
560 #if defined(__BIG_ENDIAN__)
561 #define BIG_ENDIAN_HOST 1
562 #elif defined(__LITTLE_ENDIAN__)
563 #define LITTLE_ENDIAN_HOST 1
565 #error "No endianness found"
570 /* Hack used for W32: ldap.m4 also tests for the ASCII version of
571 ldap_start_tls_s because that is the actual symbol used in the
572 library. winldap.h redefines it to our commonly used value,
573 thus we define our usual macro here. */
574 #ifdef HAVE_LDAP_START_TLS_SA
575 # ifndef HAVE_LDAP_START_TLS_S
576 # define HAVE_LDAP_START_TLS_S 1
580 /* Enable the es_ macros from gpgrt. */
581 #define GPGRT_ENABLE_ES_MACROS 1
583 /* Enable the log_ macros from gpgrt. */
584 #define GPGRT_ENABLE_LOG_MACROS 1
586 /* We want the argparse macros from gpgrt. */
587 #define GPGRT_ENABLE_ARGPARSE_MACROS 1
589 /* Tell libgcrypt not to use its own libgpg-error implementation. */
590 #define USE_LIBGPG_ERROR 1
592 /* Tell Libgcrypt not to include deprecated definitions. */
593 #define GCRYPT_NO_DEPRECATED 1
595 /* Our HTTP code is used in estream mode. */
596 #define HTTP_USE_ESTREAM 1
598 /* Under W32 we do an explicit socket initialization, thus we need to
599 avoid the on-demand initialization which would also install an atexit
601 #define HTTP_NO_WSASTARTUP
603 /* Under Windows we use the gettext code from libgpg-error. */
604 #define GPG_ERR_ENABLE_GETTEXT_MACROS
606 /* Under WindowsCE we use the strerror replacement from libgpg-error. */
607 #define GPG_ERR_ENABLE_ERRNO_MACROS
609 #endif /*GNUPG_CONFIG_H_INCLUDED*/
614 AC_ARG_VAR(SYSROOT,[locate config scripts also below that directory])
616 # Checks for programs.
617 AC_MSG_NOTICE([checking for programs])
620 missing_dir=`cd $ac_aux_dir && pwd`
621 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
622 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
623 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
624 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
625 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
631 if test "x$ac_cv_prog_cc_c89" = "xno" ; then
632 AC_MSG_ERROR([[No C-89 compiler found]])
637 AC_CHECK_TOOL(AR, ar, :)
638 AC_PATH_PROG(PERL,"perl")
639 AC_CHECK_TOOL(WINDRES, windres, :)
640 AC_PATH_PROG(YAT2M, "yat2m", "./yat2m" )
641 AC_ARG_VAR(YAT2M, [tool to convert texi to man pages])
642 AM_CONDITIONAL(HAVE_YAT2M, test -n "$ac_cv_path_YAT2M")
643 AC_SEARCH_LIBS([strerror],[cposix])
647 # GNU AWK requires -n option to interpret "0xHH" as a number
648 if $AWK 'BEGIN { if (PROCINFO@<:@"version"@:>@) exit 1 }'; then
649 AWK_HEX_NUMBER_OPTION=''
650 AC_MSG_NOTICE([awk with no option for hexadecimal])
652 AWK_HEX_NUMBER_OPTION='-n'
653 AC_MSG_NOTICE([awk with an option -n for hexadecimal])
655 AC_SUBST(AWK_HEX_NUMBER_OPTION)
657 # We need to compile and run a program on the build machine. A
658 # comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
659 # the AC archive is broken for autoconf 2.57. Given that there is no
660 # newer version of that macro, we assume that it is also broken for
661 # autoconf 2.61 and thus we use a simple but usually sufficient
663 AC_MSG_CHECKING(for cc for build)
664 if test "$cross_compiling" = "yes"; then
665 CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
667 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
669 AC_MSG_RESULT($CC_FOR_BUILD)
670 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
672 # We need to call this macro because other pkg-config macros are
679 have_dosish_system=no
681 have_android_system=no
682 use_simple_gettext=no
684 require_pipe_to_unblock_pselect=yes
687 # special stuff for Windoze NT
688 ac_cv_have_dev_random=no
689 AC_DEFINE(USE_ONLY_8DOT3,1,
690 [Set this to limit filenames to the 8.3 format])
691 AC_DEFINE(USE_SIMPLE_GETTEXT,1,
692 [Because the Unix gettext has too much overhead on
693 MingW32 systems and these systems lack Posix functions,
694 we use a simplified version of gettext])
695 have_dosish_system=yes
698 require_pipe_to_unblock_pselect=no
699 AC_DEFINE(HAVE_DRIVE_LETTERS,1, [Defined if the OS supports drive letters.])
701 use_simple_gettext=yes
705 i?86-emx-os2 | i?86-*-os2*emx )
706 # OS/2 with the EMX environment
707 ac_cv_have_dev_random=no
708 AC_DEFINE(HAVE_DRIVE_LETTERS)
709 have_dosish_system=yes
715 # DOS with the DJGPP environment
716 ac_cv_have_dev_random=no
717 AC_DEFINE(HAVE_DRIVE_LETTERS)
718 have_dosish_system=yes
724 if test -z "$GCC" ; then
725 CFLAGS="-Ae -D_HPUX_SOURCE $CFLAGS"
729 if test -z "$GCC" ; then
730 # Suppress all warnings
731 # to get rid of the unsigned/signed char mismatch warnings.
736 if test -z "$GCC" ; then
737 # Use the newer compiler `-msg_disable ptrmismatch1' to
738 # get rid of the unsigned/signed char mismatch warnings.
739 # Using this may hide other pointer mismatch warnings, but
740 # it at least lets other warning classes through
741 CFLAGS="-msg_disable ptrmismatch1 $CFLAGS"
747 have_android_system=yes
748 # Android is fully utf-8 and we do not want to use iconv to
749 # keeps things simple
754 AC_DEFINE(_DARWIN_C_SOURCE, 1,
755 Expose all libc features (__DARWIN_C_FULL).)
758 require_pipe_to_unblock_pselect=yes
764 if test "$require_pipe_to_unblock_pselect" = yes; then
765 AC_DEFINE(HAVE_PSELECT_NO_EINTR, 1,
766 [Defined if we run on systems like NetBSD, where
767 pselect cannot be unblocked by signal from a thread
768 within the same process. We use pipe in this case, instead.])
771 if test "$have_dosish_system" = yes; then
772 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
773 [Defined if we run on some of the PCDOS like systems
774 (DOS, Windoze. OS/2) with special properties like
775 no file modes, case insensitive file names and preferred
776 use of backslashes as directory name separators.])
778 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
780 AM_CONDITIONAL(USE_SIMPLE_GETTEXT, test x"$use_simple_gettext" = xyes)
782 if test "$have_w32_system" = yes; then
783 AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
784 AC_CHECK_HEADERS([winsock2.h])
786 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
788 if test "$have_android_system" = yes; then
789 AC_DEFINE(HAVE_ANDROID_SYSTEM,1, [Defined if we build for an Android system])
791 AM_CONDITIONAL(HAVE_ANDROID_SYSTEM, test "$have_android_system" = yes)
794 # (These need to go after AC_PROG_CC so that $EXEEXT is defined)
795 AC_DEFINE_UNQUOTED(EXEEXT,"$EXEEXT",[The executable file extension, if any])
799 # Checks for libraries.
801 AC_MSG_NOTICE([checking for libraries])
805 # gpgrt (aka libgpg-error) is a library with error codes shared
806 # between GnuPG related projects.
808 AM_PATH_GPG_ERROR("$NEED_GPGRT_VERSION",
809 have_gpg_error=yes,have_gpg_error=no)
813 # Libgcrypt is our generic crypto library
815 AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
816 have_libgcrypt=yes,have_libgcrypt=no)
817 # And, then, check if it's newer than 1.9.0 so that we can
818 # conditionally build some programs.
819 # Note: This is not anymore needed but keep the code commented in case
820 # we need it again with some future libgcrypt.
821 #have_libgcrypt_newer=no
822 #if test $ok = yes; then
823 # if test "$major" -gt 1; then
824 # have_libgcrypt_newer=yes
826 # if test "$major" -eq 1; then
827 # if test "$minor" -gt 9; then
828 # have_libgcrypt_newer=yes
830 # if test "$minor" -eq 9; then
831 # if test "$micro" -ge 0; then
832 # have_libgcrypt_newer=yes
839 #AM_CONDITIONAL(HAVE_NEWER_LIBGCRYPT, [test $have_libgcrypt_newer = yes])
842 # libassuan is used for IPC
844 AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
845 have_libassuan=yes,have_libassuan=no)
846 if test "$have_libassuan" = "yes"; then
847 AC_DEFINE_UNQUOTED(GNUPG_LIBASSUAN_VERSION, "$libassuan_version",
848 [version of the libassuan library])
849 show_tor_support="only .onion"
854 # libksba is our X.509 support library
856 AM_PATH_KSBA("$NEED_KSBA_API:$NEED_KSBA_VERSION",have_ksba=yes,have_ksba=no)
860 # libusb allows us to use the integrated CCID smartcard reader driver.
862 # FiXME: Use GNUPG_CHECK_LIBUSB and modify to use separate AC_SUBSTs.
863 if test "$use_ccid_driver" = auto || test "$use_ccid_driver" = yes; then
872 LIBUSB_LIBS="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit"
875 # FreeBSD has a native 1.0 compatible library by -lusb.
885 if test x"$LIBUSB_NAME" != x ; then
886 AC_CHECK_LIB($LIBUSB_NAME, libusb_init,
887 [ LIBUSB_LIBS="-l$LIBUSB_NAME $LIBUSB_LIBS"
889 AC_MSG_CHECKING([libusb include dir])
890 usb_incdir_found="no"
891 for _incdir in "" "/usr/include/libusb-1.0" \
892 "/usr/local/include/libusb-1.0" "/usr/pkg/include/libusb-1.0"; do
893 _libusb_save_cppflags=$CPPFLAGS
894 if test -n "${_incdir}"; then
895 CPPFLAGS="-I${_incdir} ${CPPFLAGS}"
897 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include <libusb.h>]])],
898 [usb_incdir=${_incdir}; usb_incdir_found="yes"], [])
899 CPPFLAGS=${_libusb_save_cppflags}
900 if test "$usb_incdir_found" = "yes"; then
904 if test "$usb_incdir_found" = "yes"; then
905 AC_MSG_RESULT([${usb_incdir}])
907 AC_MSG_RESULT([not found])
910 if test "$use_ccid_driver" != yes; then
916 if test "$have_libusb" = yes; then
917 AC_DEFINE(HAVE_LIBUSB,1, [defined if libusb is available])
919 if test x"$usb_incdir" = x; then
922 LIBUSB_CPPFLAGS="-I${usb_incdir}"
925 AC_SUBST(LIBUSB_LIBS)
926 AC_SUBST(LIBUSB_CPPFLAGS)
929 # Check whether it is necessary to link against libdl.
930 # (For example to load libpcsclite)
932 gnupg_dlopen_save_libs="$LIBS"
934 AC_SEARCH_LIBS(dlopen, c dl,,,)
937 LIBS="$gnupg_dlopen_save_libs"
942 AC_ARG_ENABLE(sqlite,
943 AS_HELP_STRING([--disable-sqlite],
944 [disable the use of SQLITE]),
945 try_sqlite=$enableval, try_sqlite=yes)
947 if test x"$use_tofu" = xyes ; then
948 if test x"$try_sqlite" = xyes ; then
949 PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= $NEED_SQLITE_VERSION],
953 if test "$have_sqlite" = "yes"; then
955 AC_SUBST([SQLITE3_CFLAGS])
956 AC_SUBST([SQLITE3_LIBS])
959 tmp=$(echo "$SQLITE3_PKG_ERRORS" | tr '\n' '\v' | sed 's/\v/\n*** /g')
962 *** Building without SQLite support - TOFU and Keyboxd disabled
967 if test "$have_sqlite" != "yes"; then
972 AM_CONDITIONAL(SQLITE3, test "$have_sqlite" = "yes")
974 if test x"$use_tofu" = xyes ; then
975 AC_DEFINE(USE_TOFU, 1, [Enable to build the TOFU code])
981 AC_PATH_PROG(ENCFS, encfs, /usr/bin/encfs)
982 AC_DEFINE_UNQUOTED(ENCFS,
983 "${ENCFS}", [defines the filename of the encfs program])
985 AC_PATH_PROG(FUSERMOUNT, fusermount, /usr/bin/fusermount)
986 AC_DEFINE_UNQUOTED(FUSERMOUNT,
987 "${FUSERMOUNT}", [defines the filename of the fusermount program])
992 # Check whether the nPth library is available
994 AM_PATH_NPTH("$NEED_NPTH_API:$NEED_NPTH_VERSION",have_npth=yes,have_npth=no)
995 if test "$have_npth" = "yes"; then
996 AC_DEFINE(HAVE_NPTH, 1,
997 [Defined if the New Portable Thread Library is available])
998 AC_DEFINE(USE_NPTH, 1,
999 [Defined if support for nPth is requested and nPth is available])
1003 *** To support concurrent access for example in gpg-agent and the SCdaemon
1004 *** we need the support of the New Portable Threads Library.
1008 # Enable debugging of nPth
1010 AC_ARG_ENABLE(npth-debug,
1011 AS_HELP_STRING([--enable-npth-debug],
1012 [build with debug version of npth]),
1013 [if test $enableval = yes ; then
1014 AC_DEFINE(NPTH_ENABLE_DEBUG,1,
1015 [Build with debug version of nPth])
1021 # NTBTLS is our TLS library. If it is not available we fall back to
1024 AC_ARG_ENABLE(ntbtls,
1025 AS_HELP_STRING([--disable-ntbtls],
1026 [disable the use of NTBTLS as TLS library]),
1027 try_ntbtls=$enableval, try_ntbtls=yes)
1028 if test x"$try_ntbtls" = xyes ; then
1029 AM_PATH_NTBTLS("$NEED_NTBTLS_API:$NEED_NTBTLS_VERSION",
1030 [have_ntbtls=yes],[have_ntbtls=no])
1032 if test "$have_ntbtls" = yes ; then
1033 use_tls_library=ntbtls
1034 AC_DEFINE(HTTP_USE_NTBTLS, 1, [Enable NTBTLS support in http.c])
1036 AC_ARG_ENABLE(gnutls,
1037 AS_HELP_STRING([--disable-gnutls],
1038 [disable GNUTLS as fallback TLS library]),
1039 try_gnutls=$enableval, try_gnutls=yes)
1040 if test x"$try_gnutls" = xyes ; then
1041 PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= $NEED_GNUTLS_VERSION],
1045 if test "$have_gnutls" = "yes"; then
1046 AC_SUBST([LIBGNUTLS_CFLAGS])
1047 AC_SUBST([LIBGNUTLS_LIBS])
1048 use_tls_library=gnutls
1049 AC_DEFINE(HTTP_USE_GNUTLS, 1, [Enable GNUTLS support in http.c])
1051 tmp=$(echo "$LIBGNUTLS_PKG_ERRORS" | tr '\n' '\v' | sed 's/\v/\n*** /g')
1055 *** Neither NTBTLS nor GNUTLS available - not building dirmngr.
1062 # Allow to set a fixed trust store file for system provided certificates.
1064 AC_ARG_WITH([default-trust-store-file],
1065 [AS_HELP_STRING([--with-default-trust-store-file=FILE],
1066 [Use FILE as system trust store])],
1067 default_trust_store_file="$withval",
1068 default_trust_store_file="")
1069 if test x"$default_trust_store_file" = xno;then
1070 default_trust_store_file=""
1072 if test x"$default_trust_store_file" != x ; then
1073 AC_DEFINE_UNQUOTED([DEFAULT_TRUST_STORE_FILE],
1074 ["$default_trust_store_file"], [Use as default system trust store file])
1078 AC_MSG_NOTICE([checking for networking options])
1081 # Must check for network library requirements before doing link tests
1082 # for ldap, for example. If ldap libs are static (or dynamic and without
1083 # ELF runtime link paths), then link will fail and LDAP support won't
1086 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
1087 [NETLIBS="-lnsl $NETLIBS"]))
1088 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
1089 [NETLIBS="-lsocket $NETLIBS"]))
1093 # Check standard resolver functions.
1095 if test "$build_dirmngr" = "yes"; then
1096 _dns_save_libs=$LIBS
1099 # Find the system resolver which can always be enabled with
1100 # the dirmngr option --standard-resolver.
1102 # the double underscore thing is a glibc-ism?
1103 AC_SEARCH_LIBS(res_query,resolv bind,,
1104 AC_SEARCH_LIBS(__res_query,resolv bind,,have_resolver=no))
1105 AC_SEARCH_LIBS(dn_expand,resolv bind,,
1106 AC_SEARCH_LIBS(__dn_expand,resolv bind,,have_resolver=no))
1108 # macOS renames dn_skipname into res_9_dn_skipname in <resolv.h>,
1109 # and for some reason fools us into believing we don't need
1110 # -lresolv even if we do. Since the test program checking for the
1111 # symbol does not include <resolv.h>, we need to check for the
1112 # renamed symbol explicitly.
1113 AC_SEARCH_LIBS(res_9_dn_skipname,resolv bind,,
1114 AC_SEARCH_LIBS(dn_skipname,resolv bind,,
1115 AC_SEARCH_LIBS(__dn_skipname,resolv bind,,have_resolver=no)))
1117 if test x"$have_resolver" != xno ; then
1119 # Make sure that the BIND 4 resolver interface is workable before
1120 # enabling any code that calls it. At some point I'll rewrite the
1121 # code to use the BIND 8 resolver API.
1122 # We might also want to use libdns instead.
1124 AC_MSG_CHECKING([whether the resolver is usable])
1125 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1126 #include <netinet/in.h>
1127 #include <arpa/nameser.h>
1128 #include <resolv.h>]],
1129 [[unsigned char answer[PACKETSZ];
1130 res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
1132 dn_expand(0,0,0,0,0);
1133 ]])],have_resolver=yes,have_resolver=no)
1134 AC_MSG_RESULT($have_resolver)
1136 # This is Apple-specific and somewhat bizarre as they changed the
1137 # define in bind 8 for some reason.
1139 if test x"$have_resolver" != xyes ; then
1141 [whether I can make the resolver usable with BIND_8_COMPAT])
1142 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define BIND_8_COMPAT
1143 #include <sys/types.h>
1144 #include <netinet/in.h>
1145 #include <arpa/nameser.h>
1146 #include <resolv.h>]],
1147 [[unsigned char answer[PACKETSZ];
1148 res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
1149 dn_skipname(0,0); dn_expand(0,0,0,0,0);
1150 ]])],[have_resolver=yes ; need_compat=yes])
1151 AC_MSG_RESULT($have_resolver)
1155 if test x"$have_resolver" = xyes ; then
1156 AC_DEFINE(HAVE_SYSTEM_RESOLVER,1,[The system's resolver is usable.])
1157 DNSLIBS="$DNSLIBS $LIBS"
1158 if test x"$need_compat" = xyes ; then
1159 AC_DEFINE(BIND_8_COMPAT,1,[an Apple OSXism])
1161 if test "$use_libdns" = yes; then
1162 show_tor_support=yes
1164 elif test "$use_libdns" = yes; then
1165 show_tor_support=yes
1169 *** The system's DNS resolver is not usable.
1170 *** Dirmngr functionality is limited.
1172 show_tor_support="${show_tor_support} (no system resolver)"
1175 if test "$have_w32_system" = yes; then
1176 if test "$use_libdns" = yes; then
1177 DNSLIBS="$DNSLIBS -liphlpapi"
1181 LIBS=$_dns_save_libs
1190 # Note that running the check changes the variable
1191 # gnupg_have_ldap from "n/a" to "no" or "yes".
1194 AS_HELP_STRING([--disable-ldap],
1195 [disable LDAP support]),
1196 [if test "$enableval" = "no"; then gnupg_have_ldap=no; fi])
1198 if test "$gnupg_have_ldap" != "no" ; then
1199 if test "$build_dirmngr" = "yes" ; then
1200 GNUPG_CHECK_LDAP($NETLIBS)
1201 AC_CHECK_LIB(lber, ber_free,
1202 [ LBER_LIBS="$LBER_LIBS -llber"
1203 AC_DEFINE(HAVE_LBER,1,
1204 [defined if liblber is available])
1210 if test "$gnupg_have_ldap" = "no"; then
1213 *** Building without LDAP support.
1214 *** No CRL access or X.509 certificate search available.
1218 AM_CONDITIONAL(USE_LDAP, [test "$gnupg_have_ldap" = yes])
1219 if test "$gnupg_have_ldap" = yes ; then
1220 AC_DEFINE(USE_LDAP,1,[Defined if LDAP is support])
1226 # Check for sendmail
1228 # This isn't necessarily sendmail itself, but anything that gives a
1229 # sendmail-ish interface to the outside world. That includes Exim,
1230 # Postfix, etc. Basically, anything that can handle "sendmail -t".
1231 AC_ARG_WITH(mailprog,
1232 AS_HELP_STRING([--with-mailprog=NAME],
1233 [use "NAME -t" for mail transport]),
1235 if test x"$with_mailprog" = xyes ; then
1236 AC_PATH_PROG(SENDMAIL,sendmail,,"$PATH":/usr/sbin:/usr/libexec:/usr/lib)
1237 elif test x"$with_mailprog" != xno ; then
1238 AC_MSG_CHECKING([for a mail transport program])
1239 AC_SUBST(SENDMAIL,$with_mailprog)
1240 AC_MSG_RESULT($with_mailprog)
1242 AC_DEFINE_UNQUOTED(NAME_OF_SENDMAIL,"$SENDMAIL",
1243 [Tool with sendmail -t interface])
1247 # Construct a printable name of the OS
1251 PRINTABLE_OS_NAME="MingW32"
1254 PRINTABLE_OS_NAME="Cygwin"
1256 i?86-emx-os2 | i?86-*-os2*emx )
1257 PRINTABLE_OS_NAME="OS/2"
1260 PRINTABLE_OS_NAME="MSDOS/DJGPP"
1264 PRINTABLE_OS_NAME="GNU/Linux"
1267 PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
1270 AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
1271 [A human readable text with the name of the OS])
1275 # Checking for iconv
1277 if test "$require_iconv" = yes; then
1283 AC_SUBST(LTLIBICONV)
1290 # This is "GNU gnupg" - The project-id script from gettext
1293 AC_MSG_NOTICE([checking for gettext])
1295 AM_GNU_GETTEXT_VERSION([0.17])
1296 if test "$try_gettext" = yes; then
1297 AM_GNU_GETTEXT([external],[need-ngettext])
1299 # gettext requires some extra checks. These really should be part of
1300 # the basic AM_GNU_GETTEXT macro. TODO: move other gettext-specific
1301 # function checks to here.
1303 AC_CHECK_FUNCS(strchr)
1306 USE_INCLUDED_LIBINTL=no
1307 BUILD_INCLUDED_LIBINTL=no
1310 AC_SUBST(USE_INCLUDED_LIBINTL)
1311 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1315 # We use HAVE_LANGINFO_CODESET in a couple of places.
1318 # Checks required for our use of locales
1325 if test "$selinux_support" = yes ; then
1326 AC_DEFINE(ENABLE_SELINUX_HACKS,1,[Define to enable SELinux support])
1331 # Checks for header files.
1333 AC_MSG_NOTICE([checking for header files])
1334 AC_CHECK_HEADERS([unistd.h langinfo.h termio.h locale.h \
1335 pwd.h inttypes.h signal.h sys/select.h sys/time.h \
1336 stdint.h signal.h termios.h \
1337 ucred.h sys/ucred.h sys/sysmacros.h sys/mkdev.h])
1341 # Checks for typedefs, structures, and compiler characteristics.
1343 AC_MSG_NOTICE([checking for system characteristics])
1349 AC_CHECK_FUNCS([sigdescr_np])
1350 AC_CHECK_DECLS([sys_siglist],[],[],[#include <signal.h>
1351 /* NetBSD declares sys_siglist in unistd.h. */
1352 #ifdef HAVE_UNISTD_H
1353 # include <unistd.h>
1360 AC_SEARCH_LIBS([inet_addr], [nsl])
1362 AC_ARG_ENABLE(endian-check,
1363 AS_HELP_STRING([--disable-endian-check],
1364 [disable the endian check and trust the OS provided macros]),
1365 endiancheck=$enableval,endiancheck=yes)
1367 if test x"$endiancheck" = xyes ; then
1371 # fixme: we should get rid of the byte type
1372 AC_CHECK_TYPES([byte, ushort, ulong, u16, u32])
1373 AC_CHECK_SIZEOF(unsigned short)
1374 AC_CHECK_SIZEOF(unsigned int)
1375 AC_CHECK_SIZEOF(unsigned long)
1376 AC_CHECK_SIZEOF(unsigned long long)
1377 AC_CHECK_SIZEOF(size_t)
1378 AC_CHECK_SIZEOF(time_t,,[[
1380 #ifdef HAVE_SYS_TIME_H
1381 # include <sys/time.h>
1386 GNUPG_TIME_T_UNSIGNED
1389 if test "$ac_cv_sizeof_unsigned_short" = "0" \
1390 || test "$ac_cv_sizeof_unsigned_int" = "0" \
1391 || test "$ac_cv_sizeof_unsigned_long" = "0"; then
1392 AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
1397 # Checks for library functions.
1399 AC_MSG_NOTICE([checking for library functions])
1400 AC_CHECK_DECLS(getpagesize)
1404 AC_CHECK_FUNCS([atexit canonicalize_file_name clock_gettime ctermid \
1405 explicit_bzero fcntl flockfile fsync ftello \
1406 ftruncate funlockfile getaddrinfo getenv getpagesize \
1407 getpwnam getpwuid getrlimit getrusage gettimeofday \
1408 gmtime_r inet_ntop inet_pton isascii lstat memicmp \
1409 memmove memrchr mmap nl_langinfo pipe raise rand \
1410 setenv setlocale setrlimit sigaction sigprocmask \
1411 stat stpcpy strcasecmp strerror strftime stricmp \
1412 strlwr strncasecmp strpbrk strsep strtol strtoul \
1413 strtoull tcgetattr timegm times ttyname unsetenv \
1416 # On some systems (e.g. Solaris) nanosleep requires linking to librl.
1417 # Given that we use nanosleep only as an optimization over a select
1418 # based wait function we want it only if it is available in libc.
1420 AC_SEARCH_LIBS([nanosleep], [],
1421 [AC_DEFINE(HAVE_NANOSLEEP,1,
1422 [Define to 1 if you have the `nanosleep' function in libc.])])
1426 # See whether libc supports the Linux inotify interface
1429 AC_CHECK_FUNCS([inotify_init])
1434 if test "$have_android_system" = yes; then
1435 # On Android ttyname is a stub but prints an error message.
1436 AC_DEFINE(HAVE_BROKEN_TTYNAME,1,
1437 [Defined if ttyname does not work properly])
1440 AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
1442 # Dirmngr requires mmap on Unix systems.
1443 if test $ac_cv_func_mmap != yes -a $mmap_needed = yes; then
1444 AC_MSG_ERROR([[Sorry, the current implementation requires mmap.]])
1449 # Check for the getsockopt SO_PEERCRED, etc.
1451 AC_CHECK_MEMBERS([struct ucred.pid, struct ucred.cr_pid, struct sockpeercred.pid], [], [], [#include <sys/types.h>
1452 #include <sys/socket.h> ])
1455 AC_CHECK_FUNCS([getpeerucred])
1464 # Do we have zlib? Must do it here because Solaris failed
1465 # when compiling a conftest (due to the "-lz" from LIBS).
1466 # Note that we combine zlib and bzlib2 in ZLIBS.
1468 if test "$use_zip" = yes ; then
1469 _cppflags="${CPPFLAGS}"
1470 _ldflags="${LDFLAGS}"
1472 [ --with-zlib=DIR use libz in DIR],[
1473 if test -d "$withval"; then
1474 CPPFLAGS="${CPPFLAGS} -I$withval/include"
1475 LDFLAGS="${LDFLAGS} -L$withval/lib"
1479 AC_CHECK_HEADER(zlib.h,
1480 AC_CHECK_LIB(z, deflateInit2_,
1483 AC_DEFINE(HAVE_ZIP,1, [Defined if ZIP and ZLIB are supported])
1485 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
1486 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
1491 # Check whether we can support bzip2
1493 if test "$use_bzip2" = yes ; then
1494 _cppflags="${CPPFLAGS}"
1495 _ldflags="${LDFLAGS}"
1497 AS_HELP_STRING([--with-bzip2=DIR],[look for bzip2 in DIR]),
1499 if test -d "$withval" ; then
1500 CPPFLAGS="${CPPFLAGS} -I$withval/include"
1501 LDFLAGS="${LDFLAGS} -L$withval/lib"
1505 # Checking alongside stdio.h as an early version of bzip2 (1.0)
1506 # required stdio.h to be included before bzlib.h, and Solaris 9 is
1507 # woefully out of date.
1508 if test "$withval" != no ; then
1509 AC_CHECK_HEADER(bzlib.h,
1510 AC_CHECK_LIB(bz2,BZ2_bzCompressInit,
1513 ZLIBS="$ZLIBS -lbz2"
1514 AC_DEFINE(HAVE_BZIP2,1,
1515 [Defined if the bz2 compression library is available])
1517 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
1518 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags},[#include <stdio.h>])
1521 AM_CONDITIONAL(ENABLE_BZIP2_SUPPORT,test x"$have_bz2" = "xyes")
1525 # Check for readline support
1526 GNUPG_CHECK_READLINE
1529 if test "$development_version" = yes; then
1530 AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
1531 [Defined if this is not a regular release])
1534 if test "$USE_MAINTAINER_MODE" = "yes"; then
1535 AC_DEFINE(MAINTAINER_MODE,1,
1536 [Defined if this build is in maintainer mode])
1539 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
1543 # Add some extra libs here so that previous tests don't fail for
1544 # mysterious reasons - the final link step should bail out.
1545 # W32SOCKLIBS is also defined so that if can be used for tools not
1546 # requiring any network stuff but linking to code in libcommon which
1547 # tracks in winsock stuff (e.g. init_common_subsystems).
1548 if test "$have_w32_system" = yes; then
1549 W32SOCKLIBS="-lws2_32"
1550 NETLIBS="${NETLIBS} ${W32SOCKLIBS}"
1554 AC_SUBST(W32SOCKLIBS)
1557 # TPM libtss library .. don't compile TPM support if we don't have it
1560 [AS_HELP_STRING([--with-tss=TSS],
1561 [use the specified TPM Software Stack (ibm, intel, or autodetect)])],
1562 [with_tss=$withval],
1563 [with_tss=autodetect])
1566 if test "$build_tpm2d" = "yes"; then
1568 _save_cflags="$CFLAGS"
1570 if test "$with_tss" = autodetect; then
1571 AC_SEARCH_LIBS([TSS_Create],[tss ibmtss],have_libtss=IBM,
1572 AC_SEARCH_LIBS([Esys_Initialize],[tss2-esys],have_libtss=Intel,have_libtss=no))
1573 elif test "$with_tss" = ibm; then
1574 AC_SEARCH_LIBS([TSS_Create],[tss ibmtss],have_libtss=IBM,
1575 [AC_MSG_ERROR([IBM TPM Software Stack requested but not found])])
1576 elif test "$with_tss" = intel; then
1577 AC_SEARCH_LIBS([Esys_Initialize],[tss2-esys],have_libtss=Intel,
1578 [AC_MSG_ERROR([Intel TPM Software Stack requested but not found])])
1580 AC_MSG_ERROR([Invalid TPM Software Stack requested: $with_tss])
1583 if test "$have_libtss" = IBM; then
1584 LIBTSS_CFLAGS="-DTPM_POSIX"
1585 CFLAGS="$CFLAGS ${LIBTSS_CFLAGS}"
1586 AC_CHECK_HEADER([tss2/tss.h],
1587 [AC_DEFINE(TSS_INCLUDE,tss2, [tss2 include location])], [
1588 AC_CHECK_HEADER([ibmtss/tss.h],[AC_DEFINE(TSS_INCLUDE,ibmtss,
1589 [ibmtss include location])], [
1590 AC_MSG_WARN([No TSS2 include directory found, disabling TPM support])
1595 AC_SUBST(TSS_INCLUDE)
1596 elif test "$have_libtss" = Intel; then
1598 # Intel TSS has an API issue: Esys_TR_GetTpmHandle wasn't introduced
1599 # until version 2.4.0.
1601 # Note: the missing API is fairly serious and is also easily backportable
1602 # so keep the check below as is intead of going by library version number.
1604 AC_CHECK_LIB(tss2-esys, Esys_TR_GetTpmHandle, [], [
1605 AC_MSG_WARN([Need Esys_TR_GetTpmHandle API (usually requires Intel TSS 2.4.0 or later, disabling TPM support)])
1608 LIBTSS_LIBS="$LIBS -ltss2-mu -ltss2-rc -ltss2-tctildr"
1609 AC_DEFINE(HAVE_INTEL_TSS, 1, [Defined if we have the Intel TSS])
1612 CFLAGS="$_save_cflags"
1613 if test "$have_libtss" != no; then
1614 AC_DEFINE(HAVE_LIBTSS, 1, [Defined if we have TPM2 support library])
1615 # look for a TPM emulator for testing
1616 AC_PATH_PROG(TPMSERVER, tpm_server,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
1617 AC_PATH_PROG(SWTPM, swtpm,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
1618 AC_PATH_PROG(SWTPM_IOCTL, swtpm_ioctl,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
1619 AC_PATH_PROG(TSSSTARTUP, tssstartup,,/bin:/usr/bin:/usr/lib/ibmtss:/usr/libexec/ibmtss)
1622 if test "$have_libtss" = no; then
1625 AC_SUBST(LIBTSS_LIBS)
1626 AC_SUBST(LIBTSS_CFLAGS)
1627 AM_CONDITIONAL(HAVE_LIBTSS, test "$have_libtss" != no)
1628 AM_CONDITIONAL(TEST_LIBTSS, test -n "$TPMSERVER" || test -n "$SWTPM" && test -n "$TSSSTARTUP")
1629 AC_SUBST(HAVE_LIBTSS)
1632 # Setup gcc specific options
1635 AC_MSG_NOTICE([checking for cc features])
1636 if test "$GCC" = yes; then
1638 mycflags_save=$CFLAGS
1640 # Check whether gcc does not emit a diagnositc for unknown -Wno-*
1641 # options. This is the case for gcc >= 4.6
1642 AC_MSG_CHECKING([if gcc ignores unknown -Wno-* options])
1643 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1644 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6 )
1646 #endif]],[])],[_gcc_silent_wno=yes],[_gcc_silent_wno=no])
1647 AC_MSG_RESULT($_gcc_silent_wno)
1649 # Note that it is okay to use CFLAGS here because these are just
1650 # warning options and the user should have a chance of overriding
1652 if test "$USE_MAINTAINER_MODE" = "yes"; then
1653 mycflags="$mycflags -O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
1654 mycflags="$mycflags -Wformat -Wno-format-y2k -Wformat-security"
1655 if test x"$_gcc_silent_wno" = xyes ; then
1658 AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
1659 CFLAGS="-Wno-missing-field-initializers"
1660 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
1661 [_gcc_wopt=yes],[_gcc_wopt=no])
1662 AC_MSG_RESULT($_gcc_wopt)
1664 if test x"$_gcc_wopt" = xyes ; then
1665 mycflags="$mycflags -W -Wno-sign-compare -Wno-format-zero-length"
1666 mycflags="$mycflags -Wno-missing-field-initializers"
1669 AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
1670 CFLAGS="-Wdeclaration-after-statement"
1671 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
1672 AC_MSG_RESULT($_gcc_wopt)
1673 if test x"$_gcc_wopt" = xyes ; then
1674 mycflags="$mycflags -Wdeclaration-after-statement"
1677 AC_MSG_CHECKING([if gcc supports -Wlogical-op])
1678 CFLAGS="-Wlogical-op -Werror"
1679 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
1680 AC_MSG_RESULT($_gcc_wopt)
1681 if test x"$_gcc_wopt" = xyes ; then
1682 mycflags="$mycflags -Wlogical-op"
1685 AC_MSG_CHECKING([if gcc supports -Wvla])
1687 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
1688 AC_MSG_RESULT($_gcc_wopt)
1689 if test x"$_gcc_wopt" = xyes ; then
1690 mycflags="$mycflags -Wvla"
1694 mycflags="$mycflags -Wall"
1695 if test x"$_gcc_silent_wno" = xyes ; then
1696 mycflags="$mycflags -Wno-format-zero-length"
1700 if test x"$_gcc_silent_wno" = xyes ; then
1703 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
1704 CFLAGS="-Wno-pointer-sign"
1705 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
1706 [_gcc_psign=yes],[_gcc_psign=no])
1707 AC_MSG_RESULT($_gcc_psign)
1709 if test x"$_gcc_psign" = xyes ; then
1710 mycflags="$mycflags -Wno-pointer-sign"
1713 AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
1714 CFLAGS="-Wpointer-arith"
1715 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_psign=yes,_gcc_psign=no)
1716 AC_MSG_RESULT($_gcc_psign)
1717 if test x"$_gcc_psign" = xyes ; then
1718 mycflags="$mycflags -Wpointer-arith"
1721 CFLAGS="$mycflags $mycflags_save"
1722 if test "$use_libdns" = yes; then
1723 # dirmngr/dns.{c,h} require C99 and GNU extensions. */
1724 USE_C99_CFLAGS="-std=gnu99"
1728 AC_SUBST(USE_C99_CFLAGS)
1732 # This is handy for debugging so the compiler doesn't rearrange
1733 # things and eliminate variables.
1735 AC_ARG_ENABLE(optimization,
1736 AS_HELP_STRING([--disable-optimization],
1737 [disable compiler optimization]),
1738 [if test $enableval = no ; then
1739 CFLAGS=`echo $CFLAGS | sed s/-O[[1-9]]\ /-O0\ /g`
1743 # log_debug has certain requirements which might hamper portability.
1744 # Thus we use an option to enable it.
1746 AC_MSG_CHECKING([whether to enable log_clock])
1747 AC_ARG_ENABLE(log_clock,
1748 AS_HELP_STRING([--enable-log-clock],
1749 [enable log_clock timestamps]),
1750 enable_log_clock=$enableval, enable_log_clock=no)
1751 AC_MSG_RESULT($enable_log_clock)
1752 if test "$enable_log_clock" = yes ; then
1753 AC_DEFINE(ENABLE_LOG_CLOCK,1,[Defined to use log_clock timestamps])
1756 # Add -Werror to CFLAGS. This hack can be used to avoid problems with
1757 # misbehaving autoconf tests in case the user supplied -Werror.
1759 AC_ARG_ENABLE(werror,
1760 AS_HELP_STRING([--enable-werror],
1761 [append -Werror to CFLAGS]),
1762 [if test $enableval = yes ; then
1763 CFLAGS="$CFLAGS -Werror"
1767 # Configure option --enable-all-tests
1769 AC_MSG_CHECKING([whether "make check" shall run all tests])
1770 AC_ARG_ENABLE(all-tests,
1771 AS_HELP_STRING([--enable-all-tests],
1772 [let "make check" run all tests]),
1773 run_all_tests=$enableval, run_all_tests=no)
1774 AC_MSG_RESULT($run_all_tests)
1775 if test "$run_all_tests" = "yes"; then
1776 AC_DEFINE(RUN_ALL_TESTS,1,
1777 [Defined if "make check" shall run all tests])
1781 # Configure option --disable-tests
1783 AC_MSG_CHECKING([whether tests should be run])
1784 AC_ARG_ENABLE(tests,
1785 AS_HELP_STRING([--disable-tests],
1786 [do not run any tests]),
1787 run_tests=$enableval, run_tests=yes)
1788 AC_MSG_RESULT($run_tests)
1791 # We do not want support for the GNUPG_BUILDDIR environment variable
1792 # in a released version. However, our regression tests suite requires
1793 # this and thus we build with support for it during "make distcheck".
1794 # This configure option implements this along with the top Makefile's
1795 # AM_DISTCHECK_CONFIGURE_FLAGS.
1797 gnupg_builddir_envvar=no
1798 AC_ARG_ENABLE(gnupg-builddir-envvar,,
1799 gnupg_builddir_envvar=$enableval)
1800 if test x"$gnupg_builddir_envvar" = x"yes"; then
1801 AC_DEFINE(ENABLE_GNUPG_BUILDDIR_ENVVAR, 1,
1802 [This is only used with "make distcheck"])
1807 # To avoid problems with systemd cleaning up the /run/user directory,
1808 # this option will make GnuPG try to use /run/gnupg/user as socket dir
1811 AC_ARG_ENABLE(run-gnupg-user-socket,
1812 AS_HELP_STRING([--enable-run-gnupg-user-socket],
1813 [try /run/gnupg/user for sockets prior to /run/user]),
1814 use_run_gnupg_user_socket=$enableval)
1815 if test x"$use_run_gnupg_user_socket" = x"yes"; then
1816 AC_DEFINE(USE_RUN_GNUPG_USER_SOCKET, 1,
1817 [If defined try /run/gnupg/user before /run/user])
1822 # Decide what to build
1825 build_scdaemon_extra=""
1826 if test "$build_scdaemon" = "yes"; then
1827 if test $have_libusb = no; then
1828 build_scdaemon_extra="without internal CCID driver"
1830 if test -n "$build_scdaemon_extra"; then
1831 build_scdaemon_extra="(${build_scdaemon_extra})"
1837 # Set variables for use by automake makefiles.
1839 AM_CONDITIONAL(BUILD_GPG, test "$build_gpg" = "yes")
1840 AM_CONDITIONAL(BUILD_GPGSM, test "$build_gpgsm" = "yes")
1841 AM_CONDITIONAL(BUILD_AGENT, test "$build_agent" = "yes")
1842 AM_CONDITIONAL(BUILD_SCDAEMON, test "$build_scdaemon" = "yes")
1843 AM_CONDITIONAL(BUILD_G13, test "$build_g13" = "yes")
1844 AM_CONDITIONAL(BUILD_DIRMNGR, test "$build_dirmngr" = "yes")
1845 AM_CONDITIONAL(BUILD_KEYBOXD, test "$build_keyboxd" = "yes")
1846 AM_CONDITIONAL(BUILD_TPM2D, test "$build_tpm2d" = "yes")
1847 AM_CONDITIONAL(BUILD_DOC, test "$build_doc" = "yes")
1848 AM_CONDITIONAL(BUILD_GPGTAR, test "$build_gpgtar" = "yes")
1849 AM_CONDITIONAL(BUILD_WKS_TOOLS, test "$build_wks_tools" = "yes")
1851 AM_CONDITIONAL(DISABLE_TESTS, test "$run_tests" != yes)
1852 AM_CONDITIONAL(ENABLE_CARD_SUPPORT, test "$card_support" = yes)
1853 AM_CONDITIONAL(NO_TRUST_MODELS, test "$use_trust_models" = no)
1854 AM_CONDITIONAL(USE_TOFU, test "$use_tofu" = yes)
1857 # Set some defines for use gpgconf.
1859 if test "$build_gpg" = yes ; then
1860 AC_DEFINE(BUILD_WITH_GPG,1,[Defined if GPG is to be build])
1862 if test "$build_gpgsm" = yes ; then
1863 AC_DEFINE(BUILD_WITH_GPGSM,1,[Defined if GPGSM is to be build])
1865 if test "$build_agent" = yes ; then
1866 AC_DEFINE(BUILD_WITH_AGENT,1,[Defined if GPG-AGENT is to be build])
1868 if test "$build_scdaemon" = yes ; then
1869 AC_DEFINE(BUILD_WITH_SCDAEMON,1,[Defined if SCDAEMON is to be build])
1871 if test "$build_dirmngr" = yes ; then
1872 AC_DEFINE(BUILD_WITH_DIRMNGR,1,[Defined if DIRMNGR is to be build])
1874 if test "$build_keyboxd" = yes ; then
1875 AC_DEFINE(BUILD_WITH_KEYBOXD,1,[Defined if KEYBOXD is to be build])
1877 if test "$build_tpm2d" = yes ; then
1878 AC_DEFINE(BUILD_WITH_TPM2D,1,[Defined if TPM2D to be build])
1880 if test "$build_g13" = yes ; then
1881 AC_DEFINE(BUILD_WITH_G13,1,[Defined if G13 is to be build])
1886 # Define Name strings
1888 AC_DEFINE_UNQUOTED(GNUPG_NAME, "GnuPG", [The name of the project])
1890 AC_DEFINE_UNQUOTED(GPG_NAME, "gpg", [The name of the OpenPGP tool])
1891 AC_DEFINE_UNQUOTED(GPG_DISP_NAME, "GnuPG", [The displayed name of gpg])
1893 AC_DEFINE_UNQUOTED(GPGSM_NAME, "gpgsm", [The name of the S/MIME tool])
1894 AC_DEFINE_UNQUOTED(GPGSM_DISP_NAME, "GPGSM", [The displayed name of gpgsm])
1896 AC_DEFINE_UNQUOTED(GPG_AGENT_NAME, "gpg-agent", [The name of the agent])
1897 AC_DEFINE_UNQUOTED(GPG_AGENT_DISP_NAME, "GPG Agent",
1898 [The displayed name of gpg-agent])
1900 AC_DEFINE_UNQUOTED(TPM2DAEMON_NAME, "tpm2daemon", [The name of the TPM2 daemon])
1901 AC_DEFINE_UNQUOTED(TPM2DAEMON_DISP_NAME, "TPM2 Daemon",
1902 [The displayed name of TPM2 daemon])
1904 AC_DEFINE_UNQUOTED(SCDAEMON_NAME, "scdaemon", [The name of the scdaemon])
1905 AC_DEFINE_UNQUOTED(SCDAEMON_DISP_NAME, "SCDaemon",
1906 [The displayed name of scdaemon])
1908 AC_DEFINE_UNQUOTED(DIRMNGR_NAME, "dirmngr", [The name of the dirmngr])
1909 AC_DEFINE_UNQUOTED(DIRMNGR_DISP_NAME, "DirMngr",
1910 [The displayed name of dirmngr])
1912 AC_DEFINE_UNQUOTED(KEYBOXD_NAME, "keyboxd", [The name of the keyboxd])
1913 AC_DEFINE_UNQUOTED(KEYBOXD_DISP_NAME, "Keyboxd",
1914 [The displayed name of keyboxd])
1916 AC_DEFINE_UNQUOTED(G13_NAME, "g13", [The name of the g13 tool])
1917 AC_DEFINE_UNQUOTED(G13_DISP_NAME, "G13", [The displayed name of g13])
1919 AC_DEFINE_UNQUOTED(GPGCONF_NAME, "gpgconf", [The name of the gpgconf tool])
1920 AC_DEFINE_UNQUOTED(GPGCONF_DISP_NAME, "GPGConf",
1921 [The displayed name of gpgconf])
1923 AC_DEFINE_UNQUOTED(GPGTAR_NAME, "gpgtar", [The name of the gpgtar tool])
1925 AC_DEFINE_UNQUOTED(GPG_AGENT_SOCK_NAME, "S.gpg-agent",
1926 [The name of the agent socket])
1927 AC_DEFINE_UNQUOTED(GPG_AGENT_EXTRA_SOCK_NAME, "S.gpg-agent.extra",
1928 [The name of the agent socket for remote access])
1929 AC_DEFINE_UNQUOTED(GPG_AGENT_BROWSER_SOCK_NAME, "S.gpg-agent.browser",
1930 [The name of the agent socket for browsers])
1931 AC_DEFINE_UNQUOTED(GPG_AGENT_SSH_SOCK_NAME, "S.gpg-agent.ssh",
1932 [The name of the agent socket for ssh])
1933 AC_DEFINE_UNQUOTED(DIRMNGR_INFO_NAME, "DIRMNGR_INFO",
1934 [The name of the dirmngr info envvar])
1935 AC_DEFINE_UNQUOTED(SCDAEMON_SOCK_NAME, "S.scdaemon",
1936 [The name of the SCdaemon socket])
1937 AC_DEFINE_UNQUOTED(KEYBOXD_SOCK_NAME, "S.keyboxd",
1938 [The name of the keyboxd socket])
1939 AC_DEFINE_UNQUOTED(TPM2DAEMON_SOCK_NAME, "S.tpm2daemon",
1940 [The name of the TPM2 daemon socket])
1941 AC_DEFINE_UNQUOTED(DIRMNGR_SOCK_NAME, "S.dirmngr",
1942 [The name of the dirmngr socket])
1943 AC_DEFINE_UNQUOTED(DIRMNGR_DEFAULT_KEYSERVER,
1944 "hkps://keyserver.ubuntu.com",
1945 [The default keyserver for dirmngr to use, if none is explicitly given])
1947 AC_DEFINE_UNQUOTED(GPGEXT_GPG, "gpg", [The standard binary file suffix])
1949 if test "$have_w32_system" = yes; then
1950 AC_DEFINE_UNQUOTED(GNUPG_REGISTRY_DIR, "Software\\\\GNU\\\\GnuPG",
1951 [The directory part of the W32 registry keys])
1956 # Provide information about the build.
1958 BUILD_REVISION="mym4_revision"
1959 AC_SUBST(BUILD_REVISION)
1960 AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
1961 [GIT commit id revision used to build this package])
1964 BUILD_VERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'`
1966 BUILD_VERSION="${BUILD_VERSION}mym4_revision_dec"
1967 BUILD_FILEVERSION=`echo "${BUILD_VERSION}" | tr . ,`
1968 AC_SUBST(BUILD_VERSION)
1969 AC_SUBST(BUILD_FILEVERSION)
1971 AC_ARG_ENABLE([build-timestamp],
1972 AS_HELP_STRING([--enable-build-timestamp],
1973 [set an explicit build timestamp for reproducibility.
1974 (default is the current time in ISO-8601 format)]),
1975 [if test "$enableval" = "yes"; then
1976 BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
1978 BUILD_TIMESTAMP="$enableval"
1980 BUILD_HOSTNAME="$ac_hostname"],
1981 [BUILD_TIMESTAMP="<none>"
1982 BUILD_HOSTNAME="<anon>"])
1983 AC_SUBST(BUILD_TIMESTAMP)
1984 AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
1985 [The time this package was configured for a build])
1986 AC_SUBST(BUILD_HOSTNAME)
1990 # Print errors here so that they are visible all
1991 # together and the user can acquire them all together.
1994 if test "$have_gpg_error" = "no"; then
1998 *** You need libgpg-error to build this program.
1999 ** This library is for example available at
2000 *** https://gnupg.org/ftp/gcrypt/gpgrt
2001 *** (at least version $NEED_GPGRT_VERSION is required.)
2004 if test "$have_libgcrypt" = "no"; then
2008 *** You need libgcrypt to build this program.
2009 ** This library is for example available at
2010 *** https://gnupg.org/ftp/gcrypt/libgcrypt/
2011 *** (at least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API) is required.)
2014 if test "$have_libassuan" = "no"; then
2018 *** You need libassuan to build this program.
2019 *** This library is for example available at
2020 *** https://gnupg.org/ftp/gcrypt/libassuan/
2021 *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
2024 if test "$have_ksba" = "no"; then
2028 *** You need libksba to build this program.
2029 *** This library is for example available at
2030 *** https://gnupg.org/ftp/gcrypt/libksba/
2031 *** (at least version $NEED_KSBA_VERSION using API $NEED_KSBA_API is required).
2034 if test "$have_npth" = "no"; then
2038 *** It is now required to build with support for the
2039 *** New Portable Threads Library (nPth). Please install this
2040 *** library first. The library is for example available at
2041 *** https://gnupg.org/ftp/gcrypt/npth/
2042 *** (at least version $NEED_NPTH_VERSION (API $NEED_NPTH_API) is required).
2046 if test "$require_iconv" = yes; then
2047 if test "$am_func_iconv" != yes; then
2051 *** The system does not provide a working iconv function. Please
2052 *** install a suitable library; for example GNU Libiconv which is
2054 *** https://ftp.gnu.org/gnu/libiconv/
2059 if test "$use_ccid_driver" = yes; then
2060 if test "$have_libusb" != yes; then
2064 *** You need libusb to build the internal ccid driver. Please
2065 *** install a libusb suitable for your system.
2070 if test "$die" = "yes"; then
2073 *** Required libraries not found. Please consult the above messages
2074 *** and install them before running configure again.
2080 AC_CONFIG_FILES([ m4/Makefile
2097 tests/gpgscm/Makefile
2098 tests/openpgp/Makefile
2100 tests/migrations/Makefile
2101 tests/tpm2dtests/Makefile
2102 tests/gpgme/Makefile
2103 tests/pkits/Makefile
2104 g10/gpg.w32-manifest
2105 g10/gpgv.w32-manifest
2106 sm/gpgsm.w32-manifest
2107 kbx/keyboxd.w32-manifest
2108 agent/gpg-agent.w32-manifest
2109 scd/scdaemon.w32-manifest
2110 dirmngr/dirmngr.w32-manifest
2111 dirmngr/dirmngr_ldap.w32-manifest
2112 dirmngr/dirmngr-client.w32-manifest
2113 tools/gpg-connect-agent.w32-manifest
2114 tools/gpgconf.w32-manifest
2115 tools/gpgtar.w32-manifest
2116 tools/gpg-check-pattern.w32-manifest
2117 tools/gpg-wks-client.w32-manifest
2118 tools/gpg-card.w32-manifest
2125 if test "$build_tpm2d" = "yes"; then
2126 show_tss_type="($have_libtss)"
2130 GnuPG v${VERSION} has been configured as follows:
2132 Revision: mym4_revision (mym4_revision_dec)
2133 Platform: $PRINTABLE_OS_NAME ($host)
2136 S/MIME: $build_gpgsm
2138 Smartcard: $build_scdaemon $build_scdaemon_extra
2139 TPM: $build_tpm2d $show_tss_type
2141 Dirmngr: $build_dirmngr
2142 Keyboxd: $build_keyboxd
2143 Gpgtar: $build_gpgtar
2144 WKS tools: $build_wks_tools
2146 Protect tool: $show_gnupg_protect_tool_pgm
2147 LDAP wrapper: $show_gnupg_dirmngr_ldap_pgm
2148 Default agent: $show_gnupg_agent_pgm
2149 Default pinentry: $show_gnupg_pinentry_pgm
2150 Default scdaemon: $show_gnupg_scdaemon_pgm
2151 Default keyboxd: $show_gnupg_keyboxd_pgm
2152 Default tpm2daemon: $show_gnupg_tpm2daemon_pgm
2153 Default dirmngr: $show_gnupg_dirmngr_pgm
2155 Dirmngr auto start: $dirmngr_auto_start
2156 Readline support: $gnupg_cv_have_readline
2157 LDAP support: $gnupg_have_ldap
2158 TLS support: $use_tls_library
2159 TOFU support: $use_tofu
2160 Tor support: $show_tor_support
2162 if test "$have_libtss" != no -a -z "$TPMSERVER" -a -z "$SWTPM"; then
2164 Warning: TPM support is compiled in but no software TPM
2165 for testing was discovered. TPM tests are disabled
2169 if test "x${gpg_config_script_warn}" != x; then
2171 Warning: Mismatches between the target platform and the
2172 to be used libraries have been detected for:
2173 ${gpg_config_script_warn}
2174 Please check above for more warning messages.
2178 if test "${build_gpg}" != "yes"; then
2180 Warning: The component "gpg" is used by other components as
2181 well as for the test suite. You have disabled
2182 this component and thus other things won't work.
2186 if test "${run_tests}" != "yes"; then
2188 Warning: The use of the test suite has been disabled!
2189 This is in almost all cases a bad idea. Take care.