1 # Configure.ac script for Libgcrypt
2 # Copyright (C) 1998, 1999, 2000, 2001,
3 # 2002, 2003 Free Software Foundation, Inc.
5 # This file is part of Libgcrypt.
7 # Libgcrypt is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser general Public License as
9 # published by the Free Software Foundation; either version 2.1 of
10 # the License, or (at your option) any later version.
12 # Libgcrypt is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 # (Process this file with autoconf to produce a configure script.)
22 AC_REVISION($Revision$)
25 # Version number: Remember to change it immediately *after* a release
26 # but remove a "-cvs" prefix right *before* a release and append it
29 AC_INIT(libgcrypt, 1.1.13-cvs, bug-libgcrypt@gnupg.org)
31 # LT Version numbers, remember to change them just *before* a release.
32 # (Interfaces removed: CURRENT++, AGE=0, REVISION=0)
33 # (Interfaces added: CURRENT++, AGE++, REVISION=0)
34 # (No interfaces changed: REVISION++)
35 LIBGCRYPT_LT_CURRENT=6
37 LIBGCRYPT_LT_REVISION=1
40 VERSION=$PACKAGE_VERSION
42 AC_CONFIG_SRCDIR([src/gcrypt.h])
43 AC_CONFIG_AUX_DIR(scripts)
45 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
46 AM_CONFIG_HEADER(config.h)
50 /* need this, because some autoconf tests rely on this (e.g. stpcpy)
51 * and it should be used for new programs */
56 #include "gcrypt-defs.h"
57 #define _GCRYPT_IN_LIBGCRYPT 1
60 AH_VERBATIM([_REENTRANT],
61 [/* To allow the use of Libgcrypt in multithreaded programs we have to use
62 special features from the library. */
68 AC_SUBST(LIBGCRYPT_LT_CURRENT)
69 AC_SUBST(LIBGCRYPT_LT_AGE)
70 AC_SUBST(LIBGCRYPT_LT_REVISION)
73 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
74 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
76 ##########################
77 ## General definitions. ##
78 ##########################
80 # Used by libgcrypt-config
81 LIBGCRYPT_CONFIG_LIBS="-lgcrypt"
82 LIBGCRYPT_CONFIG_CFLAGS=""
84 # Definitions for symmetric ciphers.
85 available_ciphers="arcfour blowfish cast5 des aes twofish"
88 # Definitions for public-key ciphers.
89 available_pubkey_ciphers="dsa elgamal rsa"
90 enabled_pubkey_ciphers=""
92 # Definitions for message digests.
93 available_digests="crc md4 md5 rmd160 sha1 sha256"
94 available_digests_64="sha512 tiger"
97 # Definitions for random modules.
98 available_random_modules="linux egd unix"
99 auto_random_modules="$available_random_modules"
104 # Setup some stuff depending on host/target.
107 available_random_modules="w32"
108 ac_cv_have_dev_random=no
109 AC_DEFINE(USE_ONLY_8DOT3,1,
110 [set this to limit filenames to the 8.3 format])
111 AC_DEFINE(HAVE_DRIVE_LETTERS,1,
112 [defined if we must run on a stupid file system])
113 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
114 [defined if we run on some of the PCDOS like systems
115 (DOS, Windoze. OS/2) with special properties like
119 i?86-emx-os2 | i?86-*-os2*emx)
120 # OS/2 with the EMX environment
121 ac_cv_have_dev_random=no
122 AC_DEFINE(HAVE_DRIVE_LETTERS)
123 AC_DEFINE(HAVE_DOSISH_SYSTEM)
127 # DOS with the DJGPP environment
128 ac_cv_have_dev_random=no
129 AC_DEFINE(HAVE_DRIVE_LETTERS)
130 AC_DEFINE(HAVE_DOSISH_SYSTEM)
135 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
136 LDFLAGS="$LDFLAGS -L/usr/local/lib"
140 if test -z "$GCC" ; then
141 CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
145 if test -z "$GCC" ; then
146 # Suppress all warnings
147 # to get rid of the unsigned/signed char mismatch warnings.
157 # For now we hardcode the use of version scripts. It would be better
158 # to write a text for this or even implement this within libtool
159 have_ld_version_script=no
162 PRINTABLE_OS_NAME="MingW32"
165 i?86-emx-os2 | i?86-*-os2*emx )
166 PRINTABLE_OS_NAME="OS/2"
170 PRINTABLE_OS_NAME="MSDOS/DJGPP"
174 PRINTABLE_OS_NAME="GNU/Linux"
175 have_ld_version_script=yes
178 # let that after linux to avoid gnu-linux problems
180 PRINTABLE_OS_NAME="GNU/Hurd"
181 have_ld_version_script=yes
185 PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
190 *-openbsd* | *-netbsd*)
191 # FIXME: Are these the best flags for OpenBSD?
192 NAME_OF_DEV_RANDOM="/dev/srandom"
193 NAME_OF_DEV_URANDOM="/dev/urandom"
194 # DYNLINK_MOD_CFLAGS="-shared -rdynamic $CFLAGS_PIC -Wl,-Bshareable -Wl,-x"
197 *-solaris* | *-irix* | *-dec-osf* )
198 NAME_OF_DEV_RANDOM="/dev/random"
199 NAME_OF_DEV_URANDOM="/dev/random"
200 # DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
204 NAME_OF_DEV_RANDOM="/dev/random"
205 NAME_OF_DEV_URANDOM="/dev/urandom"
206 # -shared is a gcc-ism. Find pic flags from GNUPG_CHECK_PIC.
207 # if test -n "$GCC" ; then
208 # DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
210 # DYNLINK_MOD_CFLAGS="$CFLAGS_PIC"
215 AC_CHECK_SIZEOF(unsigned short, 2)
216 AC_CHECK_SIZEOF(unsigned int, 4)
217 AC_CHECK_SIZEOF(unsigned long, 4)
218 AC_CHECK_SIZEOF(unsigned long long, 0)
220 if test "$ac_cv_sizeof_unsigned_short" = "0" \
221 || test "$ac_cv_sizeof_unsigned_int" = "0" \
222 || test "$ac_cv_sizeof_unsigned_long" = "0"; then
223 AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
226 # Do we have any 64-bit data types?
227 if test "$ac_cv_sizeof_unsigned_int" != "8" \
228 && test "$ac_cv_sizeof_unsigned_long" != "8" \
229 && test "$ac_cv_sizeof_unsigned_long_long" != "8" \
230 && test "$ac_cv_sizeof_uint64_t" != "8"; then
231 AC_MSG_WARN([No 64-bit types. Disabling TIGER/192, SHA-384, and SHA-512])
233 available_digests="$available_digests $available_digests_64"
236 # If not specified otherwise, all available algorithms will be
238 default_ciphers="$available_ciphers"
239 default_pubkey_ciphers="$available_pubkey_ciphers"
240 default_digests="$available_digests"
242 ############################
243 ## Command line switches. ##
244 ############################
246 # Implementation of the --enable-ciphers switch.
247 AC_ARG_ENABLE(ciphers,
248 AC_HELP_STRING([--enable-ciphers=ciphers],
249 [select the symmetric ciphers to include]),
250 [enabled_ciphers=$(echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]')],
251 [enabled_ciphers=""])
252 if test "x$enabled_ciphers" = "x" \
253 -o "$enabled_ciphers" = "yes" \
254 -o "$enabled_ciphers" = "no"; then
255 enabled_ciphers=$default_ciphers
257 AC_MSG_CHECKING([which symmetric ciphers to include])
258 for cipher in $enabled_ciphers; do
259 LIST_MEMBER($cipher, $available_ciphers)
260 if test "$found" = "0"; then
261 AC_MSG_ERROR([unsupported cipher specified])
264 AC_MSG_RESULT([$enabled_ciphers])
266 # Implementation of the --enable-pubkey-ciphers switch.
267 AC_ARG_ENABLE(pubkey-ciphers,
268 AC_HELP_STRING([--enable-pubkey-ciphers=ciphers],
269 [select the public-key ciphers to include]),
270 [enabled_pubkey_ciphers=$(echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]')],
271 [enabled_pubkey_ciphers=""])
272 if test "x$enabled_pubkey_ciphers" = "x" \
273 -o "$enabled_pubkey_ciphers" = "yes" \
274 -o "$enabled_pubkey_ciphers" = "no"; then
275 enabled_pubkey_ciphers=$default_pubkey_ciphers
277 AC_MSG_CHECKING([which public-key ciphers to include])
278 for cipher in $enabled_pubkey_ciphers; do
279 LIST_MEMBER($cipher, $available_pubkey_ciphers)
280 if test "$found" = "0"; then
281 AC_MSG_ERROR([unsupported public-key cipher specified])
284 AC_MSG_RESULT([$enabled_pubkey_ciphers])
286 # Implementation of the --enable-digests switch.
287 AC_ARG_ENABLE(digests,
288 AC_HELP_STRING([--enable-digests=digests],
289 [select the message digests to include]),
290 [enabled_digests=$(echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]')],
291 [enabled_digests=""])
292 if test "x$enabled_digests" = "x" \
293 -o "$enabled_digests" = "yes" \
294 -o "$enabled_digests" = "no"; then
295 enabled_digests=$default_digests
297 AC_MSG_CHECKING([which message digests to include])
298 for digest in $enabled_digests; do
299 LIST_MEMBER($digest, $available_digests)
300 if test "$found" = "0"; then
301 AC_MSG_ERROR([unsupported message digest specified])
304 AC_MSG_RESULT([$enabled_digests])
306 # Implementation of the --enable-random switch.
307 AC_ARG_ENABLE(random,
308 AC_HELP_STRING([--enable-random=name],
309 [select which random number generator to use]),
310 [random=$(echo $enableval | tr '[A-Z]' '[a-z]')],
312 if test "x$random" = "x" -o "$random" = "yes" -o "$random" = "no"; then
315 AC_MSG_CHECKING([which random module to use])
316 if test "$random" != "default" -a "$random" != "auto"; then
317 LIST_MEMBER($random, $available_random_modules)
318 if test "$found" = "0"; then
319 AC_MSG_ERROR([unsupported random module specified])
322 AC_MSG_RESULT($random)
324 # Implementation of the --disable-dev-random switch.
325 AC_MSG_CHECKING([whether use of /dev/random is requested])
326 AC_ARG_ENABLE(dev-random,
327 [ --disable-dev-random disable the use of dev random],
328 try_dev_random=$enableval, try_dev_random=yes)
329 AC_MSG_RESULT($try_dev_random)
331 # Implementation of the --with-egd-socket switch.
332 AC_ARG_WITH(egd-socket,
333 [ --with-egd-socket=NAME Use NAME for the EGD socket)],
334 egd_socket_name="$withval", egd_socket_name="" )
335 AC_DEFINE_UNQUOTED(EGD_SOCKET_NAME, "$egd_socket_name",
336 [Define if you don't want the default EGD socket name.
337 For details see cipher/rndegd.c])
339 # Implementation of the --enable-m-guard switch.
340 AC_MSG_CHECKING([whether memory guard is requested])
341 AC_ARG_ENABLE(m-guard,
342 [ --enable-m-guard enable memory guard facility],
343 use_m_guard=$enableval, use_m_guard=no)
344 AC_MSG_RESULT($use_m_guard)
345 if test "$use_m_guard" = yes ; then
346 AC_DEFINE(M_GUARD,1,[Define to use the (obsolete) malloc guarding feature])
349 # Implementation of the --with-capabilities switch.
350 # Check whether we want to use Linux capabilities
351 AC_MSG_CHECKING([whether use of capabilities is requested])
352 AC_ARG_WITH(capabilities,
353 [ --with-capabilities use linux capabilities [default=no]],
354 [use_capabilities="$withval"],[use_capabilities=no])
355 AC_MSG_RESULT($use_capabilities)
357 ##############################
358 #### Checks for programs. ####
359 ##############################
362 missing_dir=`cd $ac_aux_dir && pwd`
363 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
364 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
365 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
366 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
367 # AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
377 AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
378 [A human readable text with the name of the OS])
379 AC_ARG_ENABLE([ld-version-script],
380 AC_HELP_STRING([--enable-ld-version-script],
381 [enable/disable use of linker version script.
382 (default is system dependent)]),
383 [have_ld_version_script=$enableval],
385 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
387 AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM",
388 [defined to the name of the strong random device])
389 AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM",
390 [defined to the name of the weaker random device])
392 ###############################
393 #### Checks for libraries. ####
394 ###############################
396 AM_PATH_GPG_ERROR(0.1)
397 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GCRYPT,
398 [The default error source for libgcrypt.])
399 CFLAGS="$CFLAGS -I\$(top_srcdir)/../errcrypto/src"
400 LDFLAGS="$LDFLAGS -L\$(top_srcdir)/../errcrypto/src"
402 # Solaris needs -lsocket and -lnsl. Unisys system includes
403 # gethostbyname in libsocket but needs libnsl for socket.
404 AC_CHECK_LIB(nsl, gethostbyname)
405 AC_CHECK_LIB(socket, socket, ac_need_libsocket=1, ac_try_nsl=1)
406 if test x$ac_need_libsocket = x1; then
407 LIBS="$LIBS -lsocket"
409 if test x$ac_try_nsl = x1; then
410 AC_CHECK_LIB(nsl, gethostbyname, ac_need_libnsl=1)
411 if test x$ac_need_libnsl = x1
417 ##################################
418 #### Checks for header files. ####
419 ##################################
422 AC_CHECK_HEADERS(unistd.h sys/select.h)
424 ##########################################
425 #### Checks for typedefs, structures, ####
426 #### and compiler characteristics. ####
427 ##########################################
436 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
437 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
438 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
439 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
440 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
442 #######################################
443 #### Checks for library functions. ####
444 #######################################
447 # We have replacements for these in src/missing-string.c
448 AC_CHECK_FUNCS(stpcpy strcasecmp)
449 # We have replacements for these in src/g10lib.h
450 AC_CHECK_FUNCS(strtoul memmove stricmp atexit raise)
452 AC_CHECK_FUNCS(strerror rand mmap getpagesize waitpid wait4)
453 AC_CHECK_FUNCS(gettimeofday getrusage gethrtime clock_gettime)
457 # The ATH systems needs to know whether pth or pthreads are available.
460 AC_CHECK_LIB(pth,pth_version,have_pth=yes)
461 if test "$have_pth" = yes; then
462 AC_DEFINE(HAVE_PTH, ,[Define if we have Pth.])
464 AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
465 if test "$have_pthread" != yes; then
466 AC_CHECK_LIB(c,pthread_create,have_pthread=yes)
468 if test "$have_pthread" = yes; then
469 AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
471 AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
472 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
474 # Check whether we can use Linux capabilities as requested.
475 if test "$use_capabilities" = "yes" ; then
477 AC_CHECK_HEADERS(sys/capability.h)
478 if test "$ac_cv_header_sys_capability_h" = "yes" ; then
479 AC_CHECK_LIB(cap, cap_init, ac_need_libcap=1)
480 if test "$ac_cv_lib_cap_cap_init" = "yes"; then
481 AC_DEFINE(USE_CAPABILITIES,1,
482 [define if capabilities should be used])
487 if test "$use_capabilities" = "no" ; then
490 *** The use of capabilities on this system is not possible.
491 *** You need a recent Linux kernel and some patches:
492 *** fcaps-2.2.9-990610.patch (kernel patch for 2.2.9)
493 *** fcap-module-990613.tar.gz (kernel module)
494 *** libcap-1.92.tar.gz (user mode library and utilities)
495 *** And you have to configure the kernel with CONFIG_VFS_CAP_PLUGIN
496 *** set (filesystems menu). Be warned: This code is *really* ALPHA.
501 # Check whether a random device is available.
502 if test "$try_dev_random" = yes ; then
503 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
504 [if test -r "$NAME_OF_DEV_RANDOM" && test -r "$NAME_OF_DEV_URANDOM" ; then
505 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
506 if test "$ac_cv_have_dev_random" = yes; then
507 AC_DEFINE(HAVE_DEV_RANDOM,1,
508 [defined if the system supports a random device] )
511 AC_MSG_CHECKING(for random device)
512 ac_cv_have_dev_random=no
513 AC_MSG_RESULT(has been disabled)
516 # Figure out the random modules for this configuration.
517 if test "$random" = "default"; then
519 # Select default value.
520 if test "$ac_cv_have_dev_random" = yes; then
521 # Try Linuxish random device.
522 random_modules="linux"
525 *-*-mingw32*|*-*-cygwin*)
526 # Windows random device.
530 # Build everything, allow to select at runtime.
531 random_modules="$auto_random_modules"
536 if test "$random" = "auto"; then
537 # Build everything, allow to select at runtime.
538 random_modules="$auto_random_modules"
544 # Setup assembler stuff.
545 AC_MSG_CHECKING(for mpi assembler functions)
546 if test -f $srcdir/mpi/config.links ; then
547 . $srcdir/mpi/config.links
548 AC_CONFIG_LINKS("$mpi_ln_list")
549 ac_cv_mpi_mod_list="$mpi_mod_list"
550 ac_cv_mpi_sflags="$mpi_sflags"
551 ac_cv_mpi_config_done="yes"
554 AC_MSG_RESULT(failed)
555 AC_MSG_ERROR([mpi/config.links missing!])
559 if test "$ac_cv_mpi_mod_list" != ""; then
560 for i in $ac_cv_mpi_mod_list; do
561 MPI_MOD_LIST_LO="$MPI_MOD_LIST_LO $i.lo"
562 MPI_MOD_LIST_O="$MPI_MOD_LIST_O $i.o"
565 AC_SUBST(MPI_MOD_LIST_LO)
566 AC_SUBST(MPI_MOD_LIST_O)
567 MPI_SFLAGS="$ac_cv_mpi_sflags"
570 # Allow users to append something to the version string without
571 # flagging it as development version. The user version part is
572 # considered everything after a dash.
576 if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
577 AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
578 [Defined if this is not a regular release])
581 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
585 if test "$GCC" = yes; then
586 if test "$MAINTAINER_MODE" = "yes"; then
587 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
589 CFLAGS="$CFLAGS -Wall"
594 # Make the version number in src/gcrypt.h the same as the one here.
595 # (this is easier than to have a *.in file just for one substitution)
597 GNUPG_FIX_HDR_VERSION([src/gcrypt.h], GCRYPT_VERSION)
599 AC_SUBST(LIBGCRYPT_CONFIG_LIBS)
600 AC_SUBST(LIBGCRYPT_CONFIG_CFLAGS)
602 AC_CONFIG_COMMANDS([gcrypt-defs],[[
603 chmod +x src/libgcrypt-config
604 cat >gcrypt-defs.tmp <<G10EOF
605 /* Generated automatically by configure */
606 #ifdef HAVE_DRIVE_LETTERS
607 #define GNUPG_LOCALEDIR "c:/lib/gnupg/locale"
608 #define GNUPG_LIBDIR "c:/lib/gnupg"
609 #define GNUPG_DATADIR "c:/lib/gnupg"
610 #define GNUPG_HOMEDIR "c:/gnupg-test"
612 #define GNUPG_LOCALEDIR "${prefix}/${DATADIRNAME}/locale"
613 #define GNUPG_LIBDIR "${libdir}/gnupg"
614 #define GNUPG_DATADIR "${datadir}/gnupg"
616 #define GNUPG_HOMEDIR "/SYS\$LOGIN/gnupg"
618 #define GNUPG_HOMEDIR "~/.gnupg-test"
622 if cmp -s gcrypt-defs.h gcrypt-defs.tmp 2>/dev/null; then
623 echo "gcrypt-defs.h is unchanged"
624 rm -f gcrypt-defs.tmp
627 mv gcrypt-defs.tmp gcrypt-defs.h
628 echo "gcrypt-defs.h created"
632 exec_prefix=$exec_prefix
635 DATADIRNAME=$DATADIRNAME
638 #####################
639 #### Conclusion. ####
640 #####################
642 # Define conditional sources and config.h symbols depending on the
643 # selected ciphers, pubkey-ciphers, digests and random modules.
645 LIST_MEMBER(arcfour, $enabled_ciphers)
646 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS arcfour.lo"
647 AC_DEFINE_UNQUOTED(USE_ARCFOUR, $found, [Defined if this module should be included])
648 LIST_MEMBER(blowfish, $enabled_ciphers)
649 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS blowfish.lo"
650 AC_DEFINE_UNQUOTED(USE_BLOWFISH, $found, [Defined if this module should be included])
651 LIST_MEMBER(cast5, $enabled_ciphers)
652 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS cast5.lo"
653 AC_DEFINE_UNQUOTED(USE_CAST5, $found, [Defined if this module should be included])
654 LIST_MEMBER(des, $enabled_ciphers)
655 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS des.lo"
656 AC_DEFINE_UNQUOTED(USE_DES, $found, [Defined if this module should be included])
657 LIST_MEMBER(aes, $enabled_ciphers)
658 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS rijndael.lo"
659 AC_DEFINE_UNQUOTED(USE_AES, $found, [Defined if this module should be included])
660 LIST_MEMBER(twofish, $enabled_ciphers)
661 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS twofish.lo"
662 AC_DEFINE_UNQUOTED(USE_TWOFISH, $found, [Defined if this module should be included])
663 LIST_MEMBER(serpent, $enabled_ciphers)
664 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS serpent.lo"
665 AC_DEFINE_UNQUOTED(USE_SERPENT, $found, [Defined if this module should be included])
667 LIST_MEMBER(dsa, $enabled_pubkey_ciphers)
668 test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS dsa.lo"
669 AC_DEFINE_UNQUOTED(USE_DSA, $found, [Defined if this module should be included])
670 LIST_MEMBER(rsa, $enabled_pubkey_ciphers)
671 test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS rsa.lo"
672 AC_DEFINE_UNQUOTED(USE_RSA, $found, [Defined if this module should be included])
673 LIST_MEMBER(elgamal, $enabled_pubkey_ciphers)
674 test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS elgamal.lo"
675 AC_DEFINE_UNQUOTED(USE_ELGAMAL, $found, [Defined if this module should be included])
677 LIST_MEMBER(crc, $enabled_digests)
678 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS crc.lo"
679 AC_DEFINE_UNQUOTED(USE_CRC, $found, [Defined if this module should be included])
680 LIST_MEMBER(md4, $enabled_digests)
681 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md4.lo"
682 AC_DEFINE_UNQUOTED(USE_MD4, $found, [Defined if this module should be included])
683 LIST_MEMBER(md5, $enabled_digests)
684 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md5.lo"
685 AC_DEFINE_UNQUOTED(USE_MD5, $found, [Defined if this module should be included])
686 LIST_MEMBER(sha1, $enabled_digests)
687 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha1.lo"
688 AC_DEFINE_UNQUOTED(USE_SHA1, $found, [Defined if this module should be included])
689 LIST_MEMBER(sha256, $enabled_digests)
690 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha256.lo"
691 AC_DEFINE_UNQUOTED(USE_SHA256, $found, [Defined if this module should be included])
692 LIST_MEMBER(sha512, $enabled_digests)
693 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha512.lo"
694 AC_DEFINE_UNQUOTED(USE_SHA512, $found, [Defined if this module should be included])
695 LIST_MEMBER(tiger, $enabled_digests)
696 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS tiger.lo"
697 AC_DEFINE_UNQUOTED(USE_TIGER, $found, [Defined if this module should be included])
699 # rmd160 should be included always.
700 GCRYPT_DIGESTS="$GCRYPT_DIGESTS rmd160.lo"
701 AM_CONDITIONAL(USE_RMD160, true)
702 AC_DEFINE_UNQUOTED(USE_RMD160, 1, [Defined if this module should be included])
704 LIST_MEMBER(linux, $random_modules)
705 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndlinux.lo"
706 AC_DEFINE_UNQUOTED(USE_RNDLINUX, $found, [Defined if the /dev/random based RNG should be used.])
708 LIST_MEMBER(unix, $random_modules)
709 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndunix.lo"
710 AC_DEFINE_UNQUOTED(USE_RNDUNIX, $found, [Defined if the default Unix RNG should be used.])
711 if test "$found" = "1"; then
715 LIST_MEMBER(egd, $random_modules)
716 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndegd.lo"
717 AC_DEFINE_UNQUOTED(USE_RNDEGD, $found, [Defined if the EGD based RNG should be used.])
719 LIST_MEMBER(w32, $random_modules)
720 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndw32.lo"
721 AC_DEFINE_UNQUOTED(USE_RNDW32, $found, [Defined if the Windows specific RNG should be used.])
723 AC_SUBST([GCRYPT_CIPHERS])
724 AC_SUBST([GCRYPT_PUBKEY_CIPHERS])
725 AC_SUBST([GCRYPT_DIGESTS])
726 AC_SUBST([GCRYPT_RANDOM])
728 AC_SUBST(LIBGCRYPT_CIPHERS, $enabled_ciphers)
729 AC_SUBST(LIBGCRYPT_PUBKEY_CIPHERS, $enabled_pubkey_ciphers)
730 AC_SUBST(LIBGCRYPT_DIGESTS, $enabled_digests)
747 if test "$print_egd_notice" = "yes"; then
750 The performance of the Unix random gatherer module (rndunix) is not
751 very good and it does not keep the entropy pool over multiple
752 invocations of GnuPG. The suggested way to overcome this problem is
755 Entropy Gathering Daemon (EGD)
757 which provides a entropy source for the whole system. It is written
758 in Perl and available at the GnuPG FTP servers. To enable EGD you
759 should rerun configure with the option "--enable-static-rnd=egd".
760 For more information consult the GnuPG webpages:
762 http://www.gnupg.org/download.html#egd
768 for file in "random_modules"; do
769 case "$file" in rndunix | rndw32) warn="$warn $file";; esac
771 if test -n "$warn"; then
772 echo "Please note that you are building a version of Libgcrypt with"
774 echo "included. These parts are licensed under the GPL and thus the"
775 echo "use of this library has to comply with the conditions of the GPL."
779 echo " Configured for: $PRINTABLE_OS_NAME ($target)"