Added SILC Thread Queue API
[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
26 case "$host_cpu" in
27   i?86)
28     AC_DEFINE([SILC_SHA256_X86], [], [SILC_SHA256_X86])
29
30     if test "${pic_mode:-default}" != "yes" ; then
31       # Don't enable ASM AES with shared libs as the code doesn't support PIC.
32       if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
33         aes_asm=true
34         AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
35       fi
36     fi
37     ;;
38   x86_64)
39
40     if test "${pic_mode:-default}" != "yes" ; then
41       if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
42         aes_asm=true
43         AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
44       fi
45     fi
46     ;;
47   default)
48     aes_asm=false
49     ;;
50 esac
51
52 SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fno-regmove)
53 if test x$summary_debug = xno -a x$want_cc_optimizations = xtrue; then
54   SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fomit-frame-pointer -O3)
55 fi
56
57 AC_SUBST(SILC_CRYPTO_CFLAGS)
58
59 AC_CONFIG_FILES(
60 lib/silccrypt/Makefile
61 #ifdef SILC_DIST_INPLACE
62 lib/silccrypt/tests/Makefile
63 #endif SILC_DIST_INPLACE
64 )
65
66 fi      # compile_libs
67
68 # AM_CONDITIONAL is so bad that it itself cannot be defined in conditional
69 AM_CONDITIONAL(SILC_AES_ASM, test x$aes_asm = xtrue)
70
71 #endif SILC_DIST_CRYPTO