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