# DLIFE (C) 2000 Richard W.M. Jones # and other authors listed in the ``AUTHORS'' file. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # $Id: configure.in,v 1.3 2002/04/05 17:02:25 rich Exp $ AC_INIT(cell.c) AM_INIT_AUTOMAKE(dlife, 1.0.0) AM_CONFIG_HEADER(config.h) dnl Check for the basic compile environment. AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET dnl Enable compiler warnings. if test "$CC" = "gcc"; then CFLAGS="$CFLAGS -Wall -Werror" fi dnl Check for arguments to configure. AC_ARG_ENABLE( check, [ --enable-check Enable extra internal consistency checks (slow)], CFLAGS="$CFLAGS -DCHECK=1" ) AC_ARG_ENABLE( profile, [ --enable-profile Enable code profiling], CFLAGS="$CFLAGS -pg" ) AC_ARG_ENABLE( user-check, [ --disable-user-check Do not check for existance of dlife account], user_check="no", user_check="yes" ) AC_ARG_ENABLE( cron, [ --enable-cron[=layout] Install cron script to run dlife net client 'layout' may be 'auto' (default), 'standard', or a path to crontab directory starting with / --disable-cron Do not install cron script], install_cron="$enableval", install_cron="yes" ) AC_ARG_ENABLE( rc, [ --enable-rc[=layout] Install rc script (runs dlife_soup at boot) 'layout' may be 'auto' (default), 'standard', or a path to local rc directory starting with / --disable-rc Do not install rc script], install_rc="$enableval", install_rc="yes" ) AC_ARG_WITH( spool, [ --with-spool=DIR Spool directory (default typically /var/spool/dlife)], SPOOLDIR="$withval", FC_EXPAND_DIR(SPOOLDIR, '${localstatedir}/spool/dlife') ) AC_ARG_WITH( conf, [ --with-conf=DIR Config directory (default typically /etc/dlife)], CONFDIR="$withval", FC_EXPAND_DIR(CONFDIR, '${sysconfdir}/dlife') ) dnl Check for ``dlife'' account. if test "$user_check" = "yes"; then AC_MSG_CHECKING([for dlife group]) if ! grep '^dlife:' /etc/group >/dev/null; then AC_MSG_ERROR([there is no 'dlife' group in /etc/group]) fi AC_MSG_RESULT([found]) AC_MSG_CHECKING([for dlife user]) if ! grep '^dlife:' /etc/passwd >/dev/null; then AC_MSG_ERROR([there is no 'dlife' user in /etc/passwd]) fi AC_MSG_RESULT([found]) fi dnl Check for available functions. AC_CHECK_FUNCS( \ closedir \ getpwnam \ getuid \ initgroups \ nice \ opendir \ openlog \ readdir \ setgid \ setuid \ syslog \ ) dnl Check for header files. AC_CHECK_HEADERS( \ assert.h \ dirent.h \ errno.h \ fcntl.h \ grp.h \ pwd.h \ signal.h \ stddef.h \ stdint.h \ string.h \ sys/param.h \ sys/types.h \ syslog.h \ time.h \ unistd.h \ ) dnl Check for a place to install the crontab. dnl The $install_cron variable will have one of the following possible dnl values: dnl yes / auto Try to determine cron dir by automatic means dnl no Do not install crontab dnl standard Use FSSTND layout (/etc/cron.d) dnl /path/to/dir/ Use given directory dnl After this, $install_cron will contain either a path (beginning dnl with /) or "no". AC_MSG_CHECKING([crontab directory]) case "$install_cron" in yes|auto) if test -d $sysconfdir/cron.d; then install_cron=$sysconfdir/cron.d else AC_MSG_ERROR([failed to find a directory to put crontabs in; try --help]) fi ;; standard) install_cron=/etc/cron.d ;; /*) dnl Do nothing. ;; no) dnl Do nothing. ;; *) AC_MSG_ERROR([unknown parameter given to --enable-cron]) ;; esac AC_MSG_RESULT($install_cron) CRONDIR=$install_cron AM_CONDITIONAL(INSTALL_CRON,[test "$install_cron" != "no"]) dnl Check for a place to install rc scripts dnl The $install_rc variable will have one of the following possible dnl values: dnl yes / auto Try to determine rc dir by automatic means dnl no Do not install rc script dnl standard Use red hat / debian / FSSTND layout (/etc/init.d) dnl /path/to/dir/ Use given directory dnl After this, $install_rc will contain either a path (beginning dnl with /) or "no". AC_MSG_CHECKING([rc directory]) case "$install_rc" in yes|auto) if test -d $sysconfdir/init.d; then install_rc=$sysconfdir/init.d else AC_MSG_ERROR([failed to find a directory to put rc scripts in; try --help]) fi ;; standard) install_rc=/etc/init.d ;; /*) dnl Do nothing. ;; no) dnl Do nothing. ;; *) AC_MSG_ERROR([unknown parameter given to --enable-rc]) ;; esac AC_MSG_RESULT($install_rc) RCDIR=$install_rc AM_CONDITIONAL(INSTALL_RC,[test "$install_rc" != "no"]) AC_MSG_CHECKING([spool directory]) AC_MSG_RESULT($SPOOLDIR) AC_MSG_CHECKING([config directory]) AC_MSG_RESULT($CONFDIR) dnl Check for a place to install documentation. AC_MSG_CHECKING([for a place to install documentation]) if test -d $prefix/share/doc; then DOCDIR=$prefix/share/doc/$PACKAGE-$VERSION else DOCDIR=/tmp fi AC_MSG_RESULT($DOCDIR) dnl Release date. RELEASEDATE=`date +"%d %b %Y"` dnl Variables to be substituted. AC_SUBST(CRONDIR) AC_SUBST(RCDIR) AC_SUBST(SPOOLDIR) AC_SUBST(CONFDIR) AC_SUBST(DOCDIR) AC_SUBST(RELEASEDATE) dnl Variables to be placed in config.h. AC_DEFINE_UNQUOTED(SPOOLDIR, "$SPOOLDIR") AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR") dnl Generate output files. AC_OUTPUT([ Makefile dlife_client.pl dlife_server.pl dlife.spec index.html ])