1## Process this file with autoconf to produce a configure script.
2#
3# Copyright © 2003, 2005, 2012, 2014 Dale Mellor <mcron-lsfnyl@rdmp.org>
4# Copyright © 2015, 2016, 2017, 2018, 2020 Mathieu Lirzin <mthl@gnu.org>
5# Copyright © 2018 宋文武 <iyzsong@member.fsf.org>
6#
7# This file is part of GNU Mcron.
8#
9# GNU Mcron is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# GNU Mcron is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with GNU Mcron.  If not, see <http://www.gnu.org/licenses/>.
21
22AC_PREREQ([2.69])
23AC_INIT([GNU Mcron],[1.2.1],[bug-mcron@gnu.org])
24AC_CONFIG_SRCDIR([src/mcron/scripts/mcron.scm])
25AC_CONFIG_AUX_DIR([build-aux])
26AC_REQUIRE_AUX_FILE([test-driver.scm])
27
28dnl We're fine with GNU make constructs, hence '-Wno-portability'.
29AM_INIT_AUTOMAKE([1.11 gnu silent-rules subdir-objects color-tests
30                  -Wall -Wno-override -Wno-portability std-options])
31
32AM_SILENT_RULES([yes])		# Enables silent rules by default.
33
34AC_CANONICAL_HOST
35
36dnl We require pkg.m4 (from pkg-config) and guile.m4 (from Guile.)
37dnl Make sure they are available when generating the configure script.
38m4_pattern_forbid([^PKG_PROG])
39m4_pattern_forbid([^PKG_CHECK])
40m4_pattern_forbid([^GUILE_P])
41m4_pattern_allow([^GUILE_PKG_ERRORS])
42m4_pattern_allow([^GUILE_PKG])
43m4_pattern_allow([^GUILE_PROGS])
44
45# Check for latest Guile development files.
46GUILE_PKG([3.0 2.2 2.0])
47
48# Checks for programs.
49GUILE_PROGS
50
51AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
52
53# Let users choose the Mail Transfert Agent (MTA) of their choice.  Default to
54# a non-absolute program name to make it a loose dependency resolved at
55# runtime.
56AC_ARG_WITH([sendmail],
57  [AS_HELP_STRING([--with-sendmail=COMMAND],
58    [command to read an email message from standard input, and send it])],
59  [SENDMAIL="$withval"],
60  [SENDMAIL="sendmail -t"])
61AC_SUBST([SENDMAIL])
62
63AC_ARG_ENABLE([multi-user],
64  [AS_HELP_STRING([--disable-multi-user],
65    [Don't Install legacy cron and crontab programs])],
66  [enable_multi_user="$enableval"],
67  [enable_multi_user="yes"])
68AM_CONDITIONAL([MULTI_USER], [test "x$enable_multi_user" = xyes])
69
70# Configure the various files that mcron uses at runtime.
71
72AC_MSG_CHECKING([which spool directory to use])
73AC_ARG_WITH(spool-dir,
74            AS_HELP_STRING([--with-spool-dir],[the crontab spool directory (/var/cron/tabs)]),
75            CONFIG_SPOOL_DIR=$withval,
76            CONFIG_SPOOL_DIR=[/var/cron/tabs])
77AC_MSG_RESULT($CONFIG_SPOOL_DIR)
78AC_SUBST(CONFIG_SPOOL_DIR)
79
80AC_MSG_CHECKING([name of socket])
81AC_ARG_WITH(socket-file,
82            AS_HELP_STRING([--with-socket-file],[unix pathname for cron socket (/var/cron/socket)]),
83            CONFIG_SOCKET_FILE=$withval,
84            CONFIG_SOCKET_FILE=[/var/cron/socket])
85AC_MSG_RESULT($CONFIG_SOCKET_FILE)
86AC_SUBST(CONFIG_SOCKET_FILE)
87
88AC_MSG_CHECKING([name of allow file])
89AC_ARG_WITH(allow-file,
90            AS_HELP_STRING([--with-allow-file],[the file of allowed users (/var/cron/allow)]),
91            CONFIG_ALLOW_FILE=$withval,
92            CONFIG_ALLOW_FILE=[/var/cron/allow])
93AC_MSG_RESULT($CONFIG_ALLOW_FILE)
94AC_SUBST(CONFIG_ALLOW_FILE)
95
96AC_MSG_CHECKING([name of deny file])
97AC_ARG_WITH(deny-file,
98            AS_HELP_STRING([--with-deny-file],[the file of barred users (/var/cron/deny)]),
99            CONFIG_DENY_FILE=$withval,
100            CONFIG_DENY_FILE=[/var/cron/deny])
101AC_MSG_RESULT($CONFIG_DENY_FILE)
102AC_SUBST(CONFIG_DENY_FILE)
103
104AC_MSG_CHECKING([name of PID file])
105AC_ARG_WITH(pid-file,
106            AS_HELP_STRING([--with-pid-file],[the file to record cron's PID (/var/run/cron.pid)]),
107            CONFIG_PID_FILE=$withval,
108            CONFIG_PID_FILE=[/var/run/cron.pid])
109AC_MSG_RESULT($CONFIG_PID_FILE)
110AC_SUBST(CONFIG_PID_FILE)
111
112AC_MSG_CHECKING([directory to hold temporary files])
113AC_ARG_WITH(tmp-dir,
114            AS_HELP_STRING([--with-tmp-dir],[directory to hold temporary files (/tmp)]),
115            CONFIG_TMP_DIR=$withval,
116            CONFIG_TMP_DIR=[/tmp])
117AC_MSG_RESULT($CONFIG_TMP_DIR)
118AC_SUBST(CONFIG_TMP_DIR)
119
120# Include the Maintainer's Makefile fragment, if it's here.
121MAINT_MAKEFILE=/dev/null
122AS_IF([test -r "$srcdir/maint.mk"],
123      [MAINT_MAKEFILE="$srcdir/maint.mk"])
124AC_SUBST_FILE([MAINT_MAKEFILE])
125
126AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
127                [chmod +x pre-inst-env])
128AC_CONFIG_FILES([doc/config.texi
129                 Makefile
130                 src/mcron/config.scm])
131AC_OUTPUT
132