Sun Mar 11 15:22:42 CET 2007 Jochen Eisinger <coffee@silcnet.org>
[silc.git] / lib / silccrypt / configure.ad
1 #ifdef SILC_DIST_CRYPTO
2 #
3 #  lib/silccrypt/configure.ad
4 #
5 #  Author: Pekka Riikonen <priikone@silcnet.org>
6 #
7 #  Copyright (C) 2006 - 2007 Pekka Riikonen
8 #
9 #  This program is free software; you can redistribute it and/or modify
10 #  it under the terms of the GNU General Public License as published by
11 #  the Free Software Foundation; version 2 of the License.
12 #
13 #  This program is distributed in the hope that it will be useful,
14 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 #  GNU General Public License for more details.
17 #
18
19 if test x$compile_libs = xtrue; then
20
21 AC_MSG_NOTICE([configuring crypto library])
22 SILC_CRYPTO_CFLAGS=
23
24 aes_asm=false
25 case "$host_cpu" in
26   i?86)
27     # Don't enable ASM AES with shared libs as the code doesn't support PIC.
28     if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
29       aes_asm=true
30       AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
31     fi
32     ;;
33   x86_64)
34     if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
35       aes_asm=true
36       AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
37     fi
38     ;;
39   default)
40     aes_asm=false
41     ;;
42 esac
43
44 SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fno-regmove)
45 if test x$summary_debug = xno; then
46   SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fomit-frame-pointer -O3)
47 fi
48
49 AC_SUBST(SILC_CRYPTO_CFLAGS)
50
51 AC_CONFIG_FILES(
52 lib/silccrypt/Makefile
53 #ifdef SILC_DIST_INPLACE
54 lib/silccrypt/tests/Makefile
55 #endif SILC_DIST_INPLACE
56 )
57
58 fi      # compile_libs
59
60 # AM_CONDITIONAL is so bad that it itself cannot be defined in conditional
61 AM_CONDITIONAL(SILC_AES_ASM, test x$aes_asm = xtrue)
62
63 #endif SILC_DIST_CRYPTO