chiark / gitweb /
Build system overhaul.
[misc] / configure.ac
CommitLineData
b2ffb9b7
MW
1dnl -*-autoconf-*-
2dnl
3dnl Configuration script for nsict-utils
4dnl
5dnl (c) 2008 Mark Wooding
6dnl
7
8dnl ----- Licensing notice --------------------------------------------------
9dnl
10dnl This program is free software; you can redistribute it and/or modify
11dnl it under the terms of the GNU General Public License as published by
12dnl the Free Software Foundation; either version 2 of the License, or
13dnl (at your option) any later version.
14dnl
15dnl This program is distributed in the hope that it will be useful,
16dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
17dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18dnl GNU General Public License for more details.
19dnl
20dnl You should have received a copy of the GNU General Public License
21dnl along with this program; if not, write to the Free Software Foundation,
22dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24dnl--------------------------------------------------------------------------
25dnl Initialization.
26
27mdw_AUTO_VERSION
28AC_INIT([nsict-utils], AUTO_VERSION, [mdw@distorted.org.uk])
29AC_CONFIG_SRCDIR([shadowfix.in])
30AC_CONFIG_AUX_DIR([config])
31AM_INIT_AUTOMAKE([foreign])
32
33dnl--------------------------------------------------------------------------
34dnl C programming environment.
35
36## Compiler.
37AC_PROG_CC
38AX_CFLAGS_WARN_ALL
39
40## Libraries.
41OLIBS=$LIBS
42AC_SEARCH_LIBS([floor], [m])
43AC_SUBST([MATH_LIBS], [$LIBS])
44LIBS=$OLIBS
45
46AC_CHECK_LIB([cdb], [cdb_seek], [have_cdb=yes], [have_cdb=no])
47AM_CONDITIONAL([HAVE_LIBCDB], [test $have_cdb = yes])
48
49AC_CHECK_LIB([spamc], [message_filter], [have_spamc=yes], [have_spamc=no])
50AM_CONDITIONAL([HAVE_LIBSPAMC], [test $have_spamc = yes])
51
52## Packages.
53PKG_CHECK_MODULES([mLib], [mLib >= 2.0.4], [have_mLib=yes], [have_mLib=no])
54AM_CONDITIONAL([HAVE_MLIB], [test $have_mLib = yes])
55
56PKG_CHECK_MODULES([catacomb], [catacomb >= 2.1.1],
57 [have_catacomb=yes], [have_catacomb=no])
58AM_CONDITIONAL([HAVE_CATACOMB], [test $have_catacomb = yes])
59
60dnl--------------------------------------------------------------------------
61dnl Python, Perl and other scripting languages.
62
63## Python.
64AM_PATH_PYTHON([2.4], [have_python=yes], [have_python=no])
65AM_CONDITIONAL([HAVE_PYTHON], [test $have_python = yes])
66
67AC_PYTHON_MODULE([cdb])
68AM_CONDITIONAL([HAVE_PYMOD_CDB], [test $HAVE_PYMOD_CDB = yes])
69
70## Perl.
71AC_ARG_VAR([PERL], [Path to your favourite Perl binary.])
72AC_PATH_PROGS([PERL], [perl perl5], [false])
73AC_PROG_PERL_VERSION([5.004], [have_perl=yes], [have_perl=no])
74AM_CONDITIONAL([HAVE_PERL], [test $have_perl = yes])
75
76AC_ARG_WITH(
77 [perlmoddir],
78 AS_HELP_STRING([--perlmoddir=DIR],
79 [Install Perl modules here.]),
80 [perlmoddir=$withval],
81 [perlmoddir='${libdir}/site_perl'])
82AC_SUBST([perlmoddir])
83
84## Tcl.
85have_tcl=yes
86AC_ARG_VAR([TCLSH], [Path to your favourite tclsh binary.])
87AC_PATH_PROG([TCLSH], [tclsh], [false])
88
89AC_MSG_CHECKING([Tcl version])
90case "$TCLSH" in false) have_tcl=no ;; esac
91case "$have_tcl" in
92 yes)
93 tclver=$(echo "puts \$tcl_version" | tclsh -)
94 tclver_hack=$(echo "$tclver" | sed 's/\.//')
95 if test "$tclver_hack" -ge 83; then
96 AC_MSG_RESULT([$tclver])
97 else
98 have_tcl=no
99 AC_MSG_RESULT([too old ($tclver)])
100 fi
101esac
102AM_CONDITIONAL([HAVE_TCLSH], [test $have_tcl = yes])
103
104## Bash.
105case "$BASH" in /bin/sh) unset BASH ;; esac
106AC_ARG_VAR([BASH], [Path to the Bourne Again Shell.])
107AC_PATH_PROG([BASH], [bash], [false])
108AC_MSG_CHECKING([bash version])
109bashver=$("$BASH" -c 'echo $BASH_VERSION')
110if "$BASH" 2>/dev/null -c '[[[ ${BASH_VERSINFO[0]} -ge 3 ]]]'; then
111 have_bash=yes
112 AC_MSG_RESULT([$bashver])
113else
114 have_bash=no
115 AC_MSG_RESULT([too old ($bashver)])
116fi
117AM_CONDITIONAL([HAVE_BASH], [test $have_bash = yes])
118
119dnl--------------------------------------------------------------------------
120dnl Output.
121
122AC_CONFIG_FILES([Makefile])
123AC_OUTPUT
124
125dnl ----- That's all, folks -------------------------------------------------