Generate precomputed tables as sources in `precomps/'.
[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
0f00dc4c
MW
49dnl Find out if we're cross-compiling.
50AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
51
ba6e6b64
MW
52dnl Various standard types.
53AC_CHECK_TYPE([pid_t], [int])
54AC_TYPE_UID_T
55AC_CHECK_TYPE([ssize_t], [int])
56
57dnl The maths library.
58mdw_ORIG_LIBS=$LIBS
59AC_SEARCH_LIBS([log], [m])
60AC_SEARCH_LIBS([sqrt], [m])
61AC_SUBST([CATACOMB_LIBS], [$LIBS])
62LIBS=$mdw_ORIG_LIBS
63
64dnl Functions used for noise-gathering.
65AC_CHECK_FUNCS([setgroups])
66AC_CACHE_CHECK([whether the freewheel noise generator will work],
67 [catacomb_cv_freewheel],
68[AC_TRY_LINK(
69[#include <setjmp.h>
70#include <sys/time.h>],
71[struct itimerval itv = { { 0, 0 }, { 0, 5000 } };
72jmp_buf j;
73setitimer(ITIMER_REAL, &itv, 0);
74sigsetjump(j, 1);],
75[catacomb_cv_freewheel=yes],
76[catacomb_cv_freewheel=no])])
77case $catacomb_cv_freewheel in
78 yes)
79 AC_DEFINE([USE_FREEWHEEL], [1],
80 [Define if you want to use the freewheel noise generator.])
81 ;;
82esac
83
84dnl Support for the passphrase pixie.
85mdw_ORIG_LIBS=$LIBS
86AC_SEARCH_LIBS([socket], [socket])
87AC_SUBST([PIXIE_LIBS], [$LIBS])
88LIBS=$mdw_ORIG_LIBS
89
90dnl Memory locking support.
91AC_CHECK_FUNCS([mlock])
92
93dnl Necessary support libraries.
94PKG_CHECK_MODULES([mLib], [mLib >= 2.0.4])
95AM_CFLAGS="$AM_CFLAGS $mLib_CFLAGS"
96
97dnl--------------------------------------------------------------------------
98dnl Python.
99
100dnl Make sure we have a suitable version.
101AM_PATH_PYTHON([2.5])
102
103dnl--------------------------------------------------------------------------
104dnl Special debugging options.
105
106AC_ARG_ENABLE([mpw],
107 [AS_HELP_STRING([--enable-mpw], [force small-width mp digits])],
108 [case "$enableval" in
109 y*|t*|short)
110 AC_DEFINE([FORCE_MPW_SHORT], [1],
111 [Define to force small-width mp digits.])
112 ;;
113 cussid)
114 AC_DEFINE([FORCE_MPW_CUSSID], [1],
115 [Define to force strange-width mp digits.])
116 ;;
117 esac])
118
119dnl--------------------------------------------------------------------------
120dnl Produce output.
121
122AC_CONFIG_HEADER([config/config.h])
123
124AC_CONFIG_FILES(
0f00dc4c
MW
125 [Makefile]
126 [base/Makefile]
127 [key/Makefile]
128 [math/Makefile]
129 [misc/Makefile]
130 [pub/Makefile]
131 [rand/Makefile]
132 [symm/Makefile]
133 [progs/Makefile])
ba6e6b64
MW
134AC_OUTPUT
135
136dnl----- That's all, folks --------------------------------------------------