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