1f04e35d2ef9b7fb6e57db4e546565a40fa62e24
[libgcrypt.git] / configure.ac
1 # Configure.ac script for Libgcrypt
2 # Copyright (C) 1998, 1999, 2000, 2001, 2002
3 #               2003, 2004, 2006 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.3.3])
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=2
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
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 assembler modules are requested])
426 AC_ARG_ENABLE([asm],
427               AC_HELP_STRING([--disable-asm],
428                              [Disable 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     [  --enable-m-guard        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     [  --with-capabilities     use linux capabilities [default=no]],
448 [use_capabilities="$withval"],[use_capabilities=no])
449 AC_MSG_RESULT($use_capabilities)
450
451 AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
452                    [A human readable text with the name of the OS])
453
454 # For some systems we know that we have ld_version scripts.  
455 # Use it then as default.
456 have_ld_version_script=no
457 case "${host}" in
458     *-*-linux*)
459         have_ld_version_script=yes
460         ;;
461     *-*-gnu*)
462         have_ld_version_script=yes
463         ;;
464 esac
465 AC_ARG_ENABLE([ld-version-script],
466               AC_HELP_STRING([--enable-ld-version-script],
467                              [enable/disable use of linker version script.
468                               (default is system dependent)]),
469               [have_ld_version_script=$enableval],
470               [ : ] )
471 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
472
473 AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM",
474                    [defined to the name of the strong random device])
475 AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM",
476                    [defined to the name of the weaker random device])
477
478 ###############################
479 #### Checks for libraries. ####
480 ###############################
481
482 #
483 # gpg-error is required.
484 #
485 AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION")
486 if test "x$GPG_ERROR_LIBS" = "x"; then
487   AC_MSG_ERROR([libgpg-error is needed.
488                 See ftp://ftp.gnupg.org/gcrypt/libgpg-error/ .])
489 fi
490
491 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GCRYPT,
492           [The default error source for libgcrypt.])
493
494 #
495 # Check whether the GNU Pth library is available.  We require this 
496 # to build the optional gcryptrnd program.
497 #
498 AC_ARG_WITH(pth-prefix,
499             AC_HELP_STRING([--with-pth-prefix=PFX],
500                            [prefix where GNU Pth is installed (optional)]),
501      pth_config_prefix="$withval", pth_config_prefix="")
502 if test x$pth_config_prefix != x ; then
503    PTH_CONFIG="$pth_config_prefix/bin/pth-config"
504 fi
505 if test "$use_random_daemon" = "yes"; then
506   AC_PATH_PROG(PTH_CONFIG, pth-config, no)
507   if test "$PTH_CONFIG" = "no"; then
508     AC_MSG_WARN([[
509 ***
510 *** To build the Libgcrypt's random number daemon
511 *** we need the support of the GNU Portable Threads Library.
512 *** Download it from ftp://ftp.gnu.org/gnu/pth/
513 *** On a Debian GNU/Linux system you might want to try 
514 ***   apt-get install libpth-dev
515 ***]])
516   else
517     GNUPG_PTH_VERSION_CHECK([1.3.7])
518     if test $have_pth = yes; then      
519        PTH_CFLAGS=`$PTH_CONFIG --cflags`
520        PTH_LIBS=`$PTH_CONFIG --ldflags`
521        PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs --all`"
522        AC_DEFINE(USE_GNU_PTH, 1,
523                 [Defined if the GNU Portable Thread Library should be used])
524        AC_DEFINE(HAVE_PTH, 1,
525                 [Defined if the GNU Pth is available])
526     fi
527   fi
528 fi
529 AC_SUBST(PTH_CFLAGS)
530 AC_SUBST(PTH_LIBS)
531
532
533 # Solaris needs -lsocket and -lnsl. Unisys system includes
534 # gethostbyname in libsocket but needs libnsl for socket.
535 AC_SEARCH_LIBS(setsockopt, [socket], ,
536         [AC_SEARCH_LIBS(setsockopt, [socket], , , [-lnsl])])
537 AC_SEARCH_LIBS(setsockopt, [nsl])
538
539 ##################################
540 #### Checks for header files. ####
541 ##################################
542
543 AC_HEADER_STDC
544 AC_CHECK_HEADERS(unistd.h sys/select.h)
545
546 ##########################################
547 #### Checks for typedefs, structures, ####
548 ####  and compiler characteristics.   ####
549 ##########################################
550
551 AC_C_CONST
552 AC_C_INLINE
553 AC_TYPE_SIZE_T
554 AC_TYPE_SIGNAL
555 AC_DECL_SYS_SIGLIST
556
557 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
558 GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
559 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
560 GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
561 GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
562
563 gl_TYPE_SOCKLEN_T
564 case "${host}" in
565   *-*-mingw32*)
566     # socklen_t may or may not be defined depending on what headers
567     # are included.  To be safe we use int as this is the actual type.
568     FALLBACK_SOCKLEN_T="typedef int gcry_socklen_t;"
569     ;;
570   *)
571     if test ".$gl_cv_socklen_t_equiv" = "."; then
572       FALLBACK_SOCKLEN_T="typedef socklen_t gcry_socklen_t;"
573     else
574       FALLBACK_SOCKLEN_T="typedef ${gl_cv_socklen_t_equiv} gcry_socklen_t;"
575     fi
576 esac
577 AC_SUBST(FALLBACK_SOCKLEN_T)
578             
579 #            
580 # Check for ELF visibility support.
581 #
582 AC_CACHE_CHECK(whether the visibility attribute is supported,
583        gcry_cv_visibility_attribute,
584        [gcry_cv_visibility_attribute=no
585         AC_LANG_CONFTEST([AC_LANG_SOURCE(
586           [[int foo __attribute__ ((visibility ("hidden"))) = 1;
587             int bar __attribute__ ((visibility ("protected"))) = 1;
588           ]])])
589         
590         if ${CC-cc} -Werror -S conftest.c -o conftest.s \
591                   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
592             if grep '\.hidden.*foo' conftest.s >/dev/null 2>&1 ; then
593                 if grep '\.protected.*bar' conftest.s >/dev/null 2>&1; then
594                     gcry_cv_visibility_attribute=yes
595                 fi
596             fi  
597         fi  
598        ])
599 if test "$gcry_cv_visibility_attribute" = "yes"; then
600     AC_CACHE_CHECK(for broken visibility attribute,
601        gcry_cv_broken_visibility_attribute,
602        [gcry_cv_broken_visibility_attribute=yes
603         AC_LANG_CONFTEST([AC_LANG_SOURCE(
604           [[int foo (int x);
605             int bar (int x) __asm__ ("foo")
606                             __attribute__ ((visibility ("hidden")));
607             int bar (int x) { return x; }
608           ]])])
609                   
610         if ${CC-cc} -Werror -S conftest.c -o conftest.s \
611                   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
612            if grep '\.hidden@<:@        _@:>@foo' conftest.s >/dev/null 2>&1;
613             then
614                gcry_cv_broken_visibility_attribute=no
615            fi
616         fi
617        ])
618 fi
619 if test "$gcry_cv_visibility_attribute" = "yes"; then
620     AC_CACHE_CHECK(for broken alias attribute,
621        gcry_cv_broken_alias_attribute,
622        [gcry_cv_broken_alias_attribute=yes
623         AC_LANG_CONFTEST([AC_LANG_SOURCE(
624           [[extern int foo (int x) __asm ("xyzzy");
625             int bar (int x) { return x; }
626             extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
627             extern int dfoo;
628             extern __typeof (dfoo) dfoo __asm ("abccb");
629             int dfoo = 1;
630           ]])])
631
632         if ${CC-cc} -Werror -S conftest.c -o conftest.s \
633                   1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
634            if grep 'xyzzy' conftest.s >/dev/null 2>&1 && \
635               grep 'abccb' conftest.s >/dev/null 2>&1; then
636               gcry_cv_broken_alias_attribute=no
637            fi
638         fi
639         ])
640 fi
641 if test "$gcry_cv_visibility_attribute" = "yes"; then
642     AC_CACHE_CHECK(if gcc supports -fvisibility=hidden,
643        gcry_cv_gcc_has_f_visibility,
644        [gcry_cv_gcc_has_f_visibility=no
645         _gcc_cflags_save=$CFLAGS
646         CFLAGS="-fvisibility=hidden"
647         AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),
648                           gcry_cv_gcc_has_f_visibility=yes)
649         CFLAGS=$_gcc_cflags_save;
650        ])
651 fi
652 if test "$gcry_cv_visibility_attribute" = "yes" \
653    && test "$gcry_cv_broken_visibility_attribute" != "yes" \
654    && test "$gcry_cv_broken_alias_attribute" != "yes" \
655    && test "$gcry_cv_gcc_has_f_visibility" = "yes"  
656  then
657    AC_DEFINE(GCRY_USE_VISIBILITY, 1,
658                [Define to use the GNU C visibility attribute])
659    CFLAGS="$CFLAGS -fvisibility=hidden"
660 fi
661
662
663 #######################################
664 #### Checks for library functions. ####
665 #######################################
666
667 AC_FUNC_VPRINTF
668 # We have replacements for these in src/missing-string.c
669 AC_CHECK_FUNCS(stpcpy strcasecmp)
670 # We have replacements for these in src/g10lib.h
671 AC_CHECK_FUNCS(strtoul memmove stricmp atexit raise)
672 # Other checks
673 AC_CHECK_FUNCS(strerror rand mmap getpagesize sysconf waitpid wait4)
674 AC_CHECK_FUNCS(gettimeofday getrusage gethrtime clock_gettime)
675 AC_CHECK_FUNCS(fcntl ftruncate)
676
677 GNUPG_CHECK_MLOCK
678
679 # Check whether we can use Linux capabilities as requested.
680 if test "$use_capabilities" = "yes" ; then
681 use_capabilities=no
682 AC_CHECK_HEADERS(sys/capability.h)
683 if test "$ac_cv_header_sys_capability_h" = "yes" ; then
684   AC_CHECK_LIB(cap, cap_init, ac_need_libcap=1)
685   if test "$ac_cv_lib_cap_cap_init" = "yes"; then
686      AC_DEFINE(USE_CAPABILITIES,1,
687                [define if capabilities should be used])
688      LIBS="$LIBS -lcap"
689      use_capabilities=yes
690   fi
691 fi
692 if test "$use_capabilities" = "no" ; then
693     AC_MSG_WARN([[
694 ***
695 *** The use of capabilities on this system is not possible.
696 *** You need a recent Linux kernel and some patches:
697 ***   fcaps-2.2.9-990610.patch      (kernel patch for 2.2.9)
698 ***   fcap-module-990613.tar.gz     (kernel module)
699 ***   libcap-1.92.tar.gz            (user mode library and utilities)
700 *** And you have to configure the kernel with CONFIG_VFS_CAP_PLUGIN
701 *** set (filesystems menu). Be warned: This code is *really* ALPHA.
702 ***]])
703 fi
704 fi
705
706 # Check whether a random device is available.
707 if test "$try_dev_random" = yes ; then
708     AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
709     [if test -r "$NAME_OF_DEV_RANDOM" && test -r "$NAME_OF_DEV_URANDOM" ; then
710       ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
711     if test "$ac_cv_have_dev_random" = yes; then
712         AC_DEFINE(HAVE_DEV_RANDOM,1,
713                  [defined if the system supports a random device] )
714     fi
715 else
716     AC_MSG_CHECKING(for random device)
717     ac_cv_have_dev_random=no
718     AC_MSG_RESULT(has been disabled)
719 fi
720
721 # Figure out the random modules for this configuration.
722 if test "$random" = "default"; then
723
724     # Select default value.
725     if test "$ac_cv_have_dev_random" = yes; then
726         # Try Linuxish random device.
727         random_modules="linux"
728     else
729         case "${host}" in
730         *-*-mingw32*|*-*-cygwin*)
731           # Windows random device.
732           random_modules="w32"
733           ;;
734         *)
735           # Build everything, allow to select at runtime.
736           random_modules="$auto_random_modules"
737           ;;
738         esac    
739     fi
740 else
741     if test "$random" = "auto"; then
742         # Build everything, allow to select at runtime.
743         random_modules="$auto_random_modules"
744     else
745         random_modules="$random"
746     fi
747 fi
748
749
750 #
751 # Setup assembler stuff.
752 #
753 GNUPG_SYS_SYMBOL_UNDERSCORE()
754 AC_ARG_ENABLE(mpi-path,
755               AC_HELP_STRING([--enable-mpi-path=EXTRA_PATH],
756               [prepend EXTRA_PATH to list of CPU specific optimizations]),
757               mpi_extra_path="$enableval",mpi_extra_path="")
758 AC_MSG_CHECKING(for mpi assembler functions)
759 if test -f $srcdir/mpi/config.links ; then
760     . $srcdir/mpi/config.links
761     AC_CONFIG_LINKS("$mpi_ln_list")
762     ac_cv_mpi_sflags="$mpi_sflags"
763     AC_MSG_RESULT(done)
764 else
765     AC_MSG_RESULT(failed)
766     AC_MSG_ERROR([mpi/config.links missing!])
767 fi
768 MPI_SFLAGS="$ac_cv_mpi_sflags"
769 AC_SUBST(MPI_SFLAGS)
770
771 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_ADD1, test "$mpi_mod_asm_mpih_add1" = yes)
772 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_SUB1, test "$mpi_mod_asm_mpih_sub1" = yes)
773 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_MUL1, test "$mpi_mod_asm_mpih_mul1" = yes)
774 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_MUL2, test "$mpi_mod_asm_mpih_mul2" = yes)
775 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_MUL3, test "$mpi_mod_asm_mpih_mul3" = yes)
776 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_LSHIFT, test "$mpi_mod_asm_mpih_lshift" = yes)
777 AM_CONDITIONAL(MPI_MOD_ASM_MPIH_RSHIFT, test "$mpi_mod_asm_mpih_rshift" = yes)
778 AM_CONDITIONAL(MPI_MOD_ASM_UDIV, test "$mpi_mod_asm_udiv" = yes)
779 AM_CONDITIONAL(MPI_MOD_ASM_UDIV_QRNND, test "$mpi_mod_asm_udiv_qrnnd" = yes)
780 AM_CONDITIONAL(MPI_MOD_C_MPIH_ADD1, test "$mpi_mod_c_mpih_add1" = yes)
781 AM_CONDITIONAL(MPI_MOD_C_MPIH_SUB1, test "$mpi_mod_c_mpih_sub1" = yes)
782 AM_CONDITIONAL(MPI_MOD_C_MPIH_MUL1, test "$mpi_mod_c_mpih_mul1" = yes)
783 AM_CONDITIONAL(MPI_MOD_C_MPIH_MUL2, test "$mpi_mod_c_mpih_mul2" = yes)
784 AM_CONDITIONAL(MPI_MOD_C_MPIH_MUL3, test "$mpi_mod_c_mpih_mul3" = yes)
785 AM_CONDITIONAL(MPI_MOD_C_MPIH_LSHIFT, test "$mpi_mod_c_mpih_lshift" = yes)
786 AM_CONDITIONAL(MPI_MOD_C_MPIH_RSHIFT, test "$mpi_mod_c_mpih_rshift" = yes)
787 AM_CONDITIONAL(MPI_MOD_C_UDIV, test "$mpi_mod_c_udiv" = yes)
788 AM_CONDITIONAL(MPI_MOD_C_UDIV_QRNND, test "$mpi_mod_c_udiv_qrnnd" = yes)
789
790 # Allow users to append something to the version string without
791 # flagging it as development version.  The user version part is
792 # considered everything after a dash.
793 changequote(,)#
794 tmp_pat='[a-zA-Z]'
795 changequote([,])#
796 if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
797     AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
798               [Defined if this is not a regular release])
799 fi
800
801 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
802
803
804 # This is handy for debugging so the compiler doesn't rearrange
805 # things and eliminate variables.
806 AC_ARG_ENABLE(optimization,
807        AC_HELP_STRING([--disable-optimization],
808                       [disable compiler optimization]),
809                       [if test $enableval = no ; then
810                          CFLAGS=`echo $CFLAGS | sed 's/-O[[0-9]]//'`
811                        fi])
812
813 AC_ARG_ENABLE(gcc-warnings,
814               AC_HELP_STRING([--enable-gcc-warnings],
815                              [enable more verbose gcc warnings]),
816               [more_gcc_warnings="$enableval"],
817               [more_gcc_warnings="no"])
818
819 if test "$GCC" = yes; then
820     if test "$USE_MAINTAINER_MODE" = "yes" ||
821        test "$more_gcc_warnings" = "yes"; then
822         CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
823         if test "$more_gcc_warnings" = "yes"; then
824             CFLAGS="$CFLAGS -W -Wextra -Wbad-function-cast"
825             CFLAGS="$CFLAGS -Wwrite-strings"
826             CFLAGS="$CFLAGS -Wdeclaration-after-statement"
827             CFLAGS="$CFLAGS -Wno-missing-field-initializers"
828             CFLAGS="$CFLAGS -Wno-sign-compare"
829             # Note: We don't use -Wunreachable-code because this gives
830             # warnings for all asserts and many inline functions like
831             # gpg_error (gcc 4.1.2 20060928).
832         fi
833     else
834         CFLAGS="$CFLAGS -Wall"
835     fi
836
837     AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
838     _gcc_cflags_save=$CFLAGS
839     CFLAGS="-Wpointer-arith"
840     AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]),_gcc_wopt=yes,_gcc_wopt=no)
841     AC_MSG_RESULT($_gcc_wopt)
842     CFLAGS=$_gcc_cflags_save;
843     if test x"$_gcc_wopt" = xyes ; then
844        CFLAGS="$CFLAGS -Wpointer-arith"
845     fi
846 fi
847
848 # Check whether as(1) supports a noeexecstack feature.  This test
849 # includes an override option.
850 CL_AS_NOEXECSTACK
851
852
853 AC_SUBST(LIBGCRYPT_CONFIG_API_VERSION)
854 AC_SUBST(LIBGCRYPT_CONFIG_LIBS)
855 AC_SUBST(LIBGCRYPT_CONFIG_CFLAGS)
856 AC_SUBST(LIBGCRYPT_THREAD_MODULES)
857
858 AC_CONFIG_COMMANDS([gcrypt-conf],[[
859 chmod +x src/libgcrypt-config
860 ]],[[
861 prefix=$prefix
862 exec_prefix=$exec_prefix
863 libdir=$libdir
864 datadir=$datadir
865 DATADIRNAME=$DATADIRNAME
866 ]])
867
868 #####################
869 #### Conclusion. ####
870 #####################
871
872 # Define conditional sources and config.h symbols depending on the
873 # selected ciphers, pubkey-ciphers, digests and random modules.
874
875 LIST_MEMBER(arcfour, $enabled_ciphers)
876 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS arcfour.lo"
877 AC_DEFINE_UNQUOTED(USE_ARCFOUR, $found,
878                                  [Defined if this module should be included])
879
880 LIST_MEMBER(blowfish, $enabled_ciphers)
881 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS blowfish.lo"
882 AC_DEFINE_UNQUOTED(USE_BLOWFISH, $found,
883                                   [Defined if this module should be included])
884
885 LIST_MEMBER(cast5, $enabled_ciphers)
886 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS cast5.lo"
887 AC_DEFINE_UNQUOTED(USE_CAST5, $found,
888                                [Defined if this module should be included])
889
890 LIST_MEMBER(des, $enabled_ciphers)
891 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS des.lo"
892 AC_DEFINE_UNQUOTED(USE_DES, $found,
893                              [Defined if this module should be included])
894
895 LIST_MEMBER(aes, $enabled_ciphers)
896 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS rijndael.lo"
897 AC_DEFINE_UNQUOTED(USE_AES, $found,
898                              [Defined if this module should be included])
899
900 LIST_MEMBER(twofish, $enabled_ciphers)
901 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS twofish.lo"
902 AC_DEFINE_UNQUOTED(USE_TWOFISH, $found,
903                                  [Defined if this module should be included])
904
905 LIST_MEMBER(serpent, $enabled_ciphers)
906 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS serpent.lo"
907 AC_DEFINE_UNQUOTED(USE_SERPENT, $found,
908                                  [Defined if this module should be included])
909
910 LIST_MEMBER(rfc2268, $enabled_ciphers)
911 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS rfc2268.lo"
912 AC_DEFINE_UNQUOTED(USE_RFC2268, $found,
913                                  [Defined if this module should be included])
914
915 LIST_MEMBER(seed, $enabled_ciphers)
916 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS seed.lo"
917 AC_DEFINE_UNQUOTED(USE_SEED, $found,
918                              [Defined if this module should be included])
919
920 LIST_MEMBER(camellia, $enabled_ciphers)
921 test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS camellia.lo camellia-glue.lo"
922 AC_DEFINE_UNQUOTED(USE_CAMELLIA, $found,
923                              [Defined if this module should be included])
924
925 LIST_MEMBER(dsa, $enabled_pubkey_ciphers)
926 test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS dsa.lo"
927 AC_DEFINE_UNQUOTED(USE_DSA, $found,
928                              [Defined if this module should be included])
929
930 LIST_MEMBER(rsa, $enabled_pubkey_ciphers)
931 test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS rsa.lo"
932 AC_DEFINE_UNQUOTED(USE_RSA, $found,
933                             [Defined if this module should be included])
934
935 LIST_MEMBER(elgamal, $enabled_pubkey_ciphers)
936 test "$found" = "1" \ 
937      && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS elgamal.lo"
938 AC_DEFINE_UNQUOTED(USE_ELGAMAL, $found,
939                                 [Defined if this module should be included])
940
941 LIST_MEMBER(ecc, $enabled_pubkey_ciphers)
942 test "$found" = "1" \ 
943      && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS ecc.lo"
944 AC_DEFINE_UNQUOTED(USE_ECC, $found,
945                                 [Defined if this module should be included])
946
947 LIST_MEMBER(crc, $enabled_digests)
948 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS crc.lo"
949 AC_DEFINE_UNQUOTED(USE_CRC, $found,
950                             [Defined if this module should be included])
951
952 LIST_MEMBER(md4, $enabled_digests)
953 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md4.lo"
954 AC_DEFINE_UNQUOTED(USE_MD4, $found,
955                              [Defined if this module should be included])
956
957 LIST_MEMBER(md5, $enabled_digests)
958 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md5.lo"
959 AC_DEFINE_UNQUOTED(USE_MD5, $found,
960                              [Defined if this module should be included])
961
962 LIST_MEMBER(sha256, $enabled_digests)
963 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha256.lo"
964 AC_DEFINE_UNQUOTED(USE_SHA256, $found,
965                                 [Defined if this module should be included])
966
967 LIST_MEMBER(sha512, $enabled_digests)
968 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha512.lo"
969 AC_DEFINE_UNQUOTED(USE_SHA512, $found,
970                                 [Defined if this module should be included])
971
972 LIST_MEMBER(tiger, $enabled_digests)
973 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS tiger.lo"
974 AC_DEFINE_UNQUOTED(USE_TIGER, $found,
975                                [Defined if this module should be included])
976
977 LIST_MEMBER(whirlpool, $enabled_digests)
978 test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS whirlpool.lo"
979 AC_DEFINE_UNQUOTED(USE_WHIRLPOOL, $found,
980                                [Defined if this module should be included])
981
982 # rmd160 and sha1 should be included always.
983 GCRYPT_DIGESTS="$GCRYPT_DIGESTS rmd160.lo sha1.lo"
984 AC_DEFINE_UNQUOTED(USE_RMD160, 1, [Defined if this module should be included])
985 AC_DEFINE_UNQUOTED(USE_SHA1, 1,   [Defined if this module should be included])
986
987 LIST_MEMBER(linux, $random_modules)
988 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndlinux.lo"
989 AC_DEFINE_UNQUOTED(USE_RNDLINUX, $found,
990                    [Defined if the /dev/random based RNG should be used.])
991
992
993 LIST_MEMBER(unix, $random_modules)
994 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndunix.lo"
995 AC_DEFINE_UNQUOTED(USE_RNDUNIX, $found,
996                   [Defined if the default Unix RNG should be used.])
997 if test "$found" = "1"; then
998    print_egd_notice=yes
999 fi
1000
1001 LIST_MEMBER(egd, $random_modules)
1002 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndegd.lo"
1003 AC_DEFINE_UNQUOTED(USE_RNDEGD, $found,
1004                   [Defined if the EGD based RNG should be used.])
1005
1006 LIST_MEMBER(w32, $random_modules)
1007 test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndw32.lo"
1008 AC_DEFINE_UNQUOTED(USE_RNDW32, $found,
1009                   [Defined if the Windows specific RNG should be used.])
1010
1011 AC_SUBST([GCRYPT_CIPHERS])
1012 AC_SUBST([GCRYPT_PUBKEY_CIPHERS])
1013 AC_SUBST([GCRYPT_DIGESTS])
1014 AC_SUBST([GCRYPT_RANDOM])
1015
1016 AC_SUBST(LIBGCRYPT_CIPHERS, $enabled_ciphers)
1017 AC_SUBST(LIBGCRYPT_PUBKEY_CIPHERS, $enabled_pubkey_ciphers)
1018 AC_SUBST(LIBGCRYPT_DIGESTS, $enabled_digests)
1019
1020 # For printing the configuration we need a colon separated list of
1021 # algorithm names.
1022 tmp=`echo "$enabled_ciphers" | tr ' ' : `
1023 AC_DEFINE_UNQUOTED(LIBGCRYPT_CIPHERS, "$tmp", 
1024                    [List of available cipher algorithms])
1025 tmp=`echo "$enabled_pubkey_ciphers" | tr ' ' : `
1026 AC_DEFINE_UNQUOTED(LIBGCRYPT_PUBKEY_CIPHERS, "$tmp", 
1027                    [List of available public key cipher algorithms])
1028 tmp=`echo "$enabled_digests" | tr ' ' : `
1029 AC_DEFINE_UNQUOTED(LIBGCRYPT_DIGESTS, "$tmp", 
1030                    [List of available digest algorithms])
1031
1032
1033
1034 # Generate extended version information for W32.
1035 if test "$have_w32_system" = yes; then
1036    BUILD_TIMESTAMP=`date --iso-8601=minutes`
1037    changequote(,)dnl 
1038    BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
1039    changequote([,])dnl
1040    BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION}"
1041 fi
1042 AC_SUBST(BUILD_REVISION)
1043 AC_SUBST(BUILD_TIMESTAMP)
1044 AC_SUBST(BUILD_FILEVERSION)
1045 AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION", 
1046                    [Subversion revision used to build this package])
1047
1048
1049
1050 # And create the files.
1051 AC_CONFIG_FILES([
1052 Makefile
1053 m4/Makefile
1054 mpi/Makefile
1055 cipher/Makefile
1056 doc/Makefile
1057 src/Makefile
1058 src/gcrypt.h
1059 src/libgcrypt-config
1060 src/versioninfo.rc
1061 tests/Makefile
1062 ])
1063 AC_OUTPUT
1064
1065 # Give some feedback
1066 echo
1067
1068 if test "$print_egd_notice" = "yes"; then
1069 cat <<G10EOF
1070   
1071    The performance of the Unix random gatherer module (rndunix) is not
1072    very good and it does not keep the entropy pool over multiple
1073    invocations of GnuPG.  The suggested way to overcome this problem is
1074    to use the
1075   
1076                  Entropy Gathering Daemon (EGD)
1077   
1078    which provides a entropy source for the whole system.  It is written
1079    in Perl and available at the GnuPG FTP servers.  To enable EGD you
1080    should rerun configure with the option "--enable-static-rnd=egd".
1081    For more information consult the GnuPG webpages:
1082   
1083              http://www.gnupg.org/download.html#egd
1084
1085 G10EOF
1086 fi
1087
1088 if test -n "$gpl"; then
1089   echo "Please note that you are building a version of Libgcrypt with"
1090   echo "  $gpl"
1091   echo "included.  These parts are licensed under the GPL and thus the"
1092   echo "use of this library has to comply with the conditions of the GPL."
1093 fi
1094
1095 # Give some feedback
1096 echo   "                Configured for: $PRINTABLE_OS_NAME ($host)"
1097 echo