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.10"
25 # Remember to change the version number immediately *after* a release.
26 # Set my_issvn to "yes" for non-released code. Remember to run an
27 # "svn up" and "autogen.sh" right before creating a distribution.
28 m4_define([my_version], [2.0.19])
29 m4_define([my_issvn], [no])
31 m4_define([svn_revision], m4_esyscmd([printf "%d" $(svn info 2>/dev/null \
32 | sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)]))
33 m4_define([git_revision], m4_esyscmd([git branch -v 2>/dev/null \
34 | awk '/^\* / {printf "%s",$3}']))
35 m4_define([my_full_version], [my_version[]m4_if(my_issvn,[yes],
36 [m4_if(git_revision,[],[-svn[]svn_revision],[-git[]git_revision])])])
38 AC_INIT([gnupg],[my_full_version],[http://bugs.gnupg.org])
39 # Set development_version to yes if the minor number is odd or you
40 # feel that the default check for a development version is not
42 development_version=no
44 NEED_GPG_ERROR_VERSION=1.7
47 NEED_LIBGCRYPT_VERSION=1.4.0
50 NEED_LIBASSUAN_VERSION=2.0.0
53 NEED_KSBA_VERSION=1.0.7
57 PACKAGE_GT=${PACKAGE_NAME}2
58 VERSION=$PACKAGE_VERSION
60 AC_CONFIG_AUX_DIR(scripts)
61 AC_CONFIG_SRCDIR(sm/gpgsm.c)
62 AM_CONFIG_HEADER(config.h)
63 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
69 # Some status variables.
80 disable_keyserver_path=no
82 use_standard_socket=no
84 GNUPG_BUILD_PROGRAM(gpg, yes)
85 GNUPG_BUILD_PROGRAM(gpgsm, yes)
86 GNUPG_BUILD_PROGRAM(agent, yes)
87 GNUPG_BUILD_PROGRAM(scdaemon, yes)
88 GNUPG_BUILD_PROGRAM(tools, yes)
89 GNUPG_BUILD_PROGRAM(doc, yes)
90 GNUPG_BUILD_PROGRAM(symcryptrun, no)
91 GNUPG_BUILD_PROGRAM(gpgtar, no)
97 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
98 AC_DEFINE_UNQUOTED(PACKAGE_GT, "$PACKAGE_GT",
99 [Name of this package for gettext])
100 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
101 AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",
102 [Bug report address])
103 AC_DEFINE_UNQUOTED(NEED_LIBGCRYPT_VERSION, "$NEED_LIBGCRYPT_VERSION",
104 [Required version of Libgcrypt])
105 AC_DEFINE_UNQUOTED(NEED_KSBA_VERSION, "$NEED_KSBA_VERSION",
106 [Required version of Libksba])
109 # The default is to use the modules from this package and the few
110 # other packages in a standard place; i.e where this package gets
111 # installed. With these options it is possible to override these
112 # ${prefix} depended values with fixed paths, which can't be replaced
113 # at make time. See also am/cmacros.am and the defaults in AH_BOTTOM.
114 AC_ARG_WITH(agent-pgm,
115 [ --with-agent-pgm=PATH Use PATH as the default for the agent)],
116 GNUPG_AGENT_PGM="$withval", GNUPG_AGENT_PGM="" )
117 AC_SUBST(GNUPG_AGENT_PGM)
118 AM_CONDITIONAL(GNUPG_AGENT_PGM, test -n "$GNUPG_AGENT_PGM")
119 show_gnupg_agent_pgm="(default)"
120 test -n "$GNUPG_AGENT_PGM" && show_gnupg_agent_pgm="$GNUPG_AGENT_PGM"
122 AC_ARG_WITH(pinentry-pgm,
123 [ --with-pinentry-pgm=PATH Use PATH as the default for the pinentry)],
124 GNUPG_PINENTRY_PGM="$withval", GNUPG_PINENTRY_PGM="" )
125 AC_SUBST(GNUPG_PINENTRY_PGM)
126 AM_CONDITIONAL(GNUPG_PINENTRY_PGM, test -n "$GNUPG_PINENTRY_PGM")
127 show_gnupg_pinentry_pgm="(default)"
128 test -n "$GNUPG_PINENTRY_PGM" && show_gnupg_pinentry_pgm="$GNUPG_PINENTRY_PGM"
131 AC_ARG_WITH(scdaemon-pgm,
132 [ --with-scdaemon-pgm=PATH Use PATH as the default for the scdaemon)],
133 GNUPG_SCDAEMON_PGM="$withval", GNUPG_SCDAEMON_PGM="" )
134 AC_SUBST(GNUPG_SCDAEMON_PGM)
135 AM_CONDITIONAL(GNUPG_SCDAEMON_PGM, test -n "$GNUPG_SCDAEMON_PGM")
136 show_gnupg_scdaemon_pgm="(default)"
137 test -n "$GNUPG_SCDAEMON_PGM" && show_gnupg_scdaemon_pgm="$GNUPG_SCDAEMON_PGM"
140 AC_ARG_WITH(dirmngr-pgm,
141 [ --with-dirmngr-pgm=PATH Use PATH as the default for the dirmngr)],
142 GNUPG_DIRMNGR_PGM="$withval", GNUPG_DIRMNGR_PGM="" )
143 AC_SUBST(GNUPG_DIRMNGR_PGM)
144 AM_CONDITIONAL(GNUPG_DIRMNGR_PGM, test -n "$GNUPG_DIRMNGR_PGM")
145 show_gnupg_dirmngr_pgm="(default)"
146 test -n "$GNUPG_DIRMNGR_PGM" && show_gnupg_dirmngr_pgm="$GNUPG_DIRMNGR_PGM"
148 AC_ARG_WITH(protect-tool-pgm,
149 [ --with-protect-tool-pgm=PATH Use PATH as the default for the protect-tool)],
150 GNUPG_PROTECT_TOOL_PGM="$withval", GNUPG_PROTECT_TOOL_PGM="" )
151 AC_SUBST(GNUPG_PROTECT_TOOL_PGM)
152 AM_CONDITIONAL(GNUPG_PROTECT_TOOL_PGM, test -n "$GNUPG_PROTECT_TOOL_PGM")
153 show_gnupg_protect_tool_pgm="(default)"
154 test -n "$GNUPG_PROTECT_TOOL_PGM" \
155 && show_gnupg_protect_tool_pgm="$GNUPG_PROTECT_TOOL_PGM"
158 # Some folks want to use only the agent from this packet. Make it
159 # easier for them by providing the configure option
160 # --enable-only-agent.
161 AC_ARG_ENABLE(agent-only,
162 AC_HELP_STRING([--enable-agent-only],[build only the gpg-agent]),
163 build_agent_only=$enableval)
165 # SELinux support includes tracking of sensitive files to avoid
166 # leaking their contents through processing these files by gpg itself
167 AC_MSG_CHECKING([whether SELinux support is requested])
168 AC_ARG_ENABLE(selinux-support,
169 AC_HELP_STRING([--enable-selinux-support],
170 [enable SELinux support]),
171 selinux_support=$enableval, selinux_support=no)
172 AC_MSG_RESULT($selinux_support)
174 # Allow disabling of bzib2 support.
175 # It is defined only after we confirm the library is available later
176 AC_MSG_CHECKING([whether to enable the BZIP2 compression algorithm])
178 AC_HELP_STRING([--disable-bzip2],[disable the BZIP2 compression algorithm]),
179 use_bzip2=$enableval)
180 AC_MSG_RESULT($use_bzip2)
182 # Configure option to allow or disallow execution of external
183 # programs, like a photo viewer.
184 AC_MSG_CHECKING([whether to enable external program execution])
186 AC_HELP_STRING([--disable-exec],[disable all external program execution]),
188 AC_MSG_RESULT($use_exec)
189 if test "$use_exec" = no ; then
190 AC_DEFINE(NO_EXEC,1,[Define to disable all external program execution])
193 if test "$use_exec" = yes ; then
194 AC_MSG_CHECKING([whether to enable photo ID viewing])
195 AC_ARG_ENABLE(photo-viewers,
196 [ --disable-photo-viewers disable photo ID viewers],
197 [if test "$enableval" = no ; then
198 AC_DEFINE(DISABLE_PHOTO_VIEWER,1,[define to disable photo viewing])
200 gnupg_cv_enable_photo_viewers=$enableval
201 AC_MSG_RESULT($enableval)
203 if test "$gnupg_cv_enable_photo_viewers" = yes ; then
204 AC_MSG_CHECKING([whether to use a fixed photo ID viewer])
205 AC_ARG_WITH(photo-viewer,
206 [ --with-photo-viewer=FIXED_VIEWER set a fixed photo ID viewer],
207 [if test "$withval" = yes ; then
209 elif test "$withval" != no ; then
210 AC_DEFINE_UNQUOTED(FIXED_PHOTO_VIEWER,"$withval",
211 [if set, restrict photo-viewer to this])
213 AC_MSG_RESULT($withval)
216 AC_MSG_CHECKING([whether to enable external keyserver helpers])
217 AC_ARG_ENABLE(keyserver-helpers,
218 [ --disable-keyserver-helpers disable all external keyserver support],
219 [if test "$enableval" = no ; then
220 AC_DEFINE(DISABLE_KEYSERVER_HELPERS,1,
221 [define to disable keyserver helpers])
223 gnupg_cv_enable_keyserver_helpers=$enableval
224 AC_MSG_RESULT($enableval)
226 if test "$gnupg_cv_enable_keyserver_helpers" = yes ; then
227 # LDAP is defined only after we confirm the library is available later
228 AC_MSG_CHECKING([whether LDAP keyserver support is requested])
230 AC_HELP_STRING([--disable-ldap],[disable LDAP keyserver interface only]),
231 try_ldap=$enableval, try_ldap=yes)
232 AC_MSG_RESULT($try_ldap)
234 AC_MSG_CHECKING([whether HKP keyserver support is requested])
236 AC_HELP_STRING([--disable-hkp],[disable HKP keyserver interface only]),
237 try_hkp=$enableval, try_hkp=yes)
238 AC_MSG_RESULT($try_hkp)
240 AC_MSG_CHECKING([whether finger key fetching support is requested])
241 AC_ARG_ENABLE(finger,
242 AC_HELP_STRING([--disable-finger],
243 [disable finger key fetching interface only]),
244 try_finger=$enableval, try_finger=yes)
245 AC_MSG_RESULT($try_finger)
247 AC_MSG_CHECKING([whether generic object key fetching support is requested])
248 AC_ARG_ENABLE(generic,
249 AC_HELP_STRING([--disable-generic],
250 [disable generic object key fetching interface only]),
251 try_generic=$enableval, try_generic=yes)
252 AC_MSG_RESULT($try_generic)
254 AC_MSG_CHECKING([whether email keyserver support is requested])
255 AC_ARG_ENABLE(mailto,
256 AC_HELP_STRING([--enable-mailto],
257 [enable email keyserver interface only]),
258 try_mailto=$enableval, try_mailto=no)
259 AC_MSG_RESULT($try_mailto)
262 AC_MSG_CHECKING([whether keyserver exec-path is enabled])
263 AC_ARG_ENABLE(keyserver-path,
264 AC_HELP_STRING([--disable-keyserver-path],
265 [disable the exec-path option for keyserver helpers]),
266 [if test "$enableval" = no ; then
267 disable_keyserver_path=yes
269 AC_MSG_RESULT($enableval)
274 # Check for the key/uid cache size. This can't be zero, but can be
275 # pretty small on embedded systems. This is used for the gpg part.
277 AC_MSG_CHECKING([for the size of the key and uid cache])
278 AC_ARG_ENABLE(key-cache,
279 AC_HELP_STRING([--enable-key-cache=SIZE],
280 [Set key cache to SIZE (default 4096)]),,enableval=4096)
281 if test "$enableval" = "no"; then
283 elif test "$enableval" = "yes" || test "$enableval" = ""; then
287 key_cache_size=`echo "$enableval" | sed 's/[A-Za-z]//g'`
289 if test "$enableval" != "$key_cache_size" || test "$key_cache_size" -lt 5; then
290 AC_MSG_ERROR([invalid key-cache size])
292 AC_MSG_RESULT($key_cache_size)
293 AC_DEFINE_UNQUOTED(PK_UID_CACHE_SIZE,$key_cache_size,
294 [Size of the key and UID caches])
299 # Check whether we want to use Linux capabilities
301 AC_MSG_CHECKING([whether use of capabilities is requested])
302 AC_ARG_WITH(capabilities,
303 [ --with-capabilities use linux capabilities [default=no]],
304 [use_capabilities="$withval"],[use_capabilities=no])
305 AC_MSG_RESULT($use_capabilities)
309 # Allow disabling of internal CCID support.
310 # It is defined only after we confirm the library is available later
312 AC_MSG_CHECKING([whether to enable the internal CCID driver])
313 AC_ARG_ENABLE(ccid-driver,
314 AC_HELP_STRING([--disable-ccid-driver],
315 [disable the internal CCID driver]),
316 use_ccid_driver=$enableval)
317 AC_MSG_RESULT($use_ccid_driver)
321 # To avoid double inclusion of config.h which might happen at some
322 # places, we add the usual double inclusion protection at the top of
326 #ifndef GNUPG_CONFIG_H_INCLUDED
327 #define GNUPG_CONFIG_H_INCLUDED
331 # Stuff which goes at the bottom of config.h.
334 /* This is the major version number of GnuPG so that
335 source included files can test for this. Note, that
336 we use 2 here even for GnuPG 1.9.x. */
337 #define GNUPG_MAJOR_VERSION 2
339 /* Now to separate file name parts.
340 Please note that the string version must not contain more
341 than one character because the code assumes strlen()==1 */
342 #ifdef HAVE_DOSISH_SYSTEM
343 #define DIRSEP_C '\\'
344 #define DIRSEP_S "\\"
347 #define PATHSEP_C ';'
348 #define PATHSEP_S ";"
349 #define EXEEXT_S ".exe"
355 #define PATHSEP_C ':'
356 #define PATHSEP_S ":"
360 /* This is the same as VERSION, but should be overridden if the
361 platform cannot handle things like dots '.' in filenames. Set
362 SAFE_VERSION_DOT and SAFE_VERSION_DASH to whatever SAFE_VERSION
363 uses for dots and dashes. */
364 #define SAFE_VERSION VERSION
365 #define SAFE_VERSION_DOT '.'
366 #define SAFE_VERSION_DASH '-'
368 /* Some global constants. */
369 #ifdef HAVE_DRIVE_LETTERS
370 #define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
372 #define GNUPG_DEFAULT_HOMEDIR "/SYS\$LOGIN/gnupg"
374 #define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
376 #define GNUPG_PRIVATE_KEYS_DIR "private-keys-v1.d"
378 /* For some systems (DOS currently), we hardcode the path here. For
379 POSIX systems the values are constructed by the Makefiles, so that
380 the values may be overridden by the make invocations; this is to
381 comply with the GNU coding standards. */
382 #ifdef HAVE_DRIVE_LETTERS
383 /* FIXME: We need to use a function to determine these values depending
384 on the actual installation directory. */
385 #define GNUPG_BINDIR "c:\\gnupg"
386 #define GNUPG_LIBEXECDIR "c:\\gnupg"
387 #define GNUPG_LIBDIR "c:\\gnupg"
388 #define GNUPG_DATADIR "c:\\gnupg"
389 #define GNUPG_SYSCONFDIR "c:\\gnupg"
392 /* Derive some other constants. */
393 #if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
394 #define EXEC_TEMPFILE_ONLY
398 /* We didn't define endianness above, so get it from OS macros. This
399 is intended for making fat binary builds on OS X. */
400 #if !defined(BIG_ENDIAN_HOST) && !defined(LITTLE_ENDIAN_HOST)
401 #if defined(__BIG_ENDIAN__)
402 #define BIG_ENDIAN_HOST 1
403 #elif defined(__LITTLE_ENDIAN__)
404 #define LITTLE_ENDIAN_HOST 1
406 #error "No endianness found"
411 /* Hack used for W32: ldap.m4 also tests for the ASCII version of
412 ldap_start_tls_s because that is the actual symbol used in the
413 library. winldap.h redefines it to our commonly used value,
414 thus we define our usual macro here. */
415 #ifdef HAVE_LDAP_START_TLS_SA
416 # ifndef HAVE_LDAP_START_TLS_S
417 # define HAVE_LDAP_START_TLS_S 1
422 /* Tell libgcrypt not to use its own libgpg-error implementation. */
423 #define USE_LIBGPG_ERROR 1
425 /* We use jnlib, so tell other modules about it. */
426 #define HAVE_JNLIB_LOGGING 1
428 /* Our HTTP code is used in estream mode. */
429 #define HTTP_USE_ESTREAM 1
431 /* Under W32 we do an explicit socket initialization, thus we need to
432 avoid the on-demand initialization which would also install an atexit
434 #define HTTP_NO_WSASTARTUP
436 /* We always include support for the OpenPGP card. */
437 #define ENABLE_CARD_SUPPORT 1
439 /* We don't want the old assuan codes anymore. */
440 #define _ASSUAN_ONLY_GPG_ERRORS 1
442 /* We explicitly need to disable PTH's soft mapping as Debian
443 currently enables it by default for no reason. */
444 #define PTH_SYSCALL_SOFT 0
446 /* We want to use the libgcrypt provided memory allocation for
448 #define _ESTREAM_PRINTF_MALLOC gcry_malloc
449 #define _ESTREAM_PRINTF_FREE gcry_free
450 #define _ESTREAM_PRINTF_EXTRA_INCLUDE "util.h"
452 #endif /*GNUPG_CONFIG_H_INCLUDED*/
458 # Checks for programs.
459 AC_MSG_NOTICE([checking for programs])
462 missing_dir=`cd $ac_aux_dir && pwd`
463 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
464 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
465 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
466 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
467 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
472 if test "x$ac_cv_prog_cc_c89" = "xno" ; then
473 AC_MSG_ERROR([[No C-89 compiler found]])
478 AC_CHECK_TOOL(AR, ar, :)
479 AC_PATH_PROG(PERL,"perl")
480 AC_CHECK_TOOL(WINDRES, windres, :)
487 # We need to compile and run a program on the build machine. A
488 # comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
489 # the AC archive is broken for autoconf 2.57. Given that tehre is no
490 # newer version of that macro, we assume that it is also broken for
491 # autoconf 2.61 and thus we use a simple but usually sufficient
493 AC_MSG_CHECKING(for cc for build)
494 if test "$cross_compiling" = "yes"; then
495 CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
497 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
499 AC_MSG_RESULT($CC_FOR_BUILD)
500 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
505 have_dosish_system=no
507 use_simple_gettext=no
510 # special stuff for Windoze NT
511 ac_cv_have_dev_random=no
512 AC_DEFINE(USE_ONLY_8DOT3,1,
513 [set this to limit filenames to the 8.3 format])
514 AC_DEFINE(HAVE_DRIVE_LETTERS,1,
515 [defined if we must run on a stupid file system])
516 AC_DEFINE(USE_SIMPLE_GETTEXT,1,
517 [because the Unix gettext has too much overhead on
518 MingW32 systems and these systems lack Posix functions,
519 we use a simplified version of gettext])
520 disable_keyserver_path=yes
521 have_dosish_system=yes
524 use_simple_gettext=yes
526 i?86-emx-os2 | i?86-*-os2*emx )
527 # OS/2 with the EMX environment
528 ac_cv_have_dev_random=no
529 AC_DEFINE(HAVE_DRIVE_LETTERS)
530 have_dosish_system=yes
535 # DOS with the DJGPP environment
536 ac_cv_have_dev_random=no
537 AC_DEFINE(HAVE_DRIVE_LETTERS)
538 have_dosish_system=yes
544 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
545 LDFLAGS="$LDFLAGS -L/usr/local/lib"
549 if test -z "$GCC" ; then
550 CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
554 if test -z "$GCC" ; then
555 # Suppress all warnings
556 # to get rid of the unsigned/signed char mismatch warnings.
561 if test -z "$GCC" ; then
562 # Use the newer compiler `-msg_disable ptrmismatch1' to
563 # get rid of the unsigned/signed char mismatch warnings.
564 # Using this may hide other pointer mismatch warnings, but
565 # it at least lets other warning classes through
566 CFLAGS="$CFLAGS -msg_disable ptrmismatch1"
575 if test "$have_dosish_system" = yes; then
576 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
577 [Defined if we run on some of the PCDOS like systems
578 (DOS, Windoze. OS/2) with special properties like
581 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
583 AM_CONDITIONAL(USE_SIMPLE_GETTEXT, test x"$use_simple_gettext" = xyes)
585 if test "$have_w32_system" = yes; then
586 AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
588 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
590 if test "$disable_keyserver_path" = yes; then
591 AC_DEFINE(DISABLE_KEYSERVER_PATH,1,
592 [Defined to disable exec-path for keyserver helpers])
596 # Allows enabling the use of a standard socket by default This is
597 # gpg-agent's option --[no-]use-standard-socket. For Windows we force
600 AC_MSG_CHECKING([whether to use a standard socket by default])
601 AC_ARG_ENABLE(standard-socket,
602 AC_HELP_STRING([--enable-standard-socket],
603 [use a standard socket for the agent by default]),
604 use_standard_socket=$enableval)
606 if test "$use_standard_socket" != yes; then
607 if test "$have_w32_system" = yes; then
608 use_standard_socket=yes
612 AC_MSG_RESULT($use_standard_socket$tmp)
613 if test "$use_standard_socket" = yes; then
614 AC_DEFINE(USE_STANDARD_SOCKET,1,
615 [Use a standard socket for the agent by default])
619 # (These need to go after AC_PROG_CC so that $EXEEXT is defined)
620 AC_DEFINE_UNQUOTED(EXEEXT,"$EXEEXT",[The executable file extension, if any])
622 if test x"$try_hkp" = xyes ; then
623 AC_SUBST(GPGKEYS_HKP,"gpg2keys_hkp$EXEEXT")
626 if test x"$try_finger" = xyes ; then
627 AC_SUBST(GPGKEYS_FINGER,"gpg2keys_finger$EXEEXT")
633 # Checks for libraries.
635 AC_MSG_NOTICE([checking for libraries])
639 # libgpg-error is a library with error codes shared between GnuPG
642 AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
643 have_gpg_error=yes,have_gpg_error=no)
647 # Libgcrypt is our generic crypto library
649 AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION",
650 have_libgcrypt=yes,have_libgcrypt=no)
654 # libassuan is used for IPC
656 AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
657 have_libassuan=yes,have_libassuan=no)
658 if test "$have_libassuan" = "yes"; then
659 AC_DEFINE_UNQUOTED(GNUPG_LIBASSUAN_VERSION, "$libassuan_version",
660 [version of the libbassuan library])
666 # libksba is our X.509 support library
668 AM_PATH_KSBA("$NEED_KSBA_API:$NEED_KSBA_VERSION",have_ksba=yes,have_ksba=no)
672 # libusb allows us to use the integrated CCID smartcard reader driver.
674 # FiXME: Use GNUPG_CHECK_LIBUSB and modify to use separate AC_SUBSTs.
675 if test "$use_ccid_driver" = yes ; then
676 AC_CHECK_LIB(usb, usb_bulk_write,
677 [ LIBUSB_LIBS="$LIBUSB_LIBS -lusb"
678 AC_DEFINE(HAVE_LIBUSB,1,
679 [defined if libusb is available])
682 AC_CHECK_FUNCS(usb_create_match)
684 AC_SUBST(LIBUSB_LIBS)
687 # Check wether it is necessary to link against libdl.
689 gnupg_dlopen_save_libs="$LIBS"
691 AC_SEARCH_LIBS(dlopen, c dl,,,)
694 LIBS="$gnupg_dlopen_save_libs"
697 # Checks for symcryptrun:
700 # libutil has openpty() and login_tty().
701 AC_CHECK_LIB(util, openpty,
702 [ LIBUTIL_LIBS="$LIBUTIL_LIBS -lutil"
703 AC_DEFINE(HAVE_LIBUTIL,1,
704 [defined if libutil is available])
706 AC_SUBST(LIBUTIL_LIBS)
708 # shred is used to clean temporary plain text files.
709 AC_PATH_PROG(SHRED, shred, /usr/bin/shred)
710 AC_DEFINE_UNQUOTED(SHRED,
711 "${SHRED}", [defines the filename of the shred program])
716 # Check whether the GNU Pth library is available
717 # Note, that we include a Pth emulation for W32.
720 if test "$have_pth" = "yes"; then
721 AC_DEFINE(USE_GNU_PTH, 1,
722 [Defined if the GNU Portable Thread Library should be used])
726 *** To support concurrent access to the gpg-agent and the SCdaemon
727 *** we need the support of the GNU Portable Threads Library.
728 *** Download it from ftp://ftp.gnu.org/gnu/pth/
729 *** On a Debian GNU/Linux system you might want to try
730 *** apt-get install libpth-dev
735 AC_MSG_NOTICE([checking for networking options])
738 # Must check for network library requirements before doing link tests
739 # for ldap, for example. If ldap libs are static (or dynamic and without
740 # ELF runtime link paths), then link will fail and LDAP support won't
743 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
744 [NETLIBS="-lnsl $NETLIBS"]))
745 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
746 [NETLIBS="-lsocket $NETLIBS"]))
752 _cppflags="${CPPFLAGS}"
753 _ldflags="${LDFLAGS}"
755 AC_HELP_STRING([--with-adns=DIR],
756 [look for the adns library in DIR]),
757 [if test -d "$withval"; then
758 CPPFLAGS="${CPPFLAGS} -I$withval/include"
759 LDFLAGS="${LDFLAGS} -L$withval/lib"
761 if test "$with_adns" != "no"; then
762 AC_CHECK_HEADERS(adns.h,
763 AC_CHECK_LIB(adns, adns_init,
765 [CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}]),
766 [CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}])
768 if test "$have_adns" = "yes"; then
772 # Newer adns versions feature a free function to be used under W32.
773 AC_CHECK_FUNCS(adns_free)
777 # Now try for the resolver functions so we can use DNS for SRV, PA and CERT.
779 if test x"$try_hkp" = xyes || test x"$try_http" = xyes ; then
780 AC_ARG_ENABLE(dns-srv,
781 AC_HELP_STRING([--disable-dns-srv],
782 [disable the use of DNS SRV in HKP and HTTP]),
783 use_dns_srv=$enableval,use_dns_srv=yes)
786 AC_ARG_ENABLE(dns-pka,
787 AC_HELP_STRING([--disable-dns-pka],
788 [disable the use of PKA records in DNS]),
789 use_dns_pka=$enableval,use_dns_pka=yes)
791 AC_ARG_ENABLE(dns-cert,
792 AC_HELP_STRING([--disable-dns-cert],
793 [disable the use of CERT records in DNS]),
794 use_dns_cert=$enableval,use_dns_cert=yes)
796 if test x"$use_dns_pka" = xyes || test x"$use_dns_srv" = xyes \
797 || test x"$use_dns_cert" = xyes; then
800 # the double underscore thing is a glibc-ism?
801 AC_SEARCH_LIBS(res_query,resolv bind,,
802 AC_SEARCH_LIBS(__res_query,resolv bind,,have_resolver=no))
803 AC_SEARCH_LIBS(dn_expand,resolv bind,,
804 AC_SEARCH_LIBS(__dn_expand,resolv bind,,have_resolver=no))
805 AC_SEARCH_LIBS(dn_skipname,resolv bind,,
806 AC_SEARCH_LIBS(__dn_skipname,resolv bind,,have_resolver=no))
808 if test x"$have_resolver" != xno ; then
810 # Make sure that the BIND 4 resolver interface is workable before
811 # enabling any code that calls it. At some point I'll rewrite the
812 # code to use the BIND 8 resolver API.
813 # We might also want to use adns instead. Problem with ADNS is that
814 # it does not support v6.
816 AC_MSG_CHECKING([whether the resolver is usable])
817 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
818 #include <netinet/in.h>
819 #include <arpa/nameser.h>
820 #include <resolv.h>]],
821 [[unsigned char answer[PACKETSZ];
822 res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
824 dn_expand(0,0,0,0,0);
825 ]])],have_resolver=yes,have_resolver=no)
826 AC_MSG_RESULT($have_resolver)
828 # This is Apple-specific and somewhat bizarre as they changed the
829 # define in bind 8 for some reason.
831 if test x"$have_resolver" != xyes ; then
833 [whether I can make the resolver usable with BIND_8_COMPAT])
834 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#define BIND_8_COMPAT
835 #include <sys/types.h>
836 #include <netinet/in.h>
837 #include <arpa/nameser.h>
838 #include <resolv.h>]],
839 [[unsigned char answer[PACKETSZ];
840 res_query("foo.bar",C_IN,T_A,answer,PACKETSZ);
841 dn_skipname(0,0); dn_expand(0,0,0,0,0);
842 ]])],[have_resolver=yes ; need_compat=yes])
843 AC_MSG_RESULT($have_resolver)
847 if test x"$have_resolver" = xyes ; then
850 if test x"$use_dns_srv" = xyes ; then
851 AC_DEFINE(USE_DNS_SRV,1,[define to use DNS SRV])
854 if test x"$use_dns_pka" = xyes ; then
855 AC_DEFINE(USE_DNS_PKA,1,[define to use our experimental DNS PKA])
858 if test x"$use_dns_cert" = xyes ; then
859 AC_DEFINE(USE_DNS_CERT,1,[define to use DNS CERT])
862 if test x"$need_compat" = xyes ; then
863 AC_DEFINE(BIND_8_COMPAT,1,[an Apple OSXism])
866 # If we have no resolver library but ADNS (e.g. under W32) enable the
867 # code parts which can be used with ADNS.
868 if test x"$have_adns" = xyes ; then
870 AC_DEFINE(USE_ADNS,1,[Use ADNS as resolver library.])
872 if test x"$use_dns_srv" = xyes ; then
873 AC_DEFINE(USE_DNS_SRV,1)
876 if test x"$use_dns_pka" = xyes ; then
877 AC_DEFINE(USE_DNS_PKA,1)
880 if test x"$use_dns_cert" = xyes ; then
881 AC_DEFINE(USE_DNS_CERT,1,[define to use DNS CERT])
895 AM_CONDITIONAL(USE_DNS_SRV, test x"$use_dns_srv" = xyes)
901 if test "$try_ldap" = yes ; then
902 GNUPG_CHECK_LDAP($NETLIBS)
906 # Check for curl. We fake the curl API if libcurl isn't installed.
907 # We require 7.10 or later as we use curl_version_info().
909 LIBCURL_CHECK_CONFIG([yes],[7.10],,[fake_curl=yes])
910 AM_CONDITIONAL(FAKE_CURL,test x"$fake_curl" = xyes)
912 # Generic, for us, means curl
914 if test x"$try_generic" = xyes ; then
915 AC_SUBST(GPGKEYS_CURL,"gpg2keys_curl$EXEEXT")
921 # This isn't necessarily sendmail itself, but anything that gives a
922 # sendmail-ish interface to the outside world. That includes Exim,
923 # Postfix, etc. Basically, anything that can handle "sendmail -t".
924 if test "$try_mailto" = yes ; then
925 AC_ARG_WITH(mailprog,
926 AC_HELP_STRING([--with-mailprog=NAME],
927 [use "NAME -t" for mail transport]),
930 if test x"$with_mailprog" = xyes ; then
931 AC_PATH_PROG(SENDMAIL,sendmail,,$PATH:/usr/sbin:/usr/libexec:/usr/lib)
932 if test "$ac_cv_path_SENDMAIL" ; then
933 GPGKEYS_MAILTO="gpg2keys_mailto"
935 elif test x"$with_mailprog" != xno ; then
936 AC_MSG_CHECKING([for a mail transport program])
937 AC_SUBST(SENDMAIL,$with_mailprog)
938 AC_MSG_RESULT($with_mailprog)
939 GPGKEYS_MAILTO="gpg2keys_mailto"
943 AC_SUBST(GPGKEYS_MAILTO)
946 # Construct a printable name of the OS
950 PRINTABLE_OS_NAME="MingW32"
953 PRINTABLE_OS_NAME="Cygwin"
955 i?86-emx-os2 | i?86-*-os2*emx )
956 PRINTABLE_OS_NAME="OS/2"
959 PRINTABLE_OS_NAME="MSDOS/DJGPP"
963 PRINTABLE_OS_NAME="GNU/Linux"
966 PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
969 AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
970 [A human readable text with the name of the OS])
982 # This is "GNU gnupg" - The project-id script from gettext
985 AC_MSG_NOTICE([checking for gettext])
987 AM_GNU_GETTEXT_VERSION([0.17])
988 if test "$try_gettext" = yes; then
989 AM_GNU_GETTEXT([external],[need-ngettext])
991 # gettext requires some extra checks. These really should be part of
992 # the basic AM_GNU_GETTEXT macro. TODO: move other gettext-specific
993 # function checks to here.
995 AC_CHECK_FUNCS(strchr)
998 USE_INCLUDED_LIBINTL=no
999 BUILD_INCLUDED_LIBINTL=no
1002 AC_SUBST(USE_INCLUDED_LIBINTL)
1003 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1007 # We use HAVE_LANGINFO_CODESET in a couple of places.
1010 # Checks required for our use locales
1017 if test "$selinux_support" = yes ; then
1018 AC_DEFINE(ENABLE_SELINUX_HACKS,1,[Define to enable SELinux support])
1023 # Checks for header files.
1025 AC_MSG_NOTICE([checking for header files])
1027 AC_CHECK_HEADERS([string.h unistd.h langinfo.h termio.h locale.h getopt.h])
1028 AC_CHECK_HEADERS([pty.h utmp.h pwd.h inttypes.h])
1033 # Checks for typedefs, structures, and compiler characteristics.
1035 AC_MSG_NOTICE([checking for system characteristics])
1044 gl_HEADER_SYS_SOCKET
1047 AC_ARG_ENABLE(endian-check,
1048 AC_HELP_STRING([--disable-endian-check],
1049 [disable the endian check and trust the OS provided macros]),
1050 endiancheck=$enableval,endiancheck=yes)
1052 if test x"$endiancheck" = xyes ; then
1056 # fixme: we should get rid of the byte type
1057 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
1058 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
1059 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
1060 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
1061 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
1063 AC_CHECK_SIZEOF(unsigned short)
1064 AC_CHECK_SIZEOF(unsigned int)
1065 AC_CHECK_SIZEOF(unsigned long)
1066 AC_CHECK_SIZEOF(unsigned long long)
1067 AC_CHECK_SIZEOF(time_t,,[[
1069 #if TIME_WITH_SYS_TIME
1070 # include <sys/time.h>
1073 # if HAVE_SYS_TIME_H
1074 # include <sys/time.h>
1082 # Ensure that we have UINT64_C before we bother to check for uint64_t
1083 # Fixme: really needed in gnupg? I think it is only useful in libcgrypt.
1084 AC_CACHE_CHECK([for UINT64_C],[gnupg_cv_uint64_c_works],
1085 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <inttypes.h>]],
1086 [[uint64_t foo=UINT64_C(42);]])],
1087 [gnupg_cv_uint64_c_works=yes],
1088 [gnupg_cv_uint64_c_works=no] ))
1089 if test "$gnupg_cv_uint64_c_works" = "yes" ; then
1090 AC_CHECK_SIZEOF(uint64_t)
1093 if test "$ac_cv_sizeof_unsigned_short" = "0" \
1094 || test "$ac_cv_sizeof_unsigned_int" = "0" \
1095 || test "$ac_cv_sizeof_unsigned_long" = "0"; then
1096 AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
1101 # Checks for library functions.
1103 AC_MSG_NOTICE([checking for library functions])
1104 AC_CHECK_DECLS(getpagesize)
1108 AC_CHECK_FUNCS([strerror strlwr tcgetattr mmap])
1109 AC_CHECK_FUNCS([strcasecmp strncasecmp ctermid times gmtime_r])
1110 AC_CHECK_FUNCS([unsetenv fcntl ftruncate])
1111 AC_CHECK_FUNCS([gettimeofday getrusage getrlimit setrlimit clock_gettime])
1112 AC_CHECK_FUNCS([atexit raise getpagesize strftime nl_langinfo setlocale])
1113 AC_CHECK_FUNCS([waitpid wait4 sigaction sigprocmask pipe stat getaddrinfo])
1114 AC_CHECK_FUNCS([ttyname rand ftello fsync stat])
1116 AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
1119 # These are needed by libjnlib - fixme: we should use a jnlib.m4
1120 # Note: We already checked pwd.h.
1121 AC_CHECK_FUNCS([memicmp stpcpy strsep strlwr strtoul memmove stricmp strtol])
1122 AC_CHECK_FUNCS([memrchr isascii timegm getrusage setrlimit stat setlocale])
1123 AC_CHECK_FUNCS([flockfile funlockfile fopencookie funopen getpwnam getpwuid])
1128 gl_SOURCE_BASE([gl])
1130 gl_MODULES([setenv mkdtemp xsize strpbrk])
1137 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
1140 # Sanity check regex. Tests adapted from mutt.
1142 AC_MSG_CHECKING([whether regular expression support is requested])
1143 AC_ARG_ENABLE(regex,
1144 AC_HELP_STRING([--disable-regex],
1145 [do not handle regular expressions in trust signatures]),
1146 use_regex=$enableval, use_regex=yes)
1147 AC_MSG_RESULT($use_regex)
1149 if test "$use_regex" = yes ; then
1150 _cppflags="${CPPFLAGS}"
1151 _ldflags="${LDFLAGS}"
1153 AC_HELP_STRING([--with-regex=DIR],[look for regex in DIR]),
1155 if test -d "$withval" ; then
1156 CPPFLAGS="${CPPFLAGS} -I$withval/include"
1157 LDFLAGS="${LDFLAGS} -L$withval/lib"
1161 # Does the system have regex functions at all?
1162 AC_SEARCH_LIBS([regcomp], [regex])
1163 AC_CHECK_FUNC(regcomp, gnupg_cv_have_regex=yes, gnupg_cv_have_regex=no)
1165 if test $gnupg_cv_have_regex = no; then
1168 if test x"$cross_compiling" = xyes; then
1169 AC_MSG_WARN([cross compiling; assuming regexp libray is not broken])
1171 AC_CACHE_CHECK([whether your system's regexp library is broken],
1172 [gnupg_cv_regex_broken],
1176 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); }],
1177 gnupg_cv_regex_broken=no, gnupg_cv_regex_broken=yes, gnupg_cv_regex_broken=yes))
1179 if test $gnupg_cv_regex_broken = yes; then
1180 AC_MSG_WARN([your regex is broken - disabling regex use])
1185 CPPFLAGS="${_cppflags}"
1186 LDFLAGS="${_ldflags}"
1189 if test "$use_regex" != yes ; then
1190 AC_DEFINE(DISABLE_REGEX,1, [Define to disable regular expression support])
1192 AM_CONDITIONAL(DISABLE_REGEX, test x"$use_regex" != xyes)
1197 # Do we have zlib? Must do it here because Solaris failed
1198 # when compiling a conftest (due to the "-lz" from LIBS).
1199 # Note that we combine zlib and bzlib2 in ZLIBS.
1201 _cppflags="${CPPFLAGS}"
1202 _ldflags="${LDFLAGS}"
1204 [ --with-zlib=DIR use libz in DIR],[
1205 if test -d "$withval"; then
1206 CPPFLAGS="${CPPFLAGS} -I$withval/include"
1207 LDFLAGS="${LDFLAGS} -L$withval/lib"
1211 AC_CHECK_HEADER(zlib.h,
1212 AC_CHECK_LIB(z, deflateInit2_,
1214 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
1215 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
1218 # Check whether we can support bzip2
1220 if test "$use_bzip2" = yes ; then
1221 _cppflags="${CPPFLAGS}"
1222 _ldflags="${LDFLAGS}"
1224 AC_HELP_STRING([--with-bzip2=DIR],[look for bzip2 in DIR]),
1226 if test -d "$withval" ; then
1227 CPPFLAGS="${CPPFLAGS} -I$withval/include"
1228 LDFLAGS="${LDFLAGS} -L$withval/lib"
1232 # Checking alongside stdio.h as an early version of bzip2 (1.0)
1233 # required stdio.h to be included before bzlib.h, and Solaris 9 is
1234 # woefully out of date.
1235 if test "$withval" != no ; then
1236 AC_CHECK_HEADER(bzlib.h,
1237 AC_CHECK_LIB(bz2,BZ2_bzCompressInit,
1240 ZLIBS="$ZLIBS -lbz2"
1241 AC_DEFINE(HAVE_BZIP2,1,
1242 [Defined if the bz2 compression library is available])
1244 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
1245 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags},[#include <stdio.h>])
1248 AM_CONDITIONAL(ENABLE_BZIP2_SUPPORT,test x"$have_bz2" = "xyes")
1252 # Check for readline support
1253 GNUPG_CHECK_READLINE
1256 # Allow users to append something to the version string without
1257 # flagging it as development version. The user version parts is
1258 # considered everything after a dash.
1260 if test "$development_version" != yes; then
1264 if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
1265 development_version=yes
1268 if test "$development_version" = yes; then
1269 AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
1270 [Defined if this is not a regular release])
1273 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
1277 # Add some extra libs here so that previous tests don't fail for
1278 # mysterious reasons - the final link step should bail out.
1279 # W32SOCKLIBS is also defined so that if can be used for tools not
1280 # requiring any network stuff but linking to code in libcommon which
1281 # tracks in winsock stuff (e.g. init_common_subsystems.
1282 if test "$have_w32_system" = yes; then
1283 W32SOCKLIBS="-lws2_32"
1284 NETLIBS="${NETLIBS} ${W32SOCKLIBS}"
1288 AC_SUBST(W32SOCKLIBS)
1291 # Setup gcc specific options
1293 AC_MSG_NOTICE([checking for cc features])
1294 if test "$GCC" = yes; then
1295 # Note that it is okay to use CFLAGS here because this are just
1296 # warning options and the user should have a chance of overriding
1298 if test "$USE_MAINTAINER_MODE" = "yes"; then
1299 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
1300 CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
1301 AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
1302 _gcc_cflags_save=$CFLAGS
1303 CFLAGS="-Wno-missing-field-initializers"
1304 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
1305 [_gcc_wopt=yes],[_gcc_wopt=no])
1306 AC_MSG_RESULT($_gcc_wopt)
1307 CFLAGS=$_gcc_cflags_save;
1308 if test x"$_gcc_wopt" = xyes ; then
1309 CFLAGS="$CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
1311 AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
1312 _gcc_cflags_save=$CFLAGS
1313 CFLAGS="-Wdeclaration-after-statement"
1314 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
1315 [_gcc_wopt=yes],[_gcc_wopt=no])
1316 AC_MSG_RESULT($_gcc_wopt)
1317 CFLAGS=$_gcc_cflags_save;
1318 if test x"$_gcc_wopt" = xyes ; then
1319 CFLAGS="$CFLAGS -Wdeclaration-after-statement"
1322 CFLAGS="$CFLAGS -Wall"
1325 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
1326 _gcc_cflags_save=$CFLAGS
1327 CFLAGS="-Wno-pointer-sign"
1328 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[_gcc_psign=yes],[_gcc_psign=no])
1329 AC_MSG_RESULT($_gcc_psign)
1330 CFLAGS=$_gcc_cflags_save;
1331 if test x"$_gcc_psign" = xyes ; then
1332 CFLAGS="$CFLAGS -Wno-pointer-sign"
1335 AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
1336 _gcc_cflags_save=$CFLAGS
1337 CFLAGS="-Wpointer-arith"
1338 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],[_gcc_psign=yes],[_gcc_psign=no])
1339 AC_MSG_RESULT($_gcc_psign)
1340 CFLAGS=$_gcc_cflags_save;
1341 if test x"$_gcc_psign" = xyes ; then
1342 CFLAGS="$CFLAGS -Wpointer-arith"
1348 # This is handy for debugging so the compiler doesn't rearrange
1349 # things and eliminate variables.
1351 AC_ARG_ENABLE(optimization,
1352 AC_HELP_STRING([--disable-optimization],
1353 [disable compiler optimization]),
1354 [if test $enableval = no ; then
1355 CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
1359 # Prepare building of estream
1365 # Decide what to build
1367 if test "$have_adns" = "yes"; then
1368 AC_SUBST(GPGKEYS_KDNS, "gpg2keys_kdns$EXEEXT")
1373 if test $have_ksba = no; then
1378 build_agent_threaded=""
1379 if test "$build_agent" = "yes"; then
1380 if test $have_pth = no; then
1381 build_agent_threaded="(not multi-threaded)"
1386 build_scdaemon_extra=""
1387 if test "$build_scdaemon" = "yes"; then
1389 if test $have_pth = no; then
1390 build_scdaemon_extra="not multi-threaded"
1394 if test $have_libusb = no; then
1395 build_scdaemon_extra="${tmp}without internal CCID driver"
1398 if test -n "$build_scdaemon_extra"; then
1399 build_scdaemon_extra="(${build_scdaemon_extra})"
1404 if test "$build_agent_only" = "yes" ; then
1413 AM_CONDITIONAL(BUILD_GPG, test "$build_gpg" = "yes")
1414 AM_CONDITIONAL(BUILD_GPGSM, test "$build_gpgsm" = "yes")
1415 AM_CONDITIONAL(BUILD_AGENT, test "$build_agent" = "yes")
1416 AM_CONDITIONAL(BUILD_SCDAEMON, test "$build_scdaemon" = "yes")
1417 AM_CONDITIONAL(BUILD_TOOLS, test "$build_tools" = "yes")
1418 AM_CONDITIONAL(BUILD_DOC, test "$build_doc" = "yes")
1419 AM_CONDITIONAL(BUILD_SYMCRYPTRUN, test "$build_symcryptrun" = "yes")
1420 AM_CONDITIONAL(BUILD_GPGTAR, test "$build_gpgtar" = "yes")
1422 AM_CONDITIONAL(RUN_GPG_TESTS,
1423 test x$cross_compiling = xno -a "$build_gpg" = yes )
1427 # Print errors here so that they are visible all
1428 # together and the user can acquire them all together.
1431 if test "$have_gpg_error" = "no"; then
1435 *** You need libgpg-error to build this program.
1436 ** This library is for example available at
1437 *** ftp://ftp.gnupg.org/gcrypt/libgpg-error
1438 *** (at least version $NEED_GPG_ERROR_VERSION is required.)
1441 if test "$have_libgcrypt" = "no"; then
1445 *** You need libgcrypt to build this program.
1446 ** This library is for example available at
1447 *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
1448 *** (at least version $NEED_LIBGCRYPT_VERSION using API $NEED_LIBGCRYPT_API is required.)
1451 if test "$have_libassuan" = "no"; then
1455 *** You need libassuan to build this program.
1456 *** This library is for example available at
1457 *** ftp://ftp.gnupg.org/gcrypt/libassuan/
1458 *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
1461 if test "$have_ksba" = "no"; then
1464 *** You need libksba to build this program.
1465 *** This library is for example available at
1466 *** ftp://ftp.gnupg.org/gcrypt/libksba/
1467 *** (at least version $NEED_KSBA_VERSION using API $NEED_KSBA_API is required).
1470 if test "$missing_pth" = "yes"; then
1473 *** It is now required to build with support for the
1474 *** GNU Portable Threads Library (Pth). Please install this
1475 *** library first. The library is for example available at
1476 *** ftp://ftp.gnu.org/gnu/pth/
1477 *** On a Debian GNU/Linux system you can install it using
1478 *** apt-get install libpth-dev
1479 *** To build GnuPG for Windows you need to use the W32PTH
1480 *** package; available at:
1481 *** ftp://ftp.g10code.com/g10code/w32pth/
1486 if test "$die" = "yes"; then
1489 *** Required libraries not found. Please consult the above messages
1490 *** and install them before running configure again.
1496 AC_CONFIG_FILES([ m4/Makefile
1509 keyserver/gpg2keys_mailto
1510 keyserver/gpg2keys_test
1515 tests/openpgp/Makefile
1516 tests/pkits/Makefile
1522 GnuPG v${VERSION} has been configured as follows:
1524 Platform: $PRINTABLE_OS_NAME ($host)
1527 S/MIME: $build_gpgsm
1528 Agent: $build_agent $build_agent_threaded
1529 Smartcard: $build_scdaemon $build_scdaemon_extra
1530 Gpgtar: $build_gpgtar
1532 Protect tool: $show_gnupg_protect_tool_pgm
1533 Default agent: $show_gnupg_agent_pgm
1534 Default pinentry: $show_gnupg_pinentry_pgm
1535 Default scdaemon: $show_gnupg_scdaemon_pgm
1536 Default dirmngr: $show_gnupg_dirmngr_pgm
1538 if test x"$use_regex" != xyes ; then
1540 Warning: No regular expression support available.
1541 OpenPGP trust signatures won't work.
1542 gpg-check-pattern will not be build.