Bump to 2.4.3
[platform/upstream/gpg2.git] / configure.ac
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
5 #
6 # This file is part of GnuPG.
7 #
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.
12 #
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.
17 #
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/>.
20
21 # Process this file with autoconf to produce a configure script.
22 AC_PREREQ([2.69])
23 min_automake_version="1.16.3"
24
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])
33
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.
39
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])
52
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])
57
58 NEED_GPGRT_VERSION=1.46
59
60 NEED_LIBGCRYPT_API=1
61 NEED_LIBGCRYPT_VERSION=1.9.1
62
63 NEED_LIBASSUAN_API=2
64 NEED_LIBASSUAN_VERSION=2.5.0
65
66 NEED_KSBA_API=1
67 NEED_KSBA_VERSION=1.6.3
68
69 NEED_NTBTLS_API=1
70 NEED_NTBTLS_VERSION=0.1.0
71
72 NEED_NPTH_API=1
73 NEED_NPTH_VERSION=1.2
74
75
76 NEED_GNUTLS_VERSION=3.0
77
78 NEED_SQLITE_VERSION=3.27
79
80 development_version=mym4_isbeta
81 PACKAGE=$PACKAGE_NAME
82 PACKAGE_GT=${PACKAGE_NAME}2
83 VERSION=$PACKAGE_VERSION
84
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])
89 AC_CANONICAL_HOST
90 AB_INIT
91
92 AC_USE_SYSTEM_EXTENSIONS
93
94
95 # Some status variables.
96 have_gpg_error=no
97 have_libgcrypt=no
98 have_libassuan=no
99 have_ksba=no
100 have_ntbtls=no
101 have_gnutls=no
102 have_sqlite=no
103 have_npth=no
104 have_libusb=no
105 have_libtss=no
106 have_system_resolver=no
107 gnupg_have_ldap="n/a"
108
109 use_zip=yes
110 use_bzip2=yes
111 use_exec=yes
112 use_trust_models=yes
113 use_tofu=yes
114 use_libdns=yes
115 card_support=yes
116 use_ccid_driver=auto
117 dirmngr_auto_start=yes
118 use_tls_library=no
119 large_secmem=no
120 show_tor_support=no
121
122 # gpg is a required part and can't be disabled anymore.
123 build_gpg=yes
124 GNUPG_BUILD_PROGRAM(gpgsm, yes)
125 # The agent is a required part and can't be disabled anymore.
126 build_agent=yes
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)
139
140
141 AC_SUBST(PACKAGE)
142 AC_SUBST(PACKAGE_GT)
143 AC_SUBST(VERSION)
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])
156
157
158
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"
171
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"
179
180
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"
188
189
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"
197
198
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"
206
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"
214
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"
223
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"
232
233
234 #
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.
237 #
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])
243 fi
244 AM_CONDITIONAL(USE_GPG2_HACK, test "$gpg_is_gpg2" = "yes")
245
246
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)
255
256
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
265 else
266    SECMEM_BUFFER_SIZE=32768
267 fi
268 AC_DEFINE_UNQUOTED(SECMEM_BUFFER_SIZE,$SECMEM_BUFFER_SIZE,
269                    [Size of secure memory buffer])
270
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)])
279
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])
289 fi
290
291 AC_MSG_CHECKING([whether to enable TOFU])
292 AC_ARG_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])
299 fi
300
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])
309 fi
310 AM_CONDITIONAL(USE_LIBDNS, test "$use_libdns" = yes)
311
312
313 #
314 # Options to disable algorithm
315 #
316
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])
323
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])
335
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])
343
344
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])
349 AC_ARG_ENABLE(zip,
350    AS_HELP_STRING([--disable-zip],
351                   [disable the ZIP and ZLIB compression algorithm]),
352    use_zip=$enableval)
353 AC_MSG_RESULT($use_zip)
354
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])
358 AC_ARG_ENABLE(bzip2,
359    AS_HELP_STRING([--disable-bzip2],[disable the BZIP2 compression algorithm]),
360    use_bzip2=$enableval)
361 AC_MSG_RESULT($use_bzip2)
362
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])
366 AC_ARG_ENABLE(exec,
367     AS_HELP_STRING([--disable-exec],[disable all external program execution]),
368     use_exec=$enableval)
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])
372 fi
373
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])
380       fi],enableval=yes)
381   gnupg_cv_enable_photo_viewers=$enableval
382   AC_MSG_RESULT($enableval)
383
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
389            withval=no
390         elif test "$withval" != no ; then
391            AC_DEFINE_UNQUOTED(FIXED_PHOTO_VIEWER,"$withval",
392                             [if set, restrict photo-viewer to this])
393         fi],withval=no)
394     AC_MSG_RESULT($withval)
395   fi
396 fi
397
398
399 #
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.
402 #
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
408    enableval=5
409 elif test "$enableval" = "yes" || test "$enableval" = ""; then
410    enableval=4096
411 fi
412 changequote(,)dnl
413 key_cache_size=`echo "$enableval" | sed 's/[A-Za-z]//g'`
414 changequote([,])dnl
415 if test "$enableval" != "$key_cache_size" || test "$key_cache_size" -lt 5; then
416    AC_MSG_ERROR([invalid key-cache size])
417 fi
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])
421
422
423
424 #
425 # Check whether we want to use Linux capabilities
426 #
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)
432
433 #
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])
443 else
444   build_scdaemon=no
445 fi
446
447 #
448 # Allow disabling of internal CCID support.
449 # It is defined only after we confirm the library is available later
450 #
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)
457
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])
467 fi
468
469
470 #
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
473 # config.h.
474 #
475 AH_TOP([
476 #ifndef GNUPG_CONFIG_H_INCLUDED
477 #define GNUPG_CONFIG_H_INCLUDED
478 ])
479
480 #
481 # Stuff which goes at the bottom of config.h.
482 #
483 AH_BOTTOM([
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
488
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 "\\"
495 #define EXTSEP_C '.'
496 #define EXTSEP_S "."
497 #define PATHSEP_C ';'
498 #define PATHSEP_S ";"
499 #define EXEEXT_S ".exe"
500 #else
501 #define DIRSEP_C '/'
502 #define DIRSEP_S "/"
503 #define EXTSEP_C '.'
504 #define EXTSEP_S "."
505 #define PATHSEP_C ':'
506 #define PATHSEP_S ":"
507 #define EXEEXT_S ""
508 #endif
509
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"
515 # else
516 #  define GNUPG_DEFAULT_HOMEDIR "/gnupg"
517 # endif
518 #elif defined(__VMS)
519 #define GNUPG_DEFAULT_HOMEDIR "/SYS$LOGIN/gnupg"
520 #else
521 #define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
522 #endif
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"
527
528 #define GNUPG_DEF_COPYRIGHT_LINE "Copyright (C) 2023 g10 Code GmbH"
529
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
534    only defaults.  */
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"
542 # else
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"
548 # endif
549 #endif
550
551 /* Derive some other constants. */
552 #if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
553 #define EXEC_TEMPFILE_ONLY
554 #endif
555
556
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
564 #else
565 #error "No endianness found"
566 #endif
567 #endif
568
569
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
577 # endif
578 #endif
579
580 /* Enable the es_ macros from gpgrt.  */
581 #define GPGRT_ENABLE_ES_MACROS 1
582
583 /* Enable the log_ macros from gpgrt.  */
584 #define GPGRT_ENABLE_LOG_MACROS 1
585
586 /* We want the argparse macros from gpgrt.  */
587 #define GPGRT_ENABLE_ARGPARSE_MACROS 1
588
589 /* Tell libgcrypt not to use its own libgpg-error implementation. */
590 #define USE_LIBGPG_ERROR 1
591
592 /* Tell Libgcrypt not to include deprecated definitions.  */
593 #define GCRYPT_NO_DEPRECATED 1
594
595 /* Our HTTP code is used in estream mode.  */
596 #define HTTP_USE_ESTREAM 1
597
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
600    handler.  */
601 #define HTTP_NO_WSASTARTUP
602
603 /* Under Windows we use the gettext code from libgpg-error.  */
604 #define GPG_ERR_ENABLE_GETTEXT_MACROS
605
606 /* Under WindowsCE we use the strerror replacement from libgpg-error.  */
607 #define GPG_ERR_ENABLE_ERRNO_MACROS
608
609 #endif /*GNUPG_CONFIG_H_INCLUDED*/
610 ])
611
612
613 AM_MAINTAINER_MODE
614 AC_ARG_VAR(SYSROOT,[locate config scripts also below that directory])
615
616 # Checks for programs.
617 AC_MSG_NOTICE([checking for programs])
618 AC_PROG_MAKE_SET
619 AM_SANITY_CHECK
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)
626 AM_SILENT_RULES
627 AC_PROG_AWK
628 AC_PROG_CC
629 AC_PROG_CPP
630 AM_PROG_CC_C_O
631 if test "x$ac_cv_prog_cc_c89" = "xno" ; then
632   AC_MSG_ERROR([[No C-89 compiler found]])
633 fi
634 AC_PROG_INSTALL
635 AC_PROG_LN_S
636 AC_PROG_RANLIB
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])
644 AC_SYS_LARGEFILE
645
646
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])
651 else
652   AWK_HEX_NUMBER_OPTION='-n'
653   AC_MSG_NOTICE([awk with an option -n for hexadecimal])
654 fi
655 AC_SUBST(AWK_HEX_NUMBER_OPTION)
656
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
662 # approach.
663 AC_MSG_CHECKING(for cc for build)
664 if test "$cross_compiling" = "yes"; then
665   CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
666 else
667   CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
668 fi
669 AC_MSG_RESULT($CC_FOR_BUILD)
670 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
671
672 # We need to call this macro because other pkg-config macros are
673 # not always used.
674 PKG_PROG_PKG_CONFIG
675
676
677 try_gettext=yes
678 require_iconv=yes
679 have_dosish_system=no
680 have_w32_system=no
681 have_android_system=no
682 use_simple_gettext=no
683 mmap_needed=yes
684 require_pipe_to_unblock_pselect=yes
685 case "${host}" in
686     *-mingw32*)
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
696         have_w32_system=yes
697         require_iconv=no
698         require_pipe_to_unblock_pselect=no
699         AC_DEFINE(HAVE_DRIVE_LETTERS,1, [Defined if the OS supports drive letters.])
700         try_gettext="no"
701         use_simple_gettext=yes
702         mmap_needed=no
703         build_wks_tools=no
704         ;;
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
710         try_gettext="no"
711         build_wks_tools=no
712         ;;
713
714     i?86-*-msdosdjgpp*)
715         # DOS with the DJGPP environment
716         ac_cv_have_dev_random=no
717         AC_DEFINE(HAVE_DRIVE_LETTERS)
718         have_dosish_system=yes
719         try_gettext="no"
720         build_wks_tools=no
721         ;;
722
723     *-*-hpux*)
724         if test -z "$GCC" ; then
725             CFLAGS="-Ae -D_HPUX_SOURCE $CFLAGS"
726         fi
727         ;;
728     *-dec-osf4*)
729         if test -z "$GCC" ; then
730             # Suppress all warnings
731             # to get rid of the unsigned/signed char mismatch warnings.
732             CFLAGS="-w $CFLAGS"
733         fi
734         ;;
735     *-dec-osf5*)
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"
742         fi
743         ;;
744     m68k-atari-mint)
745         ;;
746     *-linux-android*)
747         have_android_system=yes
748         # Android is fully utf-8 and we do not want to use iconv to
749         # keeps things simple
750         require_iconv=no
751         build_wks_tools=no
752         ;;
753     *-apple-darwin*)
754         AC_DEFINE(_DARWIN_C_SOURCE, 1,
755                   Expose all libc features (__DARWIN_C_FULL).)
756         ;;
757     *-*-netbsd*)
758         require_pipe_to_unblock_pselect=yes
759         ;;
760     *)
761         ;;
762 esac
763
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.])
769 fi
770
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.])
777 fi
778 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
779
780 AM_CONDITIONAL(USE_SIMPLE_GETTEXT, test x"$use_simple_gettext" = xyes)
781
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])
785 fi
786 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
787
788 if test "$have_android_system" = yes; then
789    AC_DEFINE(HAVE_ANDROID_SYSTEM,1, [Defined if we build for an Android system])
790 fi
791 AM_CONDITIONAL(HAVE_ANDROID_SYSTEM, test "$have_android_system" = yes)
792
793
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])
796
797
798 #
799 # Checks for libraries.
800 #
801 AC_MSG_NOTICE([checking for libraries])
802
803
804 #
805 # gpgrt (aka libgpg-error) is a library with error codes shared
806 # between GnuPG related projects.
807 #
808 AM_PATH_GPG_ERROR("$NEED_GPGRT_VERSION",
809                   have_gpg_error=yes,have_gpg_error=no)
810
811
812 #
813 # Libgcrypt is our generic crypto library
814 #
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
825 #    else
826 #        if test "$major" -eq 1; then
827 #            if test "$minor" -gt 9; then
828 #               have_libgcrypt_newer=yes
829 #            else
830 #               if test "$minor" -eq 9; then
831 #                   if test "$micro" -ge 0; then
832 #                     have_libgcrypt_newer=yes
833 #                   fi
834 #               fi
835 #            fi
836 #        fi
837 #    fiy
838 #fi
839 #AM_CONDITIONAL(HAVE_NEWER_LIBGCRYPT, [test $have_libgcrypt_newer = yes])
840
841 #
842 # libassuan is used for IPC
843 #
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"
850 fi
851
852
853 #
854 # libksba is our X.509 support library
855 #
856 AM_PATH_KSBA("$NEED_KSBA_API:$NEED_KSBA_VERSION",have_ksba=yes,have_ksba=no)
857
858
859 #
860 # libusb allows us to use the integrated CCID smartcard reader driver.
861 #
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
864    case "${host}" in
865      *-mingw32*)
866        LIBUSB_NAME=
867        LIBUSB_LIBS=
868        LIBUSB_CPPFLAGS=
869        ;;
870      *-*-darwin*)
871        LIBUSB_NAME=usb-1.0
872        LIBUSB_LIBS="-Wl,-framework,CoreFoundation -Wl,-framework,IOKit"
873        ;;
874      *-*-freebsd*)
875        # FreeBSD has a native 1.0 compatible library by -lusb.
876        LIBUSB_NAME=usb
877        LIBUSB_LIBS=
878        ;;
879      *)
880        LIBUSB_NAME=usb-1.0
881        LIBUSB_LIBS=
882        ;;
883    esac
884 fi
885 if test x"$LIBUSB_NAME" != x ; then
886    AC_CHECK_LIB($LIBUSB_NAME, libusb_init,
887                 [ LIBUSB_LIBS="-l$LIBUSB_NAME $LIBUSB_LIBS"
888                   have_libusb=yes ])
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}"
896      fi
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
901        break
902      fi
903    done
904    if test "$usb_incdir_found" = "yes"; then
905      AC_MSG_RESULT([${usb_incdir}])
906    else
907      AC_MSG_RESULT([not found])
908      usb_incdir=""
909      have_libusb=no
910      if test "$use_ccid_driver" != yes; then
911        use_ccid_driver=no
912      fi
913      LIBUSB_LIBS=""
914    fi
915
916    if test "$have_libusb" = yes; then
917      AC_DEFINE(HAVE_LIBUSB,1, [defined if libusb is available])
918    fi
919    if test x"$usb_incdir" = x; then
920      LIBUSB_CPPFLAGS=""
921    else
922      LIBUSB_CPPFLAGS="-I${usb_incdir}"
923    fi
924 fi
925 AC_SUBST(LIBUSB_LIBS)
926 AC_SUBST(LIBUSB_CPPFLAGS)
927
928 #
929 # Check whether it is necessary to link against libdl.
930 # (For example to load libpcsclite)
931 #
932 gnupg_dlopen_save_libs="$LIBS"
933 LIBS=""
934 AC_SEARCH_LIBS(dlopen, c dl,,,)
935 DL_LIBS=$LIBS
936 AC_SUBST(DL_LIBS)
937 LIBS="$gnupg_dlopen_save_libs"
938
939
940 # Checks for g10
941
942 AC_ARG_ENABLE(sqlite,
943                 AS_HELP_STRING([--disable-sqlite],
944                                [disable the use of SQLITE]),
945               try_sqlite=$enableval, try_sqlite=yes)
946
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],
950                                  [have_sqlite=yes],
951                                  [have_sqlite=no])
952   fi
953   if test "$have_sqlite" = "yes"; then
954     :
955     AC_SUBST([SQLITE3_CFLAGS])
956     AC_SUBST([SQLITE3_LIBS])
957   else
958     use_tofu=no
959     tmp=$(echo "$SQLITE3_PKG_ERRORS" | tr '\n' '\v' | sed 's/\v/\n*** /g')
960     AC_MSG_WARN([[
961 ***
962 *** Building without SQLite support - TOFU and Keyboxd disabled
963 ***
964 *** $tmp]])
965   fi
966 fi
967 if test "$have_sqlite" != "yes"; then
968     build_keyboxd=no
969 fi
970
971
972 AM_CONDITIONAL(SQLITE3, test "$have_sqlite" = "yes")
973
974 if test x"$use_tofu" = xyes ; then
975     AC_DEFINE(USE_TOFU, 1, [Enable to build the TOFU code])
976 fi
977
978
979 # Checks for g13
980
981 AC_PATH_PROG(ENCFS, encfs, /usr/bin/encfs)
982 AC_DEFINE_UNQUOTED(ENCFS,
983         "${ENCFS}", [defines the filename of the encfs program])
984
985 AC_PATH_PROG(FUSERMOUNT, fusermount, /usr/bin/fusermount)
986 AC_DEFINE_UNQUOTED(FUSERMOUNT,
987         "${FUSERMOUNT}", [defines the filename of the fusermount program])
988
989
990
991 #
992 # Check whether the nPth library is available
993 #
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])
1000 else
1001   AC_MSG_WARN([[
1002 ***
1003 *** To support concurrent access for example in gpg-agent and the SCdaemon
1004 *** we need the support of the New Portable Threads Library.
1005 ***]])
1006 fi
1007 #
1008 # Enable debugging of nPth
1009 #
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])
1016                   fi])
1017
1018
1019
1020 #
1021 # NTBTLS is our TLS library.  If it is not available we fall back to
1022 # GNUTLS.
1023 #
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])
1031 fi
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])
1035 else
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],
1042                                    [have_gnutls=yes],
1043                                    [have_gnutls=no])
1044   fi
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])
1050   else
1051     tmp=$(echo "$LIBGNUTLS_PKG_ERRORS" | tr '\n' '\v' | sed 's/\v/\n*** /g')
1052     build_dirmngr=no
1053     AC_MSG_WARN([[
1054 ***
1055 *** Neither NTBTLS nor GNUTLS available - not building dirmngr.
1056 ***
1057 *** $tmp]])
1058   fi
1059 fi
1060
1061 #
1062 # Allow to set a fixed trust store file for system provided certificates.
1063 #
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=""
1071 fi
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])
1075 fi
1076
1077
1078 AC_MSG_NOTICE([checking for networking options])
1079
1080 #
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
1084 # be detected.
1085 #
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"]))
1090
1091
1092 #
1093 # Check standard resolver functions.
1094 #
1095 if test "$build_dirmngr" = "yes"; then
1096   _dns_save_libs=$LIBS
1097   LIBS=""
1098
1099   # Find the system resolver which can always be enabled with
1100   # the dirmngr option --standard-resolver.
1101
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))
1107
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)))
1116
1117   if test x"$have_resolver" != xno ; then
1118
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.
1123
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);
1131   dn_skipname(0,0);
1132   dn_expand(0,0,0,0,0);
1133 ]])],have_resolver=yes,have_resolver=no)
1134     AC_MSG_RESULT($have_resolver)
1135
1136     # This is Apple-specific and somewhat bizarre as they changed the
1137     # define in bind 8 for some reason.
1138
1139     if test x"$have_resolver" != xyes ; then
1140       AC_MSG_CHECKING(
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)
1152     fi
1153   fi
1154
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])
1160     fi
1161     if test "$use_libdns" = yes; then
1162      show_tor_support=yes
1163     fi
1164   elif test "$use_libdns" = yes; then
1165     show_tor_support=yes
1166   else
1167     AC_MSG_WARN([[
1168 ***
1169 *** The system's DNS resolver is not usable.
1170 *** Dirmngr functionality is limited.
1171 ***]])
1172     show_tor_support="${show_tor_support} (no system resolver)"
1173   fi
1174
1175   if test "$have_w32_system" = yes; then
1176     if test "$use_libdns" = yes; then
1177       DNSLIBS="$DNSLIBS -liphlpapi"
1178     fi
1179   fi
1180
1181   LIBS=$_dns_save_libs
1182 fi
1183
1184 AC_SUBST(DNSLIBS)
1185
1186
1187 #
1188 # Check for LDAP
1189 #
1190 # Note that running the check changes the variable
1191 # gnupg_have_ldap from "n/a" to "no" or "yes".
1192
1193 AC_ARG_ENABLE(ldap,
1194     AS_HELP_STRING([--disable-ldap],
1195                    [disable LDAP support]),
1196     [if test "$enableval" = "no"; then gnupg_have_ldap=no; fi])
1197
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])
1205                     have_lber=yes
1206                  ])
1207   fi
1208 fi
1209 AC_SUBST(LBER_LIBS)
1210 if test "$gnupg_have_ldap" = "no"; then
1211     AC_MSG_WARN([[
1212 ***
1213 *** Building without LDAP support.
1214 *** No CRL access or X.509 certificate search available.
1215 ***]])
1216 fi
1217
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])
1221 fi
1222
1223
1224
1225 #
1226 # Check for sendmail
1227 #
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]),
1234              ,with_mailprog=yes)
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)
1241 fi
1242 AC_DEFINE_UNQUOTED(NAME_OF_SENDMAIL,"$SENDMAIL",
1243                    [Tool with sendmail -t interface])
1244
1245
1246 #
1247 # Construct a printable name of the OS
1248 #
1249 case "${host}" in
1250     *-mingw32*)
1251         PRINTABLE_OS_NAME="MingW32"
1252         ;;
1253     *-*-cygwin*)
1254         PRINTABLE_OS_NAME="Cygwin"
1255         ;;
1256     i?86-emx-os2 | i?86-*-os2*emx )
1257         PRINTABLE_OS_NAME="OS/2"
1258         ;;
1259     i?86-*-msdosdjgpp*)
1260         PRINTABLE_OS_NAME="MSDOS/DJGPP"
1261         try_dynload=no
1262         ;;
1263     *-linux*)
1264         PRINTABLE_OS_NAME="GNU/Linux"
1265         ;;
1266     *)
1267         PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
1268         ;;
1269 esac
1270 AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
1271                    [A human readable text with the name of the OS])
1272
1273
1274 #
1275 # Checking for iconv
1276 #
1277 if test "$require_iconv" = yes; then
1278   AM_ICONV
1279 else
1280   LIBICONV=
1281   LTLIBICONV=
1282   AC_SUBST(LIBICONV)
1283   AC_SUBST(LTLIBICONV)
1284 fi
1285
1286
1287 #
1288 # Check for gettext
1289 #
1290 # This is "GNU gnupg" - The project-id script from gettext
1291 #                       needs this string
1292 #
1293 AC_MSG_NOTICE([checking for gettext])
1294 AM_PO_SUBDIRS
1295 AM_GNU_GETTEXT_VERSION([0.17])
1296 if test "$try_gettext" = yes; then
1297   AM_GNU_GETTEXT([external],[need-ngettext])
1298
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.
1302
1303   AC_CHECK_FUNCS(strchr)
1304 else
1305   USE_NLS=no
1306   USE_INCLUDED_LIBINTL=no
1307   BUILD_INCLUDED_LIBINTL=no
1308   POSUB=po
1309   AC_SUBST(USE_NLS)
1310   AC_SUBST(USE_INCLUDED_LIBINTL)
1311   AC_SUBST(BUILD_INCLUDED_LIBINTL)
1312   AC_SUBST(POSUB)
1313 fi
1314
1315 # We use HAVE_LANGINFO_CODESET in a couple of places.
1316 AM_LANGINFO_CODESET
1317
1318 # Checks required for our use of locales
1319 gt_LC_MESSAGES
1320
1321
1322 #
1323 # SELinux support
1324 #
1325 if test "$selinux_support" = yes ; then
1326   AC_DEFINE(ENABLE_SELINUX_HACKS,1,[Define to enable SELinux support])
1327 fi
1328
1329
1330 #
1331 # Checks for header files.
1332 #
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])
1338
1339
1340 #
1341 # Checks for typedefs, structures, and compiler characteristics.
1342 #
1343 AC_MSG_NOTICE([checking for system characteristics])
1344 AC_C_CONST
1345 AC_C_INLINE
1346 AC_C_VOLATILE
1347 AC_TYPE_SIZE_T
1348 AC_TYPE_MODE_T
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>
1354 #endif
1355 ])
1356
1357
1358 gl_TYPE_SOCKLEN_T
1359
1360 AC_SEARCH_LIBS([inet_addr], [nsl])
1361
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)
1366
1367 if test x"$endiancheck" = xyes ; then
1368   GNUPG_CHECK_ENDIAN
1369 fi
1370
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,,[[
1379 #include <stdio.h>
1380 #ifdef HAVE_SYS_TIME_H
1381 # include <sys/time.h>
1382 #else
1383 # include <time.h>
1384 #endif
1385 ]])
1386 GNUPG_TIME_T_UNSIGNED
1387
1388
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]);
1393 fi
1394
1395
1396 #
1397 # Checks for library functions.
1398 #
1399 AC_MSG_NOTICE([checking for library functions])
1400 AC_CHECK_DECLS(getpagesize)
1401 AC_FUNC_FSEEKO
1402 AC_FUNC_VPRINTF
1403 AC_FUNC_FORK
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     \
1414                 wait4 waitpid ])
1415
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.
1419 _save_libs="$LIBS"
1420 AC_SEARCH_LIBS([nanosleep], [],
1421                [AC_DEFINE(HAVE_NANOSLEEP,1,
1422                 [Define to 1 if you have the `nanosleep' function in libc.])])
1423 LIBS="$_save_libs"
1424
1425
1426 # See whether libc supports the Linux inotify interface
1427 case "${host}" in
1428     *-*-linux*)
1429         AC_CHECK_FUNCS([inotify_init])
1430         ;;
1431 esac
1432
1433
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])
1438 fi
1439
1440 AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
1441
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.]])
1445 fi
1446
1447
1448 #
1449 # Check for the getsockopt SO_PEERCRED, etc.
1450 #
1451 AC_CHECK_MEMBERS([struct ucred.pid, struct ucred.cr_pid, struct sockpeercred.pid], [], [], [#include <sys/types.h>
1452 #include <sys/socket.h> ])
1453
1454 # (Open)Solaris
1455 AC_CHECK_FUNCS([getpeerucred])
1456
1457
1458 #
1459 # W32 specific test
1460 #
1461
1462
1463 #
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.
1467 #
1468 if test "$use_zip" = yes ; then
1469   _cppflags="${CPPFLAGS}"
1470   _ldflags="${LDFLAGS}"
1471   AC_ARG_WITH(zlib,
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"
1476       fi
1477     ])
1478
1479   AC_CHECK_HEADER(zlib.h,
1480      AC_CHECK_LIB(z, deflateInit2_,
1481        [
1482        ZLIBS="-lz"
1483        AC_DEFINE(HAVE_ZIP,1, [Defined if ZIP and ZLIB are supported])
1484        ],
1485        CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
1486        CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
1487 fi
1488
1489
1490 #
1491 # Check whether we can support bzip2
1492 #
1493 if test "$use_bzip2" = yes ; then
1494   _cppflags="${CPPFLAGS}"
1495   _ldflags="${LDFLAGS}"
1496   AC_ARG_WITH(bzip2,
1497      AS_HELP_STRING([--with-bzip2=DIR],[look for bzip2 in DIR]),
1498       [
1499       if test -d "$withval" ; then
1500         CPPFLAGS="${CPPFLAGS} -I$withval/include"
1501         LDFLAGS="${LDFLAGS} -L$withval/lib"
1502       fi
1503       ],withval="")
1504
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,
1511           [
1512           have_bz2=yes
1513           ZLIBS="$ZLIBS -lbz2"
1514           AC_DEFINE(HAVE_BZIP2,1,
1515                   [Defined if the bz2 compression library is available])
1516           ],
1517           CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
1518           CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags},[#include <stdio.h>])
1519   fi
1520 fi
1521 AM_CONDITIONAL(ENABLE_BZIP2_SUPPORT,test x"$have_bz2" = "xyes")
1522 AC_SUBST(ZLIBS)
1523
1524
1525 # Check for readline support
1526 GNUPG_CHECK_READLINE
1527
1528
1529 if test "$development_version" = yes; then
1530     AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
1531             [Defined if this is not a regular release])
1532 fi
1533
1534 if test "$USE_MAINTAINER_MODE" = "yes"; then
1535     AC_DEFINE(MAINTAINER_MODE,1,
1536             [Defined if this build is in maintainer mode])
1537 fi
1538
1539 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
1540
1541 GNUPG_CHECK_GNUMAKE
1542
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}"
1551 fi
1552
1553 AC_SUBST(NETLIBS)
1554 AC_SUBST(W32SOCKLIBS)
1555
1556 #
1557 # TPM libtss library .. don't compile TPM support if we don't have it
1558 #
1559 AC_ARG_WITH([tss],
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])
1564 LIBTSS_LIBS=
1565 LIBTSS_CFLAGS=
1566 if test "$build_tpm2d" = "yes"; then
1567   _save_libs="$LIBS"
1568   _save_cflags="$CFLAGS"
1569   LIBS=""
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])])
1579   else
1580     AC_MSG_ERROR([Invalid TPM Software Stack requested: $with_tss])
1581   fi
1582
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])
1591         have_libtss=no
1592       ])
1593     ])
1594     LIBTSS_LIBS=$LIBS
1595     AC_SUBST(TSS_INCLUDE)
1596   elif test "$have_libtss" = Intel; then
1597     ##
1598     # Intel TSS has an API issue: Esys_TR_GetTpmHandle wasn't introduced
1599     # until version 2.4.0.
1600     #
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.
1603     ##
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)])
1606         have_libtss=no
1607     ])
1608     LIBTSS_LIBS="$LIBS -ltss2-mu -ltss2-rc -ltss2-tctildr"
1609     AC_DEFINE(HAVE_INTEL_TSS, 1, [Defined if we have the Intel TSS])
1610   fi
1611   LIBS="$_save_libs"
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)
1620   fi
1621 fi
1622 if test "$have_libtss" = no; then
1623   build_tpm2d=no
1624 fi
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)
1630
1631 #
1632 # Setup gcc specific options
1633 #
1634 USE_C99_CFLAGS=
1635 AC_MSG_NOTICE([checking for cc features])
1636 if test "$GCC" = yes; then
1637     mycflags=
1638     mycflags_save=$CFLAGS
1639
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 )
1645 #kickerror
1646 #endif]],[])],[_gcc_silent_wno=yes],[_gcc_silent_wno=no])
1647     AC_MSG_RESULT($_gcc_silent_wno)
1648
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
1651     # them.
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
1656           _gcc_wopt=yes
1657         else
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)
1663         fi
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"
1667         fi
1668
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"
1675         fi
1676
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"
1683         fi
1684
1685         AC_MSG_CHECKING([if gcc supports -Wvla])
1686         CFLAGS="-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"
1691         fi
1692
1693     else
1694         mycflags="$mycflags -Wall"
1695         if test x"$_gcc_silent_wno" = xyes ; then
1696           mycflags="$mycflags -Wno-format-zero-length"
1697         fi
1698     fi
1699
1700     if test x"$_gcc_silent_wno" = xyes ; then
1701       _gcc_psign=yes
1702     else
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)
1708     fi
1709     if test x"$_gcc_psign" = xyes ; then
1710        mycflags="$mycflags -Wno-pointer-sign"
1711     fi
1712
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"
1719     fi
1720
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"
1725     fi
1726 fi
1727
1728 AC_SUBST(USE_C99_CFLAGS)
1729
1730
1731 #
1732 # This is handy for debugging so the compiler doesn't rearrange
1733 # things and eliminate variables.
1734 #
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`
1740                    fi])
1741
1742 #
1743 # log_debug has certain requirements which might hamper portability.
1744 # Thus we use an option to enable it.
1745 #
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])
1754 fi
1755
1756 # Add -Werror to CFLAGS.  This hack can be used to avoid problems with
1757 # misbehaving autoconf tests in case the user supplied -Werror.
1758 #
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"
1764                    fi])
1765
1766 #
1767 # Configure option --enable-all-tests
1768 #
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])
1778 fi
1779
1780 #
1781 # Configure option --disable-tests
1782 #
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)
1789
1790 #
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.
1796 #
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"])
1803 fi
1804
1805
1806 #
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
1809 # before /run/user
1810 #
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])
1818 fi
1819
1820
1821 #
1822 # Decide what to build
1823 #
1824
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"
1829   fi
1830   if test -n "$build_scdaemon_extra"; then
1831      build_scdaemon_extra="(${build_scdaemon_extra})"
1832   fi
1833 fi
1834
1835
1836 #
1837 # Set variables for use by automake makefiles.
1838 #
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")
1850
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)
1855
1856 #
1857 # Set some defines for use gpgconf.
1858 #
1859 if test "$build_gpg" = yes ; then
1860     AC_DEFINE(BUILD_WITH_GPG,1,[Defined if GPG is to be build])
1861 fi
1862 if test "$build_gpgsm" = yes ; then
1863     AC_DEFINE(BUILD_WITH_GPGSM,1,[Defined if GPGSM is to be build])
1864 fi
1865 if test "$build_agent" = yes ; then
1866     AC_DEFINE(BUILD_WITH_AGENT,1,[Defined if GPG-AGENT is to be build])
1867 fi
1868 if test "$build_scdaemon" = yes ; then
1869     AC_DEFINE(BUILD_WITH_SCDAEMON,1,[Defined if SCDAEMON is to be build])
1870 fi
1871 if test "$build_dirmngr" = yes ; then
1872     AC_DEFINE(BUILD_WITH_DIRMNGR,1,[Defined if DIRMNGR is to be build])
1873 fi
1874 if test "$build_keyboxd" = yes ; then
1875     AC_DEFINE(BUILD_WITH_KEYBOXD,1,[Defined if KEYBOXD is to be build])
1876 fi
1877 if test "$build_tpm2d" = yes ; then
1878     AC_DEFINE(BUILD_WITH_TPM2D,1,[Defined if TPM2D to be build])
1879 fi
1880 if test "$build_g13" = yes ; then
1881     AC_DEFINE(BUILD_WITH_G13,1,[Defined if G13 is to be build])
1882 fi
1883
1884
1885 #
1886 # Define Name strings
1887 #
1888 AC_DEFINE_UNQUOTED(GNUPG_NAME, "GnuPG", [The name of the project])
1889
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])
1892
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])
1895
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])
1899
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])
1903
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])
1907
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])
1911
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])
1915
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])
1918
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])
1922
1923 AC_DEFINE_UNQUOTED(GPGTAR_NAME, "gpgtar", [The name of the gpgtar tool])
1924
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])
1946
1947 AC_DEFINE_UNQUOTED(GPGEXT_GPG, "gpg", [The standard binary file suffix])
1948
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])
1952 fi
1953
1954
1955 #
1956 # Provide information about the build.
1957 #
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])
1962
1963 changequote(,)dnl
1964 BUILD_VERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'`
1965 changequote([,])dnl
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)
1970
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`
1977       else
1978         BUILD_TIMESTAMP="$enableval"
1979       fi
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)
1987
1988
1989 #
1990 # Print errors here so that they are visible all
1991 # together and the user can acquire them all together.
1992 #
1993 die=no
1994 if test "$have_gpg_error" = "no"; then
1995    die=yes
1996    AC_MSG_NOTICE([[
1997 ***
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.)
2002 ***]])
2003 fi
2004 if test "$have_libgcrypt" = "no"; then
2005    die=yes
2006    AC_MSG_NOTICE([[
2007 ***
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.)
2012 ***]])
2013 fi
2014 if test "$have_libassuan" = "no"; then
2015    die=yes
2016    AC_MSG_NOTICE([[
2017 ***
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).
2022 ***]])
2023 fi
2024 if test "$have_ksba" = "no"; then
2025     die=yes
2026     AC_MSG_NOTICE([[
2027 ***
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).
2032 ***]])
2033 fi
2034 if test "$have_npth" = "no"; then
2035     die=yes
2036     AC_MSG_NOTICE([[
2037 ***
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).
2043 ***]])
2044 fi
2045
2046 if test "$require_iconv" = yes; then
2047   if test "$am_func_iconv" != yes; then
2048     die=yes
2049     AC_MSG_NOTICE([[
2050 ***
2051 *** The system does not provide a working iconv function.  Please
2052 *** install a suitable library; for example GNU Libiconv which is
2053 *** available at:
2054 ***   https://ftp.gnu.org/gnu/libiconv/
2055 ***]])
2056   fi
2057 fi
2058
2059 if test "$use_ccid_driver" = yes; then
2060   if test "$have_libusb" != yes; then
2061     die=yes
2062     AC_MSG_NOTICE([[
2063 ***
2064 *** You need libusb to build the internal ccid driver.  Please
2065 *** install a libusb suitable for your system.
2066 ***]])
2067   fi
2068 fi
2069
2070 if test "$die" = "yes"; then
2071     AC_MSG_ERROR([[
2072 ***
2073 *** Required libraries not found. Please consult the above messages
2074 *** and install them before running configure again.
2075 ***]])
2076 fi
2077
2078
2079
2080 AC_CONFIG_FILES([ m4/Makefile
2081 Makefile
2082 po/Makefile.in
2083 common/Makefile
2084 common/w32info-rc.h
2085 regexp/Makefile
2086 kbx/Makefile
2087 g10/Makefile
2088 sm/Makefile
2089 agent/Makefile
2090 scd/Makefile
2091 tpm2d/Makefile
2092 g13/Makefile
2093 dirmngr/Makefile
2094 tools/Makefile
2095 doc/Makefile
2096 tests/Makefile
2097 tests/gpgscm/Makefile
2098 tests/openpgp/Makefile
2099 tests/cms/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
2119 ])
2120
2121
2122 AC_OUTPUT
2123
2124 show_tss_type=
2125 if test "$build_tpm2d" = "yes"; then
2126   show_tss_type="($have_libtss)"
2127 fi
2128
2129 echo "
2130         GnuPG v${VERSION} has been configured as follows:
2131
2132         Revision:  mym4_revision  (mym4_revision_dec)
2133         Platform:  $PRINTABLE_OS_NAME ($host)
2134
2135         OpenPGP:   $build_gpg
2136         S/MIME:    $build_gpgsm
2137         Agent:     $build_agent
2138         Smartcard: $build_scdaemon $build_scdaemon_extra
2139         TPM:       $build_tpm2d $show_tss_type
2140         G13:       $build_g13
2141         Dirmngr:   $build_dirmngr
2142         Keyboxd:   $build_keyboxd
2143         Gpgtar:    $build_gpgtar
2144         WKS tools: $build_wks_tools
2145
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
2154
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
2161 "
2162 if test "$have_libtss" != no -a -z "$TPMSERVER" -a -z "$SWTPM"; then
2163 cat <<G10EOF
2164         Warning: TPM support is compiled in but no software TPM
2165                  for testing was discovered. TPM tests are disabled
2166
2167 G10EOF
2168 fi
2169 if test "x${gpg_config_script_warn}" != x; then
2170 cat <<G10EOF
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.
2175
2176 G10EOF
2177 fi
2178 if test "${build_gpg}" != "yes"; then
2179 cat <<G10EOF
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.
2183
2184 G10EOF
2185 fi
2186 if test "${run_tests}" != "yes"; then
2187 cat <<G10EOF
2188         Warning: The use of the test suite has been disabled!
2189                  This is in almost all cases a bad idea.  Take care.
2190
2191 G10EOF
2192 fi