aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/libgcrypt/libgcrypt-1.2.2/configure.ac
diff options
context:
space:
mode:
authorJay Threeth2011-04-04 11:48:26 -0700
committerJay Threeth2011-04-04 11:48:26 -0700
commit3c9cc506f741b980565ff5b3b001cd8b6ee36b12 (patch)
treecb862c57b3d5f74177cde3bd962a53fc377166f6 /linden/indra/libgcrypt/libgcrypt-1.2.2/configure.ac
parentbuild fixes, might build on linux now (diff)
downloadmeta-impy-3c9cc506f741b980565ff5b3b001cd8b6ee36b12.zip
meta-impy-3c9cc506f741b980565ff5b3b001cd8b6ee36b12.tar.gz
meta-impy-3c9cc506f741b980565ff5b3b001cd8b6ee36b12.tar.bz2
meta-impy-3c9cc506f741b980565ff5b3b001cd8b6ee36b12.tar.xz
add source to libraries, and cruft for building under windows
Diffstat (limited to '')
-rwxr-xr-xlinden/indra/libgcrypt/libgcrypt-1.2.2/configure.ac843
1 files changed, 843 insertions, 0 deletions
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/configure.ac b/linden/indra/libgcrypt/libgcrypt-1.2.2/configure.ac
new file mode 100755
index 0000000..dab5e54
--- /dev/null
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/configure.ac
@@ -0,0 +1,843 @@
1# Configure.ac script for Libgcrypt
2# Copyright (C) 1998, 1999, 2000, 2001, 2002
3# 2003, 2004 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.)
22AC_REVISION($Revision: 1119 $)
23AC_PREREQ(2.59)
24min_automake_version="1.9.3"
25
26# Version number: Remember to change it immediately *after* a release
27# but remove a "-cvs" prefix right *before* a release and append it
28# soon later.
29
30AC_INIT(libgcrypt, 1.2.2, bug-libgcrypt@gnupg.org)
31
32# LT Version numbers, remember to change them just *before* a release.
33# (Interfaces removed: CURRENT++, AGE=0, REVISION=0)
34# (Interfaces added: CURRENT++, AGE++, REVISION=0)
35# (No interfaces changed: REVISION++)
36LIBGCRYPT_LT_CURRENT=13
37LIBGCRYPT_LT_AGE=2
38LIBGCRYPT_LT_REVISION=1
39
40# If the API is changed in an incompatible way: increment the next counter.
41LIBGCRYPT_CONFIG_API_VERSION=1
42
43NEED_GPG_ERROR_VERSION=0.5
44
45
46PACKAGE=$PACKAGE_NAME
47VERSION=$PACKAGE_VERSION
48
49AC_CONFIG_SRCDIR([src/gcrypt.h])
50AC_CANONICAL_TARGET()
51AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
52AM_CONFIG_HEADER(config.h)
53AM_MAINTAINER_MODE
54
55AH_TOP([
56/* need this, because some autoconf tests rely on this (e.g. stpcpy)
57 * and it should be used for new programs */
58#define _GNU_SOURCE 1
59])
60
61AH_BOTTOM([
62#define _GCRYPT_IN_LIBGCRYPT 1
63])
64
65AH_VERBATIM([_REENTRANT],
66[/* To allow the use of Libgcrypt in multithreaded programs we have to use
67 special features from the library. */
68#ifndef _REENTRANT
69# define _REENTRANT 1
70#endif
71])
72
73AC_SUBST(LIBGCRYPT_LT_CURRENT)
74AC_SUBST(LIBGCRYPT_LT_AGE)
75AC_SUBST(LIBGCRYPT_LT_REVISION)
76AC_SUBST(PACKAGE)
77AC_SUBST(VERSION)
78AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
79AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
80
81
82AC_PROG_MAKE_SET
83missing_dir=`cd $ac_aux_dir && pwd`
84AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
85AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
86AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
87AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
88# AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
89AC_PROG_CC
90AC_PROG_CPP
91AM_PROG_AS
92AC_ISC_POSIX
93AC_PROG_INSTALL
94AC_PROG_AWK
95
96AM_PROG_LIBTOOL
97
98##########################
99## General definitions. ##
100##########################
101
102# Used by libgcrypt-config
103LIBGCRYPT_CONFIG_LIBS="-lgcrypt"
104LIBGCRYPT_CONFIG_CFLAGS=""
105
106# Definitions for symmetric ciphers.
107available_ciphers="arcfour blowfish cast5 des aes twofish serpent rfc2268"
108enabled_ciphers=""
109
110# Definitions for public-key ciphers.
111available_pubkey_ciphers="dsa elgamal rsa"
112enabled_pubkey_ciphers=""
113
114# Definitions for message digests.
115available_digests="crc md4 md5 rmd160 sha1 sha256"
116available_digests_64="sha512 tiger"
117enabled_digests=""
118
119# Definitions for random modules.
120available_random_modules="linux egd unix"
121auto_random_modules="$available_random_modules"
122
123# Supported thread backends.
124LIBGCRYPT_THREAD_MODULES=""
125
126# Other definitions.
127print_egd_notice=no
128
129# Setup some stuff depending on host/target.
130case "${target}" in
131 *-*-mingw32*)
132 available_random_modules="w32"
133 ac_cv_have_dev_random=no
134 AC_DEFINE(USE_ONLY_8DOT3,1,
135 [set this to limit filenames to the 8.3 format])
136 AC_DEFINE(HAVE_DRIVE_LETTERS,1,
137 [defined if we must run on a stupid file system])
138 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
139 [defined if we run on some of the PCDOS like systems
140 (DOS, Windoze. OS/2) with special properties like
141 no file modes])
142 ;;
143
144 i?86-emx-os2 | i?86-*-os2*emx)
145 # OS/2 with the EMX environment
146 ac_cv_have_dev_random=no
147 AC_DEFINE(HAVE_DRIVE_LETTERS)
148 AC_DEFINE(HAVE_DOSISH_SYSTEM)
149 ;;
150
151 i?86-*-msdosdjgpp*)
152 # DOS with the DJGPP environment
153 ac_cv_have_dev_random=no
154 AC_DEFINE(HAVE_DRIVE_LETTERS)
155 AC_DEFINE(HAVE_DOSISH_SYSTEM)
156 ;;
157
158 *-*-freebsd*)
159 # FreeBSD
160 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
161 LDFLAGS="$LDFLAGS -L/usr/local/lib"
162 ;;
163
164 *-*-hpux*)
165 if test -z "$GCC" ; then
166 CFLAGS="$CFLAGS -Ae -D_HPUX_SOURCE"
167 fi
168 ;;
169 *-dec-osf4*)
170 if test -z "$GCC" ; then
171 # Suppress all warnings
172 # to get rid of the unsigned/signed char mismatch warnings.
173 CFLAGS="$CFLAGS -w"
174 fi
175 ;;
176 m68k-atari-mint)
177 ;;
178 *)
179 ;;
180esac
181
182# A printable OS Name is sometime useful.
183case "${target}" in
184 *-*-mingw32*)
185 PRINTABLE_OS_NAME="MingW32"
186 ;;
187
188 i?86-emx-os2 | i?86-*-os2*emx )
189 PRINTABLE_OS_NAME="OS/2"
190 ;;
191
192 i?86-*-msdosdjgpp*)
193 PRINTABLE_OS_NAME="MSDOS/DJGPP"
194 ;;
195
196 *-linux*)
197 PRINTABLE_OS_NAME="GNU/Linux"
198 ;;
199
200 *)
201 PRINTABLE_OS_NAME=`uname -s || echo "Unknown"`
202 ;;
203esac
204
205
206case "${target}" in
207 *-openbsd* | *-netbsd*)
208 # FIXME: Are these the best flags for OpenBSD?
209 NAME_OF_DEV_RANDOM="/dev/srandom"
210 NAME_OF_DEV_URANDOM="/dev/urandom"
211# DYNLINK_MOD_CFLAGS="-shared -rdynamic $CFLAGS_PIC -Wl,-Bshareable -Wl,-x"
212 ;;
213
214 *-solaris* | *-irix* | *-dec-osf* )
215 NAME_OF_DEV_RANDOM="/dev/random"
216 NAME_OF_DEV_URANDOM="/dev/random"
217# DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
218 ;;
219
220 *)
221 NAME_OF_DEV_RANDOM="/dev/random"
222 NAME_OF_DEV_URANDOM="/dev/urandom"
223 # -shared is a gcc-ism. Find pic flags from GNUPG_CHECK_PIC.
224# if test -n "$GCC" ; then
225# DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
226# else
227# DYNLINK_MOD_CFLAGS="$CFLAGS_PIC"
228# fi
229 ;;
230esac
231
232
233AC_C_BIGENDIAN
234
235AC_CHECK_SIZEOF(unsigned short, 2)
236AC_CHECK_SIZEOF(unsigned int, 4)
237AC_CHECK_SIZEOF(unsigned long, 4)
238AC_CHECK_SIZEOF(unsigned long long, 0)
239
240if test "$ac_cv_sizeof_unsigned_short" = "0" \
241 || test "$ac_cv_sizeof_unsigned_int" = "0" \
242 || test "$ac_cv_sizeof_unsigned_long" = "0"; then
243 AC_MSG_WARN([Hmmm, something is wrong with the sizes - using defaults]);
244fi
245
246# Do we have any 64-bit data types?
247if test "$ac_cv_sizeof_unsigned_int" != "8" \
248 && test "$ac_cv_sizeof_unsigned_long" != "8" \
249 && test "$ac_cv_sizeof_unsigned_long_long" != "8" \
250 && test "$ac_cv_sizeof_uint64_t" != "8"; then
251 AC_MSG_WARN([No 64-bit types. Disabling TIGER/192, SHA-384, and SHA-512])
252else
253 available_digests="$available_digests $available_digests_64"
254fi
255
256# If not specified otherwise, all available algorithms will be
257# included.
258default_ciphers="$available_ciphers"
259default_pubkey_ciphers="$available_pubkey_ciphers"
260default_digests="$available_digests"
261
262############################
263## Command line switches. ##
264############################
265
266# Implementation of the --enable-ciphers switch.
267AC_ARG_ENABLE(ciphers,
268 AC_HELP_STRING([--enable-ciphers=ciphers],
269 [select the symmetric ciphers to include]),
270 [enabled_ciphers=$(echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]')],
271 [enabled_ciphers=""])
272if test "x$enabled_ciphers" = "x" \
273 -o "$enabled_ciphers" = "yes" \
274 -o "$enabled_ciphers" = "no"; then
275 enabled_ciphers=$default_ciphers
276fi
277AC_MSG_CHECKING([which symmetric ciphers to include])
278for cipher in $enabled_ciphers; do
279 LIST_MEMBER($cipher, $available_ciphers)
280 if test "$found" = "0"; then
281 AC_MSG_ERROR([unsupported cipher specified])
282 fi
283done
284AC_MSG_RESULT([$enabled_ciphers])
285
286# Implementation of the --enable-pubkey-ciphers switch.
287AC_ARG_ENABLE(pubkey-ciphers,
288 AC_HELP_STRING([--enable-pubkey-ciphers=ciphers],
289 [select the public-key ciphers to include]),
290 [enabled_pubkey_ciphers=$(echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]')],
291 [enabled_pubkey_ciphers=""])
292if test "x$enabled_pubkey_ciphers" = "x" \
293 -o "$enabled_pubkey_ciphers" = "yes" \
294 -o "$enabled_pubkey_ciphers" = "no"; then
295 enabled_pubkey_ciphers=$default_pubkey_ciphers
296fi
297AC_MSG_CHECKING([which public-key ciphers to include])
298for cipher in $enabled_pubkey_ciphers; do
299 LIST_MEMBER($cipher, $available_pubkey_ciphers)
300 if test "$found" = "0"; then
301 AC_MSG_ERROR([unsupported public-key cipher specified])
302 fi
303done
304AC_MSG_RESULT([$enabled_pubkey_ciphers])
305
306# Implementation of the --enable-digests switch.
307AC_ARG_ENABLE(digests,
308 AC_HELP_STRING([--enable-digests=digests],
309 [select the message digests to include]),
310 [enabled_digests=$(echo $enableval | tr , ' ' | tr '[A-Z]' '[a-z]')],
311 [enabled_digests=""])
312if test "x$enabled_digests" = "x" \
313 -o "$enabled_digests" = "yes" \
314 -o "$enabled_digests" = "no"; then
315 enabled_digests=$default_digests
316fi
317AC_MSG_CHECKING([which message digests to include])
318for digest in $enabled_digests; do
319 LIST_MEMBER($digest, $available_digests)
320 if test "$found" = "0"; then
321 AC_MSG_ERROR([unsupported message digest specified])
322 fi
323done
324AC_MSG_RESULT([$enabled_digests])
325
326# Implementation of the --enable-random switch.
327AC_ARG_ENABLE(random,
328 AC_HELP_STRING([--enable-random=name],
329 [select which random number generator to use]),
330 [random=$(echo $enableval | tr '[A-Z]' '[a-z]')],
331 [])
332if test "x$random" = "x" -o "$random" = "yes" -o "$random" = "no"; then
333 random=default
334fi
335AC_MSG_CHECKING([which random module to use])
336if test "$random" != "default" -a "$random" != "auto"; then
337 LIST_MEMBER($random, $available_random_modules)
338 if test "$found" = "0"; then
339 AC_MSG_ERROR([unsupported random module specified])
340 fi
341fi
342AC_MSG_RESULT($random)
343
344# Implementation of the --disable-dev-random switch.
345AC_MSG_CHECKING([whether use of /dev/random is requested])
346AC_ARG_ENABLE(dev-random,
347[ --disable-dev-random disable the use of dev random],
348 try_dev_random=$enableval, try_dev_random=yes)
349AC_MSG_RESULT($try_dev_random)
350
351# Implementation of the --with-egd-socket switch.
352AC_ARG_WITH(egd-socket,
353 [ --with-egd-socket=NAME Use NAME for the EGD socket)],
354 egd_socket_name="$withval", egd_socket_name="" )
355AC_DEFINE_UNQUOTED(EGD_SOCKET_NAME, "$egd_socket_name",
356 [Define if you don't want the default EGD socket name.
357 For details see cipher/rndegd.c])
358
359# Implementation of --disable-asm.
360AC_MSG_CHECKING([whether assembler modules are requested])
361AC_ARG_ENABLE([asm],
362 AC_HELP_STRING([--disable-asm],
363 [Disable assembler modules]),
364 [try_asm_modules=$enableval],
365 [try_asm_modules=yes])
366AC_MSG_RESULT($try_asm_modules)
367
368# Implementation of the --enable-m-guard switch.
369AC_MSG_CHECKING([whether memory guard is requested])
370AC_ARG_ENABLE(m-guard,
371 [ --enable-m-guard enable memory guard facility],
372 use_m_guard=$enableval, use_m_guard=no)
373 AC_MSG_RESULT($use_m_guard)
374if test "$use_m_guard" = yes ; then
375 AC_DEFINE(M_GUARD,1,[Define to use the (obsolete) malloc guarding feature])
376fi
377
378# Implementation of the --with-capabilities switch.
379# Check whether we want to use Linux capabilities
380AC_MSG_CHECKING([whether use of capabilities is requested])
381AC_ARG_WITH(capabilities,
382 [ --with-capabilities use linux capabilities [default=no]],
383[use_capabilities="$withval"],[use_capabilities=no])
384AC_MSG_RESULT($use_capabilities)
385
386# We don't have a test to check whether as(1) knows about the
387# non executable stack option. Thus we provide an option to enable it.
388AC_MSG_CHECKING([whether non excutable stack support is requested])
389AC_ARG_ENABLE(noexecstack,
390 AC_HELP_STRING([--enable-noexecstack],
391 [enable non executable stack support (gcc only)]),
392 noexecstack_support=$enableval, noexecstack_support=no)
393AC_MSG_RESULT($noexecstack_support)
394
395
396
397AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
398 [A human readable text with the name of the OS])
399
400# For some systems we know that we have ld_version scripts.
401# Use it then as default.
402have_ld_version_script=no
403case "${host}" in
404 *-*-linux*)
405 have_ld_version_script=yes
406 ;;
407 *-*-gnu*)
408 have_ld_version_script=yes
409 ;;
410esac
411AC_ARG_ENABLE([ld-version-script],
412 AC_HELP_STRING([--enable-ld-version-script],
413 [enable/disable use of linker version script.
414 (default is system dependent)]),
415 [have_ld_version_script=$enableval],
416 [ : ] )
417AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
418
419AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM",
420 [defined to the name of the strong random device])
421AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM",
422 [defined to the name of the weaker random device])
423
424###############################
425#### Checks for libraries. ####
426###############################
427
428AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION")
429if test "x$GPG_ERROR_LIBS" = "x"; then
430 AC_MSG_ERROR([libgpg-error is needed.
431 See ftp://ftp.gnupg.org/gcrypt/libgpg-error/ .])
432fi
433
434AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GCRYPT,
435 [The default error source for libgcrypt.])
436
437# Solaris needs -lsocket and -lnsl. Unisys system includes
438# gethostbyname in libsocket but needs libnsl for socket.
439AC_CHECK_LIB(nsl, gethostbyname)
440AC_CHECK_LIB(socket, socket, ac_need_libsocket=1, ac_try_nsl=1)
441if test x$ac_need_libsocket = x1; then
442 LIBS="$LIBS -lsocket"
443fi
444if test x$ac_try_nsl = x1; then
445 AC_CHECK_LIB(nsl, gethostbyname, ac_need_libnsl=1)
446 if test x$ac_need_libnsl = x1
447 then
448 LIBS="$LIBS -lnsl"
449 fi
450fi
451
452##################################
453#### Checks for header files. ####
454##################################
455
456AC_HEADER_STDC
457AC_CHECK_HEADERS(unistd.h sys/select.h)
458
459##########################################
460#### Checks for typedefs, structures, ####
461#### and compiler characteristics. ####
462##########################################
463
464AC_C_CONST
465AC_C_INLINE
466AC_TYPE_SIZE_T
467AC_TYPE_SIGNAL
468AC_DECL_SYS_SIGLIST
469
470GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
471GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF)
472GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
473GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF)
474GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF)
475
476AC_CHECK_TYPE(socklen_t,,
477 [AC_DEFINE_UNQUOTED([socklen_t],
478 [int],
479 [Define to `int' if unavailable.])],
480 [
481#include <sys/types.h>
482#include <sys/socket.h>
483 ])
484
485#######################################
486#### Checks for library functions. ####
487#######################################
488
489AC_FUNC_VPRINTF
490# We have replacements for these in src/missing-string.c
491AC_CHECK_FUNCS(stpcpy strcasecmp)
492# We have replacements for these in src/g10lib.h
493AC_CHECK_FUNCS(strtoul memmove stricmp atexit raise)
494# Other checks
495AC_CHECK_FUNCS(strerror rand mmap getpagesize waitpid wait4)
496AC_CHECK_FUNCS(gettimeofday getrusage gethrtime clock_gettime)
497
498GNUPG_CHECK_MLOCK
499
500# Check whether we can use Linux capabilities as requested.
501if test "$use_capabilities" = "yes" ; then
502use_capabilities=no
503AC_CHECK_HEADERS(sys/capability.h)
504if test "$ac_cv_header_sys_capability_h" = "yes" ; then
505 AC_CHECK_LIB(cap, cap_init, ac_need_libcap=1)
506 if test "$ac_cv_lib_cap_cap_init" = "yes"; then
507 AC_DEFINE(USE_CAPABILITIES,1,
508 [define if capabilities should be used])
509 LIBS="$LIBS -lcap"
510 use_capabilities=yes
511 fi
512fi
513if test "$use_capabilities" = "no" ; then
514 AC_MSG_WARN([[
515***
516*** The use of capabilities on this system is not possible.
517*** You need a recent Linux kernel and some patches:
518*** fcaps-2.2.9-990610.patch (kernel patch for 2.2.9)
519*** fcap-module-990613.tar.gz (kernel module)
520*** libcap-1.92.tar.gz (user mode library and utilities)
521*** And you have to configure the kernel with CONFIG_VFS_CAP_PLUGIN
522*** set (filesystems menu). Be warned: This code is *really* ALPHA.
523***]])
524fi
525fi
526
527# Check whether a random device is available.
528if test "$try_dev_random" = yes ; then
529 AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
530 [if test -r "$NAME_OF_DEV_RANDOM" && test -r "$NAME_OF_DEV_URANDOM" ; then
531 ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
532 if test "$ac_cv_have_dev_random" = yes; then
533 AC_DEFINE(HAVE_DEV_RANDOM,1,
534 [defined if the system supports a random device] )
535 fi
536else
537 AC_MSG_CHECKING(for random device)
538 ac_cv_have_dev_random=no
539 AC_MSG_RESULT(has been disabled)
540fi
541
542# Figure out the random modules for this configuration.
543if test "$random" = "default"; then
544
545 # Select default value.
546 if test "$ac_cv_have_dev_random" = yes; then
547 # Try Linuxish random device.
548 random_modules="linux"
549 else
550 case "${target}" in
551 *-*-mingw32*|*-*-cygwin*)
552 # Windows random device.
553 random_modules="w32"
554 ;;
555 *)
556 # Build everything, allow to select at runtime.
557 random_modules="$auto_random_modules"
558 ;;
559 esac
560 fi
561else
562 if test "$random" = "auto"; then
563 # Build everything, allow to select at runtime.
564 random_modules="$auto_random_modules"
565 fi
566fi
567
568
569#
570# Setup assembler stuff.
571#
572GNUPG_SYS_SYMBOL_UNDERSCORE()
573AC_MSG_CHECKING(for mpi assembler functions)
574if test -f $srcdir/mpi/config.links ; then
575 . $srcdir/mpi/config.links
576 AC_CONFIG_LINKS("$mpi_ln_list")
577 ac_cv_mpi_mod_list="$mpi_mod_list"
578 ac_cv_mpi_sflags="$mpi_sflags"
579 ac_cv_mpi_config_done="yes"
580 AC_MSG_RESULT(done)
581else
582 AC_MSG_RESULT(failed)
583 AC_MSG_ERROR([mpi/config.links missing!])
584fi
585MPI_MOD_LIST_LO=""
586MPI_MOD_LIST_O=""
587if test "$ac_cv_mpi_mod_list" != ""; then
588 for i in $ac_cv_mpi_mod_list; do
589 MPI_MOD_LIST_LO="$MPI_MOD_LIST_LO $i.lo"
590 MPI_MOD_LIST_O="$MPI_MOD_LIST_O $i.o"
591 done
592fi
593AC_SUBST(MPI_MOD_LIST_LO)
594AC_SUBST(MPI_MOD_LIST_O)
595MPI_SFLAGS="$ac_cv_mpi_sflags"
596AC_SUBST(MPI_SFLAGS)
597
598# Allow users to append something to the version string without
599# flagging it as development version. The user version part is
600# considered everything after a dash.
601changequote(,)#
602tmp_pat='[a-zA-Z]'
603changequote([,])#
604if echo "$VERSION" | sed 's/-.*//' | grep "$tmp_pat" >/dev/null ; then
605 AC_DEFINE(IS_DEVELOPMENT_VERSION,1,
606 [Defined if this is not a regular release])
607fi
608
609AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
610
611# We don't check for GNU make anymore - automake should not have the
612# old flaws anymore.
613#GNUPG_CHECK_GNUMAKE
614
615AC_ARG_ENABLE(gcc-warnings,
616 AC_HELP_STRING([--enable-gcc-warnings],
617 [enable more verbose gcc warnings]),
618 [more_gcc_warnings="$enableval"],
619 [more_gcc_warnings="no"])
620
621if test "$GCC" = yes; then
622 if test "$USE_MAINTAINER_MODE" = "yes" ||
623 test "$more_gcc_warnings" = "yes"; then
624 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
625 if test "$more_gcc_warnings" = "yes"; then
626 CFLAGS="$CFLAGS -W -Wpointer-arith -Wbad-function-cast"
627 CFLAGS="$CFLAGS -Wwrite-strings -Wunreachable-code"
628 CFLAGS="$CFLAGS -Wno-sign-compare"
629 fi
630 else
631 CFLAGS="$CFLAGS -Wall"
632 fi
633
634 # Non exec stack hack. Fixme: Write a test to check whether as
635 # can cope with it and use the enable-noexecstack option only to
636 # disable it in case it is required on some platforms.
637 if test "$noexecstack_support" = yes; then
638 NOEXECSTACK_FLAGS="-Wa,--noexecstack"
639 fi
640fi
641AC_SUBST(NOEXECSTACK_FLAGS)
642
643#
644# Make the version number in src/gcrypt.h the same as the one here.
645# (this is easier than to have a *.in file just for one substitution)
646#
647GNUPG_FIX_HDR_VERSION([src/gcrypt.h], GCRYPT_VERSION)
648
649AC_SUBST(LIBGCRYPT_CONFIG_API_VERSION)
650AC_SUBST(LIBGCRYPT_CONFIG_LIBS)
651AC_SUBST(LIBGCRYPT_CONFIG_CFLAGS)
652AC_SUBST(LIBGCRYPT_THREAD_MODULES)
653
654AC_CONFIG_COMMANDS([gcrypt-conf],[[
655chmod +x src/libgcrypt-config
656]],[[
657prefix=$prefix
658exec_prefix=$exec_prefix
659libdir=$libdir
660datadir=$datadir
661DATADIRNAME=$DATADIRNAME
662]])
663
664#####################
665#### Conclusion. ####
666#####################
667
668# Define conditional sources and config.h symbols depending on the
669# selected ciphers, pubkey-ciphers, digests and random modules.
670
671LIST_MEMBER(arcfour, $enabled_ciphers)
672test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS arcfour.lo"
673AC_DEFINE_UNQUOTED(USE_ARCFOUR, $found,
674 [Defined if this module should be included])
675
676LIST_MEMBER(blowfish, $enabled_ciphers)
677test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS blowfish.lo"
678AC_DEFINE_UNQUOTED(USE_BLOWFISH, $found,
679 [Defined if this module should be included])
680
681LIST_MEMBER(cast5, $enabled_ciphers)
682test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS cast5.lo"
683AC_DEFINE_UNQUOTED(USE_CAST5, $found,
684 [Defined if this module should be included])
685
686LIST_MEMBER(des, $enabled_ciphers)
687test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS des.lo"
688AC_DEFINE_UNQUOTED(USE_DES, $found,
689 [Defined if this module should be included])
690
691LIST_MEMBER(aes, $enabled_ciphers)
692test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS rijndael.lo"
693AC_DEFINE_UNQUOTED(USE_AES, $found,
694 [Defined if this module should be included])
695
696LIST_MEMBER(twofish, $enabled_ciphers)
697test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS twofish.lo"
698AC_DEFINE_UNQUOTED(USE_TWOFISH, $found,
699 [Defined if this module should be included])
700
701LIST_MEMBER(serpent, $enabled_ciphers)
702test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS serpent.lo"
703AC_DEFINE_UNQUOTED(USE_SERPENT, $found,
704 [Defined if this module should be included])
705
706LIST_MEMBER(rfc2268, $enabled_ciphers)
707test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS rfc2268.lo"
708AC_DEFINE_UNQUOTED(USE_RFC2268, $found,
709 [Defined if this module should be included])
710
711LIST_MEMBER(dsa, $enabled_pubkey_ciphers)
712test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS dsa.lo"
713AC_DEFINE_UNQUOTED(USE_DSA, $found,
714 [Defined if this module should be included])
715
716LIST_MEMBER(rsa, $enabled_pubkey_ciphers)
717test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS rsa.lo"
718AC_DEFINE_UNQUOTED(USE_RSA, $found,
719 [Defined if this module should be included])
720
721LIST_MEMBER(elgamal, $enabled_pubkey_ciphers)
722test "$found" = "1" \
723 && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS elgamal.lo"
724AC_DEFINE_UNQUOTED(USE_ELGAMAL, $found,
725 [Defined if this module should be included])
726
727LIST_MEMBER(crc, $enabled_digests)
728test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS crc.lo"
729AC_DEFINE_UNQUOTED(USE_CRC, $found,
730 [Defined if this module should be included])
731
732LIST_MEMBER(md4, $enabled_digests)
733test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md4.lo"
734AC_DEFINE_UNQUOTED(USE_MD4, $found,
735 [Defined if this module should be included])
736
737LIST_MEMBER(md5, $enabled_digests)
738test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md5.lo"
739AC_DEFINE_UNQUOTED(USE_MD5, $found,
740 [Defined if this module should be included])
741
742LIST_MEMBER(sha256, $enabled_digests)
743test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha256.lo"
744AC_DEFINE_UNQUOTED(USE_SHA256, $found,
745 [Defined if this module should be included])
746
747LIST_MEMBER(sha512, $enabled_digests)
748test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha512.lo"
749AC_DEFINE_UNQUOTED(USE_SHA512, $found,
750 [Defined if this module should be included])
751
752LIST_MEMBER(tiger, $enabled_digests)
753test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS tiger.lo"
754AC_DEFINE_UNQUOTED(USE_TIGER, $found,
755 [Defined if this module should be included])
756
757# rmd160 and sha1 should be included always.
758GCRYPT_DIGESTS="$GCRYPT_DIGESTS rmd160.lo sha1.lo"
759AC_DEFINE_UNQUOTED(USE_RMD160, 1, [Defined if this module should be included])
760AC_DEFINE_UNQUOTED(USE_SHA1, 1, [Defined if this module should be included])
761
762LIST_MEMBER(linux, $random_modules)
763test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndlinux.lo"
764AC_DEFINE_UNQUOTED(USE_RNDLINUX, $found,
765 [Defined if the /dev/random based RNG should be used.])
766
767
768LIST_MEMBER(unix, $random_modules)
769test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndunix.lo"
770AC_DEFINE_UNQUOTED(USE_RNDUNIX, $found,
771 [Defined if the default Unix RNG should be used.])
772if test "$found" = "1"; then
773 print_egd_notice=yes
774fi
775
776LIST_MEMBER(egd, $random_modules)
777test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndegd.lo"
778AC_DEFINE_UNQUOTED(USE_RNDEGD, $found,
779 [Defined if the EGD based RNG should be used.])
780
781LIST_MEMBER(w32, $random_modules)
782test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndw32.lo"
783AC_DEFINE_UNQUOTED(USE_RNDW32, $found,
784 [Defined if the Windows specific RNG should be used.])
785
786AC_SUBST([GCRYPT_CIPHERS])
787AC_SUBST([GCRYPT_PUBKEY_CIPHERS])
788AC_SUBST([GCRYPT_DIGESTS])
789AC_SUBST([GCRYPT_RANDOM])
790
791AC_SUBST(LIBGCRYPT_CIPHERS, $enabled_ciphers)
792AC_SUBST(LIBGCRYPT_PUBKEY_CIPHERS, $enabled_pubkey_ciphers)
793AC_SUBST(LIBGCRYPT_DIGESTS, $enabled_digests)
794
795AC_CONFIG_FILES([
796Makefile
797mpi/Makefile
798cipher/Makefile
799doc/Makefile
800src/Makefile
801src/libgcrypt-config
802tests/Makefile
803w32-dll/Makefile
804])
805AC_OUTPUT
806
807# Give some feedback
808echo
809
810if test "$print_egd_notice" = "yes"; then
811cat <<G10EOF
812
813 The performance of the Unix random gatherer module (rndunix) is not
814 very good and it does not keep the entropy pool over multiple
815 invocations of GnuPG. The suggested way to overcome this problem is
816 to use the
817
818 Entropy Gathering Daemon (EGD)
819
820 which provides a entropy source for the whole system. It is written
821 in Perl and available at the GnuPG FTP servers. To enable EGD you
822 should rerun configure with the option "--enable-static-rnd=egd".
823 For more information consult the GnuPG webpages:
824
825 http://www.gnupg.org/download.html#egd
826
827G10EOF
828fi
829
830warn=""
831for file in "random_modules"; do
832 case "$file" in rndunix | rndw32) warn="$warn $file";; esac
833done
834if test -n "$warn"; then
835 echo "Please note that you are building a version of Libgcrypt with"
836 echo " $warn"
837 echo "included. These parts are licensed under the GPL and thus the"
838 echo "use of this library has to comply with the conditions of the GPL."
839fi
840
841# Give some feedback
842echo " Configured for: $PRINTABLE_OS_NAME ($target)"
843echo