Merge branch 'Lyberta/VersionInfo' 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
16 AS_IF([test x"$with_tommath" != xno],
17         [AC_SEARCH_LIBS(mp_init, tommath, ,
18                 [AC_MSG_ERROR([libtommath not found, see http://www.libtom.org/, or try --without-tommath])])],
19         [AS_IF([test x"$with_tfm" != xno],
20                 [AC_SEARCH_LIBS(fp_ident, tfm, ,
21                         [AC_MSG_ERROR([libtfm not found, see http://www.libtom.org/, or try --without-tfm])])],
22                 [AS_IF([test x"$with_openssl" != xno],
23                         [AC_SEARCH_LIBS(BN_init, crypto, ,
24                                 [AC_MSG_ERROR([OpenSSL not found, see http://www.openssl.org/, or try --without-openssl])])],
25                         [AC_SEARCH_LIBS(__gmpz_init, gmp, ,
26                                 [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/, or try --with-openssl])])])])])
27
28 AC_ARG_ENABLE(rijndael, AS_HELP_STRING([--disable-rijndael], [Disable build of the d0_rijndael library]), [enable_aes=$enableval], [enable_aes=yes])
29
30 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])])])
31 AM_CONDITIONAL(ENABLE_RIJNDAEL, [test x$enable_aes = xyes])
32
33 AC_CONFIG_FILES([Makefile d0_blind_id.pc d0_rijndael.pc])
34
35 AC_OUTPUT