TomsFastMath support, performs at 80% GMP performance...
[xonotic/d0_blind_id.git] / configure.ac
1 AC_INIT([d0_blind_id],[0.5],[divVerent@xonotic.org])
2 AC_CONFIG_MACRO_DIR([m4])
3 AM_INIT_AUTOMAKE([-Wall foreign])
4 AC_PROG_CC
5 AM_PROG_AR
6 LT_INIT
7
8 AC_ARG_WITH(openssl, AS_HELP_STRING([--with-openssl], [Use OpenSSL instead of GMP (beware of the OpenSSL license)]), [with_openssl=$withval], [with_openssl=no])
9 AC_ARG_WITH(tommath, AS_HELP_STRING([--with-tommath], [Use libtommath instead of GMP (slow, but WTFPL)]), [with_tommath=$withval], [with_tommath=no])
10 AC_ARG_WITH(tfm, AS_HELP_STRING([--with-tfm], [Use tfm (TomsFastMath) instead of GMP (PD)]), [with_tfm=$withval], [with_tfm=no])
11 AM_CONDITIONAL(WITH_OPENSSL, [test x"$with_openssl" != xno])
12 AM_CONDITIONAL(WITH_TOMMATH, [test x"$with_tommath" != xno])
13 AM_CONDITIONAL(WITH_TOMSFASTMATH, [test x"$with_tfm" != xno])
14
15 AS_IF([test x"$with_tommath" != xno],
16         [AC_SEARCH_LIBS(mp_init, tommath, ,
17                 [AC_MSG_ERROR([libtommath not found, see http://www.libtom.org/, or try --without-tommath])])],
18         [AS_IF([test x"$with_tfm" != xno],
19                 [AC_SEARCH_LIBS(fp_ident, tfm, ,
20                         [AC_MSG_ERROR([libtfm not found, see http://www.libtom.org/, or try --without-tfm])])],
21                 [AS_IF([test x"$with_openssl" != xno],
22                         [AC_SEARCH_LIBS(BN_init, crypto, ,
23                                 [AC_MSG_ERROR([OpenSSL not found, see http://www.openssl.org/, or try --without-openssl])])],
24                         [AC_SEARCH_LIBS(__gmpz_init, gmp, ,
25                                 [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/, or try --with-openssl])])])])])
26
27 AC_ARG_ENABLE(rijndael, AS_HELP_STRING([--disable-rijndael], [Disable build of the d0_rijndael library]), [enable_aes=$enableval], [enable_aes=yes])
28
29 AS_IF([test -f "$srcdir/d0_rijndael.c"], [], [AS_IF([test x"$enable_aes" != xno], [AC_MSG_ERROR([d0_rijndael.c is missing, try --disable-rijndael or download the full version of this library, but beware of crypto import laws then])])])
30 AM_CONDITIONAL(ENABLE_RIJNDAEL, [test x$enable_aes = xyes])
31
32 AC_CONFIG_FILES([Makefile d0_blind_id.pc d0_rijndael.pc])
33
34 AC_OUTPUT