diff options
author | Jay Threeth | 2011-04-04 11:48:26 -0700 |
---|---|---|
committer | Jay Threeth | 2011-04-04 11:48:26 -0700 |
commit | 3c9cc506f741b980565ff5b3b001cd8b6ee36b12 (patch) | |
tree | cb862c57b3d5f74177cde3bd962a53fc377166f6 /linden/indra/libgcrypt/libgcrypt-1.2.2/configure.ac | |
parent | build fixes, might build on linux now (diff) | |
download | meta-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-x | linden/indra/libgcrypt/libgcrypt-1.2.2/configure.ac | 843 |
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.) | ||
22 | AC_REVISION($Revision: 1119 $) | ||
23 | AC_PREREQ(2.59) | ||
24 | min_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 | |||
30 | AC_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++) | ||
36 | LIBGCRYPT_LT_CURRENT=13 | ||
37 | LIBGCRYPT_LT_AGE=2 | ||
38 | LIBGCRYPT_LT_REVISION=1 | ||
39 | |||
40 | # If the API is changed in an incompatible way: increment the next counter. | ||
41 | LIBGCRYPT_CONFIG_API_VERSION=1 | ||
42 | |||
43 | NEED_GPG_ERROR_VERSION=0.5 | ||
44 | |||
45 | |||
46 | PACKAGE=$PACKAGE_NAME | ||
47 | VERSION=$PACKAGE_VERSION | ||
48 | |||
49 | AC_CONFIG_SRCDIR([src/gcrypt.h]) | ||
50 | AC_CANONICAL_TARGET() | ||
51 | AM_INIT_AUTOMAKE($PACKAGE, $VERSION) | ||
52 | AM_CONFIG_HEADER(config.h) | ||
53 | AM_MAINTAINER_MODE | ||
54 | |||
55 | AH_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 | |||
61 | AH_BOTTOM([ | ||
62 | #define _GCRYPT_IN_LIBGCRYPT 1 | ||
63 | ]) | ||
64 | |||
65 | AH_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 | |||
73 | AC_SUBST(LIBGCRYPT_LT_CURRENT) | ||
74 | AC_SUBST(LIBGCRYPT_LT_AGE) | ||
75 | AC_SUBST(LIBGCRYPT_LT_REVISION) | ||
76 | AC_SUBST(PACKAGE) | ||
77 | AC_SUBST(VERSION) | ||
78 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package]) | ||
79 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) | ||
80 | |||
81 | |||
82 | AC_PROG_MAKE_SET | ||
83 | missing_dir=`cd $ac_aux_dir && pwd` | ||
84 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | ||
85 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | ||
86 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | ||
87 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | ||
88 | # AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | ||
89 | AC_PROG_CC | ||
90 | AC_PROG_CPP | ||
91 | AM_PROG_AS | ||
92 | AC_ISC_POSIX | ||
93 | AC_PROG_INSTALL | ||
94 | AC_PROG_AWK | ||
95 | |||
96 | AM_PROG_LIBTOOL | ||
97 | |||
98 | ########################## | ||
99 | ## General definitions. ## | ||
100 | ########################## | ||
101 | |||
102 | # Used by libgcrypt-config | ||
103 | LIBGCRYPT_CONFIG_LIBS="-lgcrypt" | ||
104 | LIBGCRYPT_CONFIG_CFLAGS="" | ||
105 | |||
106 | # Definitions for symmetric ciphers. | ||
107 | available_ciphers="arcfour blowfish cast5 des aes twofish serpent rfc2268" | ||
108 | enabled_ciphers="" | ||
109 | |||
110 | # Definitions for public-key ciphers. | ||
111 | available_pubkey_ciphers="dsa elgamal rsa" | ||
112 | enabled_pubkey_ciphers="" | ||
113 | |||
114 | # Definitions for message digests. | ||
115 | available_digests="crc md4 md5 rmd160 sha1 sha256" | ||
116 | available_digests_64="sha512 tiger" | ||
117 | enabled_digests="" | ||
118 | |||
119 | # Definitions for random modules. | ||
120 | available_random_modules="linux egd unix" | ||
121 | auto_random_modules="$available_random_modules" | ||
122 | |||
123 | # Supported thread backends. | ||
124 | LIBGCRYPT_THREAD_MODULES="" | ||
125 | |||
126 | # Other definitions. | ||
127 | print_egd_notice=no | ||
128 | |||
129 | # Setup some stuff depending on host/target. | ||
130 | case "${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 | ;; | ||
180 | esac | ||
181 | |||
182 | # A printable OS Name is sometime useful. | ||
183 | case "${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 | ;; | ||
203 | esac | ||
204 | |||
205 | |||
206 | case "${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 | ;; | ||
230 | esac | ||
231 | |||
232 | |||
233 | AC_C_BIGENDIAN | ||
234 | |||
235 | AC_CHECK_SIZEOF(unsigned short, 2) | ||
236 | AC_CHECK_SIZEOF(unsigned int, 4) | ||
237 | AC_CHECK_SIZEOF(unsigned long, 4) | ||
238 | AC_CHECK_SIZEOF(unsigned long long, 0) | ||
239 | |||
240 | if 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]); | ||
244 | fi | ||
245 | |||
246 | # Do we have any 64-bit data types? | ||
247 | if 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]) | ||
252 | else | ||
253 | available_digests="$available_digests $available_digests_64" | ||
254 | fi | ||
255 | |||
256 | # If not specified otherwise, all available algorithms will be | ||
257 | # included. | ||
258 | default_ciphers="$available_ciphers" | ||
259 | default_pubkey_ciphers="$available_pubkey_ciphers" | ||
260 | default_digests="$available_digests" | ||
261 | |||
262 | ############################ | ||
263 | ## Command line switches. ## | ||
264 | ############################ | ||
265 | |||
266 | # Implementation of the --enable-ciphers switch. | ||
267 | AC_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=""]) | ||
272 | if test "x$enabled_ciphers" = "x" \ | ||
273 | -o "$enabled_ciphers" = "yes" \ | ||
274 | -o "$enabled_ciphers" = "no"; then | ||
275 | enabled_ciphers=$default_ciphers | ||
276 | fi | ||
277 | AC_MSG_CHECKING([which symmetric ciphers to include]) | ||
278 | for 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 | ||
283 | done | ||
284 | AC_MSG_RESULT([$enabled_ciphers]) | ||
285 | |||
286 | # Implementation of the --enable-pubkey-ciphers switch. | ||
287 | AC_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=""]) | ||
292 | if 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 | ||
296 | fi | ||
297 | AC_MSG_CHECKING([which public-key ciphers to include]) | ||
298 | for 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 | ||
303 | done | ||
304 | AC_MSG_RESULT([$enabled_pubkey_ciphers]) | ||
305 | |||
306 | # Implementation of the --enable-digests switch. | ||
307 | AC_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=""]) | ||
312 | if test "x$enabled_digests" = "x" \ | ||
313 | -o "$enabled_digests" = "yes" \ | ||
314 | -o "$enabled_digests" = "no"; then | ||
315 | enabled_digests=$default_digests | ||
316 | fi | ||
317 | AC_MSG_CHECKING([which message digests to include]) | ||
318 | for 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 | ||
323 | done | ||
324 | AC_MSG_RESULT([$enabled_digests]) | ||
325 | |||
326 | # Implementation of the --enable-random switch. | ||
327 | AC_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 | []) | ||
332 | if test "x$random" = "x" -o "$random" = "yes" -o "$random" = "no"; then | ||
333 | random=default | ||
334 | fi | ||
335 | AC_MSG_CHECKING([which random module to use]) | ||
336 | if 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 | ||
341 | fi | ||
342 | AC_MSG_RESULT($random) | ||
343 | |||
344 | # Implementation of the --disable-dev-random switch. | ||
345 | AC_MSG_CHECKING([whether use of /dev/random is requested]) | ||
346 | AC_ARG_ENABLE(dev-random, | ||
347 | [ --disable-dev-random disable the use of dev random], | ||
348 | try_dev_random=$enableval, try_dev_random=yes) | ||
349 | AC_MSG_RESULT($try_dev_random) | ||
350 | |||
351 | # Implementation of the --with-egd-socket switch. | ||
352 | AC_ARG_WITH(egd-socket, | ||
353 | [ --with-egd-socket=NAME Use NAME for the EGD socket)], | ||
354 | egd_socket_name="$withval", egd_socket_name="" ) | ||
355 | AC_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. | ||
360 | AC_MSG_CHECKING([whether assembler modules are requested]) | ||
361 | AC_ARG_ENABLE([asm], | ||
362 | AC_HELP_STRING([--disable-asm], | ||
363 | [Disable assembler modules]), | ||
364 | [try_asm_modules=$enableval], | ||
365 | [try_asm_modules=yes]) | ||
366 | AC_MSG_RESULT($try_asm_modules) | ||
367 | |||
368 | # Implementation of the --enable-m-guard switch. | ||
369 | AC_MSG_CHECKING([whether memory guard is requested]) | ||
370 | AC_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) | ||
374 | if test "$use_m_guard" = yes ; then | ||
375 | AC_DEFINE(M_GUARD,1,[Define to use the (obsolete) malloc guarding feature]) | ||
376 | fi | ||
377 | |||
378 | # Implementation of the --with-capabilities switch. | ||
379 | # Check whether we want to use Linux capabilities | ||
380 | AC_MSG_CHECKING([whether use of capabilities is requested]) | ||
381 | AC_ARG_WITH(capabilities, | ||
382 | [ --with-capabilities use linux capabilities [default=no]], | ||
383 | [use_capabilities="$withval"],[use_capabilities=no]) | ||
384 | AC_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. | ||
388 | AC_MSG_CHECKING([whether non excutable stack support is requested]) | ||
389 | AC_ARG_ENABLE(noexecstack, | ||
390 | AC_HELP_STRING([--enable-noexecstack], | ||
391 | [enable non executable stack support (gcc only)]), | ||
392 | noexecstack_support=$enableval, noexecstack_support=no) | ||
393 | AC_MSG_RESULT($noexecstack_support) | ||
394 | |||
395 | |||
396 | |||
397 | AC_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. | ||
402 | have_ld_version_script=no | ||
403 | case "${host}" in | ||
404 | *-*-linux*) | ||
405 | have_ld_version_script=yes | ||
406 | ;; | ||
407 | *-*-gnu*) | ||
408 | have_ld_version_script=yes | ||
409 | ;; | ||
410 | esac | ||
411 | AC_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 | [ : ] ) | ||
417 | AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") | ||
418 | |||
419 | AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM", | ||
420 | [defined to the name of the strong random device]) | ||
421 | AC_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 | |||
428 | AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION") | ||
429 | if test "x$GPG_ERROR_LIBS" = "x"; then | ||
430 | AC_MSG_ERROR([libgpg-error is needed. | ||
431 | See ftp://ftp.gnupg.org/gcrypt/libgpg-error/ .]) | ||
432 | fi | ||
433 | |||
434 | AC_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. | ||
439 | AC_CHECK_LIB(nsl, gethostbyname) | ||
440 | AC_CHECK_LIB(socket, socket, ac_need_libsocket=1, ac_try_nsl=1) | ||
441 | if test x$ac_need_libsocket = x1; then | ||
442 | LIBS="$LIBS -lsocket" | ||
443 | fi | ||
444 | if 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 | ||
450 | fi | ||
451 | |||
452 | ################################## | ||
453 | #### Checks for header files. #### | ||
454 | ################################## | ||
455 | |||
456 | AC_HEADER_STDC | ||
457 | AC_CHECK_HEADERS(unistd.h sys/select.h) | ||
458 | |||
459 | ########################################## | ||
460 | #### Checks for typedefs, structures, #### | ||
461 | #### and compiler characteristics. #### | ||
462 | ########################################## | ||
463 | |||
464 | AC_C_CONST | ||
465 | AC_C_INLINE | ||
466 | AC_TYPE_SIZE_T | ||
467 | AC_TYPE_SIGNAL | ||
468 | AC_DECL_SYS_SIGLIST | ||
469 | |||
470 | GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF) | ||
471 | GNUPG_CHECK_TYPEDEF(ushort, HAVE_USHORT_TYPEDEF) | ||
472 | GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF) | ||
473 | GNUPG_CHECK_TYPEDEF(u16, HAVE_U16_TYPEDEF) | ||
474 | GNUPG_CHECK_TYPEDEF(u32, HAVE_U32_TYPEDEF) | ||
475 | |||
476 | AC_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 | |||
489 | AC_FUNC_VPRINTF | ||
490 | # We have replacements for these in src/missing-string.c | ||
491 | AC_CHECK_FUNCS(stpcpy strcasecmp) | ||
492 | # We have replacements for these in src/g10lib.h | ||
493 | AC_CHECK_FUNCS(strtoul memmove stricmp atexit raise) | ||
494 | # Other checks | ||
495 | AC_CHECK_FUNCS(strerror rand mmap getpagesize waitpid wait4) | ||
496 | AC_CHECK_FUNCS(gettimeofday getrusage gethrtime clock_gettime) | ||
497 | |||
498 | GNUPG_CHECK_MLOCK | ||
499 | |||
500 | # Check whether we can use Linux capabilities as requested. | ||
501 | if test "$use_capabilities" = "yes" ; then | ||
502 | use_capabilities=no | ||
503 | AC_CHECK_HEADERS(sys/capability.h) | ||
504 | if 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 | ||
512 | fi | ||
513 | if 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 | ***]]) | ||
524 | fi | ||
525 | fi | ||
526 | |||
527 | # Check whether a random device is available. | ||
528 | if 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 | ||
536 | else | ||
537 | AC_MSG_CHECKING(for random device) | ||
538 | ac_cv_have_dev_random=no | ||
539 | AC_MSG_RESULT(has been disabled) | ||
540 | fi | ||
541 | |||
542 | # Figure out the random modules for this configuration. | ||
543 | if 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 | ||
561 | else | ||
562 | if test "$random" = "auto"; then | ||
563 | # Build everything, allow to select at runtime. | ||
564 | random_modules="$auto_random_modules" | ||
565 | fi | ||
566 | fi | ||
567 | |||
568 | |||
569 | # | ||
570 | # Setup assembler stuff. | ||
571 | # | ||
572 | GNUPG_SYS_SYMBOL_UNDERSCORE() | ||
573 | AC_MSG_CHECKING(for mpi assembler functions) | ||
574 | if 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) | ||
581 | else | ||
582 | AC_MSG_RESULT(failed) | ||
583 | AC_MSG_ERROR([mpi/config.links missing!]) | ||
584 | fi | ||
585 | MPI_MOD_LIST_LO="" | ||
586 | MPI_MOD_LIST_O="" | ||
587 | if 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 | ||
592 | fi | ||
593 | AC_SUBST(MPI_MOD_LIST_LO) | ||
594 | AC_SUBST(MPI_MOD_LIST_O) | ||
595 | MPI_SFLAGS="$ac_cv_mpi_sflags" | ||
596 | AC_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. | ||
601 | changequote(,)# | ||
602 | tmp_pat='[a-zA-Z]' | ||
603 | changequote([,])# | ||
604 | if 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]) | ||
607 | fi | ||
608 | |||
609 | AM_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 | |||
615 | AC_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 | |||
621 | if 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 | ||
640 | fi | ||
641 | AC_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 | # | ||
647 | GNUPG_FIX_HDR_VERSION([src/gcrypt.h], GCRYPT_VERSION) | ||
648 | |||
649 | AC_SUBST(LIBGCRYPT_CONFIG_API_VERSION) | ||
650 | AC_SUBST(LIBGCRYPT_CONFIG_LIBS) | ||
651 | AC_SUBST(LIBGCRYPT_CONFIG_CFLAGS) | ||
652 | AC_SUBST(LIBGCRYPT_THREAD_MODULES) | ||
653 | |||
654 | AC_CONFIG_COMMANDS([gcrypt-conf],[[ | ||
655 | chmod +x src/libgcrypt-config | ||
656 | ]],[[ | ||
657 | prefix=$prefix | ||
658 | exec_prefix=$exec_prefix | ||
659 | libdir=$libdir | ||
660 | datadir=$datadir | ||
661 | DATADIRNAME=$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 | |||
671 | LIST_MEMBER(arcfour, $enabled_ciphers) | ||
672 | test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS arcfour.lo" | ||
673 | AC_DEFINE_UNQUOTED(USE_ARCFOUR, $found, | ||
674 | [Defined if this module should be included]) | ||
675 | |||
676 | LIST_MEMBER(blowfish, $enabled_ciphers) | ||
677 | test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS blowfish.lo" | ||
678 | AC_DEFINE_UNQUOTED(USE_BLOWFISH, $found, | ||
679 | [Defined if this module should be included]) | ||
680 | |||
681 | LIST_MEMBER(cast5, $enabled_ciphers) | ||
682 | test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS cast5.lo" | ||
683 | AC_DEFINE_UNQUOTED(USE_CAST5, $found, | ||
684 | [Defined if this module should be included]) | ||
685 | |||
686 | LIST_MEMBER(des, $enabled_ciphers) | ||
687 | test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS des.lo" | ||
688 | AC_DEFINE_UNQUOTED(USE_DES, $found, | ||
689 | [Defined if this module should be included]) | ||
690 | |||
691 | LIST_MEMBER(aes, $enabled_ciphers) | ||
692 | test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS rijndael.lo" | ||
693 | AC_DEFINE_UNQUOTED(USE_AES, $found, | ||
694 | [Defined if this module should be included]) | ||
695 | |||
696 | LIST_MEMBER(twofish, $enabled_ciphers) | ||
697 | test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS twofish.lo" | ||
698 | AC_DEFINE_UNQUOTED(USE_TWOFISH, $found, | ||
699 | [Defined if this module should be included]) | ||
700 | |||
701 | LIST_MEMBER(serpent, $enabled_ciphers) | ||
702 | test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS serpent.lo" | ||
703 | AC_DEFINE_UNQUOTED(USE_SERPENT, $found, | ||
704 | [Defined if this module should be included]) | ||
705 | |||
706 | LIST_MEMBER(rfc2268, $enabled_ciphers) | ||
707 | test "$found" = "1" && GCRYPT_CIPHERS="$GCRYPT_CIPHERS rfc2268.lo" | ||
708 | AC_DEFINE_UNQUOTED(USE_RFC2268, $found, | ||
709 | [Defined if this module should be included]) | ||
710 | |||
711 | LIST_MEMBER(dsa, $enabled_pubkey_ciphers) | ||
712 | test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS dsa.lo" | ||
713 | AC_DEFINE_UNQUOTED(USE_DSA, $found, | ||
714 | [Defined if this module should be included]) | ||
715 | |||
716 | LIST_MEMBER(rsa, $enabled_pubkey_ciphers) | ||
717 | test "$found" = "1" && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS rsa.lo" | ||
718 | AC_DEFINE_UNQUOTED(USE_RSA, $found, | ||
719 | [Defined if this module should be included]) | ||
720 | |||
721 | LIST_MEMBER(elgamal, $enabled_pubkey_ciphers) | ||
722 | test "$found" = "1" \ | ||
723 | && GCRYPT_PUBKEY_CIPHERS="$GCRYPT_PUBKEY_CIPHERS elgamal.lo" | ||
724 | AC_DEFINE_UNQUOTED(USE_ELGAMAL, $found, | ||
725 | [Defined if this module should be included]) | ||
726 | |||
727 | LIST_MEMBER(crc, $enabled_digests) | ||
728 | test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS crc.lo" | ||
729 | AC_DEFINE_UNQUOTED(USE_CRC, $found, | ||
730 | [Defined if this module should be included]) | ||
731 | |||
732 | LIST_MEMBER(md4, $enabled_digests) | ||
733 | test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md4.lo" | ||
734 | AC_DEFINE_UNQUOTED(USE_MD4, $found, | ||
735 | [Defined if this module should be included]) | ||
736 | |||
737 | LIST_MEMBER(md5, $enabled_digests) | ||
738 | test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS md5.lo" | ||
739 | AC_DEFINE_UNQUOTED(USE_MD5, $found, | ||
740 | [Defined if this module should be included]) | ||
741 | |||
742 | LIST_MEMBER(sha256, $enabled_digests) | ||
743 | test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha256.lo" | ||
744 | AC_DEFINE_UNQUOTED(USE_SHA256, $found, | ||
745 | [Defined if this module should be included]) | ||
746 | |||
747 | LIST_MEMBER(sha512, $enabled_digests) | ||
748 | test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS sha512.lo" | ||
749 | AC_DEFINE_UNQUOTED(USE_SHA512, $found, | ||
750 | [Defined if this module should be included]) | ||
751 | |||
752 | LIST_MEMBER(tiger, $enabled_digests) | ||
753 | test "$found" = "1" && GCRYPT_DIGESTS="$GCRYPT_DIGESTS tiger.lo" | ||
754 | AC_DEFINE_UNQUOTED(USE_TIGER, $found, | ||
755 | [Defined if this module should be included]) | ||
756 | |||
757 | # rmd160 and sha1 should be included always. | ||
758 | GCRYPT_DIGESTS="$GCRYPT_DIGESTS rmd160.lo sha1.lo" | ||
759 | AC_DEFINE_UNQUOTED(USE_RMD160, 1, [Defined if this module should be included]) | ||
760 | AC_DEFINE_UNQUOTED(USE_SHA1, 1, [Defined if this module should be included]) | ||
761 | |||
762 | LIST_MEMBER(linux, $random_modules) | ||
763 | test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndlinux.lo" | ||
764 | AC_DEFINE_UNQUOTED(USE_RNDLINUX, $found, | ||
765 | [Defined if the /dev/random based RNG should be used.]) | ||
766 | |||
767 | |||
768 | LIST_MEMBER(unix, $random_modules) | ||
769 | test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndunix.lo" | ||
770 | AC_DEFINE_UNQUOTED(USE_RNDUNIX, $found, | ||
771 | [Defined if the default Unix RNG should be used.]) | ||
772 | if test "$found" = "1"; then | ||
773 | print_egd_notice=yes | ||
774 | fi | ||
775 | |||
776 | LIST_MEMBER(egd, $random_modules) | ||
777 | test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndegd.lo" | ||
778 | AC_DEFINE_UNQUOTED(USE_RNDEGD, $found, | ||
779 | [Defined if the EGD based RNG should be used.]) | ||
780 | |||
781 | LIST_MEMBER(w32, $random_modules) | ||
782 | test "$found" = "1" && GCRYPT_RANDOM="$GCRYPT_RANDOM rndw32.lo" | ||
783 | AC_DEFINE_UNQUOTED(USE_RNDW32, $found, | ||
784 | [Defined if the Windows specific RNG should be used.]) | ||
785 | |||
786 | AC_SUBST([GCRYPT_CIPHERS]) | ||
787 | AC_SUBST([GCRYPT_PUBKEY_CIPHERS]) | ||
788 | AC_SUBST([GCRYPT_DIGESTS]) | ||
789 | AC_SUBST([GCRYPT_RANDOM]) | ||
790 | |||
791 | AC_SUBST(LIBGCRYPT_CIPHERS, $enabled_ciphers) | ||
792 | AC_SUBST(LIBGCRYPT_PUBKEY_CIPHERS, $enabled_pubkey_ciphers) | ||
793 | AC_SUBST(LIBGCRYPT_DIGESTS, $enabled_digests) | ||
794 | |||
795 | AC_CONFIG_FILES([ | ||
796 | Makefile | ||
797 | mpi/Makefile | ||
798 | cipher/Makefile | ||
799 | doc/Makefile | ||
800 | src/Makefile | ||
801 | src/libgcrypt-config | ||
802 | tests/Makefile | ||
803 | w32-dll/Makefile | ||
804 | ]) | ||
805 | AC_OUTPUT | ||
806 | |||
807 | # Give some feedback | ||
808 | echo | ||
809 | |||
810 | if test "$print_egd_notice" = "yes"; then | ||
811 | cat <<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 | |||
827 | G10EOF | ||
828 | fi | ||
829 | |||
830 | warn="" | ||
831 | for file in "random_modules"; do | ||
832 | case "$file" in rndunix | rndw32) warn="$warn $file";; esac | ||
833 | done | ||
834 | if 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." | ||
839 | fi | ||
840 | |||
841 | # Give some feedback | ||
842 | echo " Configured for: $PRINTABLE_OS_NAME ($target)" | ||
843 | echo | ||