]> git.xonotic.org Git - xonotic/d0_blind_id.git/blob - configure.ac
Merge branch 'little_update' into 'master'
[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 # automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
6 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
7 LT_INIT
8
9 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])
10 AC_ARG_WITH(tommath, AS_HELP_STRING([--with-tommath], [Use libtommath instead of GMP (slow, but WTFPL)]), [with_tommath=$withval], [with_tommath=no])
11 AC_ARG_WITH(tfm, AS_HELP_STRING([--with-tfm], [Use tfm (TomsFastMath) instead of GMP (PD)]), [with_tfm=$withval], [with_tfm=no])
12 AM_CONDITIONAL(WITH_OPENSSL, [test x"$with_openssl" != xno])
13 AM_CONDITIONAL(WITH_TOMMATH, [test x"$with_tommath" != xno])
14 AM_CONDITIONAL(WITH_TOMSFASTMATH, [test x"$with_tfm" != xno])
15 AC_CHECK_FUNCS(explicit_bzero memset_s)
16
17 AS_IF([test x"$with_tommath" != xno],
18         [AC_SEARCH_LIBS(mp_init, tommath, ,
19                 [AC_MSG_ERROR([libtommath not found, see http://www.libtom.org/, or try --without-tommath])])],
20         [AS_IF([test x"$with_tfm" != xno],
21                 [AC_SEARCH_LIBS(fp_ident, tfm, ,
22                         [AC_MSG_ERROR([libtfm not found, see http://www.libtom.org/, or try --without-tfm])])],
23                 [AS_IF([test x"$with_openssl" != xno],
24                         [AC_SEARCH_LIBS(BN_init, crypto, ,
25                                 [AC_MSG_ERROR([OpenSSL not found, see http://www.openssl.org/, or try --without-openssl])])],
26                         [AC_SEARCH_LIBS(__gmpz_init, gmp, ,
27                                 [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/, or try --with-openssl])])])])])
28
29 AC_ARG_ENABLE(rijndael, AS_HELP_STRING([--disable-rijndael], [Disable build of the d0_rijndael library]), [enable_aes=$enableval], [enable_aes=yes])
30
31 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])])])
32 AM_CONDITIONAL(ENABLE_RIJNDAEL, [test x$enable_aes = xyes])
33
34 AC_CONFIG_FILES([Makefile d0_blind_id.pc d0_rijndael.pc])
35
36 AC_OUTPUT