.gitignore: Ignore `auto-version' script.
[u/mdw/catacomb] / configure.in
1 dnl -*-m4-*-
2 dnl
3 dnl $Id$
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 --- Boring boilerplate ---
30
31 mdw_AUTO_VERSION
32 AC_INIT(catacomb, AUTO_VERSION, mdw@distorted.org.uk)
33 AC_CONFIG_SRCDIR(blkc.h)
34 AC_CONFIG_AUX_DIR(.)
35 AM_CONFIG_HEADER(config.h)
36 AM_INIT_AUTOMAKE(foreign)
37
38 dnl --- Make sure I can compile and build libraries ---
39
40 AC_PROG_CC
41 AM_PROG_LIBTOOL
42 AX_CFLAGS_WARN_ALL
43 mdw_LIBTOOL_VERSION_INFO
44
45 AC_PROG_YACC
46
47 dnl --- Actually, I assume these exist anyway ---
48
49 AC_CHECK_HEADERS(unistd.h)
50 AC_HEADER_STDC
51
52 dnl --- Check for various important system types ---
53
54 AC_CHECK_TYPE(pid_t, int)
55 AC_CHECK_TYPE(size_t, unsigned)
56 AC_TYPE_UID_T
57 AC_CHECK_TYPE(time_t, long)
58 AC_CHECK_TYPE(ssize_t, int)
59
60 dnl --- The maths library, for Maurer's test ---
61
62 OLIBS=$LIBS
63 AC_SEARCH_LIBS(log, m)
64 AC_SEARCH_LIBS(sqrt, m)
65 AC_SUBST([CATACOMB_LIBS], [$LIBS]) LIBS=$OLIBS
66
67 dnl --- Functions used for noise-gathering ---
68
69 AC_CHECK_FUNCS(setgroups)
70
71 AC_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 } };
78 jmp_buf j;
79 setitimer(ITIMER_REAL, &itv, 0);
80 sigsetjmp(j, 1);],
81 [catacomb_cv_freewheel=yes],
82 [catacomb_cv_freewheel=no])])
83 if test "$catacomb_cv_freewheel" = "yes"; then
84 AC_DEFINE([USE_FREEWHEEL], [1],
85 [Define if you want to use the freewheel noise generator.])
86 fi
87
88 dnl --- Support for the passphrase pixie ---
89
90 OLIBS=$LIBS
91 AC_SEARCH_LIBS(socket, socket)
92 AC_SUBST([PIXIE_LIBS], [$LIBS]) LIBS=$OLIBS
93 AC_CHECK_FUNCS(mlock)
94
95 dnl --- Debugging things ---
96
97 AC_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])
110
111 dnl --- Done ---
112
113 PKG_CHECK_MODULES(mLib, mLib >= 2.0.4)
114 CFLAGS="$CFLAGS $mLib_CFLAGS"
115 LIBS="$LIBS $mLib_LIBS"
116 AC_OUTPUT(Makefile tests/Makefile catacomb.pc qcc,
117 chmod 755 qcc)
118
119 dnl ----- That's all, folks -------------------------------------------------