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