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 | |
31 | AC_INIT(blkc.h) | |
4263ac2b | 32 | AM_INIT_AUTOMAKE(catacomb, 2.1.1) |
d03ab969 | 33 | AM_CONFIG_HEADER(config.h) |
34 | ||
35 | dnl --- Make sure I can compile and build libraries --- | |
36 | ||
37 | AC_PROG_CC | |
ffc086db | 38 | AM_PROG_LIBTOOL |
4263ac2b | 39 | AX_CFLAGS_WARN_ALL |
d03ab969 | 40 | |
41 | AC_PROG_YACC | |
42 | ||
43 | dnl --- Actually, I assume these exist anyway --- | |
44 | ||
45 | AC_CHECK_HEADERS(unistd.h) | |
46 | AC_HEADER_STDC | |
47 | ||
48 | dnl --- Check for various important system types --- | |
49 | ||
4263ac2b MW |
50 | AC_CHECK_TYPE(pid_t, int) |
51 | AC_CHECK_TYPE(size_t, unsigned) | |
d03ab969 | 52 | AC_TYPE_UID_T |
53 | AC_CHECK_TYPE(time_t, long) | |
4263ac2b | 54 | AC_CHECK_TYPE(ssize_t, int) |
d03ab969 | 55 | |
93100380 | 56 | dnl --- The maths library, for Maurer's test --- |
57 | ||
4263ac2b MW |
58 | OLIBS=$LIBS |
59 | AC_SEARCH_LIBS(log, m) | |
60 | AC_SEARCH_LIBS(sqrt, m) | |
61 | AC_SUBST([CATACOMB_LIBS], [$LIBS]) LIBS=$OLIBS | |
93100380 | 62 | |
25f654a7 | 63 | dnl --- Functions used for noise-gathering --- |
d03ab969 | 64 | |
65 | AC_CHECK_FUNCS(setgroups) | |
a094cab7 | 66 | |
25f654a7 | 67 | AC_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 } }; | |
74 | jmp_buf j; | |
75 | setitimer(ITIMER_REAL, &itv, 0); | |
76 | sigsetjmp(j, 1);], | |
77 | [catacomb_cv_freewheel=yes], | |
78 | [catacomb_cv_freewheel=no])]) | |
79 | if test "$catacomb_cv_freewheel" = "yes"; then | |
e4fb6b4d | 80 | AC_DEFINE([USE_FREEWHEEL], [1], |
45c0fd36 | 81 | [Define if you want to use the freewheel noise generator.]) |
25f654a7 | 82 | fi |
83 | ||
db2623e1 | 84 | dnl --- Support for the passphrase pixie --- |
85 | ||
4263ac2b MW |
86 | OLIBS=$LIBS |
87 | AC_SEARCH_LIBS(socket, socket) | |
88 | AC_SUBST([PIXIE_LIBS], [$LIBS]) LIBS=$OLIBS | |
db2623e1 | 89 | AC_CHECK_FUNCS(mlock) |
90 | ||
c29970a7 MW |
91 | dnl --- Debugging things --- |
92 | ||
45c0fd36 MW |
93 | AC_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]) | |
c29970a7 | 106 | |
d03ab969 | 107 | dnl --- Done --- |
108 | ||
4263ac2b MW |
109 | PKG_CHECK_MODULES(mLib, mLib >= 2.0.4) |
110 | CFLAGS="$CFLAGS $mLib_CFLAGS" | |
111 | LIBS="$LIBS $mLib_LIBS" | |
112 | AC_OUTPUT(Makefile tests/Makefile catacomb.pc qcc, | |
8de066ff | 113 | chmod 755 qcc) |
d03ab969 | 114 | |
115 | dnl ----- That's all, folks ------------------------------------------------- |