dnl  fsh - fast remote execution
dnl  Copyright (C) 1999-2001 by Per Cederqvist
dnl
dnl  This program is free software; you can redistribute it and/or modify
dnl  it under the terms of the GNU General Public License as published by
dnl  the Free Software Foundation; either version 2 of the License, or
dnl  (at your option) any later version.
dnl
dnl  This program is distributed in the hope that it will be useful,
dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl  GNU General Public License for more details.
dnl
dnl  You should have received a copy of the GNU General Public License
dnl  along with this program; if not, write to the Free Software
dnl  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */

dnl Process this file with autoconf to produce a configure script.

AC_REVISION($Revision: 1.16 $)dnl
AC_INIT(fsh.texi)
AM_INIT_AUTOMAKE(fsh, 1.2)

AC_ARG_ENABLE([trampoline], 
[   --enable-trampoline    Use /bin/sh to start Python scripts])

AC_ARG_ENABLE([timeout], 
[   --enable-timeout=X     Set default timeout for fshd, in seconds.
   --disable-timout       Disable the timeout. (Default: 10 hours.)])

[if test -z "$enable_timeout"
then
    enable_timeout=yes
fi
case "$enable_timeout" in
    yes) enable_timeout=36000;;
    no)  enable_timeout=None;;
    *)	 if test -n "`echo $enable_timeout|sed 's/[0-9]*//g'`"
	 then]
	     AC_MSG_ERROR([invalid value $enable_timeout for timeout])
	 [fi
esac
DEFAULT_FSHD_TIMEOUT=$enable_timeout]
AC_SUBST(DEFAULT_FSHD_TIMEOUT)

dnl Checks for programs.

AC_PATH_PROG(PYTHON, python, nopython)
[if test "$PYTHON" = nopython
then]
    AC_ERROR([cannot find python in \$PATH, which is set to $PATH])
[fi]

AC_MSG_CHECKING([whether to use /bin/sh trampolines])
[if test "$enable_trampoline" = yes
then
    PYTHON_SCRIPT_TEMPLATE=trampoline
else
    PYTHON_SCRIPT_TEMPLATE=simple
    enable_trampoline=no
fi]
AC_SUBST(PYTHON_SCRIPT_TEMPLATE)
AC_MSG_RESULT($enable_trampoline)

AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CC
AM_PROG_CC_STDC

AC_OUTPUT(Makefile fshconfig.py)
