1 # DLIFE (C) 2000 Richard W.M. Jones <rich@annexia.org>
2 # and other authors listed in the ``AUTHORS'' file.
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # $Id: configure.in,v 1.3 2002/04/05 17:02:25 rich Exp $
21 AM_INIT_AUTOMAKE(dlife, 1.0.0)
22 AM_CONFIG_HEADER(config.h)
24 dnl Check for the basic compile environment.
29 dnl Enable compiler warnings.
30 if test "$CC" = "gcc"; then
31 CFLAGS="$CFLAGS -Wall -Werror"
34 dnl Check for arguments to configure.
37 [ --enable-check Enable extra internal consistency checks (slow)],
38 CFLAGS="$CFLAGS -DCHECK=1"
43 [ --enable-profile Enable code profiling],
49 [ --disable-user-check Do not check for existance of dlife account],
56 [ --enable-cron[=layout] Install cron script to run dlife net client
57 'layout' may be 'auto' (default), 'standard',
58 or a path to crontab directory starting with /
59 --disable-cron Do not install cron script],
60 install_cron="$enableval",
66 [ --enable-rc[=layout] Install rc script (runs dlife_soup at boot)
67 'layout' may be 'auto' (default), 'standard',
68 or a path to local rc directory starting with /
69 --disable-rc Do not install rc script],
70 install_rc="$enableval",
76 [ --with-spool=DIR Spool directory (default typically /var/spool/dlife)],
78 FC_EXPAND_DIR(SPOOLDIR, '${localstatedir}/spool/dlife')
83 [ --with-conf=DIR Config directory (default typically /etc/dlife)],
85 FC_EXPAND_DIR(CONFDIR, '${sysconfdir}/dlife')
88 dnl Check for ``dlife'' account.
89 if test "$user_check" = "yes"; then
90 AC_MSG_CHECKING([for dlife group])
91 if ! grep '^dlife:' /etc/group >/dev/null; then
92 AC_MSG_ERROR([there is no 'dlife' group in /etc/group])
94 AC_MSG_RESULT([found])
96 AC_MSG_CHECKING([for dlife user])
97 if ! grep '^dlife:' /etc/passwd >/dev/null; then
98 AC_MSG_ERROR([there is no 'dlife' user in /etc/passwd])
100 AC_MSG_RESULT([found])
103 dnl Check for available functions.
118 dnl Check for header files.
137 dnl Check for a place to install the crontab.
138 dnl The $install_cron variable will have one of the following possible
140 dnl yes / auto Try to determine cron dir by automatic means
141 dnl no Do not install crontab
142 dnl standard Use FSSTND layout (/etc/cron.d)
143 dnl /path/to/dir/ Use given directory
144 dnl After this, $install_cron will contain either a path (beginning
147 AC_MSG_CHECKING([crontab directory])
149 case "$install_cron" in
151 if test -d $sysconfdir/cron.d; then
152 install_cron=$sysconfdir/cron.d
154 AC_MSG_ERROR([failed to find a directory to put crontabs in; try --help])
158 install_cron=/etc/cron.d
167 AC_MSG_ERROR([unknown parameter given to --enable-cron])
171 AC_MSG_RESULT($install_cron)
172 CRONDIR=$install_cron
174 AM_CONDITIONAL(INSTALL_CRON,[test "$install_cron" != "no"])
176 dnl Check for a place to install rc scripts
177 dnl The $install_rc variable will have one of the following possible
179 dnl yes / auto Try to determine rc dir by automatic means
180 dnl no Do not install rc script
181 dnl standard Use red hat / debian / FSSTND layout (/etc/init.d)
182 dnl /path/to/dir/ Use given directory
183 dnl After this, $install_rc will contain either a path (beginning
186 AC_MSG_CHECKING([rc directory])
188 case "$install_rc" in
190 if test -d $sysconfdir/init.d; then
191 install_rc=$sysconfdir/init.d
193 AC_MSG_ERROR([failed to find a directory to put rc scripts in; try --help])
197 install_rc=/etc/init.d
206 AC_MSG_ERROR([unknown parameter given to --enable-rc])
210 AC_MSG_RESULT($install_rc)
213 AM_CONDITIONAL(INSTALL_RC,[test "$install_rc" != "no"])
215 AC_MSG_CHECKING([spool directory])
216 AC_MSG_RESULT($SPOOLDIR)
218 AC_MSG_CHECKING([config directory])
219 AC_MSG_RESULT($CONFDIR)
221 dnl Check for a place to install documentation.
222 AC_MSG_CHECKING([for a place to install documentation])
223 if test -d $prefix/share/doc; then
224 DOCDIR=$prefix/share/doc/$PACKAGE-$VERSION
228 AC_MSG_RESULT($DOCDIR)
231 RELEASEDATE=`date +"%d %b %Y"`
233 dnl Variables to be substituted.
239 AC_SUBST(RELEASEDATE)
241 dnl Variables to be placed in config.h.
242 AC_DEFINE_UNQUOTED(SPOOLDIR, "$SPOOLDIR")
243 AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR")
245 dnl Generate output files.