Added assembler AES for x86 and x86_64.
[silc.git] / lib / silccrypt / configure.ad
1 #
2 #  lib/silccrypt/configure.ad
3 #
4 #  Author: Pekka Riikonen <priikone@silcnet.org>
5 #
6 #  Copyright (C) 2006 Pekka Riikonen
7 #
8 #  This program is free software; you can redistribute it and/or modify
9 #  it under the terms of the GNU General Public License as published by
10 #  the Free Software Foundation; version 2 of the License.
11 #
12 #  This program 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 General Public License for more details.
16 #
17
18 if test x$compile_libs = xtrue; then
19
20 AC_MSG_NOTICE([configuring crypto library])
21 SILC_CRYPTO_CFLAGS=
22
23 aes_asm=false
24 case "$host_cpu" in
25   i?86)
26     if test x$have_assembler = xtrue; then
27       aes_asm=true
28       AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
29     fi
30     ;;
31   x86_64)
32     if test x$have_assembler = xtrue; then
33       aes_asm=true
34       AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
35     fi
36     ;;
37   default)
38     aes_asm=false
39     ;;
40 esac
41 AM_CONDITIONAL(SILC_AES_ASM, test x$aes_asm = xtrue)
42
43 SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fno-regmove)
44 if test x$summary_debug = xno; then
45   SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fomit-frame-pointer -O3)
46 fi
47
48 AC_SUBST(SILC_CRYPTO_CFLAGS)
49
50 AC_CONFIG_FILES(
51 lib/silccrypt/Makefile
52 #ifdef SILC_DIST_INPLACE
53 lib/silccrypt/tests/Makefile
54 #endif SILC_DIST_INPLACE
55 )
56
57 fi      # compile_libs