New free counter noise generator, for use if /dev/random is
[u/mdw/catacomb] / configure.in
1 dnl -*-fundamental-*-
2 dnl
3 dnl $Id: configure.in,v 1.12 2000/06/17 12:57:47 mdw Exp $
4 dnl
5 dnl Autoconfiguration for Catacomb
6 dnl
7 dnl (c) 1999 Straylight/Edgeware
8 dnl
9
10 dnl ----- Licensing notice --------------------------------------------------
11 dnl
12 dnl This file is part of Catacomb.
13 dnl
14 dnl Catacomb is free software; you can redistribute it and/or modify
15 dnl it under the terms of the GNU Library General Public License as
16 dnl published by the Free Software Foundation; either version 2 of the
17 dnl License, or (at your option) any later version.
18 dnl
19 dnl Catacomb is distributed in the hope that it will be useful,
20 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
21 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 dnl GNU Library General Public License for more details.
23 dnl
24 dnl You should have received a copy of the GNU Library General Public
25 dnl License along with Catacomb; if not, write to the Free
26 dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
27 dnl MA 02111-1307, USA.
28
29 dnl ----- Revision history --------------------------------------------------
30 dnl
31 dnl $Log: configure.in,v $
32 dnl Revision 1.12 2000/06/17 12:57:47 mdw
33 dnl New free counter noise generator, for use if /dev/random is
34 dnl unavailable.
35 dnl
36 dnl Revision 1.11 2000/06/17 10:51:23 mdw
37 dnl Version number changes. Find maths library for Maurer's test.
38 dnl
39 dnl Revision 1.10 1999/12/22 16:03:31 mdw
40 dnl New mLib version. Find socket functions for pixie.
41 dnl
42 dnl Revision 1.7 1999/11/13 01:55:48 mdw
43 dnl Don't be pedantic, because using `long long' as a multiprecision type
44 dnl gets complained about.
45 dnl
46 dnl Revision 1.6 1999/11/11 18:56:14 mdw
47 dnl Use `libtool' to generate a shared library.
48 dnl
49 dnl Revision 1.5 1999/11/11 17:47:34 mdw
50 dnl Updates for new configuration system, and `mptypes' generator.
51 dnl
52 dnl Revision 1.4 1999/11/11 00:58:19 mdw
53 dnl Use canned check for `ssize_t'.
54 dnl
55 dnl Revision 1.3 1999/10/24 10:20:36 mdw
56 dnl Modify for standalone distribution. The library's getting far too large
57 dnl to be sensibly embedded in other programs.
58 dnl
59 dnl Revision 1.2 1999/10/23 12:56:25 mdw
60 dnl Version number change.
61 dnl
62 dnl Revision 1.1 1999/09/03 08:41:11 mdw
63 dnl Initial import.
64 dnl
65
66 dnl --- Boring boilerplate ---
67
68 AC_INIT(blkc.h)
69 AM_INIT_AUTOMAKE(catacomb, 2.0.0pre1)
70 AM_CONFIG_HEADER(config.h)
71
72 dnl --- Make sure I can compile and build libraries ---
73
74 AC_PROG_CC
75 AM_PROG_LIBTOOL
76 mdw_GCC_FLAGS(-Wall)
77
78 AC_PROG_YACC
79
80 dnl --- Actually, I assume these exist anyway ---
81
82 AC_CHECK_HEADERS(unistd.h)
83 AC_HEADER_STDC
84
85 dnl --- Check for various important system types ---
86
87 AC_TYPE_PID_T
88 AC_TYPE_SIZE_T
89 AC_TYPE_UID_T
90 AC_CHECK_TYPE(time_t, long)
91 mdw_TYPE_SSIZE_T
92
93 dnl --- The maths library, for Maurer's test ---
94
95 mdw_CHECK_MANYLIBS(log, m,,, [#include <math.h>], [2])
96 mdw_CHECK_MANYLIBS(sqrt, m,,, [#include <math.h>], [2])
97
98 dnl --- Functions used for noise-gathering ---
99
100 AC_CHECK_FUNCS(setgroups)
101
102 AC_CACHE_CHECK([whether the freewheel noise generator will work],
103 [catacomb_cv_freewheel],
104 [AC_TRY_LINK([
105 #include <setjmp.h>
106 #include <sys/time.h>
107 ],
108 [struct itimerval itv = { { 0, 0 }, { 0, 5000 } };
109 jmp_buf j;
110 setitimer(ITIMER_REAL, &itv, 0);
111 sigsetjmp(j, 1);],
112 [catacomb_cv_freewheel=yes],
113 [catacomb_cv_freewheel=no])])
114 if test "$catacomb_cv_freewheel" = "yes"; then
115 AC_DEFINE([USE_FREEWHEEL])
116 fi
117
118 dnl --- Support for the passphrase pixie ---
119
120 mdw_CHECK_MANYLIBS(socket, socket)
121 AC_CHECK_FUNCS(mlock)
122
123 dnl --- Done ---
124
125 mdw_MLIB(2.0.0)
126 AC_OUTPUT(Makefile tests/Makefile catacomb-config qcc, chmod 755 qcc)
127
128 dnl ----- That's all, folks -------------------------------------------------