1 dnl Configure.ac script for GnuPG
2 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
4 dnl This file is part of GnuPG.
6 dnl GnuPG is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 2 of the License, or
9 dnl (at your option) any later version.
11 dnl GnuPG is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 dnl GNU General Public License for more details.
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with this program; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 dnl (Process this file with autoconf to produce a configure script.)
21 dnlAC_REVISION($Revision$)dnl
25 # Please enter the version number here and set development_version to
26 # yes if the minor number is odd or you feel that the default check
27 # for a development version is not sufficient.
28 AC_INIT(gnupg, 1.1.91, bug-gnupg@gnu.org)
29 development_version=yes
31 ALL_LINGUAS="cs da de eo el es et fr gl id it ja nl pl pt_BR pt sv tr"
32 static_modules="sha1 md5 rmd160"
33 static_random_module=""
36 VERSION=$PACKAGE_VERSION
38 AC_CONFIG_AUX_DIR(scripts)
39 AC_CONFIG_SRCDIR(g10/g10.c)
41 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
42 AM_CONFIG_HEADER(config.h)
46 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
47 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
48 AC_DEFINE(_GNU_SOURCE,1,[Some tests rely on this (stpcpy) and it should be used for new programs anyway])
52 MODULES_IN_CIPHER=`$AWK '/^EXTRA_PROGRAMS/ { for(i=3;i<=NF;i++) print $i}' \
53 $srcdir/cipher/Makefile.am`
56 dnl Check for random module options
58 dnl Fixme: get the list of available modules from MODULES_IN_CIPHER
59 dnl and check against this list
61 AC_MSG_CHECKING([which static random module to use])
62 AC_ARG_ENABLE(static-rnd,
63 [ --enable-static-rnd=[egd|unix|linux|none] ],
64 [use_static_rnd=$enableval], [use_static_rnd=default] )
66 if test "$use_static_rnd" = no; then
67 use_static_rnd=default
70 case "$use_static_rnd" in
71 egd | linux | unix | none | default )
72 AC_MSG_RESULT($use_static_rnd)
75 AC_MSG_RESULT(invalid argument)
76 AC_MSG_ERROR(there is no random module rnd$use_static_rnd)
80 AC_ARG_WITH(egd-socket,
81 [ --with-egd-socket=NAME Use NAME for the EGD socket)],
82 egd_socket_name="$withval", egd_socket_name="" )
83 AC_DEFINE_UNQUOTED(EGD_SOCKET_NAME, "$egd_socket_name",
84 [Define if you don't want the default EGD socket name.
85 For details see cipher/rndegd.c])
89 dnl See whether the user wants to disable checking for /dev/random
91 AC_MSG_CHECKING([whether use of /dev/random is requested])
92 AC_ARG_ENABLE(dev-random,
93 [ --disable-dev-random disable the use of dev random],
94 try_dev_random=$enableval, try_dev_random=yes)
95 AC_MSG_RESULT($try_dev_random)
99 dnl Check other options
102 AC_MSG_CHECKING([whether use of extensions is requested])
103 AC_ARG_ENABLE(dynload,
104 [ --disable-dynload disable use of extensions],
105 try_dynload=$enableval, try_dynload=yes)
106 AC_MSG_RESULT($try_dynload)
108 AC_MSG_CHECKING([whether assembler modules are requested])
110 [ --disable-asm do not use assembler modules],
111 try_asm_modules=$enableval, try_asm_modules=yes)
112 AC_MSG_RESULT($try_asm_modules)
114 AC_MSG_CHECKING([whether memory guard is requested])
115 AC_ARG_ENABLE(m-guard,
116 [ --enable-m-guard enable memory guard facility],
117 use_m_guard=$enableval, use_m_guard=no)
118 AC_MSG_RESULT($use_m_guard)
119 if test "$use_m_guard" = yes ; then
120 AC_DEFINE(M_GUARD,1,[Define to use the (obsolete) malloc guarding feature])
123 AC_MSG_CHECKING([whether to enable external program execution])
125 [ --disable-exec disable all external program execution],
126 use_exec=$enableval, use_exec=yes)
127 AC_MSG_RESULT($use_exec)
128 if test "$use_exec" = no ; then
129 AC_DEFINE(NO_EXEC,1,[Define to disable all external program execution])
132 if test "$use_exec" = yes ; then
133 AC_MSG_CHECKING([whether to use a restricted exec-path])
134 AC_ARG_ENABLE(exec-path,
135 [ --enable-exec-path=PATH restrict exec-path to PATH],
136 [if test "$enableval" = yes ; then
139 AC_DEFINE_UNQUOTED(USE_EXEC_PATH,"$enableval",
140 [if set, restrict exec-path to this value])
142 AC_MSG_RESULT($enableval)
144 AC_MSG_CHECKING([whether to enable photo ID viewing])
145 AC_ARG_ENABLE(photo-viewers,
146 [ --disable-photo-viewers disable photo ID viewers],
147 [if test "$enableval" = no ; then
148 AC_DEFINE(DISABLE_PHOTO_VIEWER,1,[define to disable photo viewing])
150 gnupg_cv_enable_photo_viewers=$enableval
151 AC_MSG_RESULT($enableval)
153 if test "$gnupg_cv_enable_photo_viewers" = yes ; then
154 AC_MSG_CHECKING([whether to use a fixed photo ID viewer])
155 AC_ARG_WITH(photo-viewer,
156 [ --with-photo-viewer=FIXED_VIEWER set a fixed photo ID viewer],
157 [if test "$withval" != yes ; then
158 AC_DEFINE_UNQUOTED(FIXED_PHOTO_VIEWER,"$withval",
159 [if set, restrict photo-viewer to this])
161 AC_MSG_RESULT($withval)
164 AC_MSG_CHECKING([whether to enable external keyserver helpers])
165 AC_ARG_ENABLE(keyserver-helpers,
166 [ --disable-keyserver-helpers disable all external keyserver support],
167 [if test "$enableval" = no ; then
168 AC_DEFINE(DISABLE_KEYSERVER_HELPERS,1,
169 [define to disable keyserver helpers])
171 gnupg_cv_enable_keyserver_helpers=$enableval
172 AC_MSG_RESULT($enableval)
174 if test "$gnupg_cv_enable_keyserver_helpers" = yes ; then
175 AC_MSG_CHECKING([whether LDAP keyserver support is requested])
177 [ --disable-ldap disable LDAP keyserver interface],
178 try_ldap=$enableval, try_ldap=yes)
179 AC_MSG_RESULT($try_ldap)
181 AC_MSG_CHECKING([whether experimental external hkp keyserver support is requested])
182 AC_ARG_ENABLE(external-hkp,
183 [ --enable-external-hkp enable experimental external HKP keyserver interface],
184 try_hkp=$enableval, try_hkp=no)
185 AC_MSG_RESULT($try_hkp)
187 if test "$try_hkp" = yes ; then
188 GPGKEYS_HKP="gpgkeys_hkp"
189 AC_DEFINE(USE_EXTERNAL_HKP,1,[define to use the experimental external HKP keyserver interface])
192 AC_MSG_CHECKING([whether email keyserver support is requested])
193 AC_ARG_ENABLE(mailto,
194 [ --disable-mailto disable email keyserver interface],
195 try_mailto=$enableval, try_mailto=yes)
196 AC_MSG_RESULT($try_mailto)
200 AC_MSG_CHECKING([whether included zlib is requested])
201 AC_ARG_WITH(included-zlib,
202 [ --with-included-zlib use the zlib code included here],
203 [g10_force_zlib=yes], [g10_force_zlib=no] )
204 AC_MSG_RESULT($g10_force_zlib)
208 dnl Check whether we want to use Linux capabilities
210 AC_MSG_CHECKING([whether use of capabilities is requested])
211 AC_ARG_WITH(capabilities,
212 [ --with-capabilities use linux capabilities [default=no]],
213 [use_capabilities="$withval"],[use_capabilities=no])
214 AC_MSG_RESULT($use_capabilities)
218 #if !(defined(HAVE_FORK) && defined(HAVE_PIPE) && defined(HAVE_WAITPID))
219 #define EXEC_TEMPFILE_ONLY
228 dnl Checks for programs.
231 dnl Setup some stuff depending on host/target.
235 disallowed_modules="rndunix rndlinux rndegd"
238 disallowed_modules="rndunix rndlinux rndegd tiger"
241 disallowed_modules="rndw32"
247 missing_dir=`cd $ac_aux_dir && pwd`
248 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
249 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
250 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
251 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
252 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
255 AC_PATH_PROG(PERL,"perl")
260 AC_CHECK_PROG(DOCBOOK_TO_MAN, docbook-to-man, yes, no)
261 AM_CONDITIONAL(HAVE_DOCBOOK_TO_MAN, test "$ac_cv_prog_DOCBOOK_TO_MAN" = yes)
263 GNUPG_CHECK_DOCBOOK_TO_TEXI
270 *-*-mingw32*|*-*-cygwin*)
271 # special stuff for Windoze NT
272 ac_cv_have_dev_random=no
273 AC_DEFINE(USE_ONLY_8DOT3,1,
274 [set this to limit filenames to the 8.3 format])
275 AC_DEFINE(HAVE_DRIVE_LETTERS,1,
276 [defined if we must run on a stupid file system])
277 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
278 [defined if we run on some of the PCDOS like systems
279 (DOS, Windoze. OS/2) with special properties like
281 AC_DEFINE(USE_SIMPLE_GETTEXT,1,
282 [because the Unix gettext has too much overhead on
283 MingW32 systems and these systems lack Posix functions,
284 we use a simplified version of gettext])
287 i?86-emx-os2 | i?86-*-os2*emx )
288 # OS/2 with the EMX environment
289 ac_cv_have_dev_random=no
290 AC_DEFINE(HAVE_DRIVE_LETTERS)
291 AC_DEFINE(HAVE_DOSISH_SYSTEM)
296 # DOS with the DJGPP environment
297 ac_cv_have_dev_random=no
298 AC_DEFINE(HAVE_DRIVE_LETTERS)
299 AC_DEFINE(HAVE_DOSISH_SYSTEM)
305 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
306 LDFLAGS="$LDFLAGS -L/usr/local/lib"
310 if test -z "$GCC" ; then
311 CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
315 if test -z "$GCC" ; then
316 # Suppress all warnings
317 # to get rid of the unsigned/signed char mismatch warnings.
322 if test -z "$GCC" ; then
323 # Use the newer compiler `-msg_disable ptrmismatch' to
324 # get rid of the unsigned/signed char mismatch warnings.
325 # Using this may hide other pointer mismatch warnings, but
326 # it at least lets other warning classes through
327 CFLAGS="$CFLAGS -msg_disable ptrmismatch"
336 AC_SUBST(MPI_OPT_FLAGS)
337 GNUPG_SYS_SYMBOL_UNDERSCORE
339 GNUPG_CHECK_EXPORTDYNAMIC
340 if test "$NO_PIC" = yes; then
344 dnl Must check for network library requirements before doing link tests
345 dnl for ldap, for example. If ldap libs are static (or dynamic and without
346 dnl ELF runtime link paths), then link will fail and LDAP support won't
349 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
350 [NETLIBS="-lnsl $NETLIBS"]))
351 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
352 [NETLIBS="-lsocket $NETLIBS"]))
354 # Try and link a LDAP test program to weed out unusable LDAP
355 # libraries. -lldap -llber -lresolv is for OpenLDAP. -lldapssl41 is
358 if test "$try_ldap" = yes ; then
359 for LDAPLIBS in "-lldap -llber -lresolv" "-lldapssl41"; do
360 _ldap_save_libs=$LIBS
361 LIBS="$LDAPLIBS $NETLIBS $LIBS"
363 AC_MSG_CHECKING([whether LDAP via \"$LDAPLIBS\" is present and sane])
364 AC_TRY_LINK([#include <ldap.h>],[ldap_open("foobar",1234);],
365 [gnupg_cv_func_ldap_init=yes],[gnupg_cv_func_ldap_init=no])
366 AC_MSG_RESULT([$gnupg_cv_func_ldap_init])
368 if test $gnupg_cv_func_ldap_init = no; then
369 AC_MSG_CHECKING([whether I can make LDAP be sane with lber.h])
370 AC_TRY_LINK([#include <lber.h>
371 #include <ldap.h>],[ldap_open("foobar",1234);],
372 [gnupg_cv_func_ldaplber_init=yes],[gnupg_cv_func_ldaplber_init=no])
373 AC_MSG_RESULT([$gnupg_cv_func_ldaplber_init])
376 if test "$gnupg_cv_func_ldaplber_init" = yes ; then
377 AC_DEFINE(NEED_LBER_H,1,[Define if the LDAP library requires including lber.h before ldap.h])
380 if test "$gnupg_cv_func_ldap_init" = yes || \
381 test "$gnupg_cv_func_ldaplber_init" = yes ; then
382 GPGKEYS_LDAP="gpgkeys_ldap"
385 LIBS=$_ldap_save_libs
387 if test "$GPGKEYS_LDAP" != "" ; then break; fi
391 AC_SUBST(GPGKEYS_LDAP)
394 if test "$try_mailto" = yes ; then
395 AC_PATH_PROG(SENDMAIL,sendmail,,$PATH:/usr/sbin:/usr/libexec:/usr/lib)
397 if test "$ac_cv_path_SENDMAIL" ; then
398 GPGKEYS_MAILTO="gpgkeys_mailto"
401 AC_SUBST(GPGKEYS_MAILTO)
403 AC_SUBST(GPGKEYS_HKP)
407 PRINTABLE_OS_NAME="MingW32"
410 PRINTABLE_OS_NAME="Cygwin32"
412 i?86-emx-os2 | i?86-*-os2*emx )
413 PRINTABLE_OS_NAME="OS/2"
416 PRINTABLE_OS_NAME="MSDOS/DJGPP"
420 PRINTABLE_OS_NAME="GNU/Linux"
422 dnl let that after linux to avoid gnu-linux problems
424 PRINTABLE_OS_NAME="GNU/Hurd"
427 PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
430 AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
431 [A human readable text with the name of the OS])
435 # 1. Set flags to be used for the extension modules
436 # 2. Set names of random devices
438 NAME_OF_DEV_RANDOM="/dev/random"
439 NAME_OF_DEV_URANDOM="/dev/urandom"
441 *-openbsd* | *-netbsd*)
442 NAME_OF_DEV_RANDOM="/dev/srandom"
443 NAME_OF_DEV_URANDOM="/dev/urandom"
444 DYNLINK_MOD_CFLAGS="-shared -rdynamic $CFLAGS_PIC -Wl,-Bshareable -Wl,-x"
448 # if using the vendor (ANSI) compiler, arrange to have `-b' passed
449 # to the linker. If using gcc, it supports `-shared' to do the same.
450 if test -n "$GCC" ; then
451 DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
453 DYNLINK_MOD_CFLAGS='-Wl,-b'
458 # Irix 6.5 (and probably a lot earlier, but I only still have
459 # access to 6.5.x) doesn't require any additional flags, as `-KPIC'
460 # is the default. Also, `-shared' works with the vendor compiler
461 DYNLINK_MOD_CFLAGS="-shared"
465 # osf (i.e. OSF/1, Digital UNIX, or Tru64 UNIX, pick any one...)
466 # on alpha doesn't require any PIC flags, everything is PIC.
467 # This may not be the case for osf ports to other machines, so
468 # hence the more specific match for target.
470 # Also, `-shared' works with the vendor compiler or gcc.
471 # -expect_unresolved turns off warnings about unresolved symbols.
472 DYNLINK_MOD_CFLAGS='-shared -Wl,-expect_unresolved,\*'
476 # -shared is a gcc-ism. Find pic flags from GNUPG_CHECK_PIC.
477 if test -n "$GCC" ; then
478 DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
480 DYNLINK_MOD_CFLAGS="-G $CFLAGS_PIC"
484 *-irix* | *-dec-osf* )
485 DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
489 # -shared is a gcc-ism. Find pic flags from GNUPG_CHECK_PIC.
490 if test -n "$GCC" ; then
491 DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
493 DYNLINK_MOD_CFLAGS="$CFLAGS_PIC"
497 AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM",
498 [defined to the name of the strong random device])
499 AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM",
500 [defined to the name of the weaker random device])
501 AC_SUBST(MPI_OPT_FLAGS)
504 dnl Checks for libraries.
506 if test "$try_gettext" = yes; then
510 USE_INCLUDED_LIBINTL=no
511 BUILD_INCLUDED_LIBINTL=no
513 AC_SUBST(USE_INCLUDED_LIBINTL)
514 AC_SUBST(BUILD_INCLUDED_LIBINTL)
518 if test "$try_dynload" = yes ; then
519 AC_CHECK_LIB(dl,dlopen)
520 if test "$ac_cv_lib_dl_dlopen" = "yes"; then
521 AC_DEFINE(USE_DYNAMIC_LINKING,1,
522 [define to enable the use of extensions])
523 AC_DEFINE(HAVE_DL_DLOPEN,1,
524 [Defined when the dlopen function family is available])
525 DYNLINK_LDFLAGS="$CFLAGS_EXPORTDYNAMIC"
526 use_gnupg_extensions=yes
528 AC_CHECK_FUNCS(dlopen)
529 if test "$ac_cv_func_dlopen" = "yes"; then
530 AC_DEFINE(USE_DYNAMIC_LINKING)
531 AC_DEFINE(HAVE_DL_DLOPEN)
532 DYNLINK_LDFLAGS="$CFLAGS_EXPORTDYNAMIC"
533 use_gnupg_extensions=yes
535 AC_CHECK_LIB(dld,shl_load)
536 if test "$ac_cv_lib_dld_shl_load" = "yes"; then
537 AC_DEFINE(USE_DYNAMIC_LINKING)
538 AC_DEFINE(HAVE_DL_SHL_LOAD,1,
539 [Defined if the shl_load function family is available])
540 DYNLINK_LDFLAGS="$CFLAGS_EXPORTDYNAMIC"
541 use_gnupg_extensions=yes
542 dnl -----------------
543 dnl DLD is not ready for use. So I better disable this test
545 dnl AC_CHECK_LIB(dld,dld_link)
546 dnl if test "$ac_cv_lib_dld_dld_link" = "yes"; then
547 dnl AC_DEFINE(USE_DYNAMIC_LINKING)
548 dnl AC_DEFINE(HAVE_DLD_DLD_LINK)
549 dnl DYNLINK_LDFLAGS="$CFLAGS_EXPORTDYNAMIC"
550 dnl use_gnupg_extensions=yes
556 AC_MSG_CHECKING(for dynamic loading)
559 use_gnupg_extensions=no
560 AC_MSG_RESULT(has been disabled)
563 AM_CONDITIONAL(ENABLE_GNUPG_EXTENSIONS, test "$use_gnupg_extensions" = yes )
564 AC_SUBST(DYNLINK_LDFLAGS)
565 AC_SUBST(DYNLINK_MOD_CFLAGS)
568 dnl Checks for header files.
570 AC_CHECK_HEADERS(unistd.h langinfo.h termio.h locale.h)
572 dnl Checks for typedefs, structures, and compiler characteristics.
582 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
583 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
584 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
585 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
586 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
588 AC_CHECK_SIZEOF(unsigned short, 2)
589 AC_CHECK_SIZEOF(unsigned int, 4)
590 AC_CHECK_SIZEOF(unsigned long, 4)
591 AC_CHECK_SIZEOF(unsigned long long, 0)
593 if test "$ac_cv_sizeof_unsigned_short" = "0" \
594 || test "$ac_cv_sizeof_unsigned_int" = "0" \
595 || test "$ac_cv_sizeof_unsigned_long" = "0"; then
596 AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
599 dnl Checks for library functions.
603 AC_CHECK_FUNCS(strerror stpcpy strsep strlwr tcgetattr strtoul mmap)
604 AC_CHECK_FUNCS(strcasecmp strncasecmp)
605 AC_CHECK_FUNCS(memmove gettimeofday getrusage setrlimit clock_gettime)
606 AC_CHECK_FUNCS(atexit raise getpagesize strftime nl_langinfo setlocale)
607 AC_CHECK_FUNCS(waitpid wait4 sigaction sigprocmask rand pipe stat)
608 AC_REPLACE_FUNCS(mkdtemp)
611 # check for gethrtime and run a testprogram to see whether
612 # it is broken. It has been reported that some Solaris and HP UX systems
615 AC_CACHE_CHECK([for gethrtime],
616 [gnupg_cv_func_gethrtime],
617 [AC_TRY_LINK([#include <sys/times.h>],[
621 [gnupg_cv_func_gethrtime=yes],
622 [gnupg_cv_func_gethrtime=no])
624 if test $gnupg_cv_func_gethrtime = yes; then
625 AC_DEFINE([HAVE_GETHRTIME], 1,
626 [Define if you have the `gethrtime(2)' function.])
627 AC_CACHE_CHECK([whether gethrtime is broken],
628 [gnupg_cv_func_broken_gethrtime],
630 #include <sys/times.h>
636 [gnupg_cv_func_broken_gethrtime=no],
637 [gnupg_cv_func_broken_gethrtime=yes],
638 [gnupg_cv_func_broken_gethrtime=assume-no])
640 if test $gnupg_cv_func_broken_gethrtime = yes; then
641 AC_DEFINE([HAVE_BROKEN_GETHRTIME], 1,
642 [Define if `gethrtime(2)' does not work correctly i.e. issues a SIGILL.])
648 GNUPG_FUNC_MKDIR_TAKES_ONE_ARG
651 dnl Check whether we can use Linux capabilities as requested
653 if test "$use_capabilities" = "yes" ; then
655 AC_CHECK_HEADERS(sys/capability.h)
656 if test "$ac_cv_header_sys_capability_h" = "yes" ; then
657 AC_CHECK_LIB(cap, cap_init, ac_need_libcap=1)
658 if test "$ac_cv_lib_cap_cap_init" = "yes"; then
659 AC_DEFINE(USE_CAPABILITIES,1,
660 [define if capabilities should be used])
665 if test "$use_capabilities" = "no" ; then
668 *** The use of capabilities on this system is not possible.
669 *** You need a recent Linux kernel and some patches:
670 *** fcaps-2.2.9-990610.patch (kernel patch for 2.2.9)
671 *** fcap-module-990613.tar.gz (kernel module)
672 *** libcap-1.92.tar.gz (user mode library and utilities)
673 *** And you have to configure the kernel with CONFIG_VFS_CAP_PLUGIN
674 *** set (filesystems menu). Be warned: This code is *really* ALPHA.
681 if test "$ac_cv_header_sys_shm_h" = "yes"; then
682 AC_DEFINE(USE_SHM_COPROCESSING,1,
683 [define if the shared memory interface should be made available])
687 dnl check whether we have a random device
689 if test "$try_dev_random" = yes ; then
690 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
691 [if test -r "$NAME_OF_DEV_RANDOM" && test -r "$NAME_OF_DEV_URANDOM" ; then
692 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
693 if test "$ac_cv_have_dev_random" = yes; then
694 AC_DEFINE(HAVE_DEV_RANDOM,1,
695 [defined if the system supports a random device] )
698 AC_MSG_CHECKING(for random device)
699 ac_cv_have_dev_random=no
700 AC_MSG_RESULT(has been disabled)
705 dnl Figure out the default linkage mode for random modules
708 if test "$use_static_rnd" = default; then
709 if test "$ac_cv_have_dev_random" = yes; then
710 static_random_module="rndlinux"
713 *-*-mingw32*|*-*-cygwin*)
714 static_random_module="rndw32"
715 AC_DEFINE(USE_STATIC_RNDW32,1,
716 [At some point in the code we need to know that
717 we use the Windows random module.])
719 i?86-emx-os2|i?86-*-os2*emx)
720 static_random_module="rndos2"
723 static_random_module="rndatari"
729 static_random_module="rndunix"
735 if test "$use_static_rnd" = none; then
738 static_random_module="rnd$use_static_rnd"
739 if test "$use_static_rnd" = "unix"; then
746 if test "$print_egd_notice" = "yes"; then
749 *** The performance of the UNIX random gatherer module is not very good
750 *** and it does not keep the entropy pool over multiple invocations of
751 *** GnuPG. The suggested way to overcome this problem is to use the
753 *** Entropy Gathering Daemon (EGD)
755 *** which provides a entropy source for the whole system. It is written
756 *** in Perl and available at the GnuPG FTP servers. For more information
757 *** consult the GnuPG webpages:
759 *** http://www.gnupg.org/download.html#egd
761 *** You may want to run ./configure with --enable-static-rnd=none to be
762 *** able to load the EGD client code dynamically; this way you can choose
763 *** between RNDUNIX and RNDEGD without recompilation.
768 dnl Parse the modules list and build the list
769 dnl of static and dynamically linked modules
771 dnl (We always need a static rmd160)
772 static_modules="$static_modules rmd160 $static_random_module"
773 STATIC_CIPHER_NAMES=""
774 STATIC_CIPHER_OBJS=""
775 DYNAMIC_CIPHER_MODS=""
777 for name in $MODULES_IN_CIPHER; do
779 for i in $disallowed_modules; do
780 if test "$name" = "$i" ; then x="no" ; fi
782 if test $x = yes; then
784 for i in $static_modules; do
785 if test "$name" = "$i" ; then
789 if test $x = yes; then
790 STATIC_CIPHER_NAMES="$STATIC_CIPHER_NAMES $name"
791 STATIC_CIPHER_OBJS="$STATIC_CIPHER_OBJS $name.o"
793 DYNAMIC_CIPHER_MODS="$DYNAMIC_CIPHER_MODS $name"
794 show_dynlink="$show_dynlink $name"
798 AC_SUBST(STATIC_CIPHER_OBJS)
799 AC_SUBST(STATIC_CIPHER_NAMES)
800 AC_SUBST(DYNAMIC_CIPHER_MODS)
803 dnl And build the constructor file
806 test -d cipher || mkdir cipher
807 cat <<G10EOF >cipher/construct.c
808 /* automatically generated by configure - do not edit */
812 for name in $STATIC_CIPHER_NAMES; do
813 echo "void ${name}_constructor(void);" >>cipher/construct.c
814 show_statlink="$show_statlink $name"
817 cat <<G10EOF >>cipher/construct.c
820 cipher_modules_constructor(void)
828 for name in $STATIC_CIPHER_NAMES; do
829 echo " ${name}_constructor();" >>cipher/construct.c
831 echo '}' >>cipher/construct.c
837 dnl Figure how to link the cipher modules
839 AC_SUBST(STATIC_CIPHER_OBJS)
840 AC_SUBST(DYNAMIC_CIPHER_MODS)
843 dnl setup assembler stuff
844 AC_MSG_CHECKING(for mpi assembler functions)
845 if test -f $srcdir/mpi/config.links ; then
846 . $srcdir/mpi/config.links
847 AC_CONFIG_LINKS("$mpi_ln_list")
848 ac_cv_mpi_extra_asm_modules="$mpi_extra_modules"
849 ac_cv_mpi_sflags="$mpi_sflags"
850 ac_cv_mpi_config_done="yes"
853 AC_MSG_RESULT(failed)
854 AC_MSG_ERROR([mpi/config.links missing!])
856 MPI_EXTRA_ASM_OBJS=""
858 if test "$ac_cv_mpi_extra_asm_modules" != ""; then
859 for i in $ac_cv_mpi_extra_asm_modules; do
860 show_extraasm="$show_extraasm $i"
861 MPI_EXTRA_ASM_OBJS="$MPI_EXTRA_ASM_OBJS $i.o"
864 AC_SUBST(MPI_EXTRA_ASM_OBJS)
865 MPI_SFLAGS="$ac_cv_mpi_sflags"
868 dnl Do we have zlib? Must do it here because Solaris failed
869 dnl when compiling a conftest (due to the "-lz" from LIBS).
871 if test "$g10_force_zlib" = "yes"; then
874 _cppflags="${CPPFLAGS}"
875 _ldflags="${LDFLAGS}"
878 [ --with-zlib=DIR use libz in DIR],[
879 if test -d "$withval"; then
880 CPPFLAGS="${CPPFLAGS} -I$withval/include"
881 LDFLAGS="${LDFLAGS} -L$withval/lib"
885 AC_CHECK_HEADER(zlib.h,
886 AC_CHECK_LIB(z, deflateInit2_,
889 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
890 CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
893 if test "$use_local_zlib" = yes ; then
894 AM_CONDITIONAL(ENABLE_LOCAL_ZLIB, true)
895 AC_CONFIG_LINKS(zlib.h:zlib/zlib.h zconf.h:zlib/zconf.h )
896 ZLIBS="../zlib/libzlib.a"
898 AM_CONDITIONAL(ENABLE_LOCAL_ZLIB, false)
904 # Allow users to append something to the version string without
905 # flagging it as development version. The user version parts is
906 # considered everything after a dash.
907 if test "$development_version" != yes; then
911 if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
912 development_version=yes
915 if test "$development_version" = yes; then
916 AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
917 [Defined if this is not a regular release])
920 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
924 # add some extra libs here so that previous tests don't fail for
925 # mysterious reasons - the final link step should bail out.
928 LIBS="$LIBS -lwsock32"
935 if test "$GCC" = yes; then
936 if test "$USE_MAINTAINER_MODE" = "yes"; then
937 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
939 CFLAGS="$CFLAGS -Wall"
945 # Note the \\\\ for backslashes. Autoconf eats one layer, leaving \\
947 AC_CONFIG_COMMANDS(g10defs.h,[[
948 cat >g10defs.tmp <<G10EOF
949 /* Generated automatically by configure */
950 #ifdef HAVE_DRIVE_LETTERS
951 #define G10_LOCALEDIR "c:/lib/gnupg/locale"
952 #define GNUPG_LIBDIR "c:/lib/gnupg"
953 #define GNUPG_DATADIR "c:/lib/gnupg"
954 #define GNUPG_HOMEDIR "c:/gnupg"
956 #define G10_LOCALEDIR "${datadir}/locale"
957 #define GNUPG_LIBDIR "${libdir}/gnupg"
958 #define GNUPG_DATADIR "${datadir}/gnupg"
960 #define GNUPG_HOMEDIR "/SYS\$LOGIN/gnupg"
962 #define GNUPG_HOMEDIR "~/.gnupg"
965 /* those are here to be redefined by handcrafted g10defs.h.
966 Please note that the string version must not contain more
967 than one character because the using code assumes strlen()==1 */
968 #ifdef HAVE_DOSISH_SYSTEM
969 #define DIRSEP_C '\\\\'
971 #define DIRSEP_S "\\\\"
980 cat mpi/mpi-asm-defs.h >>g10defs.tmp
981 if cmp -s g10defs.h g10defs.tmp 2>/dev/null; then
982 echo "g10defs.h is unchanged"
986 mv g10defs.tmp g10defs.h
987 echo "g10defs.h created"
991 exec_prefix=$exec_prefix
994 DATADIRNAME=$DATADIRNAME
1007 keyserver/gpgkeys_mailto
1008 keyserver/gpgkeys_test
1016 # Give some feedback
1018 echo " Configured for: $PRINTABLE_OS_NAME ($target)"
1019 if test -n "$show_dynlink"; then
1020 echo " Dynamically linked modules:$show_dynlink"
1022 if test -n "$show_statlink"; then
1023 echo " Statically linked modules:$show_statlink"
1025 if test -n "$show_extraasm"; then
1026 echo " Extra cpu specific functions:$show_extraasm"