]> granicus.if.org Git - fcron/commitdiff
Initial revision
authorthib <thib>
Tue, 12 Sep 2000 16:32:04 +0000 (16:32 +0000)
committerthib <thib>
Tue, 12 Sep 2000 16:32:04 +0000 (16:32 +0000)
configure.in [new file with mode: 0644]

diff --git a/configure.in b/configure.in
new file mode 100644 (file)
index 0000000..c9710cc
--- /dev/null
@@ -0,0 +1,298 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(allow.c)
+AC_PREFIX_DEFAULT(/usr)
+AC_CONFIG_HEADER(config.h)
+AC_PREREQ(2.7)
+
+vers="0.9.2"
+AC_DEFINE_UNQUOTED(VERSION, $version)
+VERSION="$vers"
+AC_SUBST(VERSION)
+
+if test "X$CFLAGS" = "X"; then
+CFLAGS=-O
+fi
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+
+dnl Checks for libraries.
+
+dnl Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS(fcntl.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+AC_HEADER_TIME
+AC_STRUCT_TM
+AC_TYPE_UID_T
+
+dnl Checks for library functions.
+AC_PROG_GCC_TRADITIONAL
+AC_FUNC_MEMCMP
+AC_TYPE_SIGNAL
+AC_FUNC_STRFTIME
+AC_FUNC_WAIT3
+AC_FUNC_GETLOADAVG
+AC_CHECK_FUNCS(getcwd gettimeofday mktime putenv strerror)
+
+dnl Checks for programs.
+
+AC_ARG_WITH(sendmail,
+[  --with-sendmail=PATH    Path to sendmail.],
+[ case "$withval" in
+  no)
+    AC_MSG_CHECKING(sendmail)
+    AC_MSG_WARN([
+
+Without sendmail you won't get the output of the jobs by mail
+])
+    ;;
+  yes)
+    AC_PATH_PROG(SENDMAIL, sendmail, , $PATH:/usr/lib:/usr/sbin )
+    if test "$ac_cv_path_SENDMAIL" != "" ; then
+      AC_DEFINE_UNQUOTED(SENDMAIL,"$ac_cv_path_SENDMAIL")
+    else
+      AC_MSG_ERROR([
+Cannot determine path to sendmail: try option with-sendmail=PATH])
+    fi
+    ;;
+  *)
+    AC_MSG_CHECKING(sendmail)
+    if test -x "$withval"; then
+      AC_DEFINE_UNQUOTED(SENDMAIL, "$withval")
+      AC_MSG_RESULT($withval)
+    else
+      AC_MSG_ERROR([
+file $withval does not exist])
+    fi
+    ;;
+  esac ], [
+  AC_PATH_PROG(SENDMAIL, sendmail, , $PATH:/usr/lib:/usr/sbin )
+  if test "$ac_cv_path_SENDMAIL" != "" ; then
+     AC_DEFINE_UNQUOTED(SENDMAIL,"$ac_cv_path_SENDMAIL")
+  else
+     AC_MSG_ERROR([
+Cannot determine path to sendmail: try option with-sendmail=PATH])
+  fi ]
+)
+
+AC_ARG_WITH(shell,
+[  --with-shell=PATH    Path to default shell (by default, path to sh).],
+[ case "$withval" in
+  no)
+    AC_MSG_CHECKING(shell)
+    AC_MSG_ERROR(Need a default shell)
+    ;;
+  yes)
+    AC_PATH_PROG(SHELL, sh, , $PATH)
+    if test "$ac_cv_path_SHELL" != "" ; then
+      AC_DEFINE_UNQUOTED(SHELL,"$ac_cv_path_SHELL")
+    else
+      AC_MSG_ERROR([
+Cannot determine path to sh: try option with-shell=PATH])
+    fi
+    ;;
+  *)
+    AC_MSG_CHECKING(shell)
+    if test -x "$withval"; then
+      AC_DEFINE_UNQUOTED(SHELL, "$withval")
+      AC_MSG_RESULT($withval)
+    else
+      AC_MSG_ERROR([
+file $withval does not exist])
+    fi
+    ;;
+  esac ], [
+  AC_PATH_PROG(SHELL, sh, , $PATH)
+  if test "$ac_cv_path_SHELL" != "" ; then
+     AC_DEFINE_UNQUOTED(SHELL,"$ac_cv_path_SHELL")
+  else
+     AC_MSG_ERROR([
+Cannot determine path to sh: try option with-shell=PATH])
+  fi ]
+)
+
+AC_ARG_WITH(editor,
+[  --with-editor=PATH    Path to default editor (by default, path to vi.],
+[ case "$withval" in
+  no)
+    AC_MSG_CHECKING(editor)
+    AC_MSG_ERROR([Need a default editor])
+    ;;
+  yes)
+    AC_PATH_PROG(EDITOR, vi)
+    if test "$ac_cv_path_EDITOR" != "" ; then
+      AC_DEFINE_UNQUOTED(EDITOR,"$ac_cv_path_EDITOR")
+    else
+      AC_MSG_ERROR([
+Cannot determine path to vi: try option with-editor=PATH])
+    fi
+    ;;
+  *)
+    AC_MSG_CHECKING(editor)
+    if test -x "$withval"; then
+      AC_DEFINE_UNQUOTED(EDITOR, "$withval")
+      AC_MSG_RESULT($withval)
+    else
+      AC_MSG_ERROR([
+file $withval does not exist])
+    fi
+    ;;
+  esac ], [
+  AC_PATH_PROG(EDITOR, vi)
+  if test "$ac_cv_path_EDITOR" != "" ; then
+     AC_DEFINE_UNQUOTED(EDITOR,"$ac_cv_path_EDITOR")
+  else
+     AC_MSG_ERROR([
+Cannot determine path to vi: try option with-editor=PATH])
+  fi ]
+)
+
+AC_MSG_CHECKING(etcdir)
+AC_ARG_WITH(etcdir,
+[  --with-etcdir=PATH      Directory containing permission files (default /etc).],
+[ case "$withval" in
+  no)
+    AC_MSG_ERROR(Need ETCDIR.)
+    ;;
+  yes)
+    etcdir=/etc
+    AC_MSG_RESULT(/etc)
+    ;;
+  *)
+    if test -d "$withval"; then
+      etcdir="$withval"
+      AC_MSG_RESULT($withval)
+    else
+      AC_MSG_ERROR(directory $withval does not exist)
+    fi
+    ;;
+  esac ],
+  if test -d "/etc"; then
+    etcdir="/etc"
+    AC_MSG_RESULT(/etc)
+  else
+    AC_MSG_ERROR(directory $withval does not exist)
+  fi
+)
+ETC="$etcdir"
+AC_DEFINE_UNQUOTED(ETC, "$etcdir")
+AC_SUBST(ETC)
+
+AC_MSG_CHECKING(location of pid file)
+if test -d /var/run ; then
+    AC_DEFINE(PIDFILE, "/var/run/fcron.pid")
+    AC_MSG_RESULT(/var/run)
+elif test -d /usr/run ; then
+    AC_DEFINE(PIDFILE, "/usr/run/fcron.pid")
+    AC_MSG_RESULT(/usr/run)
+else
+    AC_DEFINE_UNQUOTED(PIDFILE, "$ETC/fcron.pid")
+    AC_MSG_RESULT($ETC)
+fi
+
+AC_MSG_CHECKING(location of spool directory)
+AC_ARG_WITH(spooldir,
+[  --with-spooldir=PATH    Directory containing fcron spool (default /var/spool/fcron).],
+[ case "$withval" in
+  no)
+    AC_MSG_ERROR(Need SPOOLDIR.)
+    ;;
+  yes)
+    if test -d /var/spool/fcron ; then
+        sp=/var/spool/fcron
+        AC_DEFINE(FCRONTABS, "/var/spool/fcron")
+        AC_MSG_RESULT(Using existing /var/spool/fcron)
+    elif  test -d /var/spool/ ; then
+       sp=/var/spool/fcron
+       AC_DEFINE(FCRONTABS, "/var/spool/fcron")
+       AC_MSG_RESULT(/var/spool/fcron)
+    elif test -d /usr/spool/ ; then
+       sp=/usr/spool/fcron
+       AC_DEFINE(FCRONTABS, "/usr/spool/fcron")
+       AC_MSG_RESULT(/usr/spool/fcron)
+    else
+       AC_MSG_ERROR(Cannot determine value for spool directory)
+    fi
+    ;;
+  *)
+    if test -d "$withval"; then
+      AC_DEFINE_UNQUOTED(FCRONTABS, "$withval")
+      AC_MSG_RESULT($withval)
+    else
+      AC_MSG_ERROR(directory $withval does not exist)
+    fi
+    ;;
+  esac ],
+  if test -d /var/spool/fcron ; then
+      sp=/var/spool/fcron
+      AC_DEFINE(FCRONTABS, "/var/spool/fcron")
+      AC_MSG_RESULT(Using existing /var/spool/fcron)
+  elif  test -d /var/spool/ ; then
+      sp=/var/spool/fcron
+      AC_DEFINE(FCRONTABS, "/var/spool/fcron")
+      AC_MSG_RESULT(/var/spool/fcron)
+  elif test -d /usr/spool/ ; then
+      sp=/usr/spool/fcron
+      AC_DEFINE(FCRONTABS, "/usr/spool/fcron")
+      AC_MSG_RESULT(/usr/spool/fcron)
+  else
+      AC_MSG_ERROR(Cannot determine value for spool directory)
+  fi
+)
+FCRONTABS="$sp"
+AC_SUBST(FCRONTABS)
+
+if test "X$HAVE_GETLOADAVG" = "X"  ; then
+AC_MSG_CHECKING(proc directory)
+AC_ARG_WITH(proc,
+[  --with-proc=PATH    Directory where procfs is mounted (default /proc).],
+[ case "$withval" in
+  no)
+    AC_MSG_WARN([
+Without proc, you won't be able to use the lavg* options 
+])
+    ;;
+  yes)
+    if test -f /proc/loadavg ; then
+        proc="/proc"
+        AC_DEFINE(PROC, "/proc")
+        AC_MSG_RESULT(/proc)
+    else
+       AC_MSG_ERROR(Cannot determine value for spool directory)
+    fi
+    ;;
+  *)
+    if test -f "$withval/loadavg"; then
+      AC_DEFINE_UNQUOTED(PROC, "$withval")
+      AC_MSG_RESULT($withval)
+    else
+      AC_MSG_ERROR(directory $withval does not exist)
+    fi
+    ;;
+  esac ],
+  if test -f "/proc/loadavg" ; then
+      proc="/proc"
+      AC_DEFINE(PROC, "/proc")
+      AC_MSG_RESULT(/proc)
+  else
+     AC_MSG_ERROR(Cannot determine value for spool directory)
+  fi
+)
+PROC="$proc"
+AC_SUBST(PROC)
+fi
+
+
+
+AC_OUTPUT(Makefile)
+