catcrypt.c: Don't close output file twice.
[u/mdw/catacomb] / configure.in
... / ...
CommitLineData
1dnl -*-m4-*-
2dnl
3dnl $Id$
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.
18dnl
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.
23dnl
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
29dnl --- Boring boilerplate ---
30
31AC_INIT(blkc.h)
32AM_INIT_AUTOMAKE(catacomb, 2.1.1)
33AM_CONFIG_HEADER(config.h)
34
35dnl --- Make sure I can compile and build libraries ---
36
37AC_PROG_CC
38AM_PROG_LIBTOOL
39AX_CFLAGS_WARN_ALL
40
41AC_PROG_YACC
42
43dnl --- Actually, I assume these exist anyway ---
44
45AC_CHECK_HEADERS(unistd.h)
46AC_HEADER_STDC
47
48dnl --- Check for various important system types ---
49
50AC_CHECK_TYPE(pid_t, int)
51AC_CHECK_TYPE(size_t, unsigned)
52AC_TYPE_UID_T
53AC_CHECK_TYPE(time_t, long)
54AC_CHECK_TYPE(ssize_t, int)
55
56dnl --- The maths library, for Maurer's test ---
57
58OLIBS=$LIBS
59AC_SEARCH_LIBS(log, m)
60AC_SEARCH_LIBS(sqrt, m)
61AC_SUBST([CATACOMB_LIBS], [$LIBS]) LIBS=$OLIBS
62
63dnl --- Functions used for noise-gathering ---
64
65AC_CHECK_FUNCS(setgroups)
66
67AC_CACHE_CHECK([whether the freewheel noise generator will work],
68[catacomb_cv_freewheel],
69[AC_TRY_LINK([
70#include <setjmp.h>
71#include <sys/time.h>
72],
73[struct itimerval itv = { { 0, 0 }, { 0, 5000 } };
74jmp_buf j;
75setitimer(ITIMER_REAL, &itv, 0);
76sigsetjmp(j, 1);],
77[catacomb_cv_freewheel=yes],
78[catacomb_cv_freewheel=no])])
79if test "$catacomb_cv_freewheel" = "yes"; then
80 AC_DEFINE([USE_FREEWHEEL], [1],
81 [Define if you want to use the freewheel noise generator.])
82fi
83
84dnl --- Support for the passphrase pixie ---
85
86OLIBS=$LIBS
87AC_SEARCH_LIBS(socket, socket)
88AC_SUBST([PIXIE_LIBS], [$LIBS]) LIBS=$OLIBS
89AC_CHECK_FUNCS(mlock)
90
91dnl --- Debugging things ---
92
93AC_ARG_ENABLE([mpw],
94 [AS_HELP_STRING([--enable-mpw],
95 [force small-width mp digits])],
96 [case "$enableval" in
97 y*|t*|short)
98 AC_DEFINE([FORCE_MPW_SHORT], [1],
99 [Define to force small-width mp digits.])
100 ;;
101 cussid)
102 AC_DEFINE([FORCE_MPW_CUSSID], [1],
103 [Define to force strange-width mp digits.])
104 ;;
105 esac])
106
107dnl --- Done ---
108
109PKG_CHECK_MODULES(mLib, mLib >= 2.0.4)
110CFLAGS="$CFLAGS $mLib_CFLAGS"
111LIBS="$LIBS $mLib_LIBS"
112AC_OUTPUT(Makefile tests/Makefile catacomb.pc qcc,
113 chmod 755 qcc)
114
115dnl ----- That's all, folks -------------------------------------------------