ct.c, ct.h: New constant-time operations.
[u/mdw/catacomb] / configure.in
CommitLineData
2ee993fe 1dnl -*-m4-*-
d03ab969 2dnl
e4fb6b4d 3dnl $Id$
d03ab969 4dnl
5dnl Autoconfiguration for Catacomb
6dnl
7dnl (c) 1999 Straylight/Edgeware
8dnl
9
10dnl ----- Licensing notice --------------------------------------------------
11dnl
12dnl This file is part of Catacomb.
13dnl
14dnl Catacomb is free software; you can redistribute it and/or modify
15dnl it under the terms of the GNU Library General Public License as
16dnl published by the Free Software Foundation; either version 2 of the
17dnl License, or (at your option) any later version.
45c0fd36 18dnl
d03ab969 19dnl Catacomb is distributed in the hope that it will be useful,
20dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
21dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22dnl GNU Library General Public License for more details.
45c0fd36 23dnl
d03ab969 24dnl You should have received a copy of the GNU Library General Public
25dnl License along with Catacomb; if not, write to the Free
26dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27dnl MA 02111-1307, USA.
28
6fcd939f 29dnl --- Boring boilerplate ---
d03ab969 30
7280f7f4
MW
31mdw_AUTO_VERSION
32AC_INIT(catacomb, AUTO_VERSION, mdw@distorted.org.uk)
33AC_CONFIG_SRCDIR(blkc.h)
ce5cb7e4 34AC_CONFIG_AUX_DIR(.)
7280f7f4
MW
35AM_CONFIG_HEADER(config.h)
36AM_INIT_AUTOMAKE(foreign)
d03ab969 37
38dnl --- Make sure I can compile and build libraries ---
39
40AC_PROG_CC
ffc086db 41AM_PROG_LIBTOOL
4263ac2b 42AX_CFLAGS_WARN_ALL
097fb6f2 43mdw_LIBTOOL_VERSION_INFO
d03ab969 44
45AC_PROG_YACC
46
47dnl --- Actually, I assume these exist anyway ---
48
49AC_CHECK_HEADERS(unistd.h)
50AC_HEADER_STDC
51
52dnl --- Check for various important system types ---
53
4263ac2b
MW
54AC_CHECK_TYPE(pid_t, int)
55AC_CHECK_TYPE(size_t, unsigned)
d03ab969 56AC_TYPE_UID_T
57AC_CHECK_TYPE(time_t, long)
4263ac2b 58AC_CHECK_TYPE(ssize_t, int)
d03ab969 59
93100380 60dnl --- The maths library, for Maurer's test ---
61
4263ac2b
MW
62OLIBS=$LIBS
63AC_SEARCH_LIBS(log, m)
64AC_SEARCH_LIBS(sqrt, m)
65AC_SUBST([CATACOMB_LIBS], [$LIBS]) LIBS=$OLIBS
93100380 66
25f654a7 67dnl --- Functions used for noise-gathering ---
d03ab969 68
69AC_CHECK_FUNCS(setgroups)
a094cab7 70
25f654a7 71AC_CACHE_CHECK([whether the freewheel noise generator will work],
72[catacomb_cv_freewheel],
73[AC_TRY_LINK([
74#include <setjmp.h>
75#include <sys/time.h>
76],
77[struct itimerval itv = { { 0, 0 }, { 0, 5000 } };
78jmp_buf j;
79setitimer(ITIMER_REAL, &itv, 0);
80sigsetjmp(j, 1);],
81[catacomb_cv_freewheel=yes],
82[catacomb_cv_freewheel=no])])
83if test "$catacomb_cv_freewheel" = "yes"; then
e4fb6b4d 84 AC_DEFINE([USE_FREEWHEEL], [1],
45c0fd36 85 [Define if you want to use the freewheel noise generator.])
25f654a7 86fi
87
db2623e1 88dnl --- Support for the passphrase pixie ---
89
4263ac2b
MW
90OLIBS=$LIBS
91AC_SEARCH_LIBS(socket, socket)
92AC_SUBST([PIXIE_LIBS], [$LIBS]) LIBS=$OLIBS
db2623e1 93AC_CHECK_FUNCS(mlock)
94
c29970a7
MW
95dnl --- Debugging things ---
96
45c0fd36
MW
97AC_ARG_ENABLE([mpw],
98 [AS_HELP_STRING([--enable-mpw],
99 [force small-width mp digits])],
100 [case "$enableval" in
101 y*|t*|short)
102 AC_DEFINE([FORCE_MPW_SHORT], [1],
103 [Define to force small-width mp digits.])
104 ;;
105 cussid)
106 AC_DEFINE([FORCE_MPW_CUSSID], [1],
107 [Define to force strange-width mp digits.])
108 ;;
109 esac])
c29970a7 110
d03ab969 111dnl --- Done ---
112
4263ac2b
MW
113PKG_CHECK_MODULES(mLib, mLib >= 2.0.4)
114CFLAGS="$CFLAGS $mLib_CFLAGS"
115LIBS="$LIBS $mLib_LIBS"
116AC_OUTPUT(Makefile tests/Makefile catacomb.pc qcc,
8de066ff 117 chmod 755 qcc)
d03ab969 118
119dnl ----- That's all, folks -------------------------------------------------