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