1 # configure.ac - for GnuPG 2.0
2 # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
3 # 2006, 2007, 2008, 2010, 2011,
4 # 2012 Free Software Foundation, Inc.
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 <http://www.gnu.org/licenses/>.
21 # Process this file with autoconf to produce a configure script.
23 min_automake_version="1.14"
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_version], [2.0.28])
31 # Below is m4 magic to extract and compute the git revision number,
32 # the decimalized short revision number, a beta version string and a
33 # flag indicating a development version (mym4_isgit). Note that the
34 # m4 processing is done by autoconf and not during the configure run.
35 m4_define([mym4_revision],
36 m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
37 m4_define([mym4_revision_dec],
38 m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))]))
39 m4_define([mym4_betastring],
40 m4_esyscmd_s([git describe --match 'gnupg-2.[0-9].*[0-9]' --long|\
41 awk -F- '$3!=0{print"-beta"$3}']))
42 m4_define([mym4_isgit],m4_if(mym4_betastring,[],[no],[yes]))
43 m4_define([mym4_full_version],[mym4_version[]mym4_betastring])
45 AC_INIT([gnupg],[mym4_full_version], [http://bugs.gnupg.org])
47 NEED_GPG_ERROR_VERSION=1.11
50 NEED_LIBGCRYPT_VERSION=1.5.0
53 NEED_LIBASSUAN_VERSION=2.0.0
56 NEED_KSBA_VERSION=1.0.7
58 development_version=mym4_isgit
60 PACKAGE_GT=${PACKAGE_NAME}2
61 VERSION=$PACKAGE_VERSION
63 AC_CONFIG_AUX_DIR(scripts)
64 AC_CONFIG_SRCDIR(sm/gpgsm.c)
65 AM_CONFIG_HEADER(config.h)
66 AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
72 # Some status variables.
83 disable_keyserver_path=no
85 use_standard_socket=no
88 GNUPG_BUILD_PROGRAM(gpg, yes)
89 GNUPG_BUILD_PROGRAM(gpgsm, yes)
90 GNUPG_BUILD_PROGRAM(agent, yes)
91 GNUPG_BUILD_PROGRAM(scdaemon, yes)
92 GNUPG_BUILD_PROGRAM(tools, yes)
93 GNUPG_BUILD_PROGRAM(doc, yes)
94 GNUPG_BUILD_PROGRAM(symcryptrun, no)
95 GNUPG_BUILD_PROGRAM(gpgtar, no)
101 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
102 AC_DEFINE_UNQUOTED(PACKAGE_GT, "$PACKAGE_GT",
103 [Name of this package for gettext])
104 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
105 AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",
106 [Bug report address])
107 AC_DEFINE_UNQUOTED(NEED_LIBGCRYPT_VERSION, "$NEED_LIBGCRYPT_VERSION",
108 [Required version of Libgcrypt])
109 AC_DEFINE_UNQUOTED(NEED_KSBA_VERSION, "$NEED_KSBA_VERSION",
110 [Required version of Libksba])
113 # The default is to use the modules from this package and the few
114 # other packages in a standard place; i.e where this package gets
115 # installed. With these options it is possible to override these
116 # ${prefix} depended values with fixed paths, which can't be replaced
117 # at make time. See also am/cmacros.am and the defaults in AH_BOTTOM.
118 AC_ARG_WITH(agent-pgm,
119 [ --with-agent-pgm=PATH Use PATH as the default for the agent)],
120 GNUPG_AGENT_PGM="$withval", GNUPG_AGENT_PGM="" )
121 AC_SUBST(GNUPG_AGENT_PGM)
122 AM_CONDITIONAL(GNUPG_AGENT_PGM, test -n "$GNUPG_AGENT_PGM")
123 show_gnupg_agent_pgm="(default)"
124 test -n "$GNUPG_AGENT_PGM" && show_gnupg_agent_pgm="$GNUPG_AGENT_PGM"
126 AC_ARG_WITH(pinentry-pgm,
127 [ --with-pinentry-pgm=PATH Use PATH as the default for the pinentry)],
128 GNUPG_PINENTRY_PGM="$withval", GNUPG_PINENTRY_PGM="" )
129 AC_SUBST(GNUPG_PINENTRY_PGM)
130 AM_CONDITIONAL(GNUPG_PINENTRY_PGM, test -n "$GNUPG_PINENTRY_PGM")
131 show_gnupg_pinentry_pgm="(default)"
132 test -n "$GNUPG_PINENTRY_PGM" && show_gnupg_pinentry_pgm="$GNUPG_PINENTRY_PGM"
135 AC_ARG_WITH(scdaemon-pgm,
136 [ --with-scdaemon-pgm=PATH Use PATH as the default for the scdaemon)],
137 GNUPG_SCDAEMON_PGM="$withval", GNUPG_SCDAEMON_PGM="" )
138 AC_SUBST(GNUPG_SCDAEMON_PGM)
139 AM_CONDITIONAL(GNUPG_SCDAEMON_PGM, test -n "$GNUPG_SCDAEMON_PGM")
140 show_gnupg_scdaemon_pgm="(default)"
141 test -n "$GNUPG_SCDAEMON_PGM" && show_gnupg_scdaemon_pgm="$GNUPG_SCDAEMON_PGM"
144 AC_ARG_WITH(dirmngr-pgm,
145 [ --with-dirmngr-pgm=PATH Use PATH as the default for the dirmngr)],
146 GNUPG_DIRMNGR_PGM="$withval", GNUPG_DIRMNGR_PGM="" )
147 AC_SUBST(GNUPG_DIRMNGR_PGM)
148 AM_CONDITIONAL(GNUPG_DIRMNGR_PGM, test -n "$GNUPG_DIRMNGR_PGM")
149 show_gnupg_dirmngr_pgm="(default)"
150 test -n "$GNUPG_DIRMNGR_PGM" && show_gnupg_dirmngr_pgm="$GNUPG_DIRMNGR_PGM"
152 AC_ARG_WITH(protect-tool-pgm,
153 [ --with-protect-tool-pgm=PATH Use PATH as the default for the protect-tool)],
154 GNUPG_PROTECT_TOOL_PGM="$withval", GNUPG_PROTECT_TOOL_PGM="" )
155 AC_SUBST(GNUPG_PROTECT_TOOL_PGM)
156 AM_CONDITIONAL(GNUPG_PROTECT_TOOL_PGM, test -n "$GNUPG_PROTECT_TOOL_PGM")
157 show_gnupg_protect_tool_pgm="(default)"
158 test -n "$GNUPG_PROTECT_TOOL_PGM" \
159 && show_gnupg_protect_tool_pgm="$GNUPG_PROTECT_TOOL_PGM"
162 # Some folks want to use only the agent from this packet. Make it
163 # easier for them by providing the configure option
164 # --enable-only-agent.
165 AC_ARG_ENABLE(agent-only,
166 AC_HELP_STRING([--enable-agent-only],[build only the gpg-agent]),
167 build_agent_only=$enableval)
169 # SELinux support includes tracking of sensitive files to avoid
170 # leaking their contents through processing these files by gpg itself
171 AC_MSG_CHECKING([whether SELinux support is requested])
172 AC_ARG_ENABLE(selinux-support,
173 AC_HELP_STRING([--enable-selinux-support],
174 [enable SELinux support]),
175 selinux_support=$enableval, selinux_support=no)
176 AC_MSG_RESULT($selinux_support)
179 AC_MSG_CHECKING([whether to allocate extra secure memory])
180 AC_ARG_ENABLE(large-secmem,
181 AC_HELP_STRING([--enable-large-secmem],
182 [allocate extra secure memory]),
183 large_secmem=$enableval, large_secmem=no)
184 AC_MSG_RESULT($large_secmem)
185 if test "$large_secmem" = yes ; then
186 SECMEM_BUFFER_SIZE=65536
188 SECMEM_BUFFER_SIZE=32768
190 AC_DEFINE_UNQUOTED(SECMEM_BUFFER_SIZE,$SECMEM_BUFFER_SIZE,
191 [Size of secure memory buffer])
194 # Allow disabling of bzib2 support.
195 # It is defined only after we confirm the library is available later
196 AC_MSG_CHECKING([whether to enable the BZIP2 compression algorithm])
198 AC_HELP_STRING([--disable-bzip2],[disable the BZIP2 compression algorithm]),
199 use_bzip2=$enableval)
200 AC_MSG_RESULT($use_bzip2)
202 # Configure option to allow or disallow execution of external
203 # programs, like a photo viewer.
204 AC_MSG_CHECKING([whether to enable external program execution])
206 AC_HELP_STRING([--disable-exec],[disable all external program execution]),
208 AC_MSG_RESULT($use_exec)
209 if test "$use_exec" = no ; then
210 AC_DEFINE(NO_EXEC,1,[Define to disable all external program execution])
213 if test "$use_exec" = yes ; then
214 AC_MSG_CHECKING([whether to enable photo ID viewing])
215 AC_ARG_ENABLE(photo-viewers,
216 [ --disable-photo-viewers disable photo ID viewers],
217 [if test "$enableval" = no ; then
218 AC_DEFINE(DISABLE_PHOTO_VIEWER,1,[define to disable photo viewing])
220 gnupg_cv_enable_photo_viewers=$enableval
221 AC_MSG_RESULT($enableval)
223 if test "$gnupg_cv_enable_photo_viewers" = yes ; then
224 AC_MSG_CHECKING([whether to use a fixed photo ID viewer])
225 AC_ARG_WITH(photo-viewer,
226 [ --with-photo-viewer=FIXED_VIEWER set a fixed photo ID viewer],
227 [if test "$withval" = yes ; then
229 elif test "$withval" != no ; then
230 AC_DEFINE_UNQUOTED(FIXED_PHOTO_VIEWER,"$withval",
231 [if set, restrict photo-viewer to this])
233 AC_MSG_RESULT($withval)
236 AC_MSG_CHECKING([whether to enable external keyserver helpers])
237 AC_ARG_ENABLE(keyserver-helpers,
238 [ --disable-keyserver-helpers disable all external keyserver support],
239 [if test "$enableval" = no ; then
240 AC_DEFINE(DISABLE_KEYSERVER_HELPERS,1,
241 [define to disable keyserver helpers])
243 gnupg_cv_enable_keyserver_helpers=$enableval
244 AC_MSG_RESULT($enableval)
246 if test "$gnupg_cv_enable_keyserver_helpers" = yes ; then
247 # LDAP is defined only after we confirm the library is available later
248 AC_MSG_CHECKING([whether LDAP keyserver support is requested])
250 AC_HELP_STRING([--disable-ldap],[disable LDAP keyserver interface only]),
251 try_ldap=$enableval, try_ldap=yes)
252 AC_MSG_RESULT($try_ldap)
254 AC_MSG_CHECKING([whether HKP keyserver support is requested])
256 AC_HELP_STRING([--disable-hkp],[disable HKP keyserver interface only]),
257 try_hkp=$enableval, try_hkp=yes)
258 AC_MSG_RESULT($try_hkp)
260 AC_MSG_CHECKING([whether finger key fetching support is requested])
261 AC_ARG_ENABLE(finger,
262 AC_HELP_STRING([--disable-finger],
263 [disable finger key fetching interface only]),
264 try_finger=$enableval, try_finger=yes)
265 AC_MSG_RESULT($try_finger)
267 AC_MSG_CHECKING([whether generic object key fetching support is requested])
268 AC_ARG_ENABLE(generic,
269 AC_HELP_STRING([--disable-generic],
270 [disable generic object key fetching interface only]),
271 try_generic=$enableval, try_generic=yes)
272 AC_MSG_RESULT($try_generic)
274 AC_MSG_CHECKING([whether email keyserver support is requested])
275 AC_ARG_ENABLE(mailto,
276 AC_HELP_STRING([--enable-mailto],
277 [enable email keyserver interface only]),
278 try_mailto=$enableval, try_mailto=no)
279 AC_MSG_RESULT($try_mailto)
282 AC_MSG_CHECKING([whether keyserver exec-path is enabled])
283 AC_ARG_ENABLE(keyserver-path,
284 AC_HELP_STRING([--disable-keyserver-path],
285 [disable the exec-path option for keyserver helpers]),
286 [if test "$enableval" = no ; then
287 disable_keyserver_path=yes
289 AC_MSG_RESULT($enableval)
294 # Check for the key/uid cache size. This can't be zero, but can be
295 # pretty small on embedded systems. This is used for the gpg part.
297 AC_MSG_CHECKING([for the size of the key and uid cache])
298 AC_ARG_ENABLE(key-cache,
299 AC_HELP_STRING([--enable-key-cache=SIZE],
300 [Set key cache to SIZE (default 4096)]),,enableval=4096)
301 if test "$enableval" = "no"; then
303 elif test "$enableval" = "yes" || test "$enableval" = ""; then
307 key_cache_size=`echo "$enableval" | sed 's/[A-Za-z]//g'`
309 if test "$enableval" != "$key_cache_size" || test "$key_cache_size" -lt 5; then
310 AC_MSG_ERROR([invalid key-cache size])
312 AC_MSG_RESULT($key_cache_size)
313 AC_DEFINE_UNQUOTED(PK_UID_CACHE_SIZE,$key_cache_size,
314 [Size of the key and UID caches])
319 # Check whether we want to use Linux capabilities
321 AC_MSG_CHECKING([whether use of capabilities is requested])
322 AC_ARG_WITH(capabilities,
323 [ --with-capabilities use linux capabilities [default=no]],
324 [use_capabilities="$withval"],[use_capabilities=no])
325 AC_MSG_RESULT($use_capabilities)
329 # Allow disabling of internal CCID support.
330 # It is defined only after we confirm the library is available later
332 AC_MSG_CHECKING([whether to enable the internal CCID driver])
333 AC_ARG_ENABLE(ccid-driver,
334 AC_HELP_STRING([--disable-ccid-driver],
335 [disable the internal CCID driver]),
336 use_ccid_driver=$enableval)
337 AC_MSG_RESULT($use_ccid_driver)
341 # To avoid double inclusion of config.h which might happen at some
342 # places, we add the usual double inclusion protection at the top of
346 #ifndef GNUPG_CONFIG_H_INCLUDED
347 #define GNUPG_CONFIG_H_INCLUDED
351 # Stuff which goes at the bottom of config.h.
354 /* This is the major version number of GnuPG so that
355 source included files can test for this. Note, that
356 we use 2 here even for GnuPG 1.9.x. */
357 #define GNUPG_MAJOR_VERSION 2
359 /* Now to separate file name parts.
360 Please note that the string version must not contain more
361 than one character because the code assumes strlen()==1 */
362 #ifdef HAVE_DOSISH_SYSTEM
363 #define DIRSEP_C '\\'
364 #define DIRSEP_S "\\"
367 #define PATHSEP_C ';'
368 #define PATHSEP_S ";"
369 #define EXEEXT_S ".exe"
375 #define PATHSEP_C ':'
376 #define PATHSEP_S ":"
380 /* This is the same as VERSION, but should be overridden if the
381 platform cannot handle things like dots '.' in filenames. Set
382 SAFE_VERSION_DOT and SAFE_VERSION_DASH to whatever SAFE_VERSION
383 uses for dots and dashes. */
384 #define SAFE_VERSION VERSION
385 #define SAFE_VERSION_DOT '.'
386 #define SAFE_VERSION_DASH '-'
388 /* Some global constants. */
389 #ifdef HAVE_DRIVE_LETTERS
390 #define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
392 #define GNUPG_DEFAULT_HOMEDIR "/SYS\$LOGIN/gnupg"
394 #define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
396 #define GNUPG_PRIVATE_KEYS_DIR "private-keys-v1.d"
398 /* For some systems (DOS currently), we hardcode the path here. For
399 POSIX systems the values are constructed by the Makefiles, so that
400 the values may be overridden by the make invocations; this is to
401 comply with the GNU coding standards. */
402 #ifdef HAVE_DRIVE_LETTERS
403 /* FIXME: We need to use a function to determine these values depending
404 on the actual installation directory. */
405 #define GNUPG_BINDIR "c:\\gnupg"
406 #define GNUPG_LIBEXECDIR "c:\\gnupg"
407 #define GNUPG_LIBDIR "c:\\gnupg"
408 #define GNUPG_DATADIR "c:\\gnupg"
409 #define GNUPG_SYSCONFDIR "c:\\gnupg"
412 /* Derive some other constants. */
413 #if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
414 #define EXEC_TEMPFILE_ONLY
418 /* We didn't define endianness above, so get it from OS macros. This
419 is intended for making fat binary builds on OS X. */
420 #if !defined(BIG_ENDIAN_HOST) && !defined(LITTLE_ENDIAN_HOST)
421 #if defined(__BIG_ENDIAN__)
422 #define BIG_ENDIAN_HOST 1
423 #elif defined(__LITTLE_ENDIAN__)
424 #define LITTLE_ENDIAN_HOST 1
426 #error "No endianness found"
431 /* Hack used for W32: ldap.m4 also tests for the ASCII version of
432 ldap_start_tls_s because that is the actual symbol used in the
433 library. winldap.h redefines it to our commonly used value,
434 thus we define our usual macro here. */
435 #ifdef HAVE_LDAP_START_TLS_SA
436 # ifndef HAVE_LDAP_START_TLS_S
437 # define HAVE_LDAP_START_TLS_S 1
442 /* Tell libgcrypt not to use its own libgpg-error implementation. */
443 #define USE_LIBGPG_ERROR 1
445 /* We use jnlib, so tell other modules about it. */
446 #define HAVE_JNLIB_LOGGING 1
448 /* Our HTTP code is used in estream mode. */
449 #define HTTP_USE_ESTREAM 1
451 /* Under W32 we do an explicit socket initialization, thus we need to
452 avoid the on-demand initialization which would also install an atexit
454 #define HTTP_NO_WSASTARTUP
456 /* We always include support for the OpenPGP card. */
457 #define ENABLE_CARD_SUPPORT 1
459 /* We don't want the old assuan codes anymore. */
460 #define _ASSUAN_ONLY_GPG_ERRORS 1
462 /* We don't need any of the old gcrypt functions. */
463 #define GCRYPT_NO_DEPRECATED 1
465 /* We explicitly need to disable PTH's soft mapping as Debian
466 currently enables it by default for no reason. */
467 #define PTH_SYSCALL_SOFT 0
469 /* We want to use the libgcrypt provided memory allocation for
471 #define _ESTREAM_PRINTF_MALLOC gcry_malloc
472 #define _ESTREAM_PRINTF_FREE gcry_free
473 #define _ESTREAM_PRINTF_EXTRA_INCLUDE "util.h"
475 #endif /*GNUPG_CONFIG_H_INCLUDED*/
480 AC_ARG_VAR(SYSROOT,[locate config scripts also below that directory])
482 # Checks for programs.
483 AC_MSG_NOTICE([checking for programs])
486 missing_dir=`cd $ac_aux_dir && pwd`
487 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
488 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
489 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
490 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
491 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
496 if test "x$ac_cv_prog_cc_c89" = "xno" ; then
497 AC_MSG_ERROR([[No C-89 compiler found]])
502 AC_CHECK_TOOL(AR, ar, :)
503 AC_PATH_PROG(PERL,"perl")
504 AC_CHECK_TOOL(WINDRES, windres, :)
511 # We need to compile and run a program on the build machine. A
512 # comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
513 # the AC archive is broken for autoconf 2.57. Given that tehre is no
514 # newer version of that macro, we assume that it is also broken for
515 # autoconf 2.61 and thus we use a simple but usually sufficient
517 AC_MSG_CHECKING(for cc for build)
518 if test "$cross_compiling" = "yes"; then
519 CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
521 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
523 AC_MSG_RESULT($CC_FOR_BUILD)
524 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
529 have_dosish_system=no
531 use_simple_gettext=no
534 # special stuff for Windoze NT
535 ac_cv_have_dev_random=no
536 AC_DEFINE(USE_ONLY_8DOT3,1,
537 [set this to limit filenames to the 8.3 format])
538 AC_DEFINE(HAVE_DRIVE_LETTERS,1,
539 [defined if we must run on a stupid file system])
540 AC_DEFINE(USE_SIMPLE_GETTEXT,1,
541 [because the Unix gettext has too much overhead on
542 MingW32 systems and these systems lack Posix functions,
543 we use a simplified version of gettext])
544 disable_keyserver_path=yes
545 have_dosish_system=yes
548 use_simple_gettext=yes
550 i?86-emx-os2 | i?86-*-os2*emx )
551 # OS/2 with the EMX environment
552 ac_cv_have_dev_random=no
553 AC_DEFINE(HAVE_DRIVE_LETTERS)
554 have_dosish_system=yes
559 # DOS with the DJGPP environment
560 ac_cv_have_dev_random=no
561 AC_DEFINE(HAVE_DRIVE_LETTERS)
562 have_dosish_system=yes
568 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
569 LDFLAGS="$LDFLAGS -L/usr/local/lib"
573 if test -z "$GCC" ; then
574 CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
578 if test -z "$GCC" ; then
579 # Suppress all warnings
580 # to get rid of the unsigned/signed char mismatch warnings.
585 if test -z "$GCC" ; then
586 # Use the newer compiler `-msg_disable ptrmismatch1' to
587 # get rid of the unsigned/signed char mismatch warnings.
588 # Using this may hide other pointer mismatch warnings, but
589 # it at least lets other warning classes through
590 CFLAGS="$CFLAGS -msg_disable ptrmismatch1"
599 if test "$have_dosish_system" = yes; then
600 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
601 [Defined if we run on some of the PCDOS like systems
602 (DOS, Windoze. OS/2) with special properties like
605 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
607 AM_CONDITIONAL(USE_SIMPLE_GETTEXT, test x"$use_simple_gettext" = xyes)
609 if test "$have_w32_system" = yes; then
610 AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
612 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
614 if test "$disable_keyserver_path" = yes; then
615 AC_DEFINE(DISABLE_KEYSERVER_PATH,1,
616 [Defined to disable exec-path for keyserver helpers])
620 # Allows enabling the use of a standard socket by default This is
621 # gpg-agent's option --[no-]use-standard-socket. For Windows we force
624 AC_MSG_CHECKING([whether to use a standard socket by default])
625 AC_ARG_ENABLE(standard-socket,
626 AC_HELP_STRING([--enable-standard-socket],
627 [use a standard socket for the agent by default]),
628 use_standard_socket=$enableval)
630 if test "$use_standard_socket" != yes; then
631 if test "$have_w32_system" = yes; then
632 use_standard_socket=yes
636 AC_MSG_RESULT($use_standard_socket$tmp)
637 if test "$use_standard_socket" = yes; then
638 AC_DEFINE(USE_STANDARD_SOCKET,1,
639 [Use a standard socket for the agent by default])
643 # (These need to go after AC_PROG_CC so that $EXEEXT is defined)
644 AC_DEFINE_UNQUOTED(EXEEXT,"$EXEEXT",[The executable file extension, if any])
646 if test x"$try_hkp" = xyes ; then
647 AC_SUBST(GPGKEYS_HKP,"gpg2keys_hkp$EXEEXT")
650 if test x"$try_finger" = xyes ; then
651 AC_SUBST(GPGKEYS_FINGER,"gpg2keys_finger$EXEEXT")
657 # Checks for libraries.
659 AC_MSG_NOTICE([checking for libraries])
663 # libgpg-error is a library with error codes shared between GnuPG
666 AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
667 have_gpg_error=yes,have_gpg_error=no)
671 # Libgcrypt is our generic crypto library
673 AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
674 have_libgcrypt=yes,have_libgcrypt=no)
678 # libassuan is used for IPC
680 AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
681 have_libassuan=yes,have_libassuan=no)
682 if test "$have_libassuan" = "yes"; then
683 AC_DEFINE_UNQUOTED(GNUPG_LIBASSUAN_VERSION, "$libassuan_version",
684 [version of the libbassuan library])
690 # libksba is our X.509 support library
692 AM_PATH_KSBA("$NEED_KSBA_API:$NEED_KSBA_VERSION",have_ksba=yes,have_ksba=no)
696 # libusb allows us to use the integrated CCID smartcard reader driver.
698 # FiXME: Use GNUPG_CHECK_LIBUSB and modify to use separate AC_SUBSTs.
699 if test "$use_ccid_driver" = yes ; then
700 AC_CHECK_LIB(usb, usb_bulk_write,
701 [ LIBUSB_LIBS="$LIBUSB_LIBS -lusb"
702 AC_DEFINE(HAVE_LIBUSB,1,
703 [defined if libusb is available])
706 AC_CHECK_FUNCS(usb_create_match)
708 AC_SUBST(LIBUSB_LIBS)
711 # Check wether it is necessary to link against libdl.
713 gnupg_dlopen_save_libs="$LIBS"
715 AC_SEARCH_LIBS(dlopen, c dl,,,)
718 LIBS="$gnupg_dlopen_save_libs"
721 # Checks for symcryptrun:
724 # libutil has openpty() and login_tty().
725 AC_CHECK_LIB(util, openpty,
726 [ LIBUTIL_LIBS="$LIBUTIL_LIBS -lutil"
727 AC_DEFINE(HAVE_LIBUTIL,1,
728 [defined if libutil is available])
730 AC_SUBST(LIBUTIL_LIBS)
732 # shred is used to clean temporary plain text files.
733 AC_PATH_PROG(SHRED, shred, /usr/bin/shred)
734 AC_DEFINE_UNQUOTED(SHRED,
735 "${SHRED}", [defines the filename of the shred program])
740 # Check whether the GNU Pth library is available
741 # Note, that we include a Pth emulation for W32.
744 if test "$have_pth" = "yes"; then
745 AC_DEFINE(USE_GNU_PTH, 1,
746 [Defined if the GNU Portable Thread Library should be used])
750 *** To support concurrent access to the gpg-agent and the SCdaemon
751 *** we need the support of the GNU Portable Threads Library.
752 *** Download it from ftp://ftp.gnu.org/gnu/pth/
753 *** On a Debian GNU/Linux system you might want to try
754 *** apt-get install libpth-dev
759 AC_MSG_NOTICE([checking for networking options])
762 # Must check for network library requirements before doing link tests
763 # for ldap, for example. If ldap libs are static (or dynamic and without
764 # ELF runtime link paths), then link will fail and LDAP support won't
767 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
768 [NETLIBS="-lnsl $NETLIBS"]))
769 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
770 [NETLIBS="-lsocket $NETLIBS"]))
776 _cppflags="${CPPFLAGS}"
777 _ldflags="${LDFLAGS}"
779 AC_HELP_STRING([--with-adns=DIR],
780 [look for the adns library in DIR]),
781 [if test -d "$withval"; then
782 CPPFLAGS="${CPPFLAGS} -I$withval/include"
783 LDFLAGS="${LDFLAGS} -L$withval/lib"
785 if test "$with_adns" != "no"; then
786 AC_CHECK_HEADERS(adns.h,
787 AC_CHECK_LIB(adns, adns_init,
789 [CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}]),
790 [CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}])
792 if test "$have_adns" = "yes"; then
796 # Newer adns versions feature a free function to be used under W32.
797 AC_CHECK_FUNCS(adns_free)
801 # Now try for the resolver functions so we can use DNS for SRV, PA and CERT.
803 if test x"$try_hkp" = xyes || test x"$try_http" = xyes ; then
804 AC_ARG_ENABLE(dns-srv,
805 AC_HELP_STRING([--disable-dns-srv],
806 [disable the use of DNS SRV in HKP and HTTP]),
807 use_dns_srv=$enableval,use_dns_srv=yes)
810 AC_ARG_ENABLE(dns-pka,
811 AC_HELP_STRING([--disable-dns-pka],
812 [disable the use of PKA records in DNS]),
813 use_dns_pka=$enableval,use_dns_pka=yes)
815 AC_ARG_ENABLE(dns-cert,
816 AC_HELP_STRING([--disable-dns-cert],
817 [disable the use of CERT records in DNS]),
818 use_dns_cert=$enableval,use_dns_cert=yes)
820 if test x"$use_dns_pka" = xyes || test x"$use_dns_srv" = xyes \
821 || test x"$use_dns_cert" = xyes; then
824 # the double underscore thing is a glibc-ism?
825 AC_SEARCH_LIBS(res_query,resolv bind,,
826 AC_SEARCH_LIBS(__res_query,resolv bind,,have_resolver=no))
827 AC_SEARCH_LIBS(dn_expand,resolv bind,,
828 AC_SEARCH_LIBS(__dn_expand,resolv bind,,have_resolver=no))
829 AC_SEARCH_LIBS(dn_skipname,resolv bind,,
830 AC_SEARCH_LIBS(__dn_skipname,resolv bind,,have_resolver=no))
832 if test x"$have_resolver" != xno ; then
834 # Make sure that the BIND 4 resolver interface is workable before
835 # enabling any code that calls it. At some point I'll rewrite the
836 # code to use the BIND 8 resolver API.
837 # We might also want to use adns instead. Problem with ADNS is that
838 # it does not support v6.
840 AC_MSG_CHECKING([whether the resolver is usable])
841 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
842 #include <netinet/in.h>
843 #include <arpa/nameser.h>
844 #include <resolv.h>]],
845 [[unsigned char answer[PACKETSZ];
846 res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
848 dn_expand(0,0,0,0,0);
849 ]])],have_resolver=yes,have_resolver=no)
850 AC_MSG_RESULT($have_resolver)
852 # This is Apple-specific and somewhat bizarre as they changed the
853 # define in bind 8 for some reason.
855 if test x"$have_resolver" != xyes ; then
857 [whether I can make the resolver usable with BIND_8_COMPAT])
858 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define BIND_8_COMPAT
859 #include <sys/types.h>
860 #include <netinet/in.h>
861 #include <arpa/nameser.h>
862 #include <resolv.h>]],
863 [[unsigned char answer[PACKETSZ];
864 res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
865 dn_skipname(0,0); dn_expand(0,0,0,0,0);
866 ]])],[have_resolver=yes ; need_compat=yes])
867 AC_MSG_RESULT($have_resolver)
871 if test x"$have_resolver" = xyes ; then
874 if test x"$use_dns_srv" = xyes ; then
875 AC_DEFINE(USE_DNS_SRV,1,[define to use DNS SRV])
878 if test x"$use_dns_pka" = xyes ; then
879 AC_DEFINE(USE_DNS_PKA,1,[define to use our experimental DNS PKA])
882 if test x"$use_dns_cert" = xyes ; then
883 AC_DEFINE(USE_DNS_CERT,1,[define to use DNS CERT])
886 if test x"$need_compat" = xyes ; then
887 AC_DEFINE(BIND_8_COMPAT,1,[an Apple OSXism])
890 # If we have no resolver library but ADNS (e.g. under W32) enable the
891 # code parts which can be used with ADNS.
892 if test x"$have_adns" = xyes ; then
894 AC_DEFINE(USE_ADNS,1,[Use ADNS as resolver library.])
896 if test x"$use_dns_srv" = xyes ; then
897 AC_DEFINE(USE_DNS_SRV,1)
900 if test x"$use_dns_pka" = xyes ; then
901 AC_DEFINE(USE_DNS_PKA,1)
904 if test x"$use_dns_cert" = xyes ; then
905 AC_DEFINE(USE_DNS_CERT,1,[define to use DNS CERT])
919 AM_CONDITIONAL(USE_DNS_SRV, test x"$use_dns_srv" = xyes)
925 if test "$try_ldap" = yes ; then
926 GNUPG_CHECK_LDAP($NETLIBS)
930 # Check for curl. We fake the curl API if libcurl isn't installed.
931 # We require 7.10 or later as we use curl_version_info().
933 LIBCURL_CHECK_CONFIG([yes],[7.10],,[fake_curl=yes])
934 AM_CONDITIONAL(FAKE_CURL,test x"$fake_curl" = xyes)
936 # Generic, for us, means curl
938 if test x"$try_generic" = xyes ; then
939 AC_SUBST(GPGKEYS_CURL,"gpg2keys_curl$EXEEXT")
945 # This isn't necessarily sendmail itself, but anything that gives a
946 # sendmail-ish interface to the outside world. That includes Exim,
947 # Postfix, etc. Basically, anything that can handle "sendmail -t".
948 if test "$try_mailto" = yes ; then
949 AC_ARG_WITH(mailprog,
950 AC_HELP_STRING([--with-mailprog=NAME],
951 [use "NAME -t" for mail transport]),
954 if test x"$with_mailprog" = xyes ; then
955 AC_PATH_PROG(SENDMAIL,sendmail,,$PATH:/usr/sbin:/usr/libexec:/usr/lib)
956 if test "$ac_cv_path_SENDMAIL" ; then
957 GPGKEYS_MAILTO="gpg2keys_mailto"
959 elif test x"$with_mailprog" != xno ; then
960 AC_MSG_CHECKING([for a mail transport program])
961 AC_SUBST(SENDMAIL,$with_mailprog)
962 AC_MSG_RESULT($with_mailprog)
963 GPGKEYS_MAILTO="gpg2keys_mailto"
967 AC_SUBST(GPGKEYS_MAILTO)
970 # Construct a printable name of the OS
974 PRINTABLE_OS_NAME="MingW32"
977 PRINTABLE_OS_NAME="Cygwin"
979 i?86-emx-os2 | i?86-*-os2*emx )
980 PRINTABLE_OS_NAME="OS/2"
983 PRINTABLE_OS_NAME="MSDOS/DJGPP"
987 PRINTABLE_OS_NAME="GNU/Linux"
990 PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
993 AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
994 [A human readable text with the name of the OS])
1002 if test "$am_cv_func_iconv" != yes; then
1010 # This is "GNU gnupg" - The project-id script from gettext
1013 AC_MSG_NOTICE([checking for gettext])
1015 AM_GNU_GETTEXT_VERSION([0.19.3])
1016 if test "$try_gettext" = yes; then
1017 AM_GNU_GETTEXT([external],[need-ngettext])
1019 # gettext requires some extra checks. These really should be part of
1020 # the basic AM_GNU_GETTEXT macro. TODO: move other gettext-specific
1021 # function checks to here.
1023 AC_CHECK_FUNCS(strchr)
1026 USE_INCLUDED_LIBINTL=no
1027 BUILD_INCLUDED_LIBINTL=no
1030 AC_SUBST(USE_INCLUDED_LIBINTL)
1031 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1035 # We use HAVE_LANGINFO_CODESET in a couple of places.
1038 # Checks required for our use locales
1045 if test "$selinux_support" = yes ; then
1046 AC_DEFINE(ENABLE_SELINUX_HACKS,1,[Define to enable SELinux support])
1051 # Checks for header files.
1053 AC_MSG_NOTICE([checking for header files])
1055 AC_CHECK_HEADERS([string.h unistd.h langinfo.h termio.h locale.h getopt.h])
1056 AC_CHECK_HEADERS([pty.h utmp.h pwd.h inttypes.h])
1061 # Checks for typedefs, structures, and compiler characteristics.
1063 AC_MSG_NOTICE([checking for system characteristics])
1072 gl_HEADER_SYS_SOCKET
1075 AC_ARG_ENABLE(endian-check,
1076 AC_HELP_STRING([--disable-endian-check],
1077 [disable the endian check and trust the OS provided macros]),
1078 endiancheck=$enableval,endiancheck=yes)
1080 if test x"$endiancheck" = xyes ; then
1084 # fixme: we should get rid of the byte type
1085 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
1086 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
1087 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
1088 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
1089 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
1091 AC_CHECK_SIZEOF(unsigned short)
1092 AC_CHECK_SIZEOF(unsigned int)
1093 AC_CHECK_SIZEOF(unsigned long)
1094 AC_CHECK_SIZEOF(unsigned long long)
1095 AC_CHECK_SIZEOF(time_t,,[[
1097 #if TIME_WITH_SYS_TIME
1098 # include <sys/time.h>
1101 # if HAVE_SYS_TIME_H
1102 # include <sys/time.h>
1110 # Ensure that we have UINT64_C before we bother to check for uint64_t
1111 # Fixme: really needed in gnupg? I think it is only useful in libcgrypt.
1112 AC_CACHE_CHECK([for UINT64_C],[gnupg_cv_uint64_c_works],
1113 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <inttypes.h>]],
1114 [[uint64_t foo=UINT64_C(42);]])],
1115 [gnupg_cv_uint64_c_works=yes],
1116 [gnupg_cv_uint64_c_works=no] ))
1117 if test "$gnupg_cv_uint64_c_works" = "yes" ; then
1118 AC_CHECK_SIZEOF(uint64_t)
1121 if test "$ac_cv_sizeof_unsigned_short" = "0" \
1122 || test "$ac_cv_sizeof_unsigned_int" = "0" \
1123 || test "$ac_cv_sizeof_unsigned_long" = "0"; then
1124 AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
1129 # Checks for library functions.
1131 AC_MSG_NOTICE([checking for library functions])
1132 AC_CHECK_DECLS(getpagesize)
1136 AC_CHECK_FUNCS([strerror strlwr tcgetattr mmap])
1137 AC_CHECK_FUNCS([strcasecmp strncasecmp ctermid times gmtime_r])
1138 AC_CHECK_FUNCS([unsetenv fcntl ftruncate inet_ntop])
1139 AC_CHECK_FUNCS([gettimeofday getrusage getrlimit setrlimit clock_gettime])
1140 AC_CHECK_FUNCS([atexit raise getpagesize strftime nl_langinfo setlocale])
1141 AC_CHECK_FUNCS([waitpid wait4 sigaction sigprocmask pipe stat getaddrinfo])
1142 AC_CHECK_FUNCS([ttyname rand ftello fsync stat])
1144 AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
1147 # These are needed by libjnlib - fixme: we should use a jnlib.m4
1148 # Note: We already checked pwd.h.
1149 AC_CHECK_FUNCS([memicmp stpcpy strsep strlwr strtoul memmove stricmp strtol])
1150 AC_CHECK_FUNCS([memrchr isascii timegm getrusage setrlimit stat setlocale])
1151 AC_CHECK_FUNCS([flockfile funlockfile fopencookie funopen getpwnam getpwuid])
1156 gl_SOURCE_BASE([gl])
1158 gl_MODULES([setenv mkdtemp xsize strpbrk])
1165 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
1168 # Sanity check regex. Tests adapted from mutt.
1170 AC_MSG_CHECKING([whether regular expression support is requested])
1171 AC_ARG_ENABLE(regex,
1172 AC_HELP_STRING([--disable-regex],
1173 [do not handle regular expressions in trust signatures]),
1174 use_regex=$enableval, use_regex=yes)
1175 AC_MSG_RESULT($use_regex)
1177 if test "$use_regex" = yes ; then
1178 _cppflags="${CPPFLAGS}"
1179 _ldflags="${LDFLAGS}"
1181 AC_HELP_STRING([--with-regex=DIR],[look for regex in DIR]),
1183 if test -d "$withval" ; then
1184 CPPFLAGS="${CPPFLAGS} -I$withval/include"
1185 LDFLAGS="${LDFLAGS} -L$withval/lib"
1189 # Does the system have regex functions at all?
1190 AC_SEARCH_LIBS([regcomp], [regex])
1191 AC_CHECK_FUNC(regcomp, gnupg_cv_have_regex=yes, gnupg_cv_have_regex=no)
1193 if test $gnupg_cv_have_regex = no; then
1196 if test x"$cross_compiling" = xyes; then
1197 AC_MSG_WARN([cross compiling; assuming regexp libray is not broken])
1199 AC_CACHE_CHECK([whether your system's regexp library is broken],
1200 [gnupg_cv_regex_broken],
1204 main() { regex_t blah ; regmatch_t p; p.rm_eo = p.rm_eo; return regcomp(&blah, "foo.*bar", REG_NOSUB) || regexec (&blah, "foobar", 0, NULL, 0); }],
1205 gnupg_cv_regex_broken=no, gnupg_cv_regex_broken=yes, gnupg_cv_regex_broken=yes))
1207 if test $gnupg_cv_regex_broken = yes; then
1208 AC_MSG_WARN([your regex is broken - disabling regex use])
1213 CPPFLAGS="${_cppflags}"
1214 LDFLAGS="${_ldflags}"
1217 if test "$use_regex" != yes ; then
1218 AC_DEFINE(DISABLE_REGEX,1, [Define to disable regular expression support])
1220 AM_CONDITIONAL(DISABLE_REGEX, test x"$use_regex" != xyes)
1225 # Do we have zlib? Must do it here because Solaris failed
1226 # when compiling a conftest (due to the "-lz" from LIBS).
1227 # Note that we combine zlib and bzlib2 in ZLIBS.
1230 _cppflags="${CPPFLAGS}"
1231 _ldflags="${LDFLAGS}"
1233 [ --with-zlib=DIR use libz in DIR],[
1234 if test -d "$withval"; then
1235 CPPFLAGS="${CPPFLAGS} -I$withval/include"
1236 LDFLAGS="${LDFLAGS} -L$withval/lib"
1240 AC_CHECK_HEADER(zlib.h,
1241 AC_CHECK_LIB(z, deflateInit2_,
1246 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
1247 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
1250 # Check whether we can support bzip2
1252 if test "$use_bzip2" = yes ; then
1253 _cppflags="${CPPFLAGS}"
1254 _ldflags="${LDFLAGS}"
1256 AC_HELP_STRING([--with-bzip2=DIR],[look for bzip2 in DIR]),
1258 if test -d "$withval" ; then
1259 CPPFLAGS="${CPPFLAGS} -I$withval/include"
1260 LDFLAGS="${LDFLAGS} -L$withval/lib"
1264 # Checking alongside stdio.h as an early version of bzip2 (1.0)
1265 # required stdio.h to be included before bzlib.h, and Solaris 9 is
1266 # woefully out of date.
1267 if test "$withval" != no ; then
1268 AC_CHECK_HEADER(bzlib.h,
1269 AC_CHECK_LIB(bz2,BZ2_bzCompressInit,
1272 ZLIBS="$ZLIBS -lbz2"
1273 AC_DEFINE(HAVE_BZIP2,1,
1274 [Defined if the bz2 compression library is available])
1276 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
1277 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags},[#include <stdio.h>])
1280 AM_CONDITIONAL(ENABLE_BZIP2_SUPPORT,test x"$have_bz2" = "xyes")
1284 # Check for readline support
1285 GNUPG_CHECK_READLINE
1288 if test "$development_version" = yes; then
1289 AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
1290 [Defined if this is not a regular release])
1293 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
1297 # Add some extra libs here so that previous tests don't fail for
1298 # mysterious reasons - the final link step should bail out.
1299 # W32SOCKLIBS is also defined so that if can be used for tools not
1300 # requiring any network stuff but linking to code in libcommon which
1301 # tracks in winsock stuff (e.g. init_common_subsystems.
1302 if test "$have_w32_system" = yes; then
1303 W32SOCKLIBS="-lws2_32"
1304 NETLIBS="${NETLIBS} ${W32SOCKLIBS}"
1308 AC_SUBST(W32SOCKLIBS)
1311 # Setup gcc specific options
1313 AC_MSG_NOTICE([checking for cc features])
1314 if test "$GCC" = yes; then
1315 # Check whether gcc does not emit a diagnositc for unknow -Wno-*
1316 # options. This is the case for gcc >= 4.6
1317 AC_MSG_CHECKING([if gcc ignores unknown -Wno-* options])
1318 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1319 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6 )
1321 #endif]],[])],[_gcc_silent_wno=yes],[_gcc_silent_wno=no])
1322 AC_MSG_RESULT($_gcc_silent_wno)
1324 # Note that it is okay to use CFLAGS here because this are just
1325 # warning options and the user should have a chance of overriding
1327 if test "$USE_MAINTAINER_MODE" = "yes"; then
1328 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
1329 CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
1330 if test x"$_gcc_silent_wno" = xyes ; then
1333 AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
1334 _gcc_cflags_save=$CFLAGS
1335 CFLAGS="-Wno-missing-field-initializers"
1336 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
1337 [_gcc_wopt=yes],[_gcc_wopt=no])
1338 AC_MSG_RESULT($_gcc_wopt)
1339 CFLAGS=$_gcc_cflags_save;
1341 if test x"$_gcc_wopt" = xyes ; then
1342 CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
1345 AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
1346 _gcc_cflags_save=$CFLAGS
1347 CFLAGS="-Wdeclaration-after-statement"
1348 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
1349 [_gcc_wopt=yes],[_gcc_wopt=no])
1350 AC_MSG_RESULT($_gcc_wopt)
1351 CFLAGS=$_gcc_cflags_save;
1352 if test x"$_gcc_wopt" = xyes ; then
1353 CFLAGS="$CFLAGS -Wdeclaration-after-statement"
1356 CFLAGS="$CFLAGS -Wall"
1359 if test x"$_gcc_silent_wno" = xyes ; then
1362 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
1363 _gcc_cflags_save=$CFLAGS
1364 CFLAGS="-Wno-pointer-sign"
1365 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
1366 [_gcc_psign=yes],[_gcc_psign=no])
1367 AC_MSG_RESULT($_gcc_psign)
1368 CFLAGS=$_gcc_cflags_save;
1370 if test x"$_gcc_psign" = xyes ; then
1371 CFLAGS="$CFLAGS -Wno-pointer-sign"
1374 AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
1375 _gcc_cflags_save=$CFLAGS
1376 CFLAGS="-Wpointer-arith"
1377 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[_gcc_psign=yes],[_gcc_psign=no])
1378 AC_MSG_RESULT($_gcc_psign)
1379 CFLAGS=$_gcc_cflags_save;
1380 if test x"$_gcc_psign" = xyes ; then
1381 CFLAGS="$CFLAGS -Wpointer-arith"
1384 # The undocumented option -Wno-psabi suppresses the annoying
1385 # "the ABI of passing union with long double has changed in GCC 4.4"
1386 # which is emitted in estream-printf.c but entirely irrelvant
1387 # because that union is local to the file.
1388 if test x"$_gcc_silent_wno" = xyes ; then
1389 CFLAGS="$CFLAGS -Wno-psabi"
1395 # This is handy for debugging so the compiler doesn't rearrange
1396 # things and eliminate variables.
1398 AC_ARG_ENABLE(optimization,
1399 AC_HELP_STRING([--disable-optimization],
1400 [disable compiler optimization]),
1401 [if test $enableval = no ; then
1402 CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
1406 # Prepare building of estream
1412 # Decide what to build
1414 if test "$have_adns" = "yes"; then
1415 AC_SUBST(GPGKEYS_KDNS, "gpg2keys_kdns$EXEEXT")
1420 if test $have_ksba = no; then
1425 build_agent_threaded=""
1426 if test "$build_agent" = "yes"; then
1427 if test $have_pth = no; then
1428 build_agent_threaded="(not multi-threaded)"
1433 build_scdaemon_extra=""
1434 if test "$build_scdaemon" = "yes"; then
1436 if test $have_pth = no; then
1437 build_scdaemon_extra="not multi-threaded"
1441 if test $have_libusb = no; then
1442 build_scdaemon_extra="${tmp}without internal CCID driver"
1445 if test -n "$build_scdaemon_extra"; then
1446 build_scdaemon_extra="(${build_scdaemon_extra})"
1451 if test "$build_agent_only" = "yes" ; then
1460 AM_CONDITIONAL(BUILD_GPG, test "$build_gpg" = "yes")
1461 AM_CONDITIONAL(BUILD_GPGSM, test "$build_gpgsm" = "yes")
1462 AM_CONDITIONAL(BUILD_AGENT, test "$build_agent" = "yes")
1463 AM_CONDITIONAL(BUILD_SCDAEMON, test "$build_scdaemon" = "yes")
1464 AM_CONDITIONAL(BUILD_TOOLS, test "$build_tools" = "yes")
1465 AM_CONDITIONAL(BUILD_DOC, test "$build_doc" = "yes")
1466 AM_CONDITIONAL(BUILD_SYMCRYPTRUN, test "$build_symcryptrun" = "yes")
1467 AM_CONDITIONAL(BUILD_GPGTAR, test "$build_gpgtar" = "yes")
1469 AM_CONDITIONAL(RUN_GPG_TESTS,
1470 test x$cross_compiling = xno -a "$build_gpg" = yes )
1474 # Provide information about the build.
1476 BUILD_REVISION="mym4_revision"
1477 AC_SUBST(BUILD_REVISION)
1478 AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
1479 [GIT commit id revision used to build this package])
1482 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
1484 BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec"
1485 AC_SUBST(BUILD_FILEVERSION)
1487 BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
1488 AC_SUBST(BUILD_TIMESTAMP)
1489 AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
1490 [The time this package was configured for a build])
1491 BUILD_HOSTNAME="$ac_hostname"
1492 AC_SUBST(BUILD_HOSTNAME)
1496 # Print errors here so that they are visible all
1497 # together and the user can acquire them all together.
1500 if test "$have_gpg_error" = "no"; then
1504 *** You need libgpg-error to build this program.
1505 ** This library is for example available at
1506 *** ftp://ftp.gnupg.org/gcrypt/libgpg-error
1507 *** (at least version $NEED_GPG_ERROR_VERSION is required.)
1510 if test "$have_libgcrypt" = "no"; then
1514 *** You need libgcrypt to build this program.
1515 ** This library is for example available at
1516 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
1517 *** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API is required.)
1520 if test "$have_libassuan" = "no"; then
1524 *** You need libassuan to build this program.
1525 *** This library is for example available at
1526 *** ftp://ftp.gnupg.org/gcrypt/libassuan/
1527 *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
1530 if test "$have_ksba" = "no"; then
1533 *** You need libksba to build this program.
1534 *** This library is for example available at
1535 *** ftp://ftp.gnupg.org/gcrypt/libksba/
1536 *** (at least version $NEED_KSBA_VERSION using API $NEED_KSBA_API is required).
1539 if test "$missing_pth" = "yes"; then
1542 *** It is now required to build with support for the
1543 *** GNU Portable Threads Library (Pth). Please install this
1544 *** library first. The library is for example available at
1545 *** ftp://ftp.gnu.org/gnu/pth/
1546 *** On a Debian GNU/Linux system you can install it using
1547 *** apt-get install libpth-dev
1548 *** To build GnuPG for Windows you need to use the W32PTH
1549 *** package; available at:
1550 *** ftp://ftp.g10code.com/g10code/w32pth/
1554 if test "$missing_zlib" = "yes"; then
1557 *** The zlib compression library is required.
1558 *** Please install a suitable development package
1559 *** (e.g. Debian package zlib1g-dev) or download
1560 *** it from http://zlib.net and build yourself.
1564 if test "$missing_iconv" = "yes"; then
1567 *** It is now required to build with support for iconv
1568 *** Please install a suitable iconv implementation.
1573 if test "$die" = "yes"; then
1576 *** Required libraries not found. Please consult the above messages
1577 *** and install them before running configure again.
1583 AC_CONFIG_FILES([ m4/Makefile
1597 keyserver/gpg2keys_mailto
1598 keyserver/gpg2keys_test
1603 tests/openpgp/Makefile
1604 tests/pkits/Makefile
1610 GnuPG v${VERSION} has been configured as follows:
1612 Revision: mym4_revision (mym4_revision_dec)
1613 Platform: $PRINTABLE_OS_NAME ($host)
1616 S/MIME: $build_gpgsm
1617 Agent: $build_agent $build_agent_threaded
1618 Smartcard: $build_scdaemon $build_scdaemon_extra
1619 Gpgtar: $build_gpgtar
1621 Protect tool: $show_gnupg_protect_tool_pgm
1622 Default agent: $show_gnupg_agent_pgm
1623 Default pinentry: $show_gnupg_pinentry_pgm
1624 Default scdaemon: $show_gnupg_scdaemon_pgm
1625 Default dirmngr: $show_gnupg_dirmngr_pgm
1627 if test x"$use_regex" != xyes ; then
1629 Warning: No regular expression support available.
1630 OpenPGP trust signatures won't work.
1631 gpg-check-pattern will not be build.
1634 if test "x${gpg_config_script_warn}" != x; then
1636 Warning: Mismatches between the target platform and the
1637 to be used libraries have been detected for:
1638 ${gpg_config_script_warn}
1639 Please check above for more warning messages.