dnl replace install-sh by the name of a real source file
AC_INIT(ozinstall)
AC_PREFIX_DEFAULT(/usr/local/oz)
AC_CANONICAL_HOST
AC_PROG_MAKE_SET
dnl
dnl
dnl
AC_DEFUN(OZSKEL_MAKE_ABSOLUTE,[
  if expr "$[$1]" : "\/" >/dev/null; then
      : ;
  else
      ozcur=`pwd`
      [$1]="$ozcur/$[$1]"
  fi
])
dnl
dnl
dnl
srcdir=`cd $srcdir 2> /dev/null && pwd`
if test "$prefix" = NONE; then
  prefix="$ac_default_prefix"
fi
OZSKEL_MAKE_ABSOLUTE(prefix)
dnl
dnl
dnl
AC_PATH_PROGS(VAR_OZE,ozengine ozengine.exe,UNDEFINED,$prefix/bin:$PATH)
if test "$VAR_OZE" = "UNDEFINED"; then
    AC_MSG_ERROR([ozengine not found])
fi
AC_SUBST(VAR_OZE)
dnl
dnl
dnl
changequote(<,>)
OZHOME=`expr "${VAR_OZE}" : '\(.*\)/[^/]*/[^/]*$' || echo "."`
changequote([,])
AC_SUBST(OZHOME)
dnl
dnl
dnl
AC_PATH_PROGS(VAR_OZC,ozc ozc.exe,UNDEFINED,$prefix/bin:$PATH)
if test "$VAR_OZC" = "UNDEFINED"; then
  AC_MSG_ERROR([ozc not found])
fi
AC_SUBST(VAR_OZC)
dnl
dnl
dnl
AC_PATH_PROGS(VAR_OZL,ozl ozl.exe,UNDEFINED,$prefix/bin:$PATH)
if test "$VAR_OZL" = "UNDEFINED"; then
  AC_MSG_ERROR([ozl not found])
fi
AC_SUBST(VAR_OZL)
dnl
dnl
dnl
AC_PATH_PROGS(VAR_OZTOOL,oztool oztool.exe,UNDEFINED,$prefix/bin:$PATH)
if test "$VAR_OZTOOL" = "UNDEFINED"; then
  AC_MSG_ERROR([oztool not found])
fi
AC_SUBST(VAR_OZTOOL)
dnl
dnl
dnl
AC_PATH_PROGS(VAR_XSLTPROC,xsltproc xsltproc.exe,UNDEFINED,$prefix/bin:$PATH)
AC_SUBST(VAR_XSLTPROC)
dnl
dnl
dnl
AC_PATH_PROGS(VAR_LYNX,lynx lynx.exe,UNDEFINED,$prefix/bin:$PATH)
if test "$VAR_LYNX" = UNDEFINED; then
    AC_PATH_PROGS(VAR_ELINKS,elinks elinks.exe,UNDEFINED,$prefix/bin:$PATH)
    if test "$VAR_ELINKS" = UNDEFINED; then
	VAR_HTML_TO_TEXT=UNDEFINED
    else
	VAR_HTML_TO_TEXT=elinks
    fi
else
    VAR_HTML_TO_TEXT=lynx
fi
AC_SUBST(VAR_HTML_TO_TEXT)
AC_SUBST(VAR_LYNX)
AC_SUBST(VAR_ELINKS)
dnl
dnl
dnl
VAR_OZINSTALL="$srcdir/ozinstall"
AC_SUBST(VAR_OZINSTALL)
AC_OUTPUT(Makefile)
