configure.ac: Replace with a new version.
[u/mdw/catacomb] / configure.ac
1 dnl -*-autoconf-*-
2 dnl
3 dnl Configuration script for Catacomb
4 dnl
5 dnl (c) 2013 Straylight/Edgeware
6 dnl
7
8 dnl----- Licensing notice ---------------------------------------------------
9 dnl
10 dnl This file is part of Catacomb.
11 dnl
12 dnl Catacomb is free software; you can redistribute it and/or modify
13 dnl it under the terms of the GNU Library General Public License as
14 dnl published by the Free Software Foundation; either version 2 of the
15 dnl License, or (at your option) any later version.
16 dnl
17 dnl Catacomb is distributed in the hope that it will be useful,
18 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
19 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 dnl GNU Library General Public License for more details.
21 dnl
22 dnl You should have received a copy of the GNU Library General Public
23 dnl License along with Catacomb; if not, write to the Free
24 dnl Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 dnl MA 02111-1307, USA.
26
27 dnl--------------------------------------------------------------------------
28 dnl Initialization.
29
30 mdw_AUTO_VERSION
31 AC_INIT([catacomb], AUTO_VERSION, [mdw@distorted.org.uk])
32 AC_CONFIG_SRCDIR([catacomb.pc.in])
33 AC_CONFIG_AUX_DIR([config])
34 AM_INIT_AUTOMAKE([foreign parallel-tests])
35 mdw_SILENT_RULES
36
37 AC_PROG_CC
38 AX_CFLAGS_WARN_ALL
39 AM_PROG_LIBTOOL
40 mdw_LIBTOOL_VERSION_INFO
41
42 AC_PROG_YACC
43
44 AC_SUBST(AM_CFLAGS)
45
46 dnl--------------------------------------------------------------------------
47 dnl C programming environment.
48
49 dnl Various standard types.
50 AC_CHECK_TYPE([pid_t], [int])
51 AC_TYPE_UID_T
52 AC_CHECK_TYPE([ssize_t], [int])
53
54 dnl The maths library.
55 mdw_ORIG_LIBS=$LIBS
56 AC_SEARCH_LIBS([log], [m])
57 AC_SEARCH_LIBS([sqrt], [m])
58 AC_SUBST([CATACOMB_LIBS], [$LIBS])
59 LIBS=$mdw_ORIG_LIBS
60
61 dnl Functions used for noise-gathering.
62 AC_CHECK_FUNCS([setgroups])
63 AC_CACHE_CHECK([whether the freewheel noise generator will work],
64 [catacomb_cv_freewheel],
65 [AC_TRY_LINK(
66 [#include <setjmp.h>
67 #include <sys/time.h>],
68 [struct itimerval itv = { { 0, 0 }, { 0, 5000 } };
69 jmp_buf j;
70 setitimer(ITIMER_REAL, &itv, 0);
71 sigsetjump(j, 1);],
72 [catacomb_cv_freewheel=yes],
73 [catacomb_cv_freewheel=no])])
74 case $catacomb_cv_freewheel in
75 yes)
76 AC_DEFINE([USE_FREEWHEEL], [1],
77 [Define if you want to use the freewheel noise generator.])
78 ;;
79 esac
80
81 dnl Support for the passphrase pixie.
82 mdw_ORIG_LIBS=$LIBS
83 AC_SEARCH_LIBS([socket], [socket])
84 AC_SUBST([PIXIE_LIBS], [$LIBS])
85 LIBS=$mdw_ORIG_LIBS
86
87 dnl Memory locking support.
88 AC_CHECK_FUNCS([mlock])
89
90 dnl Necessary support libraries.
91 PKG_CHECK_MODULES([mLib], [mLib >= 2.0.4])
92 AM_CFLAGS="$AM_CFLAGS $mLib_CFLAGS"
93
94 dnl--------------------------------------------------------------------------
95 dnl Python.
96
97 dnl Make sure we have a suitable version.
98 AM_PATH_PYTHON([2.5])
99
100 dnl--------------------------------------------------------------------------
101 dnl Special debugging options.
102
103 AC_ARG_ENABLE([mpw],
104 [AS_HELP_STRING([--enable-mpw], [force small-width mp digits])],
105 [case "$enableval" in
106 y*|t*|short)
107 AC_DEFINE([FORCE_MPW_SHORT], [1],
108 [Define to force small-width mp digits.])
109 ;;
110 cussid)
111 AC_DEFINE([FORCE_MPW_CUSSID], [1],
112 [Define to force strange-width mp digits.])
113 ;;
114 esac])
115
116 dnl--------------------------------------------------------------------------
117 dnl Produce output.
118
119 AC_CONFIG_HEADER([config/config.h])
120
121 AC_CONFIG_FILES(
122 [Makefile])
123 AC_OUTPUT
124
125 dnl----- That's all, folks --------------------------------------------------