dnl -*- sh -*-
dnl
dnl  Authors:
dnl    Michael Mehl (mehl@dfki.de)
dnl 
dnl  Contributors:
dnl    Denys Duchier, (duchier@ps.uni-sb.de)
dnl 
dnl  Copyright:
dnl    Michael Mehl (1997)
dnl 
dnl  Last change:
dnl    $Date: 2002-07-25 17:45:59 +0200 (Thu, 25 Jul 2002) $ by $Author: duchier $
dnl    $Revision: 15026 $
dnl 
dnl  This file is part of Mozart, an implementation 
dnl  of Oz 3:
dnl     http://www.mozart-oz.org
dnl 
dnl  See the file "LICENSE" or
dnl     http://www.mozart-oz.org/LICENSE.html
dnl  for information on usage and redistribution 
dnl  of this file, and for a DISCLAIMER OF ALL 
dnl  WARRANTIES.
dnl

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

dnl *****************************************************************
dnl INITIALIZE
dnl *****************************************************************

dnl This will check that we are in the Oz directory and initiate
AC_INIT(OZVERSION)

OZ_INIT

AC_MSG_CHECKING(for --enable-contrib)
AC_ARG_ENABLE(contrib,
    [--enable-contrib
	configure the contributions (default: yes)])

if test "${enable_contrib}" != no
then
    : ${oz_enable_contrib=contrib}
    AC_MSG_RESULT(yes)
else
    AC_MSG_RESULT(no)
fi

AC_MSG_CHECKING(for --enable-doc)
AC_ARG_ENABLE(doc,
    [--enable-doc
	configure the documentation (default: yes)])

if test "${enable_doc}" != no
then
    : ${oz_enable_doc=doc}
    AC_MSG_RESULT(yes)
else
    AC_MSG_RESULT(no)
fi

if test "$target" = "i386-mingw32"
then
    : ${oz_subdirs="platform $oz_enable_contrib"}
else
    : ${oz_subdirs="platform share $oz_enable_contrib $oz_enable_doc"}
fi

AC_MSG_CHECKING(for --enable-subdirs)
AC_ARG_ENABLE(subdirs,
    [--enable-subdirs=<dirs>
	which subdirs should be configured (default: $oz_subdirs)])

if test -n "${enable_subdirs}"
then
    case $enable_subdirs in
	no)
	    oz_subdirs=
	    ;;
	yes)
	    ;;
	*)
	    oz_subdirs=${enable_subdirs}
	    ;;
    esac
fi

AC_MSG_RESULT($oz_subdirs)

AC_SUBST(oz_subdirs)

AC_MSG_CHECKING(for --with-stdlib)
AC_ARG_WITH(stdlib,
    [--with-stdlib=DIR
         directory where mozart standard library is checked out (default=NONE)],
    oz_stdlib=${with_stdlib})
: ${oz_stdlib=}
if test -n "$oz_stdlib"; then
  oz_stdlib=`cd "$oz_stdlib" && pwd`
fi
AC_MSG_RESULT($oz_stdlib)
OZSTDLIB="$oz_stdlib"
AC_SUBST(OZSTDLIB)

AC_CONFIG_SUBDIRS($oz_subdirs)

AC_OUTPUT(Makefile)

errprint(ifdef([OZ_INIT],
 [autoconf succeeded.
],
 [autoconf failed: use 'autoconf -l .' to include ./aclocal.m4.
]))
