Preparing 1.4.0.
[libgcrypt.git] / configure.ac
1 # Configure.ac script for Libgcrypt
2 # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006,
3 #               2007 Free Software Foundation, Inc.
4 #
5 # This file is part of Libgcrypt.
6 #
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.
11 #
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.
16 #
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
20 #
21 # (Process this file with autoconf to produce a configure script.)
22 AC_REVISION($Revision$)
23 AC_PREREQ(2.60)
24 min_automake_version="1.10"
25
26
27 # Remember to change the version number immediately *after* a release.
28 # Set my_issvn to "yes" for non-released code.  Remember to run an
29 # "svn up" and "autogen.sh" right before creating a distribution.
30 m4_define([my_version], [1.4.0])
31 m4_define([my_issvn], [no])
32
33 m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
34             || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')]))
35 AC_INIT([libgcrypt], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]),
36         [bug-libgcrypt@gnupg.org])
37 # LT Version numbers, remember to change them just *before* a release.
38 #   (Interfaces removed:    CURRENT++, AGE=0, REVISION=0)
39 #   (Interfaces added:      CURRENT++, AGE++, REVISION=0)
40 #   (No interfaces changed:                   REVISION++)
41 LIBGCRYPT_LT_CURRENT=15
42 LIBGCRYPT_LT_AGE=4
43 LIBGCRYPT_LT_REVISION=3
44
45
46 # If the API is changed in an incompatible way: increment the next counter.
47 LIBGCRYPT_CONFIG_API_VERSION=1
48
49 NEED_GPG_ERROR_VERSION=1.0
50
51 BUILD_REVISION=svn_revision
52 PACKAGE=$PACKAGE_NAME
53 VERSION=$PACKAGE_VERSION
54
55 AC_CONFIG_SRCDIR([src/libgcrypt.vers])
56 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
57 AM_CONFIG_HEADER(config.h)
58 AC_CANONICAL_HOST
59 AM_MAINTAINER_MODE
60
61 AH_TOP([
62 #ifndef _GCRYPT_CONFIG_H_INCLUDED
63 #define _GCRYPT_CONFIG_H_INCLUDED
64 /* need this, because some autoconf tests rely on this (e.g. stpcpy)
65  * and it should be used for new programs  */
66 #define _GNU_SOURCE  1
67 ])
68
69 AH_BOTTOM([
70 #define _GCRYPT_IN_LIBGCRYPT 1
71
72 /* If the configure check for endianness has been disabled, get it from
73    OS macros.  This is intended for making fat binary builds on OS X.  */
74 #ifdef DISABLED_ENDIAN_CHECK
75 # if defined(__BIG_ENDIAN__)
76 #  define WORDS_BIGENDIAN 1
77 # elif defined(__LITTLE_ENDIAN__)
78 #  undef WORDS_BIGENDIAN
79 # else
80 #  error "No endianness found"
81 # endif
82 #endif /*DISABLED_ENDIAN_CHECK*/
83
84 #endif /*_GCRYPT_CONFIG_H_INCLUDED*/
85 ])
86
87 AH_VERBATIM([_REENTRANT],
88 [/* To allow the use of Libgcrypt in multithreaded programs we have to use
89     special features from the library. */
90 #ifndef _REENTRANT
91 # define _REENTRANT 1
92 #endif
93 ])
94
95
96 AC_SUBST(LIBGCRYPT_LT_CURRENT)
97 AC_SUBST(LIBGCRYPT_LT_AGE)
98 AC_SUBST(LIBGCRYPT_LT_REVISION)
99 AC_SUBST(PACKAGE)
100 AC_SUBST(VERSION)
101 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
102 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
103
104
105 ######################
106 ##  Basic checks.  ### (we need some results later on (e.g. $GCC)
107 ######################
108
109 AC_PROG_MAKE_SET
110 missing_dir=`cd $ac_aux_dir && pwd`
111 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
112 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
113 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
114 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
115 # AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
116 AC_PROG_CC
117 AC_PROG_CPP
118 AM_PROG_CC_C_O
119 AM_PROG_AS
120 AC_ISC_POSIX
121 AC_PROG_INSTALL
122 AC_PROG_AWK
123
124 AC_LIBTOOL_WIN32_DLL
125 AC_LIBTOOL_RC
126 AM_PROG_LIBTOOL
127
128
129 ##########################
130 ## General definitions. ##
131 ##########################
132
133 # Used by libgcrypt-config
134 LIBGCRYPT_CONFIG_LIBS="-lgcrypt"
135 LIBGCRYPT_CONFIG_CFLAGS=""
136
137 # Definitions for symmetric ciphers.
138 available_ciphers="arcfour blowfish cast5 des aes twofish serpent rfc2268 seed"
139 available_ciphers="$available_ciphers camellia"
140 enabled_ciphers=""
141
142 # Definitions for public-key ciphers.
143 available_pubkey_ciphers="dsa elgamal rsa ecc"
144 enabled_pubkey_ciphers=""
145
146 # Definitions for message digests.
147 available_digests="crc md4 md5 rmd160 sha1 sha256"
148 available_digests_64="sha512 tiger whirlpool"
149 enabled_digests=""
150
151 # Definitions for random modules.
152 available_random_modules="linux egd unix"
153 auto_random_modules="$available_random_modules"
154
155 # Supported thread backends.
156 LIBGCRYPT_THREAD_MODULES=""
157
158 # Other definitions.
159 print_egd_notice=no
160 have_w32_system=no
161
162 # Setup some stuff depending on host.
163 case "${host}" in
164     *-*-mingw32*)
165       available_random_modules="w32"
166       ac_cv_have_dev_random=no
167       have_w32_system=yes
168       AC_DEFINE(USE_ONLY_8DOT3,1,
169                 [set this to limit filenames to the 8.3 format])
170       AC_DEFINE(HAVE_DRIVE_LETTERS,1,
171                 [defined if we must run on a stupid file system])
172       AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
173                 [defined if we run on some of the PCDOS like systems 
174                  (DOS, Windoze. OS/2) with special properties like
175                   no file modes])
176       ;;
177
178     i?86-emx-os2 | i?86-*-os2*emx)
179         # OS/2 with the EMX environment
180         ac_cv_have_dev_random=no
181         AC_DEFINE(HAVE_DRIVE_LETTERS)
182         AC_DEFINE(HAVE_DOSISH_SYSTEM)
183         ;;
184
185     i?86-*-msdosdjgpp*)
186         # DOS with the DJGPP environment
187         ac_cv_have_dev_random=no
188         AC_DEFINE(HAVE_DRIVE_LETTERS)
189         AC_DEFINE(HAVE_DOSISH_SYSTEM)
190         ;;
191
192     *-*-freebsd*)
193        # FreeBSD
194        CPPFLAGS="$CPPFLAGS -I/usr/local/include"
195        LDFLAGS="$LDFLAGS -L/usr/local/lib"
196        ;;
197
198     *-*-hpux*)
199         if test -z "$GCC" ; then
200             CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
201         fi
202         ;;
203     *-dec-osf4*)
204         if test -z "$GCC" ; then
205             # Suppress all warnings
206             # to get rid of the unsigned/signed char mismatch warnings.
207             CFLAGS="$CFLAGS -w"
208         fi
209         ;;
210     m68k-atari-mint)
211         ;;
212     *)
213       ;;
214 esac
215
216 if test "$have_w32_system" = yes; then
217    AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
218 fi
219 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
220
221
222
223 # A printable OS Name is sometimes useful.
224 case "${host}" in
225     *-*-mingw32*)
226         PRINTABLE_OS_NAME="MingW32"
227         ;;
228
229     i?86-emx-os2 | i?86-*-os2*emx )
230         PRINTABLE_OS_NAME="OS/2"
231         ;;
232
233     i?86-*-msdosdjgpp*)
234         PRINTABLE_OS_NAME="MSDOS/DJGPP"
235         ;;
236
237     *-linux*)
238         PRINTABLE_OS_NAME="GNU/Linux"
239         ;;
240
241     *)
242         PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
243         ;;
244 esac
245
246 # Figure out the name of the random device
247 case "${host}" in
248     *-openbsd*)
249         # FIXME: Are these the best flags for OpenBSD?
250         NAME_OF_DEV_RANDOM="/dev/srandom"
251         NAME_OF_DEV_URANDOM="/dev/urandom"
252 #       DYNLINK_MOD_CFLAGS="-shared -rdynamic $CFLAGS_PIC -Wl,-Bshareable -Wl,-x"
253         ;;
254
255     *-solaris* | *-irix* | *-dec-osf* | *-netbsd* )
256         NAME_OF_DEV_RANDOM="/dev/random"
257         NAME_OF_DEV_URANDOM="/dev/random"
258 #       DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
259         ;;
260
261     *)
262         NAME_OF_DEV_RANDOM="/dev/random"
263         NAME_OF_DEV_URANDOM="/dev/urandom"
264         # -shared is a gcc-ism.  Find pic flags from GNUPG_CHECK_PIC.
265 #        if test -n "$GCC" ; then
266 #           DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"                            
267 #        else
268 #           DYNLINK_MOD_CFLAGS="$CFLAGS_PIC"
269 #        fi
270         ;;
271 esac
272
273
274 AC_ARG_ENABLE(endian-check,
275               AC_HELP_STRING([--disable-endian-check],
276               [disable the endian check and trust the OS provided macros]),
277               endiancheck=$enableval,endiancheck=yes)
278 if test x"$endiancheck" = xyes ; then
279   AC_C_BIGENDIAN
280 else
281   AC_DEFINE(DISABLED_ENDIAN_CHECK,1,[configure did not test for endianess])
282 fi
283
284 AC_CHECK_SIZEOF(unsigned short, 2)
285 AC_CHECK_SIZEOF(unsigned int, 4)
286 AC_CHECK_SIZEOF(unsigned long, 4)
287 AC_CHECK_SIZEOF(unsigned long long, 0)
288
289 if test "$ac_cv_sizeof_unsigned_short" = "0" \
290    || test "$ac_cv_sizeof_unsigned_int" = "0" \
291    || test "$ac_cv_sizeof_unsigned_long" = "0"; then
292     AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
293 fi
294
295 # Do we have any 64-bit data types?
296 if test "$ac_cv_sizeof_unsigned_int" != "8" \
297    && test "$ac_cv_sizeof_unsigned_long" != "8" \
298    && test "$ac_cv_sizeof_unsigned_long_long" != "8" \
299    && test "$ac_cv_sizeof_uint64_t" != "8"; then
300     AC_MSG_WARN([No 64-bit types.  Disabling TIGER/192, SHA-384, and SHA-512])
301 else
302   available_digests="$available_digests $available_digests_64"
303 fi
304
305 # If not specified otherwise, all available algorithms will be
306 # included.  
307 default_ciphers="$available_ciphers"
308 default_pubkey_ciphers="$available_pubkey_ciphers"
309 default_digests="$available_digests"
310
311 ############################
312 ## Command line switches. ##
313 ############################
314
315 # Implementation of the --enable-ciphers switch.
316 AC_ARG_ENABLE(ciphers,
317               AC_HELP_STRING([--enable-ciphers=ciphers],
318                              [select the symmetric ciphers to include]),
319               [enabled_ciphers=`echo $enableval | tr ',:' '  ' | tr '[A-Z]' '[a-z]'`],
320               [enabled_ciphers=""])
321 if test "x$enabled_ciphers" = "x" \
322    -o "$enabled_ciphers" = "yes"  \
323    -o "$enabled_ciphers" = "no"; then
324    enabled_ciphers=$default_ciphers
325 fi
326 AC_MSG_CHECKING([which symmetric ciphers to include])
327 for cipher in $enabled_ciphers; do
328     LIST_MEMBER($cipher, $available_ciphers)
329     if test "$found" = "0"; then
330        AC_MSG_ERROR([unsupported cipher "$cipher" specified])
331     fi
332 done
333 AC_MSG_RESULT([$enabled_ciphers])
334
335 # Implementation of the --enable-pubkey-ciphers switch.
336 AC_ARG_ENABLE(pubkey-ciphers,
337               AC_HELP_STRING([--enable-pubkey-ciphers=ciphers],
338                              [select the public-key ciphers to include]),
339               [enabled_pubkey_ciphers=`echo $enableval | tr ',:' '  ' | tr '[A-Z]' '[a-z]'`],
340               [enabled_pubkey_ciphers=""])
341 if test "x$enabled_pubkey_ciphers" = "x" \
342    -o "$enabled_pubkey_ciphers" = "yes"  \
343    -o "$enabled_pubkey_ciphers" = "no"; then
344    enabled_pubkey_ciphers=$default_pubkey_ciphers
345 fi
346 AC_MSG_CHECKING([which public-key ciphers to include])
347 for cipher in $enabled_pubkey_ciphers; do
348     LIST_MEMBER($cipher, $available_pubkey_ciphers)
349     if test "$found" = "0"; then
350        AC_MSG_ERROR([unsupported public-key cipher specified])
351     fi
352 done
353 AC_MSG_RESULT([$enabled_pubkey_ciphers])
354
355 # Implementation of the --enable-digests switch.
356 AC_ARG_ENABLE(digests,
357               AC_HELP_STRING([--enable-digests=digests],
358                              [select the message digests to include]),
359               [enabled_digests=`echo $enableval | tr ',:' '  ' | tr '[A-Z]' '[a-z]'`],
360               [enabled_digests=""])
361 if test "x$enabled_digests" = "x" \
362    -o "$enabled_digests" = "yes"  \
363    -o "$enabled_digests" = "no"; then
364    enabled_digests=$default_digests
365 fi
366 AC_MSG_CHECKING([which message digests to include])
367 for digest in $enabled_digests; do
368     LIST_MEMBER($digest, $available_digests)
369     if test "$found" = "0"; then
370        AC_MSG_ERROR([unsupported message digest specified])
371     fi
372 done
373 AC_MSG_RESULT([$enabled_digests])
374
375 # Implementation of the --enable-random switch.
376 AC_ARG_ENABLE(random,
377               AC_HELP_STRING([--enable-random=name],
378                              [select which random number generator to use]),
379               [random=`echo $enableval | tr '[A-Z]' '[a-z]'`],
380               [])
381 if test "x$random" = "x" -o "$random" = "yes" -o "$random" = "no"; then
382     random=default
383 fi
384 AC_MSG_CHECKING([which random module to use])
385 if test "$random" != "default" -a "$random" != "auto"; then
386     LIST_MEMBER($random, $available_random_modules)
387     if test "$found" = "0"; then
388        AC_MSG_ERROR([unsupported random module specified])
389     fi
390 fi
391 AC_MSG_RESULT($random)
392
393 # Implementation of the --disable-dev-random switch.
394 AC_MSG_CHECKING([whether use of /dev/random is requested])
395 AC_ARG_ENABLE(dev-random,
396 [  --disable-dev-random    disable the use of dev random],
397     try_dev_random=$enableval, try_dev_random=yes)
398 AC_MSG_RESULT($try_dev_random)
399
400 # Implementation of the --with-egd-socket switch.
401 AC_ARG_WITH(egd-socket,
402     [  --with-egd-socket=NAME  Use NAME for the EGD socket)],
403             egd_socket_name="$withval", egd_socket_name="" )
404 AC_DEFINE_UNQUOTED(EGD_SOCKET_NAME, "$egd_socket_name",
405                    [Define if you don't want the default EGD socket name.
406                     For details see cipher/rndegd.c])
407
408 # Implementation of the --enable-random-daemon
409 AC_MSG_CHECKING([whether the experimental random daemon is requested])
410 AC_ARG_ENABLE([random-daemon],
411               AC_HELP_STRING([--enable-random-daemon],
412                              [Build and support the experimental gcryptrnd]),
413               [use_random_daemon=$enableval],
414               [use_random_daemon=no])
415 AC_MSG_RESULT($use_random_daemon)
416 if test x$use_random_daemon = xyes ; then
417     AC_DEFINE(USE_RANDOM_DAEMON,1,
418               [Define to support the experimental random daemon])
419 fi
420 AM_CONDITIONAL(USE_RANDOM_DAEMON, test x$use_random_daemon = xyes)
421
422
423 # Implementation of --disable-asm.
424 AC_MSG_CHECKING([whether MPI assembler modules are requested])
425 AC_ARG_ENABLE([asm],
426               AC_HELP_STRING([--disable-asm],
427                              [Disable MPI assembler modules]),
428               [try_asm_modules=$enableval],
429               [try_asm_modules=yes])
430 AC_MSG_RESULT($try_asm_modules)
431
432 # Implementation of the --enable-m-guard switch.
433 AC_MSG_CHECKING([whether memory guard is requested])
434 AC_ARG_ENABLE(m-guard,
435               AC_HELP_STRING([--enable-m-guard],
436                              [Enable memory guard facility]),
437               [use_m_guard=$enableval], [use_m_guard=no])
438 AC_MSG_RESULT($use_m_guard)
439 if test "$use_m_guard" = yes ; then
440     AC_DEFINE(M_GUARD,1,[Define to use the (obsolete) malloc guarding feature])
441 fi
442
443 # Implementation of the --with-capabilities switch.
444 # Check whether we want to use Linux capabilities
445 AC_MSG_CHECKING([whether use of capabilities is requested])
446 AC_ARG_WITH(capabilities,
447             AC_HELP_STRING([--with-capabilities],
448                            [Use linux capabilities [default=no]]),
449             [use_capabilities="$withval"],[use_capabilities=no])
450 AC_MSG_RESULT($use_capabilities)
451
452
453 # Implementation of the --disable-padlock-support switch.
454 AC_MSG_CHECKING([whether padlock support is requested])
455 AC_ARG_ENABLE(padlock-support,
456               AC_HELP_STRING([--disable-padlock-support],
457                  [Disable support for the PadLock Engine of VIA processors]),
458               padlocksupport=$enableval,padlocksupport=yes)
459 AC_MSG_RESULT($padlocksupport)
460 if test x"$padlocksupport" = xyes ; then
461   AC_DEFINE(ENABLE_PADLOCK_SUPPORT, 1,
462             [Enable support for the PadLock engine.])
463 fi
464
465
466
467 AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
468                    [A human readable text with the name of the OS])
469
470 # For some systems we know that we have ld_version scripts.  
471 # Use it then as default.
472 have_ld_version_script=no
473 case "${host}" in
474     *-*-linux*)
475         have_ld_version_script=yes
476         ;;
477     *-*-gnu*)
478         have_ld_version_script=yes
479         ;;
480 esac
481 AC_ARG_ENABLE([ld-version-script],
482               AC_HELP_STRING([--enable-ld-version-script],
483                              [enable/disable use of linker version script.
484                               (default is system dependent)]),
485               [have_ld_version_script=$enableval],
486               [ : ] )
487 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
488
489 AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM",
490                    [defined to the name of the strong random device])
491 AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM",
492                    [defined to the name of the weaker random device])
493
494 ###############################
495 #### Checks for libraries. ####
496 ###############################
497
498 #
499 # gpg-error is required.
500 #
501 AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION")
502 if test "x$GPG_ERROR_LIBS" = "x"; then
503   AC_MSG_ERROR([libgpg-error is needed.
504                 See ftp://ftp.gnupg.org/gcrypt/libgpg-error/ .])
505 fi
506
507 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GCRYPT,
508           [The default error source for libgcrypt.])
509
510 #
511 # Check whether the GNU Pth library is available.  We require this 
512 # to build the optional gcryptrnd program.
513 #
514 AC_ARG_WITH(pth-prefix,
515             AC_HELP_STRING([--with-pth-prefix=PFX],
516                            [prefix where GNU Pth is installed (optional)]),
517      pth_config_prefix="$withval", pth_config_prefix="")
518 if test x$pth_config_prefix != x ; then
519    PTH_CONFIG="$pth_config_prefix/bin/pth-config"
520 fi
521 if test "$use_random_daemon" = "yes"; then
522   AC_PATH_PROG(PTH_CONFIG, pth-config, no)
523   if test "$PTH_CONFIG" = "no"; then
524     AC_MSG_WARN([[
525 ***
526 *** To build the Libgcrypt's random number daemon
527 *** we need the support of the GNU Portable Threads Library.
528 *** Download it from ftp://ftp.gnu.org/gnu/pth/
529 *** On a Debian GNU/Linux system you might want to try 
530 ***   apt-get install libpth-dev
531 ***]])
532   else
533     GNUPG_PTH_VERSION_CHECK([1.3.7])
534     if test $have_pth = yes; then      
535        PTH_CFLAGS=`$PTH_CONFIG --cflags`
536        PTH_LIBS=`$PTH_CONFIG --ldflags`
537        PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs --all`"
538        AC_DEFINE(USE_GNU_PTH, 1,
539                 [Defined if the GNU Portable Thread Library should be used])
540        AC_DEFINE(HAVE_PTH, 1,
541                 [Defined if the GNU Pth is available])
542     fi
543   fi
544 fi
545 AC_SUBST(PTH_CFLAGS)
546 AC_SUBST(PTH_LIBS)
547
548
549 # Solaris needs -lsocket and -lnsl. Unisys system includes
550 # gethostbyname in libsocket but needs libnsl for socket.
551 AC_SEARCH_LIBS(setsockopt, [socket], ,
552         [AC_SEARCH_LIBS(setsockopt, [socket], , , [-lnsl])])
553 AC_SEARCH_LIBS(setsockopt, [nsl])
554
555 ##################################
556 #### Checks for header files. ####
557 ##################################
558
559 AC_HEADER_STDC
560 AC_CHECK_HEADERS(unistd.h sys/select.h)
561
562 ##########################################
563 #### Checks for typedefs, structures, ####
564 ####  and compiler characteristics.   ####
565 ##########################################
566
567 AC_C_CONST
568 AC_C_INLINE
569 AC_TYPE_SIZE_T
570 AC_TYPE_SIGNAL
571 AC_DECL_SYS_SIGLIST
572
573 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
574 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
575 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
576 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
577 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
578
579 gl_TYPE_SOCKLEN_T
580 case "${host}" in
581   *-*-mingw32*)
582     # socklen_t may or may not be defined depending on what headers
583     # are included.  To be safe we use int as this is the actual type.
584     FALLBACK_SOCKLEN_T="typedef int gcry_socklen_t;"
585     ;;
586   *)
587     if test ".$gl_cv_socklen_t_equiv" = "."; then
588       FALLBACK_SOCKLEN_T="typedef socklen_t gcry_socklen_t;"
589     else
590       FALLBACK_SOCKLEN_T="typedef ${gl_cv_socklen_t_equiv} gcry_socklen_t;"
591     fi
592 esac
593 AC_SUBST(FALLBACK_SOCKLEN_T)
594             
595 #            
596 # Check for ELF visibility support.
597 #
598 AC_CACHE_CHECK(whether the visibility attribute is supported,
599        gcry_cv_visibility_attribute,
600        [gcry_cv_visibility_attribute=no
601         AC_LANG_CONFTEST([AC_LANG_SOURCE(
602           [[int foo __attribute__ ((visibility ("hidden"))) = 1;
603             int bar __attribute__ ((visibility ("protected"))) = 1;
604           ]])])
605         
606         if ${CC-cc} -Werror -S conftest.c -o conftest.s \
607                   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
608             if grep '\.hidden.*foo' conftest.s >/dev/null 2>&1 ; then
609                 if grep '\.protected.*bar' conftest.s >/dev/null 2>&1; then
610                     gcry_cv_visibility_attribute=yes
611                 fi
612             fi  
613         fi  
614        ])
615 if test "$gcry_cv_visibility_attribute" = "yes"; then
616     AC_CACHE_CHECK(for broken visibility attribute,
617        gcry_cv_broken_visibility_attribute,
618        [gcry_cv_broken_visibility_attribute=yes
619         AC_LANG_CONFTEST([AC_LANG_SOURCE(
620           [[int foo (int x);
621             int bar (int x) __asm__ ("foo")
622                             __attribute__ ((visibility ("hidden")));
623             int bar (int x) { return x; }
624           ]])])
625                   
626         if ${CC-cc} -Werror -S conftest.c -o conftest.s \
627                   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
628            if grep '\.hidden@<:@        _@:>@foo' conftest.s >/dev/null 2>&1;
629             then
630                gcry_cv_broken_visibility_attribute=no
631            fi
632         fi
633        ])
634 fi
635 if test "$gcry_cv_visibility_attribute" = "yes"; then
636     AC_CACHE_CHECK(for broken alias attribute,
637        gcry_cv_broken_alias_attribute,
638        [gcry_cv_broken_alias_attribute=yes
639         AC_LANG_CONFTEST([AC_LANG_SOURCE(
640           [[extern int foo (int x) __asm ("xyzzy");
641             int bar (int x) { return x; }
642             extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
643             extern int dfoo;
644             extern __typeof (dfoo) dfoo __asm ("abccb");
645             int dfoo = 1;
646           ]])])
647
648         if ${CC-cc} -Werror -S conftest.c -o conftest.s \
649                   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
650            if grep 'xyzzy' conftest.s >/dev/null 2>&1 && \
651               grep 'abccb' conftest.s >/dev/null 2>&1; then
652               gcry_cv_broken_alias_attribute=no
653            fi
654         fi
655         ])
656 fi
657 if test "$gcry_cv_visibility_attribute" = "yes"; then
658     AC_CACHE_CHECK(if gcc supports -fvisibility=hidden,
659        gcry_cv_gcc_has_f_visibility,
660        [gcry_cv_gcc_has_f_visibility=no
661         _gcc_cflags_save=$CFLAGS
662         CFLAGS="-fvisibility=hidden"
663         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
664                           gcry_cv_gcc_has_f_visibility=yes)
665         CFLAGS=$_gcc_cflags_save;
666        ])
667 fi
668 if test "$gcry_cv_visibility_attribute" = "yes" \
669    && test "$gcry_cv_broken_visibility_attribute" != "yes" \
670    && test "$gcry_cv_broken_alias_attribute" != "yes" \
671    && test "$gcry_cv_gcc_has_f_visibility" = "yes"  
672  then
673    AC_DEFINE(GCRY_USE_VISIBILITY, 1,
674                [Define to use the GNU C visibility attribute.])
675    CFLAGS="$CFLAGS -fvisibility=hidden"
676 fi
677
678
679 #######################################
680 #### Checks for library functions. ####
681 #######################################
682
683 AC_FUNC_VPRINTF
684 # We have replacements for these in src/missing-string.c
685 AC_CHECK_FUNCS(stpcpy strcasecmp)
686 # We have replacements for these in src/g10lib.h
687 AC_CHECK_FUNCS(strtoul memmove stricmp atexit raise)
688 # Other checks
689 AC_CHECK_FUNCS(strerror rand mmap getpagesize sysconf waitpid wait4)
690 AC_CHECK_FUNCS(gettimeofday getrusage gethrtime clock_gettime)
691 AC_CHECK_FUNCS(fcntl ftruncate)
692
693 GNUPG_CHECK_MLOCK
694
695 # Check whether we can use Linux capabilities as requested.
696 if test "$use_capabilities" = "yes" ; then
697 use_capabilities=no
698 AC_CHECK_HEADERS(sys/capability.h)
699 if test "$ac_cv_header_sys_capability_h" = "yes" ; then
700   AC_CHECK_LIB(cap, cap_init, ac_need_libcap=1)
701   if test "$ac_cv_lib_cap_cap_init" = "yes"; then
702      AC_DEFINE(USE_CAPABILITIES,1,
703                [define if capabilities should be used])
704      LIBS="$LIBS -lcap"
705      use_capabilities=yes
706   fi
707 fi
708 if test "$use_capabilities" = "no" ; then
709     AC_MSG_WARN([[
710 ***
711 *** The use of capabilities on this system is not possible.
712 *** You need a recent Linux kernel and some patches:
713 ***   fcaps-2.2.9-990610.patch      (kernel patch for 2.2.9)
714 ***   fcap-module-990613.tar.gz     (kernel module)
715 ***   libcap-1.92.tar.gz            (user mode library and utilities)
716 *** And you have to configure the kernel with CONFIG_VFS_CAP_PLUGIN
717 *** set (filesystems menu). Be warned: This code is *really* ALPHA.
718 ***]])
719 fi
720 fi
721
722 # Check whether a random device is available.
723 if test "$try_dev_random" = yes ; then
724     AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
725     [if test -r "$NAME_OF_DEV_RANDOM" && test -r "$NAME_OF_DEV_URANDOM" ; then
726       ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
727     if test "$ac_cv_have_dev_random" = yes; then
728         AC_DEFINE(HAVE_DEV_RANDOM,1,
729                  [defined if the system supports a random device] )
730     fi
731 else
732     AC_MSG_CHECKING(for random device)
733     ac_cv_have_dev_random=no
734     AC_MSG_RESULT(has been disabled)
735 fi
736
737 # Figure out the random modules for this configuration.
738 if test "$random" = "default"; then
739
740     # Select default value.
741     if test "$ac_cv_have_dev_random" = yes; then
742         # Try Linuxish random device.
743         random_modules="linux"
744     else
745         case "${host}" in
746         *-*-mingw32*|*-*-cygwin*)
747           # Windows random device.
748           random_modules="w32"
749           ;;
750         *)
751           # Build everything, allow to select at runtime.
752           random_modules="$auto_random_modules"
753           ;;
754         esac    
755     fi
756 else
757     if test "$random" = "auto"; then
758         # Build everything, allow to select at runtime.
759         random_modules="$auto_random_modules"
760     else
761         random_modules="$random"
762     fi
763 fi
764
765
766 #
767 # Setup assembler stuff.
768 #
769 GNUPG_SYS_SYMBOL_UNDERSCORE()
770 AC_ARG_ENABLE(mpi-path,
771               AC_HELP_STRING([--enable-mpi-path=EXTRA_PATH],
772               [prepend EXTRA_PATH to list of CPU specific optimizations]),
773               mpi_extra_path="$enableval",mpi_extra_path="")
774 AC_MSG_CHECKING(for mpi assembler functions)
775 if test -f $srcdir/mpi/config.links ; then
776     . $srcdir/mpi/config.links
777     AC_CONFIG_LINKS("$mpi_ln_list")
778     ac_cv_mpi_sflags="$mpi_sflags"
779     AC_MSG_RESULT(done)
780 else
781     AC_MSG_RESULT(failed)
782     AC_MSG_ERROR([mpi/config.links missing!])
783 fi
784 MPI_SFLAGS="$ac_cv_mpi_sflags"
785 AC_SUBST(MPI_SFLAGS)
786
787 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_ADD1, test "$mpi_mod_asm_mpih_add1" = yes)
788 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_SUB1, test "$mpi_mod_asm_mpih_sub1" = yes)
789 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_MUL1, test "$mpi_mod_asm_mpih_mul1" = yes)
790 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_MUL2, test "$mpi_mod_asm_mpih_mul2" = yes)
791 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_MUL3, test "$mpi_mod_asm_mpih_mul3" = yes)
792 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_LSHIFT, test "$mpi_mod_asm_mpih_lshift" = yes)
793 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_RSHIFT, test "$mpi_mod_asm_mpih_rshift" = yes)
794 AM_CONDITIONAL(MPI_MOD_ASM_UDIV, test "$mpi_mod_asm_udiv" = yes)
795 AM_CONDITIONAL(MPI_MOD_ASM_UDIV_QRNND, test "$mpi_mod_asm_udiv_qrnnd" = yes)
796 AM_CONDITIONAL(MPI_MOD_C_MPIH_ADD1, test "$mpi_mod_c_mpih_add1" = yes)
797 AM_CONDITIONAL(MPI_MOD_C_MPIH_SUB1, test "$mpi_mod_c_mpih_sub1" = yes)
798 AM_CONDITIONAL(MPI_MOD_C_MPIH_MUL1, test "$mpi_mod_c_mpih_mul1" = yes)
799 AM_CONDITIONAL(MPI_MOD_C_MPIH_MUL2, test "$mpi_mod_c_mpih_mul2" = yes)
800 AM_CONDITIONAL(MPI_MOD_C_MPIH_MUL3, test "$mpi_mod_c_mpih_mul3" = yes)
801 AM_CONDITIONAL(MPI_MOD_C_MPIH_LSHIFT, test "$mpi_mod_c_mpih_lshift" = yes)
802 AM_CONDITIONAL(MPI_MOD_C_MPIH_RSHIFT, test "$mpi_mod_c_mpih_rshift" = yes)
803 AM_CONDITIONAL(MPI_MOD_C_UDIV, test "$mpi_mod_c_udiv" = yes)
804 AM_CONDITIONAL(MPI_MOD_C_UDIV_QRNND, test "$mpi_mod_c_udiv_qrnnd" = yes)
805
806 # Allow users to append something to the version string without
807 # flagging it as development version.  The user version part is
808 # considered everything after a dash.
809 changequote(,)#
810 tmp_pat='[a-zA-Z]'
811 changequote([,])#
812 if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
813     AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
814               [Defined if this is not a regular release])
815 fi
816
817 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
818
819
820 # This is handy for debugging so the compiler doesn't rearrange
821 # things and eliminate variables.
822 AC_ARG_ENABLE(optimization,
823        AC_HELP_STRING([--disable-optimization],
824                       [disable compiler optimization]),
825                       [if test $enableval = no ; then
826                          CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
827                        fi])
828
829 AC_ARG_ENABLE(gcc-warnings,
830               AC_HELP_STRING([--enable-gcc-warnings],
831                              [enable more verbose gcc warnings]),
832               [more_gcc_warnings="$enableval"],
833               [more_gcc_warnings="no"])
834
835 if test "$GCC" = yes; then
836     if test "$USE_MAINTAINER_MODE" = "yes" ||
837        test "$more_gcc_warnings" = "yes"; then
838         CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
839         if test "$more_gcc_warnings" = "yes"; then
840             CFLAGS="$CFLAGS -W -Wextra -Wbad-function-cast"
841             CFLAGS="$CFLAGS -Wwrite-strings"
842             CFLAGS="$CFLAGS -Wdeclaration-after-statement"
843             CFLAGS="$CFLAGS -Wno-missing-field-initializers"
844             CFLAGS="$CFLAGS -Wno-sign-compare"
845             # Note: We don't use -Wunreachable-code because this gives
846             # warnings for all asserts and many inline functions like
847             # gpg_error (gcc 4.1.2 20060928).
848         fi
849     else
850         CFLAGS="$CFLAGS -Wall"
851     fi
852
853     AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
854     _gcc_cflags_save=$CFLAGS
855     CFLAGS="-Wpointer-arith"
856     AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
857     AC_MSG_RESULT($_gcc_wopt)
858     CFLAGS=$_gcc_cflags_save;
859     if test x"$_gcc_wopt" = xyes ; then
860        CFLAGS="$CFLAGS -Wpointer-arith"
861     fi
862 fi
863
864 # Check whether as(1) supports a noeexecstack feature.  This test
865 # includes an override option.
866 CL_AS_NOEXECSTACK
867
868
869 AC_SUBST(LIBGCRYPT_CONFIG_API_VERSION)
870 AC_SUBST(LIBGCRYPT_CONFIG_LIBS)
871 AC_SUBST(LIBGCRYPT_CONFIG_CFLAGS)
872 AC_SUBST(LIBGCRYPT_THREAD_MODULES)
873
874 AC_CONFIG_COMMANDS([gcrypt-conf],[[
875 chmod +x src/libgcrypt-config
876 ]],[[
877 prefix=$prefix
878 exec_prefix=$exec_prefix
879 libdir=$libdir
880 datadir=$datadir
881 DATADIRNAME=$DATADIRNAME
882 ]])
883
884 #####################
885 #### Conclusion. ####
886 #####################
887
888 # Define conditional sources and config.h symbols depending on the
889 # selected ciphers, pubkey-ciphers, digests and random modules.
890
891 LIST_MEMBER(arcfour, $enabled_ciphers)
892 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS arcfour.lo"
893 AC_DEFINE_UNQUOTED(USE_ARCFOUR, $found,
894                                  [Defined if this module should be included])
895
896 LIST_MEMBER(blowfish, $enabled_ciphers)
897 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS blowfish.lo"
898 AC_DEFINE_UNQUOTED(USE_BLOWFISH, $found,
899                                   [Defined if this module should be included])
900
901 LIST_MEMBER(cast5, $enabled_ciphers)
902 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS cast5.lo"
903 AC_DEFINE_UNQUOTED(USE_CAST5, $found,
904                                [Defined if this module should be included])
905
906 LIST_MEMBER(des, $enabled_ciphers)
907 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS des.lo"
908 AC_DEFINE_UNQUOTED(USE_DES, $found,
909                              [Defined if this module should be included])
910
911 LIST_MEMBER(aes, $enabled_ciphers)
912 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS rijndael.lo"
913 AC_DEFINE_UNQUOTED(USE_AES, $found,
914                              [Defined if this module should be included])
915
916 LIST_MEMBER(twofish, $enabled_ciphers)
917 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS twofish.lo"
918 AC_DEFINE_UNQUOTED(USE_TWOFISH, $found,
919                                  [Defined if this module should be included])
920
921 LIST_MEMBER(serpent, $enabled_ciphers)
922 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS serpent.lo"
923 AC_DEFINE_UNQUOTED(USE_SERPENT, $found,
924                                  [Defined if this module should be included])
925
926 LIST_MEMBER(rfc2268, $enabled_ciphers)
927 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS rfc2268.lo"
928 AC_DEFINE_UNQUOTED(USE_RFC2268, $found,
929                                  [Defined if this module should be included])
930
931 LIST_MEMBER(seed, $enabled_ciphers)
932 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS seed.lo"
933 AC_DEFINE_UNQUOTED(USE_SEED, $found,
934                              [Defined if this module should be included])
935
936 LIST_MEMBER(camellia, $enabled_ciphers)
937 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS camellia.lo camellia-glue.lo"
938 AC_DEFINE_UNQUOTED(USE_CAMELLIA, $found,
939                              [Defined if this module should be included])
940
941 LIST_MEMBER(dsa, $enabled_pubkey_ciphers)
942 test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS dsa.lo"
943 AC_DEFINE_UNQUOTED(USE_DSA, $found,
944                              [Defined if this module should be included])
945
946 LIST_MEMBER(rsa, $enabled_pubkey_ciphers)
947 test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS rsa.lo"
948 AC_DEFINE_UNQUOTED(USE_RSA, $found,
949                             [Defined if this module should be included])
950
951 LIST_MEMBER(elgamal, $enabled_pubkey_ciphers)
952 test "$found" = "1" \ 
953      && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS elgamal.lo"
954 AC_DEFINE_UNQUOTED(USE_ELGAMAL, $found,
955                                 [Defined if this module should be included])
956
957 LIST_MEMBER(ecc, $enabled_pubkey_ciphers)
958 test "$found" = "1" \ 
959      && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS ecc.lo"
960 AC_DEFINE_UNQUOTED(USE_ECC, $found,
961                                 [Defined if this module should be included])
962
963 LIST_MEMBER(crc, $enabled_digests)
964 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS crc.lo"
965 AC_DEFINE_UNQUOTED(USE_CRC, $found,
966                             [Defined if this module should be included])
967
968 LIST_MEMBER(md4, $enabled_digests)
969 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md4.lo"
970 AC_DEFINE_UNQUOTED(USE_MD4, $found,
971                              [Defined if this module should be included])
972
973 LIST_MEMBER(md5, $enabled_digests)
974 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md5.lo"
975 AC_DEFINE_UNQUOTED(USE_MD5, $found,
976                              [Defined if this module should be included])
977
978 LIST_MEMBER(sha256, $enabled_digests)
979 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha256.lo"
980 AC_DEFINE_UNQUOTED(USE_SHA256, $found,
981                                 [Defined if this module should be included])
982
983 LIST_MEMBER(sha512, $enabled_digests)
984 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha512.lo"
985 AC_DEFINE_UNQUOTED(USE_SHA512, $found,
986                                 [Defined if this module should be included])
987
988 LIST_MEMBER(tiger, $enabled_digests)
989 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS tiger.lo"
990 AC_DEFINE_UNQUOTED(USE_TIGER, $found,
991                                [Defined if this module should be included])
992
993 LIST_MEMBER(whirlpool, $enabled_digests)
994 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS whirlpool.lo"
995 AC_DEFINE_UNQUOTED(USE_WHIRLPOOL, $found,
996                                [Defined if this module should be included])
997
998 # rmd160 and sha1 should be included always.
999 GCRYPT_DIGESTS="$GCRYPT_DIGESTS rmd160.lo sha1.lo"
1000 AC_DEFINE_UNQUOTED(USE_RMD160, 1, [Defined if this module should be included])
1001 AC_DEFINE_UNQUOTED(USE_SHA1, 1,   [Defined if this module should be included])
1002
1003 LIST_MEMBER(linux, $random_modules)
1004 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndlinux.lo"
1005 AC_DEFINE_UNQUOTED(USE_RNDLINUX, $found,
1006                    [Defined if the /dev/random based RNG should be used.])
1007
1008
1009 LIST_MEMBER(unix, $random_modules)
1010 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndunix.lo"
1011 AC_DEFINE_UNQUOTED(USE_RNDUNIX, $found,
1012                   [Defined if the default Unix RNG should be used.])
1013 if test "$found" = "1"; then
1014    print_egd_notice=yes
1015 fi
1016
1017 LIST_MEMBER(egd, $random_modules)
1018 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndegd.lo"
1019 AC_DEFINE_UNQUOTED(USE_RNDEGD, $found,
1020                   [Defined if the EGD based RNG should be used.])
1021
1022 LIST_MEMBER(w32, $random_modules)
1023 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndw32.lo"
1024 AC_DEFINE_UNQUOTED(USE_RNDW32, $found,
1025                   [Defined if the Windows specific RNG should be used.])
1026
1027 AC_SUBST([GCRYPT_CIPHERS])
1028 AC_SUBST([GCRYPT_PUBKEY_CIPHERS])
1029 AC_SUBST([GCRYPT_DIGESTS])
1030 AC_SUBST([GCRYPT_RANDOM])
1031
1032 AC_SUBST(LIBGCRYPT_CIPHERS, $enabled_ciphers)
1033 AC_SUBST(LIBGCRYPT_PUBKEY_CIPHERS, $enabled_pubkey_ciphers)
1034 AC_SUBST(LIBGCRYPT_DIGESTS, $enabled_digests)
1035
1036 # For printing the configuration we need a colon separated list of
1037 # algorithm names.
1038 tmp=`echo "$enabled_ciphers" | tr ' ' : `
1039 AC_DEFINE_UNQUOTED(LIBGCRYPT_CIPHERS, "$tmp", 
1040                    [List of available cipher algorithms])
1041 tmp=`echo "$enabled_pubkey_ciphers" | tr ' ' : `
1042 AC_DEFINE_UNQUOTED(LIBGCRYPT_PUBKEY_CIPHERS, "$tmp", 
1043                    [List of available public key cipher algorithms])
1044 tmp=`echo "$enabled_digests" | tr ' ' : `
1045 AC_DEFINE_UNQUOTED(LIBGCRYPT_DIGESTS, "$tmp", 
1046                    [List of available digest algorithms])
1047
1048
1049
1050 # Generate extended version information for W32.
1051 if test "$have_w32_system" = yes; then
1052    BUILD_TIMESTAMP=`date --iso-8601=minutes`
1053    changequote(,)dnl 
1054    BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
1055    changequote([,])dnl
1056    BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION}"
1057 fi
1058 AC_SUBST(BUILD_REVISION)
1059 AC_SUBST(BUILD_TIMESTAMP)
1060 AC_SUBST(BUILD_FILEVERSION)
1061 AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION", 
1062                    [Subversion revision used to build this package])
1063
1064
1065
1066 # And create the files.
1067 AC_CONFIG_FILES([
1068 Makefile
1069 m4/Makefile
1070 mpi/Makefile
1071 cipher/Makefile
1072 doc/Makefile
1073 src/Makefile
1074 src/gcrypt.h
1075 src/libgcrypt-config
1076 src/versioninfo.rc
1077 tests/Makefile
1078 ])
1079 AC_OUTPUT
1080
1081 # Give some feedback
1082 echo
1083
1084 if test "$print_egd_notice" = "yes"; then
1085 cat <<G10EOF
1086   
1087    The performance of the Unix random gatherer module (rndunix) is not
1088    very good and it does not keep the entropy pool over multiple
1089    invocations of GnuPG.  The suggested way to overcome this problem is
1090    to use the
1091   
1092                  Entropy Gathering Daemon (EGD)
1093   
1094    which provides a entropy source for the whole system.  It is written
1095    in Perl and available at the GnuPG FTP servers.  To enable EGD you
1096    should rerun configure with the option "--enable-static-rnd=egd".
1097    For more information consult the GnuPG webpages:
1098   
1099              http://www.gnupg.org/download.html#egd
1100
1101 G10EOF
1102 fi
1103
1104 if test -n "$gpl"; then
1105   echo "Please note that you are building a version of Libgcrypt with"
1106   echo "  $gpl"
1107   echo "included.  These parts are licensed under the GPL and thus the"
1108   echo "use of this library has to comply with the conditions of the GPL."
1109 fi
1110
1111 # Give some feedback
1112 echo   "                Configured for: $PRINTABLE_OS_NAME ($host)"
1113 echo