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

AC_INIT(install-sh)
AC_CONFIG_HEADER(config.h)

AC_SUBST(SP_PATH)
AC_SUBST(PLINCLUDE)
AC_SUBST(COFLAGS)
AC_SUBST(CWFLAGS)
AC_SUBST(CMFLAGS)

AC_PROG_CC

AC_CHECK_PROGS(MAKE, gmake make, "make")
AC_CHECK_PROGS(RANLIB, ranlib, ":")
AC_CHECK_PROG(AR, ar, ar, ar)
AC_PROG_INSTALL
AC_ISC_POSIX
AC_HEADER_STDC
if test ! -z "$GCC"; then
    COFLAGS=-O2
    CWFLAGS=-Wall
else
    COFLAGS=-O
    CWFLAGS=
fi
CFLAGS="$CMFLAGS"
AC_FUNC_ALLOCA

AC_CHECK_PROGS(SICSTUS, sicstus, ":")
if test $SICSTUS != ":"; then
cat > conftest.sh << _EOS_
$SICSTUS << _EOF_
absolute_file_name('\\\$SP_PATH', X),
write(X), nl, halt(0).
halt(1).
_EOF_
_EOS_
SP_PATH=`sh conftest.sh 2>/dev/null`
rm -f conftest.sh

if test ! -d "$SP_PATH"; then SP_PATH=""; fi
fi

AC_CHECK_HEADERS(malloc.h unistd.h sys/time.h fcntl.h)

AC_OUTPUT(Makefile)
