configure.ac 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. ## Process this file with autoconf to produce a configure script.
  2. # Copyright © 2003, 2005, 2012, 2014 Dale Mellor
  3. # <dale_mellor@users.sourceforge.net>
  4. # Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
  5. #
  6. # This file is part of GNU Mcron.
  7. #
  8. # GNU Mcron is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, either version 3 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # GNU Mcron is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with GNU Mcron. If not, see <http://www.gnu.org/licenses/>.
  20. AC_PREREQ(2.61)
  21. AC_INIT([GNU Mcron],
  22. m4_esyscmd([build-aux/git-version-gen .tarball-version]),
  23. [bug-mcron@gnu.org])
  24. AC_CONFIG_SRCDIR([src/wrapper.c])
  25. AC_CONFIG_AUX_DIR([build-aux])
  26. AC_REQUIRE_AUX_FILE([test-driver.scm])
  27. AC_REQUIRE_AUX_FILE([git-version-gen])
  28. AM_INIT_AUTOMAKE([subdir-objects -Wall -Wno-override])
  29. AM_SILENT_RULES([yes]) # enables silent rules by default
  30. moduledir="${datarootdir}/guile/site/2.0"
  31. AC_SUBST([moduledir])
  32. AC_SUBST([mcronmoduledir], ["${moduledir}/mcron"])
  33. AC_MSG_CHECKING([whether debugging is requested])
  34. AC_ARG_ENABLE(debug,
  35. AC_HELP_STRING([--enable-debug],
  36. [enable debugging and traceback on error]),
  37. CONFIG_DEBUG=$enableval,
  38. CONFIG_DEBUG=no)
  39. AC_MSG_RESULT($CONFIG_DEBUG)
  40. if test "$CONFIG_DEBUG" = "no"; then
  41. CONFIG_DEBUG="#f"
  42. else
  43. CONFIG_DEBUG="#t"
  44. fi
  45. AC_SUBST(CONFIG_DEBUG)
  46. # We have no interest (hence a no-op), but Debian wants this.
  47. AC_ARG_ENABLE(maintainer-mode)
  48. AC_CANONICAL_HOST
  49. AC_PROG_AWK
  50. AC_PROG_EGREP
  51. AM_PROG_CC_C_O
  52. PKG_CHECK_MODULES([GUILE], [guile-2.0 >= 2.0.7])
  53. AC_PATH_PROG([GUILE], [guile])
  54. # search guild
  55. AC_PATH_PROG([GUILD], [guild])
  56. AS_IF([test -z "$ac_cv_path_GUILD"],
  57. [AC_MSG_ERROR(['guild' program cannot be found.])])
  58. # Checks for programs.
  59. AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
  60. AC_CHECK_PROGS(SED, sed)
  61. if test "x$ac_cv_prog_SED" = "x"; then
  62. AC_MSG_ERROR(sed not found)
  63. fi
  64. AC_CHECK_PROGS(HEAD, head)
  65. if test "x$ac_cv_prog_HEAD" = "x"; then
  66. AC_MSG_ERROR(head not found)
  67. fi
  68. AC_CHECK_PROGS(WHICH, which)
  69. if test "x$ac_cv_prog_WHICH" = "x"; then
  70. AC_MSG_ERROR(which not found)
  71. fi
  72. AC_CHECK_PROGS(CP, cp)
  73. if test "x$ac_cv_prog_CP" = "x"; then
  74. AC_MSG_ERROR(cp not found)
  75. fi
  76. # Now find a sendmail or equivalent.
  77. AC_CHECK_PROGS(SENDMAIL, sendmail)
  78. if test "x$ac_cv_prog_SENDMAIL" != "x"; then
  79. AC_MSG_CHECKING(sendmail path and arguments)
  80. ac_cv_prog_SENDMAIL="`$ac_cv_prog_WHICH sendmail` -FCronDaemon -odi -oem "
  81. dnl -or0s"
  82. AC_MSG_RESULT($ac_cv_prog_SENDMAIL)
  83. else
  84. AC_CHECK_PROGS(SENDMAIL, mail)
  85. if test "x$ac_cv_prog_SENDMAIL" != "x"; then
  86. AC_MSG_CHECKING(mail path)
  87. ac_cv_prog_SENDMAIL="`$ac_cv_prog_WHICH mail` -d "
  88. AC_MSG_RESULT($ac_cv_prog_SENDMAIL)
  89. else
  90. AC_MSG_RESULT(No mail program found)
  91. fi
  92. fi
  93. SENDMAIL=$ac_cv_prog_SENDMAIL
  94. # Find out if we are avoiding Vixie.
  95. AC_MSG_CHECKING([whether to avoid clobbering a Vixie installation])
  96. AC_ARG_ENABLE(no-vixie-clobber,
  97. AC_HELP_STRING([--enable-no-vixie-clobber],
  98. [do not install with program names that would override a legacy cron installation]),
  99. NO_VIXIE_CLOBBER=$enableval,
  100. NO_VIXIE_CLOBBER=[no])
  101. AC_MSG_RESULT($NO_VIXIE_CLOBBER)
  102. AC_SUBST(NO_VIXIE_CLOBBER)
  103. # Configure the various files that mcron uses at runtime.
  104. AC_MSG_CHECKING([which spool directory to use])
  105. AC_ARG_WITH(spool-dir,
  106. AC_HELP_STRING([--with-spool-dir],
  107. [the crontab spool directory (/var/cron/tabs)]),
  108. CONFIG_SPOOL_DIR=$withval,
  109. CONFIG_SPOOL_DIR=[/var/cron/tabs])
  110. AC_MSG_RESULT($CONFIG_SPOOL_DIR)
  111. AC_SUBST(CONFIG_SPOOL_DIR)
  112. AC_MSG_CHECKING([name of socket])
  113. AC_ARG_WITH(socket-file,
  114. AC_HELP_STRING([--with-socket-file],
  115. [unix pathname for cron socket (/var/cron/socket)]),
  116. CONFIG_SOCKET_FILE=$withval,
  117. CONFIG_SOCKET_FILE=[/var/cron/socket])
  118. AC_MSG_RESULT($CONFIG_SOCKET_FILE)
  119. AC_SUBST(CONFIG_SOCKET_FILE)
  120. AC_MSG_CHECKING([name of allow file])
  121. AC_ARG_WITH(allow-file,
  122. AC_HELP_STRING([--with-allow-file],
  123. [the file of allowed users (/var/cron/allow)]),
  124. CONFIG_ALLOW_FILE=$withval,
  125. CONFIG_ALLOW_FILE=[/var/cron/allow])
  126. AC_MSG_RESULT($CONFIG_ALLOW_FILE)
  127. AC_SUBST(CONFIG_ALLOW_FILE)
  128. AC_MSG_CHECKING([name of deny file])
  129. AC_ARG_WITH(deny-file,
  130. AC_HELP_STRING([--with-deny-file],
  131. [the file of barred users (/var/cron/deny)]),
  132. CONFIG_DENY_FILE=$withval,
  133. CONFIG_DENY_FILE=[/var/cron/deny])
  134. AC_MSG_RESULT($CONFIG_DENY_FILE)
  135. AC_SUBST(CONFIG_DENY_FILE)
  136. AC_MSG_CHECKING([name of PID file])
  137. AC_ARG_WITH(pid-file,
  138. AC_HELP_STRING([--with-pid-file],
  139. [the file to record cron's PID (/var/run/cron.pid)]),
  140. CONFIG_PID_FILE=$withval,
  141. CONFIG_PID_FILE=[/var/run/cron.pid])
  142. AC_MSG_RESULT($CONFIG_PID_FILE)
  143. AC_SUBST(CONFIG_PID_FILE)
  144. AC_MSG_CHECKING([directory to hold temporary files])
  145. AC_ARG_WITH(tmp-dir,
  146. AC_HELP_STRING([--with-tmp-dir],
  147. [directory to hold temporary files (/tmp)]),
  148. CONFIG_TMP_DIR=$withval,
  149. CONFIG_TMP_DIR=[/tmp])
  150. AC_MSG_RESULT($CONFIG_TMP_DIR)
  151. AC_SUBST(CONFIG_TMP_DIR)
  152. # This is to support `make DESTDIR=...'
  153. real_program_prefix=`echo $program_prefix | sed s/NONE//`
  154. AC_SUBST(real_program_prefix)
  155. AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
  156. [chmod +x pre-inst-env])
  157. AC_CONFIG_FILES([doc/config.texi
  158. Makefile
  159. src/mcron/config.scm])
  160. AC_OUTPUT