dnl -*-autoconf-*- dnl dnl Configuration script for distorted-utils dnl dnl (c) 2008 Mark Wooding dnl dnl ----- Licensing notice -------------------------------------------------- dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software Foundation, dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl-------------------------------------------------------------------------- dnl Initialization. mdw_AUTO_VERSION AC_INIT([distorted-utils], AUTO_VERSION, [mdw@distorted.org.uk]) AC_CONFIG_SRCDIR([shadowfix.in]) AC_CONFIG_AUX_DIR([config]) AM_INIT_AUTOMAKE([foreign]) mdw_SILENT_RULES AC_ARG_WITH([logdir], AS_HELP_STRING([--with-logdir=DIR], [Write log files here.]), [logdir=$withval], [logdir=/var/log for i in /var/log /var/adm; do if test -d $i; then logdir=$i; break; fi done]) AC_SUBST(logdir) AC_CANONICAL_HOST dnl-------------------------------------------------------------------------- dnl C programming environment. ## Compiler. AC_PROG_CC AX_CFLAGS_WARN_ALL AC_PROG_CXX AX_CXXFLAGS_WARN_ALL ## Libraries. OLIBS=$LIBS AC_SEARCH_LIBS([floor], [m]) AC_SUBST([MATH_LIBS], [$LIBS]) LIBS=$OLIBS AC_CHECK_LIB([cdb], [cdb_seek], [have_cdb=yes], [have_cdb=no]) AM_CONDITIONAL([HAVE_LIBCDB], [test $have_cdb = yes]) ## Packages. PKG_CHECK_MODULES([mLib], [mLib >= 2.0.4], [have_mLib=yes], [have_mLib=no]) AM_CONDITIONAL([HAVE_MLIB], [test $have_mLib = yes]) PKG_CHECK_MODULES([catacomb], [catacomb >= 2.1.1], [have_catacomb=yes], [have_catacomb=no]) AM_CONDITIONAL([HAVE_CATACOMB], [test $have_catacomb = yes]) ## Functions. AC_CHECK_FUNC([prlimit], [have_prlimit=yes], [have_prlimit=no]) AM_CONDITIONAL([HAVE_PRLIMIT], [test $have_prlimit = yes]) ## Processor type. case "$host_cpu" in i?86 | x86_64) x86=yes;; *) x86=no;; esac AM_CONDITIONAL([X86], [test $x86 = yes -a $GCC = yes]) dnl-------------------------------------------------------------------------- dnl Python, Perl and other scripting languages. ## Python. AM_PATH_PYTHON([2.4], [have_python=yes], [have_python=no]) AM_CONDITIONAL([HAVE_PYTHON], [test $have_python = yes]) AC_PYTHON_MODULE([cdb]) AM_CONDITIONAL([HAVE_PYMOD_CDB], [test $HAVE_PYMOD_CDB = yes]) ## Perl. AC_ARG_VAR([PERL], [Path to your favourite Perl binary.]) AC_PATH_PROGS([PERL], [perl perl5], [false]) AX_PROG_PERL_VERSION([5.004], [have_perl=yes], [have_perl=no]) AM_CONDITIONAL([HAVE_PERL], [test $have_perl = yes]) AC_ARG_WITH([perlmoddir], AS_HELP_STRING([--with-perlmoddir=DIR], [Install Perl modules here.]), [perlmoddir=$withval], [perlmoddir='${libdir}/site_perl']) AC_SUBST([perlmoddir]) ## Tcl. have_tcl=yes AC_ARG_VAR([TCLSH], [Path to your favourite tclsh binary.]) AC_PATH_PROG([TCLSH], [tclsh], [false]) AC_MSG_CHECKING([Tcl version]) case "$TCLSH" in false) have_tcl=no ;; esac case "$have_tcl" in yes) tclver=$(echo "puts \$tcl_version" | tclsh -) tclver_hack=$(echo "$tclver" | sed 's/\.//') if test "$tclver_hack" -ge 83; then AC_MSG_RESULT([$tclver]) else have_tcl=no AC_MSG_RESULT([too old ($tclver)]) fi esac AM_CONDITIONAL([HAVE_TCLSH], [test $have_tcl = yes]) ## Bash. case "$BASH" in /bin/sh) unset BASH ;; esac AC_ARG_VAR([BASH], [Path to the Bourne Again Shell.]) AC_PATH_PROG([BASH], [bash], [false]) AC_MSG_CHECKING([bash version]) bashver=$("$BASH" -c 'echo $BASH_VERSION') if "$BASH" 2>/dev/null -c '[[[ ${BASH_VERSINFO[0]} -ge 3 ]]]'; then have_bash=yes AC_MSG_RESULT([$bashver]) else have_bash=no AC_MSG_RESULT([too old ($bashver)]) fi AM_CONDITIONAL([HAVE_BASH], [test $have_bash = yes]) dnl-------------------------------------------------------------------------- dnl Output. AC_CONFIG_FILES([Makefile]) AC_OUTPUT dnl ----- That's all, folks -------------------------------------------------