mtimeout.1: Use correct dash for number ranges.
[misc] / configure.ac
CommitLineData
b2ffb9b7
MW
1dnl -*-autoconf-*-
2dnl
c1749034 3dnl Configuration script for distorted-utils
b2ffb9b7
MW
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
926e521f 28AC_INIT([distorted-utils], AUTO_VERSION, [mdw@distorted.org.uk])
b2ffb9b7
MW
29AC_CONFIG_SRCDIR([shadowfix.in])
30AC_CONFIG_AUX_DIR([config])
31AM_INIT_AUTOMAKE([foreign])
8653d1c3 32mdw_SILENT_RULES
b2ffb9b7 33
c818aced
MW
34AC_ARG_WITH([logdir],
35 AS_HELP_STRING([--with-logdir=DIR],
36 [Write log files here.]),
37 [logdir=$withval],
38 [logdir=/var/log
39 for i in /var/log /var/adm; do
40 if test -d $i; then logdir=$i; break; fi
41 done])
42AC_SUBST(logdir)
43
92f7c002
MW
44AC_CANONICAL_HOST
45
b2ffb9b7
MW
46dnl--------------------------------------------------------------------------
47dnl C programming environment.
48
49## Compiler.
50AC_PROG_CC
51AX_CFLAGS_WARN_ALL
300a556d
MW
52AC_PROG_CXX
53AX_CXXFLAGS_WARN_ALL
b2ffb9b7
MW
54
55## Libraries.
56OLIBS=$LIBS
57AC_SEARCH_LIBS([floor], [m])
58AC_SUBST([MATH_LIBS], [$LIBS])
59LIBS=$OLIBS
60
61AC_CHECK_LIB([cdb], [cdb_seek], [have_cdb=yes], [have_cdb=no])
62AM_CONDITIONAL([HAVE_LIBCDB], [test $have_cdb = yes])
63
b2ffb9b7
MW
64## Packages.
65PKG_CHECK_MODULES([mLib], [mLib >= 2.0.4], [have_mLib=yes], [have_mLib=no])
66AM_CONDITIONAL([HAVE_MLIB], [test $have_mLib = yes])
67
68PKG_CHECK_MODULES([catacomb], [catacomb >= 2.1.1],
69 [have_catacomb=yes], [have_catacomb=no])
70AM_CONDITIONAL([HAVE_CATACOMB], [test $have_catacomb = yes])
71
2e169b7e
MW
72## Functions.
73AC_CHECK_FUNC([prlimit], [have_prlimit=yes], [have_prlimit=no])
74AM_CONDITIONAL([HAVE_PRLIMIT], [test $have_prlimit = yes])
75
92f7c002 76## Processor type.
8fc36470 77case "$host_cpu" in i?86 | x86_64) x86=yes;; *) x86=no;; esac
92f7c002
MW
78AM_CONDITIONAL([X86], [test $x86 = yes -a $GCC = yes])
79
b2ffb9b7
MW
80dnl--------------------------------------------------------------------------
81dnl Python, Perl and other scripting languages.
82
83## Python.
84AM_PATH_PYTHON([2.4], [have_python=yes], [have_python=no])
85AM_CONDITIONAL([HAVE_PYTHON], [test $have_python = yes])
86
87AC_PYTHON_MODULE([cdb])
88AM_CONDITIONAL([HAVE_PYMOD_CDB], [test $HAVE_PYMOD_CDB = yes])
89
90## Perl.
91AC_ARG_VAR([PERL], [Path to your favourite Perl binary.])
92AC_PATH_PROGS([PERL], [perl perl5], [false])
1506eae0 93AX_PROG_PERL_VERSION([5.004], [have_perl=yes], [have_perl=no])
b2ffb9b7
MW
94AM_CONDITIONAL([HAVE_PERL], [test $have_perl = yes])
95
0da5c4d5
MW
96AC_ARG_WITH([perlmoddir],
97 AS_HELP_STRING([--with-perlmoddir=DIR],
b2ffb9b7
MW
98 [Install Perl modules here.]),
99 [perlmoddir=$withval],
100 [perlmoddir='${libdir}/site_perl'])
101AC_SUBST([perlmoddir])
102
103## Tcl.
104have_tcl=yes
105AC_ARG_VAR([TCLSH], [Path to your favourite tclsh binary.])
106AC_PATH_PROG([TCLSH], [tclsh], [false])
107
108AC_MSG_CHECKING([Tcl version])
109case "$TCLSH" in false) have_tcl=no ;; esac
110case "$have_tcl" in
111 yes)
112 tclver=$(echo "puts \$tcl_version" | tclsh -)
113 tclver_hack=$(echo "$tclver" | sed 's/\.//')
114 if test "$tclver_hack" -ge 83; then
115 AC_MSG_RESULT([$tclver])
116 else
117 have_tcl=no
118 AC_MSG_RESULT([too old ($tclver)])
119 fi
120esac
121AM_CONDITIONAL([HAVE_TCLSH], [test $have_tcl = yes])
122
123## Bash.
124case "$BASH" in /bin/sh) unset BASH ;; esac
125AC_ARG_VAR([BASH], [Path to the Bourne Again Shell.])
126AC_PATH_PROG([BASH], [bash], [false])
127AC_MSG_CHECKING([bash version])
128bashver=$("$BASH" -c 'echo $BASH_VERSION')
129if "$BASH" 2>/dev/null -c '[[[ ${BASH_VERSINFO[0]} -ge 3 ]]]'; then
130 have_bash=yes
131 AC_MSG_RESULT([$bashver])
132else
133 have_bash=no
134 AC_MSG_RESULT([too old ($bashver)])
135fi
136AM_CONDITIONAL([HAVE_BASH], [test $have_bash = yes])
137
138dnl--------------------------------------------------------------------------
139dnl Output.
140
141AC_CONFIG_FILES([Makefile])
142AC_OUTPUT
143
144dnl ----- That's all, folks -------------------------------------------------