Update SoftHSM v2.0 to the latest version
[aaf/sshsm.git] / SoftHSMv2 / m4 / acx_botan_aes_gcm.m4
1 AC_DEFUN([ACX_BOTAN_AES_GCM],[
2         AC_MSG_CHECKING(for Botan AES GCM support)
3
4         tmp_CPPFLAGS=$CPPFLAGS
5         tmp_LIBS=$LIBS
6
7         CPPFLAGS="$CPPFLAGS $CRYPTO_INCLUDES"
8         LIBS="$CRYPTO_LIBS $LIBS"
9
10         AC_LANG_PUSH([C++])
11         AC_CACHE_VAL([acx_cv_lib_botan_aes_gcm_support],[
12                 acx_cv_lib_botan_aes_gcm_support=no
13                 AC_COMPILE_IFELSE([
14                         AC_LANG_SOURCE([[
15                                 #include <botan/botan.h>
16                                 #include <botan/version.h>
17                                 int main()
18                                 {
19                                         using namespace Botan;
20
21 #if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(2,0,0)
22                                         return 0;
23 #else
24 #error "Botan too old"
25 #endif
26                                 }
27                         ]])
28                 ],[
29                         AC_MSG_RESULT([Found AES GCM])
30                         acx_cv_lib_botan_aes_gcm_support=yes
31                 ],[
32                         AC_MSG_RESULT([Cannot find AES GCM support, upgrade to Botan >= v2.0.0])
33                 ])
34         ])
35         AC_LANG_POP([C++])
36         if test "x$acx_cv_lib_botan_aes_gcm_support" = xyes; then
37                 AC_DEFINE([WITH_AES_GCM], [1],
38                           [Compile with AES GCM])
39         fi
40
41         CPPFLAGS=$tmp_CPPFLAGS
42         LIBS=$tmp_LIBS
43 ])