#! /bin/sh

# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.13 
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.

# Defaults:
ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_default_prefix=/usr/local/oz
ac_help="$ac_help
--with-inc-dir=d1,...,dn	add these dirs to CPPFLAGS"
ac_help="$ac_help
--with-lib-dir=d1,...,dn	add these dirs to LDFLAGS"
ac_help="$ac_help
--enable-denys-events enable new events mechanism (default=no)"
ac_help="$ac_help
--enable-site-property enable site property support (default=no)"
ac_help="$ac_help
--with-sunpro      use sunpro compiler (default: no)"
ac_help="$ac_help
--with-cxx=<CXX>	use <CXX> as C++ compiler (default=NONE)"
ac_help="$ac_help
--enable-warnings  print c warnings (default=no)"
ac_help="$ac_help
--enable-errors  c warnings abort make (default=no)"
ac_help="$ac_help
--enable-link-static  link system libraries statically (default=no)"
ac_help="$ac_help
--enable-malloc-heap	use malloc for Oz heap memory allocation"
ac_help="$ac_help
--enable-mmap-heap	use mmap for Oz heap memory allocation"
ac_help="$ac_help
--enable-sbrk-heap	use sbrk for Oz heap memory allocation"
ac_help="$ac_help
--with-gmp=<dir>   search gmp library and header in <dir> (default: yes)"
ac_help="$ac_help
--with-zlib=<dir>  search zlib library and header in <dir> (default: yes)"
ac_help="$ac_help
--with-ccmalloc    use debugging malloc library ccmalloc "
ac_help="$ac_help
--enable-opt=<k>   add specialied compile options (default=yes)
                   (o|yes=optimize, d=debug, no|none, p=profile, rsp=ralfs profile)"
ac_help="$ac_help
--enable-threaded  threaded code emulator (default=yes)"
ac_help="$ac_help
--enable-fastreg   fast register access (default=yes)"
ac_help="$ac_help
--enable-fasterreg   even faster temporary register access (default=yes)"
ac_help="$ac_help
--enable-fastarith   use fast arithemtic (assembly), if available (default=no)"
ac_help="$ac_help
--enable-modules-static  link modules statically (default=$oz_enable_modules_static)"
ac_help="$ac_help
--with-malloc=<obj>      use malloc from object file <obj> (default: NONE)"
ac_help="$ac_help
--enable-virtualsites    provide support for virtual sites (default=no)"
ac_help="$ac_help
--enable-miscbuiltins    include misc builtins (default=no)"

# Initialize some variables set by options.
# The variables have the same names as the options, with
# dashes changed to underlines.
build=NONE
cache_file=./config.cache
exec_prefix=NONE
host=NONE
no_create=
nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
mandir='${prefix}/man'

# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12

ac_prev=
for ac_option
do

  # If the previous option needs an argument, assign it.
  if test -n "$ac_prev"; then
    eval "$ac_prev=\$ac_option"
    ac_prev=
    continue
  fi

  case "$ac_option" in
  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) ac_optarg= ;;
  esac

  # Accept the important Cygnus configure options, so we can diagnose typos.

  case "$ac_option" in

  -bindir | --bindir | --bindi | --bind | --bin | --bi)
    ac_prev=bindir ;;
  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
    bindir="$ac_optarg" ;;

  -build | --build | --buil | --bui | --bu)
    ac_prev=build ;;
  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
    build="$ac_optarg" ;;

  -cache-file | --cache-file | --cache-fil | --cache-fi \
  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
    ac_prev=cache_file ;;
  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
    cache_file="$ac_optarg" ;;

  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
    ac_prev=datadir ;;
  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  | --da=*)
    datadir="$ac_optarg" ;;

  -disable-* | --disable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    eval "enable_${ac_feature}=no" ;;

  -enable-* | --enable-*)
    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
    fi
    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "enable_${ac_feature}='$ac_optarg'" ;;

  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  | --exec | --exe | --ex)
    ac_prev=exec_prefix ;;
  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  | --exec=* | --exe=* | --ex=*)
    exec_prefix="$ac_optarg" ;;

  -gas | --gas | --ga | --g)
    # Obsolete; use --with-gas.
    with_gas=yes ;;

  -help | --help | --hel | --he)
    # Omit some internal or obsolete options to make the list less imposing.
    # This message is too long to be a string in the A/UX 3.1 sh.
    cat << EOF
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
  --cache-file=FILE       cache test results in FILE
  --help                  print this message
  --no-create             do not create output files
  --quiet, --silent       do not print \`checking...' messages
  --version               print the version of autoconf that created configure
Directory and file names:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [same as prefix]
  --bindir=DIR            user executables in DIR [EPREFIX/bin]
  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  --datadir=DIR           read-only architecture-independent data in DIR
                          [PREFIX/share]
  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
                          [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  --includedir=DIR        C header files in DIR [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  --infodir=DIR           info documentation in DIR [PREFIX/info]
  --mandir=DIR            man documentation in DIR [PREFIX/man]
  --srcdir=DIR            find the sources in DIR [configure dir or ..]
  --program-prefix=PREFIX prepend PREFIX to installed program names
  --program-suffix=SUFFIX append SUFFIX to installed program names
  --program-transform-name=PROGRAM
                          run sed PROGRAM on installed program names
EOF
    cat << EOF
Host type:
  --build=BUILD           configure for building on BUILD [BUILD=HOST]
  --host=HOST             configure for HOST [guessed]
  --target=TARGET         configure for TARGET [TARGET=HOST]
Features and packages:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --x-includes=DIR        X include files are in DIR
  --x-libraries=DIR       X library files are in DIR
EOF
    if test -n "$ac_help"; then
      echo "--enable and --with options recognized:$ac_help"
    fi
    exit 0 ;;

  -host | --host | --hos | --ho)
    ac_prev=host ;;
  -host=* | --host=* | --hos=* | --ho=*)
    host="$ac_optarg" ;;

  -includedir | --includedir | --includedi | --included | --include \
  | --includ | --inclu | --incl | --inc)
    ac_prev=includedir ;;
  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  | --includ=* | --inclu=* | --incl=* | --inc=*)
    includedir="$ac_optarg" ;;

  -infodir | --infodir | --infodi | --infod | --info | --inf)
    ac_prev=infodir ;;
  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
    infodir="$ac_optarg" ;;

  -libdir | --libdir | --libdi | --libd)
    ac_prev=libdir ;;
  -libdir=* | --libdir=* | --libdi=* | --libd=*)
    libdir="$ac_optarg" ;;

  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  | --libexe | --libex | --libe)
    ac_prev=libexecdir ;;
  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  | --libexe=* | --libex=* | --libe=*)
    libexecdir="$ac_optarg" ;;

  -localstatedir | --localstatedir | --localstatedi | --localstated \
  | --localstate | --localstat | --localsta | --localst \
  | --locals | --local | --loca | --loc | --lo)
    ac_prev=localstatedir ;;
  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
    localstatedir="$ac_optarg" ;;

  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
    ac_prev=mandir ;;
  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
    mandir="$ac_optarg" ;;

  -nfp | --nfp | --nf)
    # Obsolete; use --without-fp.
    with_fp=no ;;

  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c)
    no_create=yes ;;

  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
    no_recursion=yes ;;

  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  | --oldin | --oldi | --old | --ol | --o)
    ac_prev=oldincludedir ;;
  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
    oldincludedir="$ac_optarg" ;;

  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
    ac_prev=prefix ;;
  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
    prefix="$ac_optarg" ;;

  -program-prefix | --program-prefix | --program-prefi | --program-pref \
  | --program-pre | --program-pr | --program-p)
    ac_prev=program_prefix ;;
  -program-prefix=* | --program-prefix=* | --program-prefi=* \
  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
    program_prefix="$ac_optarg" ;;

  -program-suffix | --program-suffix | --program-suffi | --program-suff \
  | --program-suf | --program-su | --program-s)
    ac_prev=program_suffix ;;
  -program-suffix=* | --program-suffix=* | --program-suffi=* \
  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
    program_suffix="$ac_optarg" ;;

  -program-transform-name | --program-transform-name \
  | --program-transform-nam | --program-transform-na \
  | --program-transform-n | --program-transform- \
  | --program-transform | --program-transfor \
  | --program-transfo | --program-transf \
  | --program-trans | --program-tran \
  | --progr-tra | --program-tr | --program-t)
    ac_prev=program_transform_name ;;
  -program-transform-name=* | --program-transform-name=* \
  | --program-transform-nam=* | --program-transform-na=* \
  | --program-transform-n=* | --program-transform-=* \
  | --program-transform=* | --program-transfor=* \
  | --program-transfo=* | --program-transf=* \
  | --program-trans=* | --program-tran=* \
  | --progr-tra=* | --program-tr=* | --program-t=*)
    program_transform_name="$ac_optarg" ;;

  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  | -silent | --silent | --silen | --sile | --sil)
    silent=yes ;;

  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
    ac_prev=sbindir ;;
  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  | --sbi=* | --sb=*)
    sbindir="$ac_optarg" ;;

  -sharedstatedir | --sharedstatedir | --sharedstatedi \
  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  | --sharedst | --shareds | --shared | --share | --shar \
  | --sha | --sh)
    ac_prev=sharedstatedir ;;
  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  | --sha=* | --sh=*)
    sharedstatedir="$ac_optarg" ;;

  -site | --site | --sit)
    ac_prev=site ;;
  -site=* | --site=* | --sit=*)
    site="$ac_optarg" ;;

  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
    ac_prev=srcdir ;;
  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
    srcdir="$ac_optarg" ;;

  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  | --syscon | --sysco | --sysc | --sys | --sy)
    ac_prev=sysconfdir ;;
  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
    sysconfdir="$ac_optarg" ;;

  -target | --target | --targe | --targ | --tar | --ta | --t)
    ac_prev=target ;;
  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
    target="$ac_optarg" ;;

  -v | -verbose | --verbose | --verbos | --verbo | --verb)
    verbose=yes ;;

  -version | --version | --versio | --versi | --vers)
    echo "configure generated by autoconf version 2.13"
    exit 0 ;;

  -with-* | --with-*)
    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    case "$ac_option" in
      *=*) ;;
      *) ac_optarg=yes ;;
    esac
    eval "with_${ac_package}='$ac_optarg'" ;;

  -without-* | --without-*)
    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
    # Reject names that are not valid shell variable names.
    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
    fi
    ac_package=`echo $ac_package| sed 's/-/_/g'`
    eval "with_${ac_package}=no" ;;

  --x)
    # Obsolete; use --with-x.
    with_x=yes ;;

  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  | --x-incl | --x-inc | --x-in | --x-i)
    ac_prev=x_includes ;;
  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
    x_includes="$ac_optarg" ;;

  -x-libraries | --x-libraries | --x-librarie | --x-librari \
  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
    ac_prev=x_libraries ;;
  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
    x_libraries="$ac_optarg" ;;

  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
    ;;

  *)
    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
      echo "configure: warning: $ac_option: invalid host type" 1>&2
    fi
    if test "x$nonopt" != xNONE; then
      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
    fi
    nonopt="$ac_option"
    ;;

  esac
done

if test -n "$ac_prev"; then
  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
fi

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 6 checking for... messages and results
# 5 compiler messages saved in config.log
if test "$silent" = yes; then
  exec 6>/dev/null
else
  exec 6>&1
fi
exec 5>./config.log

echo "\
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
" 1>&5

# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell metacharacters.
ac_configure_args=
for ac_arg
do
  case "$ac_arg" in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c) ;;
  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  esac
done

# NLS nuisances.
# Only set these to C if already set.  These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=base.hh

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then its parent.
  ac_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    srcdir=..
  fi
else
  ac_srcdir_defaulted=no
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test "$ac_srcdir_defaulted" = yes; then
    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  else
    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  fi
fi
srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`

# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
  if test "x$prefix" != xNONE; then
    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  else
    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  fi
fi
for ac_site_file in $CONFIG_SITE; do
  if test -r "$ac_site_file"; then
    echo "loading site script $ac_site_file"
    . "$ac_site_file"
  fi
done

if test -r "$cache_file"; then
  echo "loading cache $cache_file"
  . $cache_file
else
  echo "creating cache $cache_file"
  > $cache_file
fi

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi




  
  
  srcdir=`cd $srcdir && pwd`
  SRCDIR="$srcdir"
  

  
  echo $ac_n "checking for SRCTOP""... $ac_c" 1>&6
echo "configure:585: checking for SRCTOP" >&5
if eval "test \"`echo '$''{'oz_cv_path_SRCTOP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
  oz_tmp_dir=$srcdir
  oz_tmp_ok=
  oz_for="OZVERSION"
  for oz_tmp1 in $oz_for; do
    for oz_tmp2 in $oz_tmp_dir \
		   $oz_tmp_dir/.. \
		   $oz_tmp_dir/../.. \
		   $oz_tmp_dir/../../.. \
		   $oz_tmp_dir/../../../.. \
		   $oz_tmp_dir/../../../../..; do
      if test -r "$oz_tmp2/$oz_tmp1"; then
        oz_cv_path_SRCTOP=`cd $oz_tmp2 && pwd`
        oz_tmp_ok=yes
        break
      fi
    done
    test -n "$oz_tmp_ok" && break
  done
    if test -z "$oz_cv_path_SRCTOP"; then
      { echo "configure: error: cannot find SRCTOP" 1>&2; exit 1; }
    fi
fi

echo "$ac_t""$oz_cv_path_SRCTOP" 1>&6
  SRCTOP=$oz_cv_path_SRCTOP
  
  
  echo $ac_n "checking for BUILDTOP""... $ac_c" 1>&6
echo "configure:619: checking for BUILDTOP" >&5
if eval "test \"`echo '$''{'oz_cv_path_BUILDTOP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
  oz_tmp_dir=.
  oz_tmp_ok=
  oz_for="contrib config.cache"
  for oz_tmp1 in $oz_for; do
    for oz_tmp2 in $oz_tmp_dir \
		   $oz_tmp_dir/.. \
		   $oz_tmp_dir/../.. \
		   $oz_tmp_dir/../../.. \
		   $oz_tmp_dir/../../../.. \
		   $oz_tmp_dir/../../../../..; do
      if test -r "$oz_tmp2/$oz_tmp1"; then
        oz_cv_path_BUILDTOP=`cd $oz_tmp2 && pwd`
        oz_tmp_ok=yes
        break
      fi
    done
    test -n "$oz_tmp_ok" && break
  done
    if test -z "$oz_cv_path_BUILDTOP"; then
      { echo "configure: error: cannot find BUILDTOP" 1>&2; exit 1; }
    fi
fi

echo "$ac_t""$oz_cv_path_BUILDTOP" 1>&6
  BUILDTOP=$oz_cv_path_BUILDTOP
  
  ac_aux_dir=
for ac_dir in $SRCTOP $srcdir/$SRCTOP; do
  if test -f $ac_dir/install-sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install-sh -c"
    break
  elif test -f $ac_dir/install.sh; then
    ac_aux_dir=$ac_dir
    ac_install_sh="$ac_aux_dir/install.sh -c"
    break
  fi
done
if test -z "$ac_aux_dir"; then
  { echo "configure: error: can not find install-sh or install.sh in $SRCTOP $srcdir/$SRCTOP" 1>&2; exit 1; }
fi
ac_config_guess=$ac_aux_dir/config.guess
ac_config_sub=$ac_aux_dir/config.sub
ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.

  if test "$host_os" = ""; then  
    
# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi

echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:678: checking host system type" >&5

host_alias=$host
case "$host_alias" in
NONE)
  case $nonopt in
  NONE)
    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
    fi ;;
  *) host_alias=$nonopt ;;
  esac ;;
esac

host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$host" 1>&6

  fi
  
  if test -z "$oz_cv_MAKE"; then
    for ac_prog in gmake make
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:706: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$MAKE"; then
  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_MAKE="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
MAKE="$ac_cv_prog_MAKE"
if test -n "$MAKE"; then
  echo "$ac_t""$MAKE" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$MAKE" && break
done
test -n "$MAKE" || MAKE="NONE"

    if test "$MAKE" = NONE; then
      oz_tmp_ok=no
    else
      
  if oz_tmp=`$MAKE -n --version 2>/dev/null` && \
     oz_tmp=`expr "$oz_tmp" : GNU`; then
    GNU_MAKE=yes
  else
    GNU_MAKE=no
  fi
      if test "$GNU_MAKE" = no; then
        oz_tmp_ok=no
        echo "configure: warning: $MAKE is not GNU make" 1>&2
      else
        oz_tmp_ok=yes
      fi
    fi
    if test "$oz_tmp_ok" = yes; then
      oz_cv_MAKE=$MAKE
    else
      { echo "configure: error: 
GNU make is needed to build the system.
It can be retrieved from:

	ftp://ftp.gnu.org/pub/gnu/

The latest version at this time is 3.77 and is available
packaged as the following archive:

	make-3.77.tar.gz

You may find a mirror archive closer to you by consulting:

	http://www.gnu.org/order/ftp.html
" 1>&2; exit 1; }
    fi
  else
    
  echo $ac_n "checking for GNU make""... $ac_c" 1>&6
echo "configure:775: checking for GNU make" >&5
  MAKE=$oz_cv_MAKE
  echo "$ac_t""(cached) $MAKE" 1>&6
  fi
  
  echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:781: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftestmake <<\EOF
all:
	@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_make_${ac_make}_set=yes
else
  eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SET_MAKE=
else
  echo "$ac_t""no" 1>&6
  SET_MAKE="MAKE=${MAKE-make}"
fi

  
  if test "${INSTALL+set}" = set; then
    echo $ac_n "checking whether to unset broken INSTALL""... $ac_c" 1>&6
echo "configure:810: checking whether to unset broken INSTALL" >&5
if eval "test \"`echo '$''{'oz_cv_unset_INSTALL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
        echo >conftest.$$
        if $INSTALL -c -m 644 conftest.$$ /tmp >/dev/null 2>&1; then
          rm -f /tmp/conftest.$$ 2>/dev/null
          oz_cv_unset_INSTALL=no
          oz_cv_given_INSTALL="$INSTALL"
        else
          oz_cv_unset_INSTALL=yes
        fi
        rm -f conftest.$$ 2>/dev/null
fi

echo "$ac_t""$oz_cv_unset_INSTALL" 1>&6
    test "$oz_cv_unset_INSTALL" = yes && unset INSTALL
  fi
  # Find a good install program.  We prefer a C program (faster),
# so one script is as good as another.  But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:841: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
  for ac_dir in $PATH; do
    # Account for people who put trailing slashes in PATH elements.
    case "$ac_dir/" in
    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      # Don't use installbsd from OSF since it installs stuff as root
      # by default.
      for ac_prog in ginstall scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    :
	  else
	    ac_cv_path_install="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_IFS"

fi
  if test "${ac_cv_path_install+set}" = set; then
    INSTALL="$ac_cv_path_install"
  else
    # As a last resort, use the slow shell script.  We don't cache a
    # path for INSTALL within a source directory, because that will
    # break other packages using the cache if that directory is
    # removed, or if the path is relative.
    INSTALL="$ac_install_sh"
  fi
fi
echo "$ac_t""$INSTALL" 1>&6

# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'

test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'

  if test "$INSTALL" = "$oz_cv_given_INSTALL"; then
    ac_given_INSTALL="$oz_cv_given_INSTALL"
  fi
  
    dummy_PWD=`pwd | sed 's/\//\\\\\//g'`
    dummy_PATH=`echo $PATH | sed -e 's/:://g' | sed -e 's/:$//g'`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/^\.:/$dummy_PWD:/g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/^\.\//$dummy_PWD\//g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/:\.\$/:$dummy_PWD/g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/:\.:/:$dummy_PWD:/g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/:.\//:$dummy_PWD\//g"`
    oz_for="$dummy_PATH:$SRCTOP/share/bin:$SRCTOP"
    # Extract the first word of "mkinstalldirs", so it can be a program name with args.
set dummy mkinstalldirs; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:908: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_INSTALL_DIR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$INSTALL_DIR" in
  /*)
  ac_cv_path_INSTALL_DIR="$INSTALL_DIR" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_INSTALL_DIR="$INSTALL_DIR" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$oz_for"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_INSTALL_DIR="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
INSTALL_DIR="$ac_cv_path_INSTALL_DIR"
if test -n "$INSTALL_DIR"; then
  echo "$ac_t""$INSTALL_DIR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

    case "$host_os" in
      cygwin*) ;;
      *) INSTALL_DIR=`echo $INSTALL_DIR | sed -e "s|//|/|g"`;;
    esac
    if test ! -n "$INSTALL_DIR"
    then
	INSTALL_DIR=undefined
	
    fi
    
  
  echo $ac_n "checking for oz version""... $ac_c" 1>&6
echo "configure:952: checking for oz version" >&5
if eval "test \"`echo '$''{'oz_cv_ozversion'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    oz_cv_ozversion=`sh $SRCTOP/OZVERSION`
fi

echo "$ac_t""$oz_cv_ozversion" 1>&6
  OZVERSION=$oz_cv_ozversion;
  
  HOMEURL="http://www.mozart-oz.org/home-$OZVERSION"
  HOMECACHE="http/www.mozart-oz.org/home-$OZVERSION"
  
  
  case "$target" in
    i386-mingw32|i386-mingw32msvc)
	PLATFORM=win32-i486
	platform="win32-i486"
	ozplatform=$platform

	cross_compiling=yes

	CXX=${target}-gcc
	CC=${CXX}
	RANLIB=${target}-ranlib
	AR=${target}-ar
	STRIP=${target}-strip
	WINDRES=${target}-windres
	AS=${target}-as
	DLLTOOL=${target}-dlltool
	DLLWRAP=${target}-dllwrap
	OZTOOL="sh $BUILDTOP/platform/emulator/${target}-oztool"
	enable_contrib_psql=no
	enable_contrib_gdbm=yes
	enable_contrib_regex=yes
	enable_contrib_os=no
    ;;

    *)
	
    dummy_PWD=`pwd | sed 's/\//\\\\\//g'`
    dummy_PATH=`echo $PATH | sed -e 's/:://g' | sed -e 's/:$//g'`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/^\.:/$dummy_PWD:/g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/^\.\//$dummy_PWD\//g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/:\.\$/:$dummy_PWD/g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/:\.:/:$dummy_PWD:/g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/:.\//:$dummy_PWD\//g"`
    oz_for="$dummy_PATH:$SRCTOP/share/bin:$SRCTOP"
    # Extract the first word of "ozplatform", so it can be a program name with args.
set dummy ozplatform; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1004: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_OZPLATFORM'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$OZPLATFORM" in
  /*)
  ac_cv_path_OZPLATFORM="$OZPLATFORM" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_OZPLATFORM="$OZPLATFORM" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$oz_for"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_OZPLATFORM="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
OZPLATFORM="$ac_cv_path_OZPLATFORM"
if test -n "$OZPLATFORM"; then
  echo "$ac_t""$OZPLATFORM" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

    case "$host_os" in
      cygwin*) ;;
      *) OZPLATFORM=`echo $OZPLATFORM | sed -e "s|//|/|g"`;;
    esac
    if test ! -n "$OZPLATFORM"
    then
	OZPLATFORM=undefined
	
    fi
    
	PLATFORM=`$OZPLATFORM || exit 1`
	
    dummy_PWD=`pwd | sed 's/\//\\\\\//g'`
    dummy_PATH=`echo $PATH | sed -e 's/:://g' | sed -e 's/:$//g'`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/^\.:/$dummy_PWD:/g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/^\.\//$dummy_PWD\//g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/:\.\$/:$dummy_PWD/g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/:\.:/:$dummy_PWD:/g"`
    dummy_PATH=`echo $dummy_PATH | sed -e "s/:.\//:$dummy_PWD\//g"`
    oz_for="$dummy_PATH:$SRCTOP/share/bin:$SRCTOP"
    # Extract the first word of "oztool", so it can be a program name with args.
set dummy oztool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1059: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_OZTOOL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$OZTOOL" in
  /*)
  ac_cv_path_OZTOOL="$OZTOOL" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_OZTOOL="$OZTOOL" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$oz_for"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_OZTOOL="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac
fi
OZTOOL="$ac_cv_path_OZTOOL"
if test -n "$OZTOOL"; then
  echo "$ac_t""$OZTOOL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

    case "$host_os" in
      cygwin*) ;;
      *) OZTOOL=`echo $OZTOOL | sed -e "s|//|/|g"`;;
    esac
    if test ! -n "$OZTOOL"
    then
	OZTOOL=undefined
	OZTOOL="sh $BUILDTOP/platform/emulator/oztool.sh"
    fi
    
    ;;
  esac
  
  echo $ac_n "checking for --with-inc-dir""... $ac_c" 1>&6
echo "configure:1105: checking for --with-inc-dir" >&5
  # Check whether --with-inc-dir or --without-inc-dir was given.
if test "${with_inc_dir+set}" = set; then
  withval="$with_inc_dir"
  oz_cv_with_inc_dirs=$with_inc_dir
else
  : ${oz_cv_with_inc_dirs=$oz_with_inc_dir}
fi

  echo "$ac_t""$with_inc_dir" 1>&6
  oz_tmp_IFS="$IFS"
  IFS=","
  # reverse the list of dirs
  oz_tmp_dirs=""
  for oz_tmp in $oz_cv_with_inc_dirs DONE; do
    if test "$oz_tmp" != DONE; then
      oz_tmp_dirs="$oz_tmp${oz_tmp_dirs:+ }$oz_tmp_dirs"
    fi
  done
  # add them to CPPFLAGS and oz_inc_path
  IFS=$oz_tmp_IFS
  : ${oz_inc_path=""}
  for oz_tmp1 in $oz_tmp_dirs DONE; do
    if test "$oz_tmp1" != DONE; then
      
  if test "-I$oz_tmp1" != yes && test "-I$oz_tmp1" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $CPPFLAGS NONE; do
      if test "$oz_tmp" = "-I$oz_tmp1"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I$oz_tmp1"
  fi

      oz_inc_path="$oz_tmp1${oz_inc_path:+ }$oz_inc_path"
    fi
  done

  
  echo $ac_n "checking for --with-lib-dir""... $ac_c" 1>&6
echo "configure:1147: checking for --with-lib-dir" >&5
  # Check whether --with-lib-dir or --without-lib-dir was given.
if test "${with_lib_dir+set}" = set; then
  withval="$with_lib_dir"
  oz_cv_with_lib_dirs=$with_lib_dir
else
  : ${oz_cv_with_lib_dirs=$oz_with_lib_dir}
fi

  echo "$ac_t""$with_lib_dir" 1>&6
  oz_tmp_IFS="$IFS"
  IFS=","
  # reverse the list of dirs
  oz_tmp_dirs=""
  for oz_tmp in $oz_cv_with_lib_dirs DONE; do
    if test "$oz_tmp" != DONE; then
      oz_tmp_dirs="$oz_tmp${oz_tmp_dirs:+ }$oz_tmp_dirs"
    fi
  done
  # add them to LDFLAGS and oz_lib_path
  IFS=$oz_tmp_IFS
  : ${oz_lib_path=""}
  for oz_tmp1 in $oz_tmp_dirs DONE; do
    if test "$oz_tmp1" != DONE; then
      
  if test "-L$oz_tmp1" != yes && test "-L$oz_tmp1" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $LDFLAGS NONE; do
      if test "$oz_tmp" = "-L$oz_tmp1"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && LDFLAGS="-L$oz_tmp1${LDFLAGS:+ }$LDFLAGS"
  fi

      oz_lib_path="$oz_tmp1${oz_lib_path:+ }$oz_lib_path"
    fi
  done

  
  
  
  echo $ac_n "checking for build date""... $ac_c" 1>&6
echo "configure:1191: checking for build date" >&5
if eval "test \"`echo '$''{'oz_cv_build_date'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    oz_cv_build_date=`date +"%Y%m%d"`
fi

echo "$ac_t""$oz_cv_build_date" 1>&6
  OZBUILDDATE=$oz_cv_build_date;
  
  
  
  echo $ac_n "checking for OZLOADSEP""... $ac_c" 1>&6
echo "configure:1205: checking for OZLOADSEP" >&5
if eval "test \"`echo '$''{'oz_cv_OZLOADSEP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    case $PLATFORM in
    win32*) oz_cv_OZLOADSEP=';'
    ;;
    *) oz_cv_OZLOADSEP=':'
    ;;
    esac
  
fi

echo "$ac_t""$oz_cv_OZLOADSEP" 1>&6
  OZLOADSEP="$oz_cv_OZLOADSEP";
  

  
  echo $ac_n "checking for OZLOADWIN""... $ac_c" 1>&6
echo "configure:1225: checking for OZLOADWIN" >&5
if eval "test \"`echo '$''{'oz_cv_OZLOADWIN'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  

  case $PLATFORM in
    win32*)
	oztmp=`pwd`
	oztmp=`cygpath -a -w "$oztmp"`
	oztmp=`expr "$oztmp" : "\(.\):"`
	if test -n "$oztmp"; then
	  oztmplo=`echo $oztmp | tr '[:upper:]' '[:lower:]'`
	  oztmphi=`echo $oztmp | tr '[:lower:]' '[:upper:]'`
	  oz_cv_OZLOADWIN="%prefix=${oztmplo}:/=${oztmplo}:/%prefix=${oztmphi}:/=${oztmphi}:/"
	fi
	oztmp=`cygpath -a -w "$srcdir"`
	oztmp=`expr "$oztmp" : "\(.\):"`
	if test -n "$oztmp"; then
	  oztmplo=`echo $oztmp | tr '[:upper:]' '[:lower:]'`
	  oztmphi=`echo $oztmp | tr '[:lower:]' '[:upper:]'`
	  oz_cv_OZLOADWIN="${oz_cv_OZLOADWIN}%prefix=${oztmplo}:/=${oztmplo}:/%prefix=${oztmphi}:/=${oztmphi}:/"
	fi
	;;
    *) oz_cv_OZLOADWIN=
	;;
  esac

  
fi

echo "$ac_t""$oz_cv_OZLOADWIN" 1>&6
  OZLOADWIN="$oz_cv_OZLOADWIN"
  



    echo $ac_n "checking for --enable-denys-events""... $ac_c" 1>&6
echo "configure:1263: checking for --enable-denys-events" >&5
    # Check whether --enable-denys-events or --disable-denys-events was given.
if test "${enable_denys_events+set}" = set; then
  enableval="$enable_denys_events"
  :
fi

    : ${oz_enable_denys_events=no}
    if test -n "${enable_denys_events}"; then
	oz_enable_denys_events=$enable_denys_events
    fi
    if test "${oz_enable_denys_events}" != no; then
	DENYS_EVENTS=yes
    else
	DENYS_EVENTS=no
    fi
    
   echo "$ac_t""$DENYS_EVENTS" 1>&6
   

    echo $ac_n "checking for --enable-site-property""... $ac_c" 1>&6
echo "configure:1284: checking for --enable-site-property" >&5
    # Check whether --enable-site-property or --disable-site-property was given.
if test "${enable_site_property+set}" = set; then
  enableval="$enable_site_property"
  :
fi

    : ${oz_enable_site_property=no}
    if test -n "${enable_site_property}"; then
	oz_enable_site_property=$enable_site_property
    fi
    if test "${oz_enable_site_property}" != no; then
	SITE_PROPERTY=yes
    else
	SITE_PROPERTY=no
    fi
    
   echo "$ac_t""$SITE_PROPERTY" 1>&6
   



echo $ac_n "checking build system type""... $ac_c" 1>&6
echo "configure:1307: checking build system type" >&5

build_alias=$build
case "$build_alias" in
NONE)
  case $nonopt in
  NONE) build_alias=$host_alias ;;
  *) build_alias=$nonopt ;;
  esac ;;
esac

build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6

if test $host != $build; then
  ac_tool_prefix=${host_alias}-
else
  ac_tool_prefix=
fi

# Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
set dummy ${ac_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1333: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AS"; then
  ac_cv_prog_AS="$AS" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AS="${ac_tool_prefix}as"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="as"
fi
fi
AS="$ac_cv_prog_AS"
if test -n "$AS"; then
  echo "$ac_t""$AS" 1>&6
else
  echo "$ac_t""no" 1>&6
fi



# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1365: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$DLLTOOL"; then
  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="dlltool"
fi
fi
DLLTOOL="$ac_cv_prog_DLLTOOL"
if test -n "$DLLTOOL"; then
  echo "$ac_t""$DLLTOOL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi



# Extract the first word of "${ac_tool_prefix}dllwrap", so it can be a program name with args.
set dummy ${ac_tool_prefix}dllwrap; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1397: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLWRAP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$DLLWRAP"; then
  ac_cv_prog_DLLWRAP="$DLLWRAP" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_DLLWRAP="${ac_tool_prefix}dllwrap"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_DLLWRAP" && ac_cv_prog_DLLWRAP="dllwrap"
fi
fi
DLLWRAP="$ac_cv_prog_DLLWRAP"
if test -n "$DLLWRAP"; then
  echo "$ac_t""$DLLWRAP" 1>&6
else
  echo "$ac_t""no" 1>&6
fi




case "$target" in
    NONE)
	;;
    i386-mingw32|i386-mingw32msvc)
	echo "$ac_t""cross compiling for windows" 1>&6
	oz_malloc_obj=

	# va-start makes problems under mingw32
	enable_warnings=no

	# -DINTERFACE does not work
	oz_copt_debug="-g"
	;;
    *)
	{ echo "configure: error: "can only cross-compile for target i386-mingw32 not for $target"" 1>&2; exit 1; }
	;;
esac



echo $ac_n "checking for --with-sunpro""... $ac_c" 1>&6
echo "configure:1448: checking for --with-sunpro" >&5
# Check whether --with-sunpro or --without-sunpro was given.
if test "${with_sunpro+set}" = set; then
  withval="$with_sunpro"
  if test "${with_sunpro}" = yes; then
            echo "$ac_t""yes" 1>&6
	    for ac_prog in CC
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1459: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_SUNPRO'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$SUNPRO"; then
  ac_cv_prog_SUNPRO="$SUNPRO" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_SUNPRO="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
SUNPRO="$ac_cv_prog_SUNPRO"
if test -n "$SUNPRO"; then
  echo "$ac_t""$SUNPRO" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
s%@SUNPRO@%$SUNPRO%g

test -n "$SUNPRO" && break
done

	    if test -n "${SUNPRO}"
	    then
		CXX=$SUNPRO
		cat >> confdefs.h <<\EOF
#define SUNPRO 1
EOF

		oz_enable_threaded=no
	    else
		echo "configure: warning: Ignoring --with-sunpro!" 1>&2
	    fi
	else
	    echo "$ac_t""no" 1>&6
	fi
else
  echo "$ac_t""no" 1>&6
fi



  if test -z "$oz_cv_cxx__chosen"; then
    : ${CXXFLAGS="-O"}
    
  # Check whether --with-cxx or --without-cxx was given.
if test "${with_cxx+set}" = set; then
  withval="$with_cxx"
  oz_cv_with_cxx=$with_cxx
fi

  : ${CCC:=$oz_cv_with_cxx}
  : ${CCC:=$oz_with_cxx}
  : ${CXX:=$CCC}

    for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1527: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CXX"; then
  ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CXX="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CXX="$ac_cv_prog_CXX"
if test -n "$CXX"; then
  echo "$ac_t""$CXX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$CXX" && break
done
test -n "$CXX" || CXX="gcc"


echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1559: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5

ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext << EOF

#line 1570 "configure"
#include "confdefs.h"

int main(){return(0);}
EOF
if { (eval echo configure:1575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cxx_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cxx_cross=no
  else
    ac_cv_prog_cxx_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cxx_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
if test $ac_cv_prog_cxx_works = no; then
  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1601: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross

echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:1606: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.C <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gxx=yes
else
  ac_cv_prog_gxx=no
fi
fi

echo "$ac_t""$ac_cv_prog_gxx" 1>&6

if test $ac_cv_prog_gxx = yes; then
  GXX=yes
else
  GXX=
fi

ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
echo "configure:1634: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  ac_cv_prog_cxx_g=yes
else
  ac_cv_prog_cxx_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
if test "$ac_test_CXXFLAGS" = set; then
  CXXFLAGS="$ac_save_CXXFLAGS"
elif test $ac_cv_prog_cxx_g = yes; then
  if test "$GXX" = yes; then
    CXXFLAGS="-g -O2"
  else
    CXXFLAGS="-g"
  fi
else
  if test "$GXX" = yes; then
    CXXFLAGS="-O2"
  else
    CXXFLAGS=
  fi
fi

    if test "${GXX}" = yes; then
      if oz_tmp=`$CXX --version 2>/dev/null`; then
        if expr "$oz_tmp" : egcs >/dev/null; then
          :

        elif oz_tmp=`expr "$oz_tmp" : '\([0-9.]*\)'`; then

          echo $ac_n "checking $CXX version is at least 2.7""... $ac_c" 1>&6
echo "configure:1673: checking $CXX version is at least 2.7" >&5
          
  oz_tmp_got="$oz_tmp"
  oz_tmp_want="2.7"
  oz_tmp_IFS="$IFS"
  IFS="$IFS._"
  set $oz_tmp_got DONE
  oz_tmp__ok=yes
  for oz_tmp_cur in $oz_tmp_want; do
    if test "$1" = DONE; then
      break
    elif test "$oz_tmp_cur" -lt "$1"; then
      break
    elif test "$oz_tmp_cur" -gt "$1"; then
      oz_tmp__ok=no
      break
    fi
    shift
  done
  IFS=$oz_tmp_IFS
  oz_tmp_ok=$oz_tmp__ok
          echo "$ac_t""$oz_tmp_ok" 1>&6
          if test "$oz_tmp_ok" = no; then
            { echo "configure: error: 
configure found the GNU C++ compiler $CXX version $oz_tmp
but version 2.7 or higher is required to build the
system.  It can be retrieved from:

	ftp://ftp.gnu.org/pub/gnu/

The latest version at this time is 2.95.2 and is available
packaged as the following archive:

	gcc-2.95.2.tar.gz 

You may find a mirror archive closer to you by consulting:

	http://www.gnu.org/order/ftp.html
" 1>&2; exit 1; }
          fi
        else
          echo "configure: warning: Could not check $CXX version, assuming ok" 1>&2
        fi
      else
        echo "configure: warning: Could not check $CXX version, assuming ok" 1>&2
      fi
    fi
    case "$PLATFORM" in
    *win32*)
      case "$CXX" in
      *mno-cygwin*)
      ;;
      *)
        
	ozm_out=
	if test -n "-mno-cygwin"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="-mno-cygwin"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:1735: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	oz_tmp="$ozm_out"
	
	CXX="$CXX${oz_tmp:+ }$oz_tmp"
      ;;
      esac
    ;;
    *)
    ;;
    esac
    echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
echo "configure:1766: checking how to run the C++ preprocessor" >&5
if test -z "$CXXCPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross
  CXXCPP="${CXX-g++} -E"
  cat > conftest.$ac_ext <<EOF
#line 1779 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CXXCPP=/lib/cpp
fi
rm -f conftest*
  ac_cv_prog_CXXCPP="$CXXCPP"
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
fi
fi
CXXCPP="$ac_cv_prog_CXXCPP"
echo "$ac_t""$CXXCPP" 1>&6

    oz_cv_CXX=$CXX
    oz_cv_CXXCPP=$CXXCPP
    oz_cv_GXX=$GXX
    oz_cv_CXXFLAGS=$CXXFLAGS
    oz_cv_cxx__chosen=yes
  else
    
  echo $ac_n "checking for C++ compiler""... $ac_c" 1>&6
echo "configure:1816: checking for C++ compiler" >&5
  CXX=$oz_cv_CXX
  echo "$ac_t""(cached) $CXX" 1>&6
    
  echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
echo "configure:1821: checking whether we are using GNU C++" >&5
  GXX=$oz_cv_GXX
  echo "$ac_t""(cached) $GXX" 1>&6
    
  echo $ac_n "checking for C++ preprocessor""... $ac_c" 1>&6
echo "configure:1826: checking for C++ preprocessor" >&5
  CXXCPP=$oz_cv_CXXCPP
  echo "$ac_t""(cached) $CXXCPP" 1>&6
    if test "${CXXFLAGS+set}" != set; then
      
  echo $ac_n "checking for default CXXFLAGS""... $ac_c" 1>&6
echo "configure:1832: checking for default CXXFLAGS" >&5
  CFLAGS=$oz_cv_CFLAGS
  echo "$ac_t""(cached) $CFLAGS" 1>&6
    fi
  fi
  
  

  if test -z "$oz_cv_cc__chosen"; then
    : ${CFLAGS="-O"}
    # Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1845: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$CC"; then
  # Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1875: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_prog_rejected=no
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
	continue
      fi
      ac_cv_prog_CC="cc"
      break
    fi
  done
  IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
  # We found a bogon in the path, so make sure we never use it.
  set dummy $ac_cv_prog_CC
  shift
  if test $# -gt 0; then
    # We chose a different compiler from the bogus one.
    # However, it has the same basename, so the bogon will be chosen
    # first if we set CC to just the basename; use the full file name.
    shift
    set dummy "$ac_dir/$ac_word" "$@"
    shift
    ac_cv_prog_CC="$@"
  fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

  if test -z "$CC"; then
    case "`uname -s`" in
    *win32* | *WIN32*)
      # Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:1926: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$CC"; then
  ac_cv_prog_CC="$CC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_CC="cl"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
  echo "$ac_t""$CC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi
 ;;
    esac
  fi
  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi

echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1958: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5

ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

cat > conftest.$ac_ext << EOF

#line 1969 "configure"
#include "confdefs.h"

main(){return(0);}
EOF
if { (eval echo configure:1974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  ac_cv_prog_cc_works=yes
  # If we can't run a trivial program, we are probably using a cross compiler.
  if (./conftest; exit) 2>/dev/null; then
    ac_cv_prog_cc_cross=no
  else
    ac_cv_prog_cc_cross=yes
  fi
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  ac_cv_prog_cc_works=no
fi
rm -fr conftest*
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross

echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:2000: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross

echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:2005: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi
fi

echo "$ac_t""$ac_cv_prog_gcc" 1>&6

if test $ac_cv_prog_gcc = yes; then
  GCC=yes
else
  GCC=
fi

ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:2033: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
  ac_cv_prog_cc_g=yes
else
  ac_cv_prog_cc_g=no
fi
rm -f conftest*

fi

echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
  CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
  if test "$GCC" = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-g"
  fi
else
  if test "$GCC" = yes; then
    CFLAGS="-O2"
  else
    CFLAGS=
  fi
fi

    if test "$GCC" = yes; then
      if oz_tmp=`$CC --version 2>/dev/null`; then
        if expr "$oz_tmp" : egcs >/dev/null; then
          :

        elif oz_tmp=`expr "$oz_tmp" : '\([0-9.]*\)'`; then

          echo $ac_n "checking $CC version is at least 2.7""... $ac_c" 1>&6
echo "configure:2072: checking $CC version is at least 2.7" >&5
          
  oz_tmp_got="$oz_tmp"
  oz_tmp_want="2.7"
  oz_tmp_IFS="$IFS"
  IFS="$IFS._"
  set $oz_tmp_got DONE
  oz_tmp__ok=yes
  for oz_tmp_cur in $oz_tmp_want; do
    if test "$1" = DONE; then
      break
    elif test "$oz_tmp_cur" -lt "$1"; then
      break
    elif test "$oz_tmp_cur" -gt "$1"; then
      oz_tmp__ok=no
      break
    fi
    shift
  done
  IFS=$oz_tmp_IFS
  oz_tmp_ok=$oz_tmp__ok
          echo "$ac_t""$oz_tmp_ok" 1>&6
          if test "$oz_tmp_ok" = no; then
            { echo "configure: error: 
configure found the GNU C compiler $CC version $oz_tmp
but version 2.7 or higher is required to build the
system.  It can be retrieved from:

	ftp://ftp.gnu.org/pub/gnu/

The latest version at this time is ??? and is available
packaged as the following archive:

	???

You may find a mirror archive closer to you by consulting:

	http://www.gnu.org/order/ftp.html
" 1>&2; exit 1; }
          fi
        else
          echo "configure: warning: Could not check $CC version, assuming ok" 1>&2
        fi
      else
        echo "configure: warning: Could not check $CC version, assuming ok" 1>&2
      fi
    fi
    case "$PLATFORM" in
    *win32*)
      case "$CC" in
      *mno-cygwin*)
      ;;
      *)
        
	ozm_out=
	if test -n "-mno-cygwin"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="-mno-cygwin"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking cc compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:2134: checking cc compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gccopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CC} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gccopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gccopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gccopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	oz_tmp="$ozm_out"
	
	CC="$CC${oztmp:+ }$oz_tmp"
      ;;
      esac
    ;;
    *)
    ;;
    esac
    echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:2165: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
    # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and "${CC-cc}" will confuse make.
  CPP="${CC-cc} -E"
  # On the NeXT, cc -E runs the code through the compiler's parser,
  # not just through cpp.
  cat > conftest.$ac_ext <<EOF
#line 2180 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.$ac_ext <<EOF
#line 2197 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP="${CC-cc} -nologo -E"
  cat > conftest.$ac_ext <<EOF
#line 2214 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:2220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  :
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
rm -f conftest*
  ac_cv_prog_CPP="$CPP"
fi
  CPP="$ac_cv_prog_CPP"
else
  ac_cv_prog_CPP="$CPP"
fi
echo "$ac_t""$CPP" 1>&6

    oz_cv_CC=$CC
    oz_cv_CPP=$CPP
    oz_cv_GCC=$GCC
    oz_cv_CFLAGS=$CFLAGS
    oz_cv_cc__chosen=yes
  else
    
  echo $ac_n "checking for C compiler""... $ac_c" 1>&6
echo "configure:2252: checking for C compiler" >&5
  CC=$oz_cv_CC
  echo "$ac_t""(cached) $CC" 1>&6
    
  echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:2257: checking whether we are using GNU C" >&5
  GCC=$oz_cv_GCC
  echo "$ac_t""(cached) $GCC" 1>&6
    
  echo $ac_n "checking for C preprocessor""... $ac_c" 1>&6
echo "configure:2262: checking for C preprocessor" >&5
  CPP=$oz_cv_CPP
  echo "$ac_t""(cached) $CPP" 1>&6
    if test "${CFLAGS+set}" != set ; then
      
  echo $ac_n "checking for default CFLAGS""... $ac_c" 1>&6
echo "configure:2268: checking for default CFLAGS" >&5
  CFLAGS=$oz_cv_CFLAGS
  echo "$ac_t""(cached) $CFLAGS" 1>&6
    fi
  fi
  
  
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross


  if test -z "$oz_cv_LEX"; then
    # Extract the first word of "flex", so it can be a program name with args.
set dummy flex; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2287: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$LEX"; then
  ac_cv_prog_LEX="$LEX" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_LEX="flex"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex"
fi
fi
LEX="$ac_cv_prog_LEX"
if test -n "$LEX"; then
  echo "$ac_t""$LEX" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

if test -z "$LEXLIB"
then
  case "$LEX" in
  flex*) ac_lib=fl ;;
  *) ac_lib=l ;;
  esac
  echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6
echo "configure:2321: checking for yywrap in -l$ac_lib" >&5
ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-l$ac_lib  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2329 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char yywrap();

int main() {
yywrap()
; return 0; }
EOF
if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  LEXLIB="-l$ac_lib"
else
  echo "$ac_t""no" 1>&6
fi

fi

    
  if `$LEX -S --version 2>/dev/null >/dev/null`; then
    GNU_LEX=yes
  else
    GNU_LEX=no
  fi
    if test "$GNU_LEX" = no; then
      oz_tmp_ok=no
      echo "configure: warning: $LEX is not GNU flex" 1>&2
    else
      
  echo $ac_n "checking $LEX version is at least 2.5.3""... $ac_c" 1>&6
echo "configure:2377: checking $LEX version is at least 2.5.3" >&5
  oz_tmp_ok=no
  if oz_tmp_version=`$LEX --version 2>/dev/null | tr '\012' ' '`; then

    oz_tmp_version=`expr "$oz_tmp_version" : '.*version \([0-9._]*\)'`

    if test -n "$oz_tmp_version"; then
      
  oz_tmp_got="$oz_tmp_version"
  oz_tmp_want="2.5.3"
  oz_tmp_IFS="$IFS"
  IFS="$IFS._"
  set $oz_tmp_got DONE
  oz_tmp__ok=yes
  for oz_tmp_cur in $oz_tmp_want; do
    if test "$1" = DONE; then
      break
    elif test "$oz_tmp_cur" -lt "$1"; then
      break
    elif test "$oz_tmp_cur" -gt "$1"; then
      oz_tmp__ok=no
      break
    fi
    shift
  done
  IFS=$oz_tmp_IFS
  oz_tmp_ok=$oz_tmp__ok
    fi
  fi
  if test -z "$oz_tmp_version"; then
    echo "$ac_t""no (cannot find version)" 1>&6
  else
    echo "$ac_t""$oz_tmp_ok" 1>&6
  fi
    fi
    if test "$oz_tmp_ok" = yes; then
      oz_cv_LEX=$LEX
    else
      if test "$oz_coolness" = yes; then
         LEX=flex_not_found
         echo "configure: warning: GNU flex not found" 1>&2
      else
         { echo "configure: error: 
GNU flex version 2.5.3 or higher is needed to build the
system.  It can be retrieved from:

	ftp://ftp.gnu.org/pub/gnu/

The latest version at this time is 2.5.4 and is available
packaged as the following archive:

	flex-2.5.4a.tar.gz

You may find a mirror archive closer to you by consulting:

	http://www.gnu.org/order/ftp.html
" 1>&2; exit 1; }
      fi
    fi
  else
    
  echo $ac_n "checking for GNU flex""... $ac_c" 1>&6
echo "configure:2439: checking for GNU flex" >&5
  LEX=$oz_cv_LEX
  echo "$ac_t""(cached) $LEX" 1>&6
  fi
  FLEX=$LEX
  
  

  if test -z "$oz_cv_YACC"; then
    for ac_prog in 'bison -y' byacc
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2453: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$YACC"; then
  ac_cv_prog_YACC="$YACC" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_YACC="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
YACC="$ac_cv_prog_YACC"
if test -n "$YACC"; then
  echo "$ac_t""$YACC" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"

    
  if oz_tmp=`$YACC --version 2>/dev/null` && \
     oz_tmp=`expr "$oz_tmp" : '.*GNU'`; then
    GNU_YACC=yes;
  else
    GNU_YACC=no
  fi
    if test "$GNU_YACC" = no; then
      oz_tmp_ok=no
      echo "configure: warning: $YACC is not GNU bison" 1>&2
    else
      
  echo $ac_n "checking $YACC version is at least 1.25""... $ac_c" 1>&6
echo "configure:2496: checking $YACC version is at least 1.25" >&5
  oz_tmp_ok=no
  if oz_tmp_version=`$YACC --version 2>/dev/null | tr '\012' ' '`; then

    oz_tmp_version=`expr "$oz_tmp_version" : '.*version \([0-9._]*\)'`

    if test -n "$oz_tmp_version"; then
      
  oz_tmp_got="$oz_tmp_version"
  oz_tmp_want="1.25"
  oz_tmp_IFS="$IFS"
  IFS="$IFS._"
  set $oz_tmp_got DONE
  oz_tmp__ok=yes
  for oz_tmp_cur in $oz_tmp_want; do
    if test "$1" = DONE; then
      break
    elif test "$oz_tmp_cur" -lt "$1"; then
      break
    elif test "$oz_tmp_cur" -gt "$1"; then
      oz_tmp__ok=no
      break
    fi
    shift
  done
  IFS=$oz_tmp_IFS
  oz_tmp_ok=$oz_tmp__ok
    fi
  fi
  if test -z "$oz_tmp_version"; then
    echo "$ac_t""no (cannot find version)" 1>&6
  else
    echo "$ac_t""$oz_tmp_ok" 1>&6
  fi
    fi
    if test "$oz_tmp_ok" = yes; then
      oz_cv_YACC=$YACC
    else
      if test "$oz_coolness" = yes; then
        YACC=bison_not_found
        echo "configure: warning: bison not found" 1>&2
      else
        { echo "configure: error: 
GNU bison version 1.25 or higher is needed to build the system.
It can be retrieved from:

	ftp://ftp.gnu.org/pub/gnu/

The latest version at this time is 1.30 and is available
packaged as the following archive:

	bison-1.30.tar.gz


You may find a mirror archive closer to you by consulting:

	http://www.gnu.org/order/ftp.html
" 1>&2; exit 1; }
      fi
    fi
  else
    
  echo $ac_n "checking for GNU bison""... $ac_c" 1>&6
echo "configure:2559: checking for GNU bison" >&5
  YACC=$oz_cv_YACC
  echo "$ac_t""(cached) $YACC" 1>&6
  fi
  BISON=$YACC
  
  
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
echo "configure:2567: checking whether ln -s works" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
  rm -f conftestdata
  ac_cv_prog_LN_S="ln -s"
else
  ac_cv_prog_LN_S=ln
fi
fi
LN_S="$ac_cv_prog_LN_S"
if test "$ac_cv_prog_LN_S" = "ln -s"; then
  echo "$ac_t""yes" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


  if test -z "$oz_cv_MAKE"; then
    for ac_prog in gmake make
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2594: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$MAKE"; then
  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_MAKE="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
MAKE="$ac_cv_prog_MAKE"
if test -n "$MAKE"; then
  echo "$ac_t""$MAKE" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$MAKE" && break
done
test -n "$MAKE" || MAKE="NONE"

    if test "$MAKE" = NONE; then
      oz_tmp_ok=no
    else
      
  if oz_tmp=`$MAKE -n --version 2>/dev/null` && \
     oz_tmp=`expr "$oz_tmp" : GNU`; then
    GNU_MAKE=yes
  else
    GNU_MAKE=no
  fi
      if test "$GNU_MAKE" = no; then
        oz_tmp_ok=no
        echo "configure: warning: $MAKE is not GNU make" 1>&2
      else
        oz_tmp_ok=yes
      fi
    fi
    if test "$oz_tmp_ok" = yes; then
      oz_cv_MAKE=$MAKE
    else
      { echo "configure: error: 
GNU make is needed to build the system.
It can be retrieved from:

	ftp://ftp.gnu.org/pub/gnu/

The latest version at this time is 3.77 and is available
packaged as the following archive:

	make-3.77.tar.gz

You may find a mirror archive closer to you by consulting:

	http://www.gnu.org/order/ftp.html
" 1>&2; exit 1; }
    fi
  else
    
  echo $ac_n "checking for GNU make""... $ac_c" 1>&6
echo "configure:2663: checking for GNU make" >&5
  MAKE=$oz_cv_MAKE
  echo "$ac_t""(cached) $MAKE" 1>&6
  fi
  
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:2669: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftestmake <<\EOF
all:
	@echo 'ac_maketemp="${MAKE}"'
EOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
  eval ac_cv_prog_make_${ac_make}_set=yes
else
  eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  SET_MAKE=
else
  echo "$ac_t""no" 1>&6
  SET_MAKE="MAKE=${MAKE-make}"
fi

# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2698: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$RANLIB"; then
  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
fi
fi
RANLIB="$ac_cv_prog_RANLIB"
if test -n "$RANLIB"; then
  echo "$ac_t""$RANLIB" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


for ac_prog in gm4 m4
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2731: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_M4'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$M4"; then
  ac_cv_prog_M4="$M4" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_M4="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
M4="$ac_cv_prog_M4"
if test -n "$M4"; then
  echo "$ac_t""$M4" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$M4" && break
done
test -n "$M4" || M4="m4"


  if test -z "$oz_cv_PERL"; then
    for ac_prog in perl perl5
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2768: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$PERL"; then
  ac_cv_prog_PERL="$PERL" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_PERL="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
PERL="$ac_cv_prog_PERL"
if test -n "$PERL"; then
  echo "$ac_t""$PERL" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$PERL" && break
done
test -n "$PERL" || PERL="NONE"

    if test "$PERL" = NONE; then
      oz_tmp_ok=no;
    else

      oz_tmp_version=`$PERL -e 'print "[$]";' | sed 's|^.||'`

      
  oz_tmp_got="$oz_tmp_version"
  oz_tmp_want="5"
  oz_tmp_IFS="$IFS"
  IFS="$IFS._"
  set $oz_tmp_got DONE
  oz_tmp__ok=yes
  for oz_tmp_cur in $oz_tmp_want; do
    if test "$1" = DONE; then
      break
    elif test "$oz_tmp_cur" -lt "$1"; then
      break
    elif test "$oz_tmp_cur" -gt "$1"; then
      oz_tmp__ok=no
      break
    fi
    shift
  done
  IFS=$oz_tmp_IFS
  oz_tmp_ok=$oz_tmp__ok
    fi
    if test "$oz_tmp_ok" = yes; then
      oz_cv_PERL=$PERL
    else
      if test "$oz_coolness" = yes; then
        PERL=perl_not_found
        echo "configure: warning: perl not found" 1>&2
      else
        echo "configure: warning: 
Perl version 5 or higher is needed to build the system.
It can be retrieved from:

	http://language.perl.com/info/software.html

The latest version at this time is 5.006 and is available
packaged as the following archive:

	http://language.perl.com/CPAN/src/latest.tar.gz

You may find further information on the Perl site:

	http://www.perl.org/
" 1>&2
      fi
    fi
  else
    
  echo $ac_n "checking for perl""... $ac_c" 1>&6
echo "configure:2852: checking for perl" >&5
  PERL=$oz_cv_PERL
  echo "$ac_t""(cached) $PERL" 1>&6
  fi
  

for ac_prog in gnused sed
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2863: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_SED'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$SED"; then
  ac_cv_prog_SED="$SED" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_SED="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
SED="$ac_cv_prog_SED"
if test -n "$SED"; then
  echo "$ac_t""$SED" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$SED" && break
done
test -n "$SED" || SED="sed"

if test -z "$AR"; then
    for ac_prog in gar ar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2899: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -n "$AR"; then
  ac_cv_prog_AR="$AR" # Let the user override the test.
else
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_prog_AR="$ac_prog"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
fi
AR="$ac_cv_prog_AR"
if test -n "$AR"; then
  echo "$ac_t""$AR" 1>&6
else
  echo "$ac_t""no" 1>&6
fi

test -n "$AR" && break
done
test -n "$AR" || AR="ar"

fi

# Extract the first word of "makedepend", so it can be a program name with args.
set dummy makedepend; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:2934: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_DEPEND'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  case "$DEPEND" in
  /*)
  ac_cv_path_DEPEND="$DEPEND" # Let the user override the test with a path.
  ;;
  ?:/*)			 
  ac_cv_path_DEPEND="$DEPEND" # Let the user override the test with a dos path.
  ;;
  *)
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
  ac_dummy="$PATH"
  for ac_dir in $ac_dummy; do 
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      ac_cv_path_DEPEND="$ac_dir/$ac_word"
      break
    fi
  done
  IFS="$ac_save_ifs"
  test -z "$ac_cv_path_DEPEND" && ac_cv_path_DEPEND="makedepend"
  ;;
esac
fi
DEPEND="$ac_cv_path_DEPEND"
if test -n "$DEPEND"; then
  echo "$ac_t""$DEPEND" 1>&6
else
  echo "$ac_t""no" 1>&6
fi


OZTOOL_SH="sh `pwd`/oztool.sh"




# PLATFORM is defined by OZ_INIT
: ${platform=$PLATFORM}


PLATFORM="`echo $platform|sed -e s/-/_/|tr a-z A-Z`"
cat >> confdefs.h <<EOF
#define $PLATFORM 1
EOF



ARCH=ARCH_`echo $PLATFORM|sed -e 's/.*_//'`
OS=`echo $PLATFORM|sed -e 's/_.*//'`
cat >> confdefs.h <<EOF
#define $ARCH 1
EOF

cat >> confdefs.h <<EOF
#define $OS 1
EOF



case "$platform" in
    win32*)
	EMULATOR_EXE=emulator.dll
	;;
    *)
	EMULATOR_EXE=emulator.exe
	;;
esac



: ${oz_copt_default=$CXXFLAGS}
CXXFLAGS=

if test "${GXX}" = yes; then
    M4_S="-s"
    DEPEND="$CXX -MM"

    
	ozm_out=
	if test -n "-fno-exceptions"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="-fno-exceptions"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:3023: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	oz_a="$ozm_out"
	
    CXXAVOID=$oz_a
    CXXFLAGS="$CXXFLAGS $oz_a"

    : ${oz_enable_warnings=no}
    echo $ac_n "checking for --enable-warnings""... $ac_c" 1>&6
echo "configure:3051: checking for --enable-warnings" >&5
    # Check whether --enable-warnings or --disable-warnings was given.
if test "${enable_warnings+set}" = set; then
  enableval="$enable_warnings"
  :
else
  enable_warnings=$oz_enable_warnings
fi

    echo "$ac_t""$enable_warnings" 1>&6
    : ${oz_enable_errors=no}
    echo $ac_n "checking for --enable-errors""... $ac_c" 1>&6
echo "configure:3063: checking for --enable-errors" >&5
    # Check whether --enable-errors or --disable-errors was given.
if test "${enable_errors+set}" = set; then
  enableval="$enable_errors"
  :
else
  enable_errors=$oz_enable_errors
fi

    echo "$ac_t""$enable_errors" 1>&6

    if test "${enable_warnings}" != no
    then
	case `$CXX -dumpversion` in
	2.*)
	oz_warn="-Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual \
	    -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \
	    -Wnested-externs -Wsynth \
	    -Winline \
	    -Wno-unused -Wno-reorder -Wno-uninitialized -Wno-sign-compare"
	;;
        3.*)
	oz_warn="-Wall -W -Wno-trigraphs -Wno-undef -Wimport -Wbad-function-cast \
	    -Wcast-qual -Wconversion -Wimplicit-function-dec -Wimplicit-int -Wmissing-braces \
	    -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wparentheses \
	    -Wsequence-point -Wpointer-arith -Wno-sign-compare -Wunknown-pragmas \
	    -Wstrict-prototypes -Wno-write-strings -Wreturn-type -Wsynth -Wno-reorder \
	    -Wno-uninitialized -Wunreachable-code -Wno-unused -Winline -Wdeprecated"
	;;
	esac
        test "$enable_errors" != no && \
	oz_warn_error="-Werror"
    fi

    oz_opt=""
    oz_om=""
    case ${platform} in
    powermac-*)
    # for the MacOS X port
      case `$CXX -dumpversion` in
      2.95.*)
          oz_opt="-O3 -pipe -fschedule-insns2 -fregmove"
	  oz_om=""
          ;;
      *)
          oz_opt="-O3 -pipe -fstrict-aliasing"
	  oz_om=""
          ;;
      esac
      ;;
    *-i486) 
	case `$CXX -dumpversion` in
	2.95.3)
	    # -fstrict-aliasing does not work with prerelease 2.95.3
	    if $CXX -v 2>&1 | egrep -s prerelease > /dev/null; then
	      oz_opt="-O3 -pipe -fschedule-insns2 -fregmove"
	    else
	      oz_opt="-O3 -pipe -fschedule-insns2 -fregmove -fstrict-aliasing"
	    fi
	    oz_om="-march=pentium -mcpu=pentiumpro -fomit-frame-pointer"
	    ;;
	2.95.*)
	    oz_opt="-O3 -pipe -fschedule-insns2 -fregmove"
	    oz_om="-march=pentium -mcpu=pentiumpro -fomit-frame-pointer"
	    ;;
	*)
	    oz_opt="-O3 -pipe -fstrict-aliasing"
	    oz_om="-march=pentium -mcpu=pentiumpro -fomit-frame-pointer"
	    ;;
	esac
	;;

    *-sparc)
	case `$CXX -dumpversion` in
	2.95.*)
	    oz_opt="-O3 -pipe -fschedule-insns2 -fregmove"
            oz_om="-mcpu=v8 -fdelayed-branch"
	    ;;
	*)
	    oz_opt="-O3 -pipe -fstrict-aliasing"
            oz_om="-mv8 -fdelayed-branch"
	    ;;
	esac
	;;

    *)  ;;
    esac

    : ${oz_copt_optimize="$oz_opt $oz_om"}
    : ${oz_copt_profile="$oz_opt -pg"}
    : ${oz_copt_debug="-g3 -DINTERFACE -fno-inline -fno-default-inline -fno-inline-functions"}
fi

if test -n "${SUNPRO}"
then
    : ${oz_copt_optimize=-fast}
    DEPEND="$CXX -xM"
fi

: ${LD=$CXX}



case $platform in
    sunos*)
        TOOLLDCMD="ld"
	oz_enable_modules_static=yes
	;;
    linux*)
        TOOLLDCMD="gcc -shared"
	# kost@ : redundant now; ;; EMULDFLAGS="-Wl,--export-dynamic"
	: ${oz_enable_modules_static=no}
	;;
    solaris*)
        TOOLLDCMD="gcc -shared"
	: ${oz_enable_modules_static=no}
	;;
    irix*)
        TOOLLDCMD="ld -shared"
	oz_enable_modules_static=yes
	CPPFLAGS="-DINTERFACE $CPPFLAGS"
	;;
    osf1*)
        TOOLLDCMD="gcc -shared -Wl,-expect_unresolved -Wl,*"
		EMULDFLAGS="-Wl,-D -Wl,0x30000000 -Wl,-T -Wl,0x20000000"
	: ${oz_enable_modules_static=no}
	;;
    hpux*)
        TOOLLDCMD="ld -b"
	EMULDFLAGS="-Wl,-E"
	oz_enable_modules_static=yes
	;;
    freebsdelf*)
	TOOLLDCMD="gcc -shared"
	# kost@ : redundant now; ;; EMULDFLAGS="-Wl,--export-dynamic"
	: ${oz_enable_modules_static=no}
        ;;
    freebsd*)
        TOOLLDCMD="ld -Bshareable"
	oz_enable_modules_static=yes
        ;;
    netbsd*)
        TOOLLDCMD="ld -Bshareable"
	oz_enable_modules_static=yes
        ;;
    win32*)
	cat >> confdefs.h <<\EOF
#define WINDOWS 1
EOF

	oz_enable_modules_static=yes
	if test "$target" = NONE
	then # compiling for mingw32 under cygwin
	    LD="$CC"
	    TOOLLDCMD="`cd .. && pwd`/mswindows/oztool -inc `pwd` ld"
	else # cross-compiling
	    cat >> confdefs.h <<\EOF
#define ARCH_I486 1
EOF

	    TOOLLDCMD="sh `pwd`/$target-oztool ld"
	fi
	CPPFLAGS="-DWINDOWS_EMULATOR $oz_a $CPPFLAGS"
    ;;
    *rhapsody | *darwin)
	cat >> confdefs.h <<\EOF
#define RHAPSODY 1
EOF

	TOOLLDCMD="$CC -dynamic -bundle -flat_namespace -undefined suppress"
	oz_enable_modules_static=yes
    ;;
    *)
	echo "configure: warning: Unknown platform "$platform"" 1>&2
	sleep 3
	TOOLLDCMD="ld"
	oz_enable_modules_static=yes
	;;
esac

# gcc's '--export-dynamic': if the linker recognizes it, then let's use it:
echo $ac_n "checking whether linker understands --export-dynamic""... $ac_c" 1>&6
echo "configure:3245: checking whether linker understands --export-dynamic" >&5
if eval "test \"`echo '$''{'ac_cv_understand_export_dynamic'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  savedKPCXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -Wl,--export-dynamic"
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

cat > conftest.$ac_ext <<EOF
#line 3259 "configure"
#include "confdefs.h"

int main() {

; return 0; }
EOF
if { (eval echo configure:3266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  ac_cv_understand_export_dynamic=yes
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_understand_export_dynamic=no
fi
rm -f conftest*
CXXFLAGS=$savedKPCXXFLAGS
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

fi


if test $ac_cv_understand_export_dynamic = yes; then
    echo "$ac_t""yes, will use it!" 1>&6
    EMULDFLAGS="$EMULDFLAGS -Wl,--export-dynamic"
else
    echo "$ac_t""no" 1>&6
fi
unset savedKPCXXFLAGS




# compiler options
: ${oz_copt_optimize="-O"}
: ${oz_copt_profile=-pg}
: ${oz_copt_debug="-g"}

# compiler options for warnings


# compiler option which turns warnings into errors


# linker options
: ${oz_lopt_profile=-pg}

# m4 options
if test -n "$M4"
then
    for oz_opt in -E -B10000; do
	echo $ac_n "checking whether $M4 understands $oz_opt option""... $ac_c" 1>&6
echo "configure:3317: checking whether $M4 understands $oz_opt option" >&5
	oz_tmp=`$M4 $oz_opt < /dev/null 2>&1`
	if test -n "$oz_tmp"
	then
	    echo "$ac_t""no" 1>&6
	else
	    echo "$ac_t""yes" 1>&6
	    M4="$M4 $oz_opt"
	fi
    done
fi



	ozm_out=
	if test -n "$oz_warn"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="$oz_warn"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:3339: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	oz_a="$ozm_out"
	
oz_warn=$oz_a


	ozm_out=
	if test -n "$oz_warn_error"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="$oz_warn_error"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:3373: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	oz_a="$ozm_out"
	
oz_warn_error=$oz_a



    echo $ac_n "checking for --enable-link-static""... $ac_c" 1>&6
echo "configure:3401: checking for --enable-link-static" >&5
    # Check whether --enable-link-static or --disable-link-static was given.
if test "${enable_link_static+set}" = set; then
  enableval="$enable_link_static"
  :
fi

    : ${oz_enable_link_static=no}
    if test -n "${enable_link_static}"; then
	oz_enable_link_static=$enable_link_static
    fi
    if test "${oz_enable_link_static}" != no; then
	echo "$ac_t""yes" 1>&6
	
    else
	echo "$ac_t""no" 1>&6
	
    fi
    



echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:3424: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3429 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  ac_cv_header_stdc=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

if test $ac_cv_header_stdc = yes; then
  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 3454 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "memchr" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 3472 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "free" >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  ac_cv_header_stdc=no
fi
rm -f conftest*

fi

if test $ac_cv_header_stdc = yes; then
  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then
  :
else
  cat > conftest.$ac_ext <<EOF
#line 3493 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

EOF
if { (eval echo configure:3507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  :
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_header_stdc=no
fi
rm -fr conftest*
fi

fi
fi

echo "$ac_t""$ac_cv_header_stdc" 1>&6
if test $ac_cv_header_stdc = yes; then
  cat >> confdefs.h <<\EOF
#define STDC_HEADERS 1
EOF

fi

echo $ac_n "checking for key_t""... $ac_c" 1>&6
echo "configure:3531: checking for key_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_key_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3536 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "(^|[^a-zA-Z_0-9])key_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  rm -rf conftest*
  ac_cv_type_key_t=yes
else
  rm -rf conftest*
  ac_cv_type_key_t=no
fi
rm -f conftest*

fi
echo "$ac_t""$ac_cv_type_key_t" 1>&6
if test $ac_cv_type_key_t = no; then
  cat >> confdefs.h <<\EOF
#define key_t unsigned int
EOF

fi




for ac_hdr in dlfcn.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3570: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3575 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3580: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done

for ac_hdr in stdint.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3610: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3615 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done







case "$platform" in
*rhapsody)
;;
win32-i486)
    echo $ac_n "checking for main in -lkernel32""... $ac_c" 1>&6
echo "configure:3657: checking for main in -lkernel32" >&5
ac_lib_var=`echo kernel32'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lkernel32  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3665 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:3672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo kernel32 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lkernel32 $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

    echo $ac_n "checking for main in -lwsock32""... $ac_c" 1>&6
echo "configure:3700: checking for main in -lwsock32" >&5
ac_lib_var=`echo wsock32'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lwsock32  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3708 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:3715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo wsock32 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lwsock32 $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

;;
irix6*)
    echo $ac_n "checking for fabs in -lm""... $ac_c" 1>&6
echo "configure:3745: checking for fabs in -lm" >&5
ac_lib_var=`echo m'_'fabs | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3753 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fabs();

int main() {
fabs()
; return 0; }
EOF
if { (eval echo configure:3767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lm $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

    echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:3795: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3803 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:3817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-ldl $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

;;
*)
    echo $ac_n "checking for gethostbyaddr in -lnsl""... $ac_c" 1>&6
echo "configure:3847: checking for gethostbyaddr in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyaddr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lnsl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3855 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyaddr();

int main() {
gethostbyaddr()
; return 0; }
EOF
if { (eval echo configure:3869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lnsl $LIBS"

else
  echo "$ac_t""no" 1>&6

      echo $ac_n "checking for gethostbyaddr in -lc""... $ac_c" 1>&6
echo "configure:3896: checking for gethostbyaddr in -lc" >&5
ac_lib_var=`echo c'_'gethostbyaddr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 3904 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyaddr();

int main() {
gethostbyaddr()
; return 0; }
EOF
if { (eval echo configure:3918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo c | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lc $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

fi

    
  echo $ac_n "checking for gethostbyaddr""... $ac_c" 1>&6
echo "configure:3949: checking for gethostbyaddr" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyaddr'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 3954 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char gethostbyaddr(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gethostbyaddr();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_gethostbyaddr) || defined (__stub___gethostbyaddr)
choke me
#else
gethostbyaddr();
#endif

; return 0; }
EOF
if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_gethostbyaddr=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_gethostbyaddr=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'gethostbyaddr`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  oz_tmp_ok=yes
else
  echo "$ac_t""no" 1>&6
oz_tmp_ok=no
fi

  if test "$oz_tmp_ok" = no; then
    { echo "configure: error: Function gethostbyaddr is not available.
The system cannot be built.
" 1>&2; exit 1; }
  fi
    echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
echo "configure:4006: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lsocket  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4014 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {
socket()
; return 0; }
EOF
if { (eval echo configure:4028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lsocket $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

    
  echo $ac_n "checking for socket""... $ac_c" 1>&6
echo "configure:4057: checking for socket" >&5
if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4062 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char socket(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char socket();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_socket) || defined (__stub___socket)
choke me
#else
socket();
#endif

; return 0; }
EOF
if { (eval echo configure:4088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_socket=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_socket=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  oz_tmp_ok=yes
else
  echo "$ac_t""no" 1>&6
oz_tmp_ok=no
fi

  if test "$oz_tmp_ok" = no; then
    { echo "configure: error: Function socket is not available.
The system cannot be built.
" 1>&2; exit 1; }
  fi
    echo $ac_n "checking for fabs in -lm""... $ac_c" 1>&6
echo "configure:4114: checking for fabs in -lm" >&5
ac_lib_var=`echo m'_'fabs | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lm  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4122 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fabs();

int main() {
fabs()
; return 0; }
EOF
if { (eval echo configure:4136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-lm $LIBS"

else
  echo "$ac_t""no" 1>&6
fi

    
  echo $ac_n "checking for fabs""... $ac_c" 1>&6
echo "configure:4165: checking for fabs" >&5
if eval "test \"`echo '$''{'ac_cv_func_fabs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4170 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char fabs(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char fabs();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_fabs) || defined (__stub___fabs)
choke me
#else
fabs();
#endif

; return 0; }
EOF
if { (eval echo configure:4196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_fabs=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_fabs=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'fabs`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  oz_tmp_ok=yes
else
  echo "$ac_t""no" 1>&6
oz_tmp_ok=no
fi

  if test "$oz_tmp_ok" = no; then
    { echo "configure: error: Function fabs is not available.
The system cannot be built.
" 1>&2; exit 1; }
  fi
    echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:4222: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-ldl  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4230 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char dlopen();

int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:4244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF

  LIBS="-ldl $LIBS"

else
  echo "$ac_t""no" 1>&6
fi


esac



echo $ac_n "checking for setpgid""... $ac_c" 1>&6
echo "configure:4277: checking for setpgid" >&5
if eval "test \"`echo '$''{'ac_cv_func_setpgid'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4282 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char setpgid(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char setpgid();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_setpgid) || defined (__stub___setpgid)
choke me
#else
setpgid();
#endif

; return 0; }
EOF
if { (eval echo configure:4308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_setpgid=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_setpgid=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'setpgid`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_SETPGID 1
EOF

else
  echo "$ac_t""no" 1>&6
fi


case $platform in
win32*)
    cat >> confdefs.h <<\EOF
#define USE_MALLOC 1
EOF

    ;;
*)
    for ac_func in dlopen
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4342: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4347 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
fi
done


    echo "checking whether we could allocate Oz heap with malloc ..." 1>&6
echo "configure:4399: checking whether we could allocate Oz heap with malloc ..." >&5
    if eval "test \"`echo '$''{'ac_cv_can_malloc'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  can_malloc=yes
     for ac_func in malloc
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4407: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4412 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
can_malloc=no
fi
done

     if test $can_malloc = yes; then
        echo $ac_n "checking ... with a test program""... $ac_c" 1>&6
echo "configure:4465: checking ... with a test program" >&5
        if test "$cross_compiling" = yes; then
  echo "$ac_t""dunno (no)" 1>&6
        can_malloc=no
else
  cat > conftest.$ac_ext <<EOF
#line 4471 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif

#include <malloc.h>
#include <signal.h>
#include <setjmp.h>

// Check whether setting an malloc threshold can be called at all,
// and that it does really work:
// - large pages become allocated outside bss
// - they are reasonably adjacent (modulo MALLOC_OVERHEAD)
// - freed chunks are really returned to OS

#define L_BLOCKSIZE	(512 * 1024)
#define S_BLOCKSIZE	(512)

#define L_MARGIN	(L_BLOCKSIZE - 1)
#define MALLOC_OVERHEAD (L_BLOCKSIZE / 100)

jmp_buf env;

static
void sh(int sig)
{
  longjmp(env, SIGSEGV);
}

main()
{
  void *s1, *s2, *l1, *l2;
  // struct mallinfo mi = mallinfo();

#if defined(M_MMAP_THRESHOLD)
  int ret = mallopt(M_MMAP_THRESHOLD, L_MARGIN);
#else
  // still try it even if there is no M_MMAP_THRESHOLD;
#endif

  s1 = malloc(S_BLOCKSIZE);
  l1 = malloc(L_BLOCKSIZE);
  s2 = malloc(S_BLOCKSIZE);
  l2 = malloc(L_BLOCKSIZE);

  if (s1 == 0 || l1 == 0 || s2 == 0 || l2 == 0)
    return (-1);

  if (s2 > s1) {
    if (l1 > s1 && l1 < s2)
      return (-2);
    if (l1 < s1 && (char *) l1 + L_BLOCKSIZE > s1)
      return (-3);
    if (l2 > s1 && l2 < s2)
      return (-4);
    if (l2 < s1 && (char *) l2 + L_BLOCKSIZE > s1)
      return (-5);
  } else {
    if (l1 > s2 && l1 < s1)
      return (-6);
    if (l1 < s2 && (char *) l1 + L_BLOCKSIZE > s2)
      return (-7);
    if (l2 > s2 && l2 < s1)
      return (-8);
    if (l2 < s2 && (char *) l2 + L_BLOCKSIZE > s2)
      return (-9);
  }

  if (l2 > l1) {
    if ((char *) l2 > ((char *) l1) + L_BLOCKSIZE + MALLOC_OVERHEAD)
      return (-10);
  } else {
    // conceivably possible..
    if ((char *) l1 > ((char *) l2) + L_BLOCKSIZE + MALLOC_OVERHEAD)
      return (-11);
  }

  if (setjmp(env) != 0)
    return (0);
  (void) signal(SIGSEGV, sh);

  free(l1);
  *((int *) l1) = 0;
  return (1);
}

EOF
if { (eval echo configure:4559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""succeeded" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""failed" 1>&6
        can_malloc=no
fi
rm -fr conftest*
fi

     fi
     ac_cv_can_malloc=$can_malloc
fi

    if test $ac_cv_can_malloc = yes; then
       echo "$ac_t""... yes, we can allocate Oz heap with malloc!" 1>&6
    else
       echo "$ac_t""... sorry, we shouldn't allocate Oz heap with malloc." 1>&6
    fi

    echo "checking whether we can allocate Oz heap via mmap..." 1>&6
echo "configure:4583: checking whether we can allocate Oz heap via mmap..." >&5
    if eval "test \"`echo '$''{'ac_cv_can_mmap'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  can_mmap=yes
     for ac_func in mmap
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4591: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4596 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
can_mmap=no
fi
done

     if test $can_mmap = yes; then
        echo $ac_n "checking ... with a test program""... $ac_c" 1>&6
echo "configure:4649: checking ... with a test program" >&5
        if test "$cross_compiling" = yes; then
  echo "$ac_t""dunno (no)" 1>&6
        can_mmap=no
else
  cat > conftest.$ac_ext <<EOF
#line 4655 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif

#include <sys/types.h>
#include <unistd.h>
#include <sys/mman.h>
#include <signal.h>
#include <setjmp.h>

// Test whether:
// - mmap is working
// - subsequent mmap"s allocate contiguous memory (no fragmentation)
// - munmap really returns memory

#if defined(MAP_ANON) && !defined(MAP_ANONYMOUS)
#define	MAP_ANONYMOUS	MAP_ANON
#elif defined(MAP_ANONYMOUS) && !defined(MAP_ANON)
#define	MAP_ANON	MAP_ANONYMOUS
#endif

#if !defined(MAP_ANONYMOUS)
#include <sys/stat.h>
#include <fcntl.h>
#endif

#define BLOCKSIZE	(512 * 1024)

jmp_buf env;

static
void sh(int sig)
{
  longjmp(env, SIGSEGV);
}

main()
{
#ifdef _POSIX_MAPPED_FILES
  void *loc1, *loc2;

#ifdef MAP_ANONYMOUS
  loc1 = mmap((void *) 0x0, (size_t) BLOCKSIZE, (PROT_READ|PROT_WRITE),
	      (MAP_PRIVATE|MAP_ANONYMOUS), -1, (off_t) 0x0);
  loc2 = mmap((void *) 0x0, (size_t) BLOCKSIZE, (PROT_READ|PROT_WRITE),
	      (MAP_PRIVATE|MAP_ANONYMOUS), -1, (off_t) 0x0);
#else
  int zeroFD = open("/dev/zero", O_RDWR);
  if (zeroFD < 0)
    return (-2);
  loc1 = mmap((caddr_t) 0x0, (size_t) BLOCKSIZE, (PROT_READ|PROT_WRITE),
	      (MAP_PRIVATE), zeroFD, 0x0);
  loc2 = mmap((caddr_t) 0x0, (size_t) BLOCKSIZE, (PROT_READ|PROT_WRITE),
	      (MAP_PRIVATE), zeroFD, (off_t) 0x0);
#endif

  if (loc1 == MAP_FAILED || loc2 == MAP_FAILED)
    return (-3);
  // On Solaris, regions are NOT adjacent - but so what?
  //    if (loc2 > loc1) {
  //      if ((char *) loc2 != ((char *) loc1) + BLOCKSIZE)
  //        return (-4);
  //    } else {
  //      // conceivable possible..
  //      if ((char *) loc1 != ((char *) loc2) + BLOCKSIZE)
  //        return (-4);
  //    }      

  if (setjmp(env) != 0)
    return (0);
  (void) signal(SIGSEGV, sh);

  if (munmap((caddr_t) loc1, BLOCKSIZE))
    return (-5);
  *((int *) loc1) = 0;
  return (-6);

#else // _POSIX_MAPPED_FILES
  exit(-1);
#endif
}

EOF
if { (eval echo configure:4740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""succeeded" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""failed" 1>&6
        can_mmap=no
fi
rm -fr conftest*
fi

     fi
     ac_cv_can_mmap=$can_mmap
fi

    if test $ac_cv_can_mmap = yes; then
       echo "$ac_t""... yes, we can allocate Oz heap via mmap!" 1>&6
    else
       echo "$ac_t""... sorry, we cannot allocate Oz heap via mmap." 1>&6
    fi

    echo "checking whether we could allocate Oz heap via sbrk ..." 1>&6
echo "configure:4764: checking whether we could allocate Oz heap via sbrk ..." >&5
    if eval "test \"`echo '$''{'ac_cv_can_sbrk'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  can_sbrk=yes
     for ac_func in sbrk
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4772: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 4777 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:4803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
can_sbrk=no
fi
done

     if test $can_sbrk = yes; then
        echo $ac_n "checking ... with a test program""... $ac_c" 1>&6
echo "configure:4830: checking ... with a test program" >&5
        if test "$cross_compiling" = yes; then
  echo "$ac_t""dunno (no)" 1>&6
        can_sbrk=no
else
  cat > conftest.$ac_ext <<EOF
#line 4836 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif

#include <unistd.h>
#include <malloc.h>
#include <signal.h>
#include <setjmp.h>

// Test whether:
// - both brk() and sbrk() are working, i.e. yielding some memory
// - malloc does not interfere with brk"ed memory fragments
//   - malloc works before and after brk()
//   - malloc"ed memory allocated before brk() retains its content
//   - malloc"ed memory can be deallocated
// - sbrk can return memory back to the OS


#define BLOCKSIZE	(512 * 1024)
#define STRUCTSIZE	(256)

jmp_buf env;

static
void sh(int sig)
{
  longjmp(env, SIGSEGV);
}

main()
{
  void *start;
  void *s1, *s2;
  void *end;
  char *mar1, *mar2;
  int i;

  start = sbrk(0);
  if (start == (void *) -1)
    return (-1);

  mar1 = (char *) malloc(STRUCTSIZE);
  if (mar1 == (char *) NULL)
    return (-2);
  for (i = 0; i < STRUCTSIZE; i++)
    mar1[i] = (char) i;

  s1 = sbrk(BLOCKSIZE);
  if (s1 == (void *) -1)
    return (-3);
  if ((char *) sbrk(0) != ((char *) s1) + BLOCKSIZE)
    return (-4);

  for (i = 0; i < STRUCTSIZE; i++) {
    if (mar1[i] != (char) i)
      return (-5);
  }

  mar2 = (char *) malloc(STRUCTSIZE);
  if (mar2 == (char *) NULL)
    return (-6);
  for (i = 0; i < STRUCTSIZE; i++)
    mar2[i] = (char) i;

  s2 = sbrk(0);
  if (sbrk == (void *) -1)
    return (-7);
  if (brk((void *) (((char *) s2) + BLOCKSIZE)) != 0)
    return (-8);
  if ((char *) sbrk(0) != ((char *) s2) + BLOCKSIZE)
    return (-9);

  for (i = 0; i < STRUCTSIZE; i++) {
    if (mar1[i] != (char) i)
      return (-10);
    if (mar2[i] != (char) i)
      return (-11);
  }

  if (brk(s2) != 0 || sbrk(0) != s2)
    return (-12);
  if (setjmp(env) == 0) {
    (void) signal(SIGSEGV, sh);
    *((int *) s2) = 0;
    return (-13);
  }

  mar1 = (char *) malloc(STRUCTSIZE);
  mar2 = (char *) malloc(STRUCTSIZE);
  if (mar1 == (char *) NULL || mar2 == (char *) NULL)
    return (-2);
  for (i = 0; i < STRUCTSIZE; i++) {
    mar1[i] = (char) i;
    mar2[i] = (char) i;
  }

  free(mar1);
  free(mar2);
}

EOF
if { (eval echo configure:4939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""succeeded" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""failed" 1>&6
        can_sbrk=no
fi
rm -fr conftest*
fi

     fi
     ac_cv_can_sbrk=$can_sbrk
fi

    if test $ac_cv_can_sbrk = yes; then
       echo "$ac_t""... yes, we can allocate Oz heap via sbrk!" 1>&6
    else
       echo "$ac_t""... sorry, we cannot allocate Oz heap with sbrk." 1>&6
    fi

    alloc_scheme=default
    echo $ac_n "checking for --enable-malloc-heap""... $ac_c" 1>&6
echo "configure:4964: checking for --enable-malloc-heap" >&5
    # Check whether --enable-malloc-heap or --disable-malloc-heap was given.
if test "${enable_malloc_heap+set}" = set; then
  enableval="$enable_malloc_heap"
  echo "$ac_t""yes" 1>&6
                  alloc_scheme=malloc
else
  if test $ac_cv_can_malloc = no; then
                     echo "configure: warning: using malloc may cause C heap fragmentation!" 1>&2
                  fi
                  echo "$ac_t""no" 1>&6
fi

    echo $ac_n "checking for --enable-mmap-heap""... $ac_c" 1>&6
echo "configure:4978: checking for --enable-mmap-heap" >&5
    # Check whether --enable-mmap-heap or --disable-mmap-heap was given.
if test "${enable_mmap_heap+set}" = set; then
  enableval="$enable_mmap_heap"
  if test $alloc_scheme = default; then
                     echo "$ac_t""yes" 1>&6
                     alloc_scheme=mmap
		     if test $ac_cv_can_mmap = no; then
			echo "configure: warning: mmap may fail to work on this platform!" 1>&2 
		     fi
		  else
		     echo "$ac_t""ignored: scheme "$alloc_scheme" is already specified" 1>&6
		  fi
else
  echo "$ac_t""no" 1>&6
fi

    echo $ac_n "checking for --enable-sbrk-heap""... $ac_c" 1>&6
echo "configure:4996: checking for --enable-sbrk-heap" >&5
    # Check whether --enable-sbrk-heap or --disable-sbrk-heap was given.
if test "${enable_sbrk_heap+set}" = set; then
  enableval="$enable_sbrk_heap"
  if test $alloc_scheme = default; then
                     echo "$ac_t""yes" 1>&6
                     alloc_scheme=sbrk
                     if test $ac_cv_can_sbrk = no; then
                        echo "configure: warning: sbrk may fail to work on this platform!" 1>&2 
                     fi
                  else
                     echo "$ac_t""ignored: scheme "$alloc_scheme" is already specified" 1>&6
                  fi
else
  echo "$ac_t""no" 1>&6
fi


    if test $alloc_scheme = default; then
       if test $ac_cv_can_malloc = yes; then
          alloc_scheme=malloc
       elif test $ac_cv_can_mmap = yes; then
          alloc_scheme=mmap
       elif test $ac_cv_can_sbrk = yes; then
          alloc_scheme=sbrk
       fi
    fi

    case $alloc_scheme in
    malloc)
        echo "$ac_t""... will use the (efficient) 'malloc'ing for Oz heap" 1>&6
        cat >> confdefs.h <<\EOF
#define USE_MALLOC 1
EOF

        ;;
    mmap)
        echo "$ac_t""... will allocate Oz heap using 'mmap'" 1>&6
        cat >> confdefs.h <<\EOF
#define USE_MMAP 1
EOF

        ;;
    sbrk)
        echo "$ac_t""... will allocate Oz heap using 'sbrk'" 1>&6
        cat >> confdefs.h <<\EOF
#define USE_SBRK 1
EOF

        ;;
    *)
        echo "$ac_t""... will use the (inefficient) 'malloc'ing for Oz heap " 1>&6
        cat >> confdefs.h <<\EOF
#define USE_MALLOC 1
EOF

        ;;
    esac
    ;;
esac

echo $ac_n "checking for strdup""... $ac_c" 1>&6
echo "configure:5058: checking for strdup" >&5
if eval "test \"`echo '$''{'ac_cv_func_strdup'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 5063 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char strdup(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char strdup();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_strdup) || defined (__stub___strdup)
choke me
#else
strdup();
#endif

; return 0; }
EOF
if { (eval echo configure:5089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_strdup=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_strdup=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'strdup`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define HAVE_STRDUP 1
EOF

else
  echo "$ac_t""no" 1>&6
fi






if test "$ac_cv_lib_dl_dlopen" = yes || \
   test "$ac_cv_func_dlopen" = yes; then
  echo $ac_n "checking whether dlopen needs leading underscore""... $ac_c" 1>&6
echo "configure:5119: checking whether dlopen needs leading underscore" >&5
if eval "test \"`echo '$''{'oz_cv_dlopen_underscore'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    if test -n "$oz_dlopen_underscore"; then
      oz_cv_dlopen_underscore=$oz_dlopen_underscore
    else
      cat > conftest.$ac_ext <<EOF
extern "C"
int foo() { return 1; }
EOF
      if { (eval echo configure:5131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
        oz_tmp=`(strings -a conftest.o | grep foo) 2>/dev/null`
        ## on some platforms strings -a does not do the job
        ## but nm works fine (e.g. Darwin). So, in case we did
        ## not get a result with strings -a, we try it again
        ## here with nm and remove the stuff preceding the
        ## identifier that we are interested in
        if test -z "$oz_tmp"; then
          oz_tmp=`(nm conftest.o | grep foo) 2>/dev/null`
          oz_tmp=`expr "$oz_tmp" : '.* . \(.*\)' 2>/dev/null`
        fi
        if expr "$oz_tmp" : '_' 1>/dev/null 2>&1; then
          oz_cv_dlopen_underscore=yes;
        else
          oz_cv_dlopen_underscore=no;
        fi
      else
        { echo "configure: error: test bombed" 1>&2; exit 1; }
      fi
      rm -rf conftest.$ac_ext conftest.o
    fi
fi

echo "$ac_t""$oz_cv_dlopen_underscore" 1>&6
  if test "$oz_cv_dlopen_underscore" = yes; then
    cat >> confdefs.h <<\EOF
#define DLOPEN_UNDERSCORE 1
EOF

  fi
fi

# AC_CHECK_SIZEOF(int)
# AC_C_BIGENDIAN

# check malloc base


: ${oz_inc_path="/usr/local/include"}
: ${oz_lib_path="/usr/local/lib"}


echo $ac_n "checking for --with-gmp""... $ac_c" 1>&6
echo "configure:5174: checking for --with-gmp" >&5
# Check whether --with-gmp or --without-gmp was given.
if test "${with_gmp+set}" = set; then
  withval="$with_gmp"
  with_gmp=$withval
else
  with_gmp=yes
fi

	    
if test "$with_gmp" != no
then
    echo "$ac_t""$with_gmp" 1>&6

    if test "${with_gmp}" != yes
    then
	oz_gmp_lib_dir=$with_gmp
	oz_gmp_inc_dir=$with_gmp
    fi
    
    oz_inc_path="$oz_gmp_inc_dir $oz_inc_path"
    oz_lib_path="$oz_gmp_lib_dir $oz_lib_path"

else
    echo "$ac_t""no" 1>&6
fi


  echo $ac_n "checking for gmp.h""... $ac_c" 1>&6
echo "configure:5203: checking for gmp.h" >&5
if eval "test \"`echo '$''{'oz_cv_header_gmp_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
      oz_tmp_cppflags="$CPPFLAGS"
      oz_tmp_ok=no
      for oz_tmp in $oz_inc_path; do
	CPPFLAGS="$oz_tmp_cppflags -I$oz_tmp"
	cat > conftest.$ac_ext <<EOF
#line 5214 "configure"
#include "confdefs.h"
#include "gmp.h"
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  
        oz_tmp_ok="-I$oz_tmp"
        break
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      done
      if test "$oz_tmp_ok" = no; then
	cat > conftest.$ac_ext <<EOF
#line 5235 "configure"
#include "confdefs.h"
#include "gmp.h"
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  
          oz_tmp_ok=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      fi
      CPPFLAGS=$oz_tmp_cppflags
oz_cv_header_gmp_h="$oz_tmp_ok"

    
fi

echo "$ac_t""$oz_cv_header_gmp_h" 1>&6

  oz_tmp_val=$oz_cv_header_gmp_h

  if test "$oz_tmp_val" != no; then
    if test "$oz_tmp_val" != yes; then
      
  if test "$oz_tmp_val" != yes && test "$oz_tmp_val" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $CPPFLAGS NONE; do
      if test "$oz_tmp" = "$oz_tmp_val"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }$oz_tmp_val"
  fi

    fi
    oz_gmp_inc_found=yes
  else
    oz_inc_path_sav=$oz_inc_path
  oz_inc_path="$oz_inc_path /usr/include/gmp2"
  
  echo $ac_n "checking for gmp.h""... $ac_c" 1>&6
echo "configure:5284: checking for gmp.h" >&5
if eval "test \"`echo '$''{'oz_cv_header_gmp_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
      oz_tmp_cppflags="$CPPFLAGS"
      oz_tmp_ok=no
      for oz_tmp in $oz_inc_path; do
	CPPFLAGS="$oz_tmp_cppflags -I$oz_tmp"
	cat > conftest.$ac_ext <<EOF
#line 5295 "configure"
#include "confdefs.h"
#include "gmp.h"
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5300: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  
        oz_tmp_ok="-I$oz_tmp"
        break
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      done
      if test "$oz_tmp_ok" = no; then
	cat > conftest.$ac_ext <<EOF
#line 5316 "configure"
#include "confdefs.h"
#include "gmp.h"
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:5321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  
          oz_tmp_ok=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      fi
      CPPFLAGS=$oz_tmp_cppflags
oz_cv_header_gmp_h="$oz_tmp_ok"

    
fi

echo "$ac_t""$oz_cv_header_gmp_h" 1>&6

  oz_tmp_val=$oz_cv_header_gmp_h

  if test "$oz_tmp_val" != no; then
    if test "$oz_tmp_val" != yes; then
      
  if test "$oz_tmp_val" != yes && test "$oz_tmp_val" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $CPPFLAGS NONE; do
      if test "$oz_tmp" = "$oz_tmp_val"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }$oz_tmp_val"
  fi

    fi
    oz_gmp_inc_found=yes
  else
    oz_gmp_inc_found=no
     oz_inc_path=$oz_inc_path_sav
  fi
  fi

if test "$oz_gmp_inc_found" = yes; then
  
  if test -n "$oz_cv_lib_path_ldflags_gmp___gmpz_init"; then
    echo $ac_n "checking for library gmp""... $ac_c" 1>&6
echo "configure:5370: checking for library gmp" >&5
    oz_add_ldflags=$oz_cv_lib_path_ldflags_gmp___gmpz_init
    oz_add_libs=$oz_cv_lib_path_libs_gmp___gmpz_init
    if test "$oz_add_ldflags" = no; then
      oz_tmp=no
    else
     if test -n "$oz_add_ldflags" && test "$oz_add_ldflags" != yes; then
       oz_tmp="$oz_add_ldflags (LDFLAGS)"
     else
       oz_tmp=
     fi
     if test -n "$oz_add_libs" && \
        test "$oz_add_libs" != yes && \
        test "$oz_add_libs" != no; then
       oz_tmp="$oz_tmp${oz_tmp:+ }$oz_add_libs (LIBS)"
     fi
    fi
    echo "$ac_t""(cached) $oz_tmp" 1>&6
  else
    oz_tmp_ldflags=$LDFLAGS
    oz_tmp_libs=$LIBS
    oz_add_ldflags=no
    oz_add_libs=no
    echo $ac_n "checking for __gmpz_init in -lgmp (default)""... $ac_c" 1>&6
echo "configure:5394: checking for __gmpz_init in -lgmp (default)" >&5
    
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 5399 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgmp -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 5424 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgmp $oz_saved_LIBS"
         oz_add_libs="-lgmp"
         
	cat > conftest.$ac_ext <<EOF
#line 5448 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for __gmpz_init in -L$p -lgmp""... $ac_c" 1>&6
echo "configure:5474: checking for __gmpz_init in -L$p -lgmp" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 5479 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgmp -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 5504 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgmp $oz_saved_LIBS"
         oz_add_libs="-lgmp"
         
	cat > conftest.$ac_ext <<EOF
#line 5528 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgmp $oz_saved_LIBS"
      oz_add_libs="-lgmp"
      
	cat > conftest.$ac_ext <<EOF
#line 5560 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgmp $oz_saved_LIBS"
      oz_add_libs="-lgmp"
      
	cat > conftest.$ac_ext <<EOF
#line 5598 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for __gmpz_init in -L$p -lgmp""... $ac_c" 1>&6
echo "configure:5624: checking for __gmpz_init in -L$p -lgmp" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 5629 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgmp -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 5654 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgmp $oz_saved_LIBS"
         oz_add_libs="-lgmp"
         
	cat > conftest.$ac_ext <<EOF
#line 5678 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgmp $oz_saved_LIBS"
      oz_add_libs="-lgmp"
      
	cat > conftest.$ac_ext <<EOF
#line 5710 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init();

int main() {
__gmpz_init()
; return 0; }
EOF
if { (eval echo configure:5721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
    fi
fi
rm -f conftest*
    LDFLAGS=$oz_tmp_ldflags
    LIBS=$oz_tmp_libs
    oz_cv_lib_path_ldflags_gmp___gmpz_init=$oz_add_ldflags
    oz_cv_lib_path_libs_gmp___gmpz_init=$oz_add_libs
  fi
  if test "$oz_add_ldflags" = no; then
        
  if test -n "$oz_cv_lib_path_ldflags_gmp_mpz_init"; then
    echo $ac_n "checking for library gmp""... $ac_c" 1>&6
echo "configure:5753: checking for library gmp" >&5
    oz_add_ldflags=$oz_cv_lib_path_ldflags_gmp_mpz_init
    oz_add_libs=$oz_cv_lib_path_libs_gmp_mpz_init
    if test "$oz_add_ldflags" = no; then
      oz_tmp=no
    else
     if test -n "$oz_add_ldflags" && test "$oz_add_ldflags" != yes; then
       oz_tmp="$oz_add_ldflags (LDFLAGS)"
     else
       oz_tmp=
     fi
     if test -n "$oz_add_libs" && \
        test "$oz_add_libs" != yes && \
        test "$oz_add_libs" != no; then
       oz_tmp="$oz_tmp${oz_tmp:+ }$oz_add_libs (LIBS)"
     fi
    fi
    echo "$ac_t""(cached) $oz_tmp" 1>&6
  else
    oz_tmp_ldflags=$LDFLAGS
    oz_tmp_libs=$LIBS
    oz_add_ldflags=no
    oz_add_libs=no
    echo $ac_n "checking for mpz_init in -lgmp (default)""... $ac_c" 1>&6
echo "configure:5777: checking for mpz_init in -lgmp (default)" >&5
    
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 5782 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:5793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgmp -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 5807 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:5818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgmp $oz_saved_LIBS"
         oz_add_libs="-lgmp"
         
	cat > conftest.$ac_ext <<EOF
#line 5831 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:5842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for mpz_init in -L$p -lgmp""... $ac_c" 1>&6
echo "configure:5857: checking for mpz_init in -L$p -lgmp" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 5862 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:5873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgmp -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 5887 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:5898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgmp $oz_saved_LIBS"
         oz_add_libs="-lgmp"
         
	cat > conftest.$ac_ext <<EOF
#line 5911 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:5922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgmp $oz_saved_LIBS"
      oz_add_libs="-lgmp"
      
	cat > conftest.$ac_ext <<EOF
#line 5943 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:5954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgmp $oz_saved_LIBS"
      oz_add_libs="-lgmp"
      
	cat > conftest.$ac_ext <<EOF
#line 5981 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:5992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for mpz_init in -L$p -lgmp""... $ac_c" 1>&6
echo "configure:6007: checking for mpz_init in -L$p -lgmp" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 6012 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgmp -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 6037 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgmp $oz_saved_LIBS"
         oz_add_libs="-lgmp"
         
	cat > conftest.$ac_ext <<EOF
#line 6061 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgmp $oz_saved_LIBS"
      oz_add_libs="-lgmp"
      
	cat > conftest.$ac_ext <<EOF
#line 6093 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
    fi
fi
rm -f conftest*
    LDFLAGS=$oz_tmp_ldflags
    LIBS=$oz_tmp_libs
    oz_cv_lib_path_ldflags_gmp_mpz_init=$oz_add_ldflags
    oz_cv_lib_path_libs_gmp_mpz_init=$oz_add_libs
  fi
  if test "$oz_add_ldflags" = no; then
    
  if test -n "$oz_cv_lib_path_ldflags_gmp2_mpz_init"; then
    echo $ac_n "checking for library gmp2""... $ac_c" 1>&6
echo "configure:6136: checking for library gmp2" >&5
    oz_add_ldflags=$oz_cv_lib_path_ldflags_gmp2_mpz_init
    oz_add_libs=$oz_cv_lib_path_libs_gmp2_mpz_init
    if test "$oz_add_ldflags" = no; then
      oz_tmp=no
    else
     if test -n "$oz_add_ldflags" && test "$oz_add_ldflags" != yes; then
       oz_tmp="$oz_add_ldflags (LDFLAGS)"
     else
       oz_tmp=
     fi
     if test -n "$oz_add_libs" && \
        test "$oz_add_libs" != yes && \
        test "$oz_add_libs" != no; then
       oz_tmp="$oz_tmp${oz_tmp:+ }$oz_add_libs (LIBS)"
     fi
    fi
    echo "$ac_t""(cached) $oz_tmp" 1>&6
  else
    oz_tmp_ldflags=$LDFLAGS
    oz_tmp_libs=$LIBS
    oz_add_ldflags=no
    oz_add_libs=no
    echo $ac_n "checking for mpz_init in -lgmp2 (default)""... $ac_c" 1>&6
echo "configure:6160: checking for mpz_init in -lgmp2 (default)" >&5
    
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 6165 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgmp2 -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 6190 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgmp2 $oz_saved_LIBS"
         oz_add_libs="-lgmp2"
         
	cat > conftest.$ac_ext <<EOF
#line 6214 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for mpz_init in -L$p -lgmp2""... $ac_c" 1>&6
echo "configure:6240: checking for mpz_init in -L$p -lgmp2" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 6245 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgmp2 -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 6270 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgmp2 $oz_saved_LIBS"
         oz_add_libs="-lgmp2"
         
	cat > conftest.$ac_ext <<EOF
#line 6294 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgmp2 $oz_saved_LIBS"
      oz_add_libs="-lgmp2"
      
	cat > conftest.$ac_ext <<EOF
#line 6326 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgmp2 $oz_saved_LIBS"
      oz_add_libs="-lgmp2"
      
	cat > conftest.$ac_ext <<EOF
#line 6364 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for mpz_init in -L$p -lgmp2""... $ac_c" 1>&6
echo "configure:6390: checking for mpz_init in -L$p -lgmp2" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 6395 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgmp2 -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 6420 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgmp2 $oz_saved_LIBS"
         oz_add_libs="-lgmp2"
         
	cat > conftest.$ac_ext <<EOF
#line 6444 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgmp2 $oz_saved_LIBS"
      oz_add_libs="-lgmp2"
      
	cat > conftest.$ac_ext <<EOF
#line 6476 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char mpz_init();

int main() {
mpz_init()
; return 0; }
EOF
if { (eval echo configure:6487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
    fi
fi
rm -f conftest*
    LDFLAGS=$oz_tmp_ldflags
    LIBS=$oz_tmp_libs
    oz_cv_lib_path_ldflags_gmp2_mpz_init=$oz_add_ldflags
    oz_cv_lib_path_libs_gmp2_mpz_init=$oz_add_libs
  fi
  if test "$oz_add_ldflags" = no; then
    oz_gmp_lib_found=no
  else
    
  if test "$oz_add_ldflags" != yes && test "$oz_add_ldflags" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $LDFLAGS NONE; do
      if test "$oz_tmp" = "$oz_add_ldflags"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && LDFLAGS="$oz_add_ldflags${LDFLAGS:+ }$LDFLAGS"
  fi

    
  if test -n "$oz_add_libs" && test "$oz_add_libs" != yes && test "$oz_add_libs" != no; then
    LIBS="$oz_add_libs${LIBS:+ }$LIBS"
  fi
    oz_gmp_lib_found=gmp2
  fi
  else
    
  if test "$oz_add_ldflags" != yes && test "$oz_add_ldflags" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $LDFLAGS NONE; do
      if test "$oz_tmp" = "$oz_add_ldflags"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && LDFLAGS="$oz_add_ldflags${LDFLAGS:+ }$LDFLAGS"
  fi

    
  if test -n "$oz_add_libs" && test "$oz_add_libs" != yes && test "$oz_add_libs" != no; then
    LIBS="$oz_add_libs${LIBS:+ }$LIBS"
  fi
    oz_gmp_lib_found=gmp
  fi
  else
    
  if test "$oz_add_ldflags" != yes && test "$oz_add_ldflags" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $LDFLAGS NONE; do
      if test "$oz_tmp" = "$oz_add_ldflags"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && LDFLAGS="$oz_add_ldflags${LDFLAGS:+ }$LDFLAGS"
  fi

    
  if test -n "$oz_add_libs" && test "$oz_add_libs" != yes && test "$oz_add_libs" != no; then
    LIBS="$oz_add_libs${LIBS:+ }$LIBS"
  fi
    oz_gmp_lib_found=gmp
  fi
fi

if test "$oz_gmp_lib_found" != no; then
  echo $ac_n "checking gmp version is at least 2""... $ac_c" 1>&6
echo "configure:6578: checking gmp version is at least 2" >&5
  if test -z "$oz_cv_gmp_version_ok"; then
    cat > conftest.$ac_ext <<EOF
#include <gmp.h>
TheVersion __GNU_MP_VERSION __GNU_MP_VERSION_MINOR
EOF
    oz_tmp=`$CXXCPP $CPPFLAGS conftest.$ac_ext | egrep TheVersion`;
    rm -f conftest.$ac_ext 2>/dev/null
    if oz_tmp=`expr "$oz_tmp" : 'TheVersion \(.*\)$'`; then
      
  oz_tmp_got="$oz_tmp"
  oz_tmp_want="2"
  oz_tmp_IFS="$IFS"
  IFS="$IFS._"
  set $oz_tmp_got DONE
  oz_tmp__ok=yes
  for oz_tmp_cur in $oz_tmp_want; do
    if test "$1" = DONE; then
      break
    elif test "$oz_tmp_cur" -lt "$1"; then
      break
    elif test "$oz_tmp_cur" -gt "$1"; then
      oz_tmp__ok=no
      break
    fi
    shift
  done
  IFS=$oz_tmp_IFS
  oz_tmp_ok=$oz_tmp__ok
      test "$oz_tmp_ok" = yes && oz_cv_gmp_version_ok=$oz_tmp_ok
    else
      oz_tmp_ok=no
    fi
    echo "$ac_t""$oz_tmp_ok" 1>&6
  else
    oz_tmp_ok=$oz_cv_gmp_version_ok
    echo "$ac_t""(cached) $oz_tmp_ok" 1>&6
  fi
  oz_gmp_version_ok=$oz_tmp_ok
fi

if test "$oz_gmp_inc_found" = no; then
  echo "configure: warning: required GNU MP include file not found" 1>&2
elif test "$oz_gmp_lib_found" = no; then
  echo "configure: warning: required GNU MP lib not found" 1>&2
elif test "$oz_gmp_version_ok" = no; then
  echo "configure: warning: GNU MP version too old" 1>&2
fi

if test "$oz_gmp_inc_found"  = no || \
   test "$oz_gmp_lib_found"  = no || \
   test "$oz_gmp_version_ok" = no; then
  { echo "configure: error: 
The GNU Multiple Precision Arithmetic Library (gmp)
version 2 or higher is required
to build the system.  It can be retrieved from:

	ftp://ftp.gnu.org/pub/gnu/

The latest version at this time is 3.0.1 and is available
packaged as the following archive:

	ftp://ftp.gnu.org/pub/gnu/gmp/gmp-3.0.1.tar.gz

You may find a mirror archive closer to you by consulting:

	http://www.gnu.org/order/ftp.html
" 1>&2; exit 1; }
fi



  echo $ac_n "checking for --with-zlib""... $ac_c" 1>&6
echo "configure:6651: checking for --with-zlib" >&5
  # Check whether --with-zlib or --without-zlib was given.
if test "${with_zlib+set}" = set; then
  withval="$with_zlib"
  with_zlib=$withval
else
  with_zlib=yes
fi

if test "$with_zlib" != no
then
    echo "$ac_t""$with_zlib" 1>&6
	    
    if test "${with_zlib}" != yes
    then
	oz_zlib_lib_dir=$with_zlib
	oz_zlib_inc_dir=$with_zlib
    fi

    oz_inc_path="$oz_zlib_inc_dir $oz_inc_path"
    oz_lib_path="$oz_zlib_lib_dir $oz_lib_path"

else
    echo "$ac_t""no" 1>&6
fi


  echo $ac_n "checking for zlib.h""... $ac_c" 1>&6
echo "configure:6679: checking for zlib.h" >&5
if eval "test \"`echo '$''{'oz_cv_header_zlib_h'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
    
      oz_tmp_cppflags="$CPPFLAGS"
      oz_tmp_ok=no
      for oz_tmp in $oz_inc_path; do
	CPPFLAGS="$oz_tmp_cppflags -I$oz_tmp"
	cat > conftest.$ac_ext <<EOF
#line 6690 "configure"
#include "confdefs.h"
#include "zlib.h"
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  
        oz_tmp_ok="-I$oz_tmp"
        break
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      done
      if test "$oz_tmp_ok" = no; then
	cat > conftest.$ac_ext <<EOF
#line 6711 "configure"
#include "confdefs.h"
#include "zlib.h"
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  
          oz_tmp_ok=yes
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
fi
rm -f conftest*
      fi
      CPPFLAGS=$oz_tmp_cppflags
oz_cv_header_zlib_h="$oz_tmp_ok"

    
fi

echo "$ac_t""$oz_cv_header_zlib_h" 1>&6

  oz_tmp_val=$oz_cv_header_zlib_h

  if test "$oz_tmp_val" != no; then
    if test "$oz_tmp_val" != yes; then
      
  if test "$oz_tmp_val" != yes && test "$oz_tmp_val" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $CPPFLAGS NONE; do
      if test "$oz_tmp" = "$oz_tmp_val"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }$oz_tmp_val"
  fi

    fi
    oz_zlib_inc_found=yes
  else
    oz_zlib_inc_found=no
  fi

if test "$oz_zlib_inc_found" = yes; then
  
  if test -n "$oz_cv_lib_path_ldflags_z_zlibVersion"; then
    echo $ac_n "checking for library z""... $ac_c" 1>&6
echo "configure:6763: checking for library z" >&5
    oz_add_ldflags=$oz_cv_lib_path_ldflags_z_zlibVersion
    oz_add_libs=$oz_cv_lib_path_libs_z_zlibVersion
    if test "$oz_add_ldflags" = no; then
      oz_tmp=no
    else
     if test -n "$oz_add_ldflags" && test "$oz_add_ldflags" != yes; then
       oz_tmp="$oz_add_ldflags (LDFLAGS)"
     else
       oz_tmp=
     fi
     if test -n "$oz_add_libs" && \
        test "$oz_add_libs" != yes && \
        test "$oz_add_libs" != no; then
       oz_tmp="$oz_tmp${oz_tmp:+ }$oz_add_libs (LIBS)"
     fi
    fi
    echo "$ac_t""(cached) $oz_tmp" 1>&6
  else
    oz_tmp_ldflags=$LDFLAGS
    oz_tmp_libs=$LIBS
    oz_add_ldflags=no
    oz_add_libs=no
    echo $ac_n "checking for zlibVersion in -lz (default)""... $ac_c" 1>&6
echo "configure:6787: checking for zlibVersion in -lz (default)" >&5
    
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 6792 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:6803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lz -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 6817 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:6828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lz $oz_saved_LIBS"
         oz_add_libs="-lz"
         
	cat > conftest.$ac_ext <<EOF
#line 6841 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:6852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for zlibVersion in -L$p -lz""... $ac_c" 1>&6
echo "configure:6867: checking for zlibVersion in -L$p -lz" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 6872 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:6883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lz -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 6897 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:6908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lz $oz_saved_LIBS"
         oz_add_libs="-lz"
         
	cat > conftest.$ac_ext <<EOF
#line 6921 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:6932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lz $oz_saved_LIBS"
      oz_add_libs="-lz"
      
	cat > conftest.$ac_ext <<EOF
#line 6953 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:6964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lz $oz_saved_LIBS"
      oz_add_libs="-lz"
      
	cat > conftest.$ac_ext <<EOF
#line 6991 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for zlibVersion in -L$p -lz""... $ac_c" 1>&6
echo "configure:7017: checking for zlibVersion in -L$p -lz" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 7022 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lz -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 7047 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lz $oz_saved_LIBS"
         oz_add_libs="-lz"
         
	cat > conftest.$ac_ext <<EOF
#line 7071 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lz $oz_saved_LIBS"
      oz_add_libs="-lz"
      
	cat > conftest.$ac_ext <<EOF
#line 7103 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7114: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
    fi
fi
rm -f conftest*
    LDFLAGS=$oz_tmp_ldflags
    LIBS=$oz_tmp_libs
    oz_cv_lib_path_ldflags_z_zlibVersion=$oz_add_ldflags
    oz_cv_lib_path_libs_z_zlibVersion=$oz_add_libs
  fi
  if test "$oz_add_ldflags" = no; then
    
  if test -n "$oz_cv_lib_path_ldflags_gz_zlibVersion"; then
    echo $ac_n "checking for library gz""... $ac_c" 1>&6
echo "configure:7146: checking for library gz" >&5
    oz_add_ldflags=$oz_cv_lib_path_ldflags_gz_zlibVersion
    oz_add_libs=$oz_cv_lib_path_libs_gz_zlibVersion
    if test "$oz_add_ldflags" = no; then
      oz_tmp=no
    else
     if test -n "$oz_add_ldflags" && test "$oz_add_ldflags" != yes; then
       oz_tmp="$oz_add_ldflags (LDFLAGS)"
     else
       oz_tmp=
     fi
     if test -n "$oz_add_libs" && \
        test "$oz_add_libs" != yes && \
        test "$oz_add_libs" != no; then
       oz_tmp="$oz_tmp${oz_tmp:+ }$oz_add_libs (LIBS)"
     fi
    fi
    echo "$ac_t""(cached) $oz_tmp" 1>&6
  else
    oz_tmp_ldflags=$LDFLAGS
    oz_tmp_libs=$LIBS
    oz_add_ldflags=no
    oz_add_libs=no
    echo $ac_n "checking for zlibVersion in -lgz (default)""... $ac_c" 1>&6
echo "configure:7170: checking for zlibVersion in -lgz (default)" >&5
    
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 7175 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgz -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 7200 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgz $oz_saved_LIBS"
         oz_add_libs="-lgz"
         
	cat > conftest.$ac_ext <<EOF
#line 7224 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for zlibVersion in -L$p -lgz""... $ac_c" 1>&6
echo "configure:7250: checking for zlibVersion in -L$p -lgz" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 7255 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgz -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 7280 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgz $oz_saved_LIBS"
         oz_add_libs="-lgz"
         
	cat > conftest.$ac_ext <<EOF
#line 7304 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgz $oz_saved_LIBS"
      oz_add_libs="-lgz"
      
	cat > conftest.$ac_ext <<EOF
#line 7336 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgz $oz_saved_LIBS"
      oz_add_libs="-lgz"
      
	cat > conftest.$ac_ext <<EOF
#line 7374 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
       oz_add_ldflags=yes
      
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
       for p in $oz_lib_path; do
         LDFLAGS="-L$p $oz_tmp_ldflags"
         echo $ac_n "checking for zlibVersion in -L$p -lgz""... $ac_c" 1>&6
echo "configure:7400: checking for zlibVersion in -L$p -lgz" >&5
         
  oz_saved_LIBS=$LIBS
  
	cat > conftest.$ac_ext <<EOF
#line 7405 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  if test "${oz_enable_link_static}" = yes; then
      oz_add_libs="-Xlinker -Bstatic -lgz -Xlinker -Bdynamic"
      LIBS="$oz_add_libs${oz_saved_LIBS:+ }$oz_saved_LIBS"
      
	cat > conftest.$ac_ext <<EOF
#line 7430 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS="-lgz $oz_saved_LIBS"
         oz_add_libs="-lgz"
         
	cat > conftest.$ac_ext <<EOF
#line 7454 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
            oz_add_libs=no
            echo "$ac_t""no" 1>&6
fi
rm -f conftest*
fi
rm -f conftest*
    else
      LIBS="-lgz $oz_saved_LIBS"
      oz_add_libs="-lgz"
      
	cat > conftest.$ac_ext <<EOF
#line 7486 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C"
#endif
char zlibVersion();

int main() {
zlibVersion()
; return 0; }
EOF
if { (eval echo configure:7497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  echo "$ac_t""yes" 1>&6
            oz_add_ldflags="-L$p"
            break
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  LIBS=$oz_saved_LIBS
         oz_add_libs=no
         echo "$ac_t""no" 1>&6
fi
rm -f conftest*
    fi
fi
rm -f conftest*
       done
fi
rm -f conftest*
    fi
fi
rm -f conftest*
    LDFLAGS=$oz_tmp_ldflags
    LIBS=$oz_tmp_libs
    oz_cv_lib_path_ldflags_gz_zlibVersion=$oz_add_ldflags
    oz_cv_lib_path_libs_gz_zlibVersion=$oz_add_libs
  fi
  if test "$oz_add_ldflags" = no; then
    oz_zlib_lib_found=no
  else
    
  if test "$oz_add_ldflags" != yes && test "$oz_add_ldflags" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $LDFLAGS NONE; do
      if test "$oz_tmp" = "$oz_add_ldflags"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && LDFLAGS="$oz_add_ldflags${LDFLAGS:+ }$LDFLAGS"
  fi

    
  if test -n "$oz_add_libs" && test "$oz_add_libs" != yes && test "$oz_add_libs" != no; then
    LIBS="$oz_add_libs${LIBS:+ }$LIBS"
  fi
    oz_zlib_lib_found=yes
  fi
  else
    
  if test "$oz_add_ldflags" != yes && test "$oz_add_ldflags" != no; then
    oz_tmp_ok=yes
    for oz_tmp in $LDFLAGS NONE; do
      if test "$oz_tmp" = "$oz_add_ldflags"; then
        oz_tmp_ok=no
        break
      fi
    done
    test "$oz_tmp_ok" = yes && LDFLAGS="$oz_add_ldflags${LDFLAGS:+ }$LDFLAGS"
  fi

    
  if test -n "$oz_add_libs" && test "$oz_add_libs" != yes && test "$oz_add_libs" != no; then
    LIBS="$oz_add_libs${LIBS:+ }$LIBS"
  fi
    oz_zlib_lib_found=yes
  fi
fi

if test "$oz_zlib_inc_found" = no; then
  echo "configure: warning: required ZLIB include file zlib.h not found" 1>&2
elif test "$oz_zlib_lib_found" = no; then
  echo "configure: warning: required ZLIB library libz not found" 1>&2
fi

if test "$oz_zlib_inc_found" = no || \
   test "$oz_zlib_lib_found" = no; then
  { echo "configure: error: 
The ZLIB general purpose compression library is required to
build the system.  It can be retrieved from:

	http://www.info-zip.org/pub/infozip/zlib/

" 1>&2; exit 1; }
fi



echo $ac_n "checking for --with-ccmalloc""... $ac_c" 1>&6
echo "configure:7587: checking for --with-ccmalloc" >&5
# Check whether --with-ccmalloc or --without-ccmalloc was given.
if test "${with_ccmalloc+set}" = set; then
  withval="$with_ccmalloc"
  :
fi


if test "$with_ccmalloc" = "yes"
then
    echo "$ac_t""yes" 1>&6
    echo $ac_n "checking for main in -lccmalloc""... $ac_c" 1>&6
echo "configure:7599: checking for main in -lccmalloc" >&5
ac_lib_var=`echo ccmalloc'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  ac_save_LIBS="$LIBS"
LIBS="-lccmalloc  $LIBS"
cat > conftest.$ac_ext <<EOF
#line 7607 "configure"
#include "confdefs.h"

int main() {
main()
; return 0; }
EOF
if { (eval echo configure:7614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"

fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  true
else
  echo "$ac_t""no" 1>&6
{ echo "configure: error: cannot find lib ccmalloc" 1>&2; exit 1; }
fi

    cat >> confdefs.h <<\EOF
#define CCMALLOC 1
EOF

    LIBS="$LIBS -lccmalloc"
    oz_enable_modules_static=yes
elif test -n "$with_ccmalloc"
then
    { echo "configure: error: only yes allowed" 1>&2; exit 1; }
else
    echo "$ac_t""no" 1>&6
fi




echo $ac_n "checking for --enable-opt""... $ac_c" 1>&6
echo "configure:7652: checking for --enable-opt" >&5
# Check whether --enable-opt or --disable-opt was given.
if test "${enable_opt+set}" = set; then
  enableval="$enable_opt"
  :
fi

case $enable_opt in
    d*)
        echo "$ac_t""debug (-DDEBUG_EMULATOR)" 1>&6
	cat >> confdefs.h <<\EOF
#define DEBUG_EMULATOR 1
EOF

	
	ozm_out=
	if test -n "$oz_copt_debug"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="$oz_copt_debug"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:7675: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	COPT="$ozm_out"
	
	oz_enable_threaded=no
	oz_enable_fastreg=no
	oz_enable_fasterreg=no
	;;
    p*)
	echo "$ac_t""profile (-DPROFILE_EMULATOR)" 1>&6
	cat >> confdefs.h <<\EOF
#define PROFILE_EMULATOR 1
EOF

        
	ozm_out=
	if test -n "$oz_copt_profile"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="$oz_copt_profile"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:7717: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	COPT="$ozm_out"
	
	EMULDFLAGS="$EMULDFLAGS $oz_lopt_profile"
	;;
    rsp*)
        echo "$ac_t""rsprofile (-DRS_PROFILE)" 1>&6
	cat >> confdefs.h <<\EOF
#define RS_PROFILE 1
EOF

        
	ozm_out=
	if test -n ""-O""
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for=""-O""
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:7757: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	COPT="$ozm_out"
	
	oz_enable_miscbuiltins="yes"
	oz_enable_threaded="no"
	;;
    no*)
        echo "$ac_t""default" 1>&6
	COPT=$oz_copt_default
	;;
    *)
	echo "$ac_t""optimize" 1>&6
	
	ozm_out=
	if test -n "$oz_copt_optimize"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="$oz_copt_optimize"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:7798: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	COPT="$ozm_out"
	
	;;
esac





    echo $ac_n "checking for --enable-threaded""... $ac_c" 1>&6
echo "configure:7829: checking for --enable-threaded" >&5
    # Check whether --enable-threaded or --disable-threaded was given.
if test "${enable_threaded+set}" = set; then
  enableval="$enable_threaded"
  :
fi

    : ${oz_enable_threaded=yes}
    if test -n "${enable_threaded}"; then
	oz_enable_threaded=$enable_threaded
    fi
    if test "${oz_enable_threaded}" != no; then
	echo "$ac_t""yes (-DTHREADED)" 1>&6
	cat >> confdefs.h <<\EOF
#define THREADED 1
EOF

	
    else
	echo "$ac_t""no" 1>&6
    fi
    


    echo $ac_n "checking for --enable-fastreg""... $ac_c" 1>&6
echo "configure:7854: checking for --enable-fastreg" >&5
    # Check whether --enable-fastreg or --disable-fastreg was given.
if test "${enable_fastreg+set}" = set; then
  enableval="$enable_fastreg"
  :
fi

    : ${oz_enable_fastreg=yes}
    if test -n "${enable_fastreg}"; then
	oz_enable_fastreg=$enable_fastreg
    fi
    if test "${oz_enable_fastreg}" != no; then
	echo "$ac_t""yes (-DFASTREGACCESS)" 1>&6
	cat >> confdefs.h <<\EOF
#define FASTREGACCESS 1
EOF

	
    else
	echo "$ac_t""no" 1>&6
    fi
    


    echo $ac_n "checking for --enable-fasterreg""... $ac_c" 1>&6
echo "configure:7879: checking for --enable-fasterreg" >&5
    # Check whether --enable-fasterreg or --disable-fasterreg was given.
if test "${enable_fasterreg+set}" = set; then
  enableval="$enable_fasterreg"
  :
fi

    : ${oz_enable_fasterreg=yes}
    if test -n "${enable_fasterreg}"; then
	oz_enable_fasterreg=$enable_fasterreg
    fi
    if test "${oz_enable_fasterreg}" != no; then
	echo "$ac_t""yes (-DFASTERREGACCESS)" 1>&6
	cat >> confdefs.h <<\EOF
#define FASTERREGACCESS 1
EOF

	
    else
	echo "$ac_t""no" 1>&6
    fi
    


    echo $ac_n "checking for --enable-fastarith""... $ac_c" 1>&6
echo "configure:7904: checking for --enable-fastarith" >&5
    # Check whether --enable-fastarith or --disable-fastarith was given.
if test "${enable_fastarith+set}" = set; then
  enableval="$enable_fastarith"
  :
fi

    : ${oz_enable_fastarith=no}
    if test -n "${enable_fastarith}"; then
	oz_enable_fastarith=$enable_fastarith
    fi
    if test "${oz_enable_fastarith}" != no; then
	echo "$ac_t""yes (-DFASTARITH)" 1>&6
	cat >> confdefs.h <<\EOF
#define FASTARITH 1
EOF

	
    else
	echo "$ac_t""no" 1>&6
    fi
    


    echo $ac_n "checking for --enable-modules-static""... $ac_c" 1>&6
echo "configure:7929: checking for --enable-modules-static" >&5
    # Check whether --enable-modules-static or --disable-modules-static was given.
if test "${enable_modules_static+set}" = set; then
  enableval="$enable_modules_static"
  :
fi

    : ${oz_enable_modules_static=$oz_enable_modules_static}
    if test -n "${enable_modules_static}"; then
	oz_enable_modules_static=$enable_modules_static
    fi
    if test "${oz_enable_modules_static}" != no; then
	oz_enable_modules_static=yes
        echo "$ac_t""yes (-DMODULES_LINK_STATIC)" 1>&6
	cat >> confdefs.h <<\EOF
#define MODULES_LINK_STATIC 1
EOF

	STATIC_MODULES="\$(MODULE_NAMES)"
	DYNAMIC_MODULES=""
	
    else
	oz_enable_modules_static=no
        echo "$ac_t""no (-UMODULES_LINK_STATIC)" 1>&6
	STATIC_MODULES=""
	DYNAMIC_MODULES="\$(MODULE_NAMES)"
	
    fi
    



case ${platform} in
*-darwin)
    ## seems needed on Darwin (MacOS X)
    ## emits pic code suitable for fynamic linking and avoiding
    ## any limit on the size of the global offset table
    ## (according to info from Marc-Antoine Parent maparent@acm.org)
    PICOPTIONS="-fPIC -fpic -Kpic"
    PICOPTIONSCC="-fPIC -fpic -Kpic"
    PICOPTIONSEXTRA="-fno-common"
    ;;
*)  PICOPTIONS="-fpic -Kpic"
    PICOPTIONSCC="-fpic -Kpic"
    ;;
esac

	ozm_out=
	if test -n "$PICOPTIONS"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="$PICOPTIONS"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:7984: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
                if test -n "$ozm_out"; then
                  break;
                fi
	    done
	    rm -f oz_conftest*
	fi
	OZTOOLDYNOPT="$ozm_out"
	

	ozm_out=
	if test -n "$PICOPTIONSEXTRA"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="$PICOPTIONSEXTRA"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking c++ compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:8019: checking c++ compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CXX} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gxxopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gxxopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gxxopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	ozm_tmp="$ozm_out"
	
if test -n "$ozm_tmp"; then
  OZTOOLDYNOPT="$OZTOOLDYNOPT $ozm_tmp"
fi
if test "$oz_enable_modules_static" != "yes" ; then 
    CDYNOPT=$OZTOOLDYNOPT
fi




if test -z "$with_ccmalloc" 
then
    echo $ac_n "checking for --with-malloc""... $ac_c" 1>&6
echo "configure:8055: checking for --with-malloc" >&5
    # Check whether --with-malloc or --without-malloc was given.
if test "${with_malloc+set}" = set; then
  withval="$with_malloc"
  :
fi


    if test -n "$with_malloc"
    then
	oz_malloc_obj=$with_malloc
    fi
    
    if test -n "$oz_malloc_obj" && test -r $oz_malloc_obj
    then
	LIBS="$LIBS $oz_malloc_obj"
	echo "$ac_t""yes (\"$oz_malloc_obj\")" 1>&6
    else
	echo "$ac_t""no" 1>&6
    fi
fi


echo $ac_n "checking whether socklen_t is declared...""... $ac_c" 1>&6
echo "configure:8079: checking whether socklen_t is declared..." >&5

if eval "test \"`echo '$''{'oz_cv_have_socklen_t'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  
cat > conftest.$ac_ext <<EOF
#line 8086 "configure"
#include "confdefs.h"
#include <sys/socket.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "typedef.*socklen_t.*;" >/dev/null 2>&1; then
  rm -rf conftest*
  oz_cv_have_socklen_t=yes
else
  rm -rf conftest*
  cat > conftest.$ac_ext <<EOF
#line 8097 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  egrep "typedef.*socklen_t.*;" >/dev/null 2>&1; then
  rm -rf conftest*
  oz_cv_have_socklen_t=yes
else
  rm -rf conftest*
  oz_cv_have_socklen_t=no
fi
rm -f conftest*

fi
rm -f conftest*

fi

if test $oz_cv_have_socklen_t = yes; then
    echo "$ac_t""yes (-DHAVE_SOCKLEN_T)" 1>&6
    cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
EOF

else
    echo "$ac_t""no" 1>&6
fi

echo "checking whether we can do virtual sites..." 1>&6
echo "configure:8127: checking whether we can do virtual sites..." >&5
if eval "test \"`echo '$''{'ac_cv_can_vs'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  can_vs=yes
 ac_safe=`echo "sys/types.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/types.h""... $ac_c" 1>&6
echo "configure:8134: checking for sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8139 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
can_vs=no
fi

 ac_safe=`echo "unistd.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for unistd.h""... $ac_c" 1>&6
echo "configure:8168: checking for unistd.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8173 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
can_vs=no
fi

 ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
echo "configure:8202: checking for sys/ipc.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8207 "configure"
#include "confdefs.h"
#include <sys/ipc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8212: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
can_vs=no
fi

 ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
echo "configure:8236: checking for sys/shm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8241 "configure"
#include "confdefs.h"
#include <sys/shm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:8246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=yes"
else
  echo "$ac_err" >&5
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  echo "$ac_t""yes" 1>&6
  :
else
  echo "$ac_t""no" 1>&6
can_vs=no
fi

 for ac_func in shmget
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:8271: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8276 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:8302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
can_vs=no
fi
done

 for ac_func in shmat
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:8330: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8335 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:8361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
can_vs=no
fi
done

 for ac_func in shmdt
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:8389: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8394 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:8420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
can_vs=no
fi
done

 for ac_func in shmctl
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:8448: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8453 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $ac_func(); below.  */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error.  */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char $ac_func();

int main() {

/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif

; return 0; }
EOF
if { (eval echo configure:8479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi

if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  echo "$ac_t""yes" 1>&6
    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
 
else
  echo "$ac_t""no" 1>&6
can_vs=no
fi
done

 if test $can_vs = yes; then
    echo $ac_n "checking shared memory with a test program""... $ac_c" 1>&6
echo "configure:8506: checking shared memory with a test program" >&5
    if test "$cross_compiling" = yes; then
  echo "$ac_t""dunno (no)" 1>&6
    can_vs=no
else
  cat > conftest.$ac_ext <<EOF
#line 8512 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif

#include <sys/types.h>
#include <unistd.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <errno.h>

#define VS_KEYTYPE_SIZE		4
#define VS_SEQ_SIZE		12
#define VS_PID_MASK		0xffff
#define SEQ_NUM			0x5
#define VS_MSGBUFFER_KEY	0x1
#define SHMSIZE			(1024*1024)
#define	PERMS			0666
#define SHM_OPT			0

typedef unsigned int Value;

#if defined(sparc)

#define ASM_SWAP(cell, value)					\
({ 								\
  Value out;							\
  __asm__ __volatile__ ("swap %3,%0"				\
		 : "=r" (out),   "=m" (cell) 	/* output */	\
		 : "0"  (value), "m"  (cell));	/* input  */	\
  out;								\
})
;

#elif defined(i386)

#define ASM_SWAP(cell, value)					\
({ 								\
  Value out;							\
  __asm__ __volatile__ ("xchgl %3,%0"				\
			 :"=r" (out), "=m" (cell)		\
			 :"0" (value), "m" (cell));		\
  out;								\
})
;

#else

DO NOT COMPILE THE CRAP!
  
#endif
 
key_t vsTypeToKey(int type)
{
  int idOffset = sizeof(key_t)*8 - VS_KEYTYPE_SIZE;
  int seqOffset = idOffset - VS_SEQ_SIZE;
  return ((key_t) ((type << idOffset) |
		    (SEQ_NUM << seqOffset) |
		    (getpid() & VS_PID_MASK)));
}

int volatile global;

main()
{
  int shmkey;
  int shmid;
  void *shm;
  struct shmid_ds ds;

  shmkey = vsTypeToKey(VS_MSGBUFFER_KEY);
  if ((shmid = shmget(shmkey, SHMSIZE, (PERMS|IPC_CREAT))) < 0)
    exit(-1);
  if ((shm = (void *) shmat(shmid, 0, SHM_OPT)) == (void *) -1)
    exit(-2);
  for (char *addr = (char *) shm; addr < ((char *) shm) + SHMSIZE; addr++)
    *addr = (char) 0;
  if (shmdt((char *) shm) < 0)
    exit(-3);

  if ((shm = (void *) shmat(shmid, 0, SHM_OPT)) == (void *) -1)
    exit(-4);
  for (char *addr = (char *) shm; addr < ((char *) shm) + SHMSIZE; addr++)
    if (*addr != (char) 0) 
      exit(-5);
  if (shmdt((char *) shm) < 0)
    exit(-6);

  if ((shm = (void *) shmat(shmid, 0, SHM_OPT)) == (void *) -1)
    exit(-7);
  for (char *addr = (char *) shm; addr < ((char *) shm) + SHMSIZE; addr++)
    *addr = (char) 0x4f;
  if (shmdt((char *) shm) < 0)
    exit(-8);

  if ((shm = (void *) shmat(shmid, 0, SHM_OPT)) == (void *) -1)
    exit(-9);
  for (char *addr = (char *) shm; addr < ((char *) shm) + SHMSIZE; addr++)
    if (*addr != (char) 0x4f) 
      exit(-10);
  if (shmdt((char *) shm) < 0)
    exit(-11);

  if (shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0) < 0)
    exit(-12);
  if (shmctl(shmid, IPC_RMID, (struct shmid_ds *) 0) == 0)
    exit(-13);
  if (errno != EIDRM && errno != EINVAL)
    exit(-14);

  int local = 0;
  global = 1;
  local = ASM_SWAP(global, local);

  if (global != 0 || local != 1) exit(-15);

  exit(0);
}

EOF
if { (eval echo configure:8633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""succeeded" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""failed" 1>&6
    can_vs=no
fi
rm -fr conftest*
fi

 fi
 ac_cv_can_vs=$can_vs
fi


if test $ac_cv_can_vs = yes; then
    echo "$ac_t""... yes, we can do virtual sites!" 1>&6
else
    echo "$ac_t""... sorry, we cannot do virtual sites." 1>&6
fi


    echo $ac_n "checking for --enable-virtualsites""... $ac_c" 1>&6
echo "configure:8659: checking for --enable-virtualsites" >&5
    # Check whether --enable-virtualsites or --disable-virtualsites was given.
if test "${enable_virtualsites+set}" = set; then
  enableval="$enable_virtualsites"
  :
fi

    : ${oz_enable_virtualsites=no}
    if test -n "${enable_virtualsites}"; then
	oz_enable_virtualsites=$enable_virtualsites
    fi
    if test "${oz_enable_virtualsites}" != no; then
	cat >> confdefs.h <<\EOF
#define VIRTUALSITES 1
EOF

        echo "$ac_t""yes" 1>&6
	
    else
	echo "$ac_t""no" 1>&6
    fi
    



    echo $ac_n "checking for --enable-miscbuiltins""... $ac_c" 1>&6
echo "configure:8685: checking for --enable-miscbuiltins" >&5
    # Check whether --enable-miscbuiltins or --disable-miscbuiltins was given.
if test "${enable_miscbuiltins+set}" = set; then
  enableval="$enable_miscbuiltins"
  :
fi

    : ${oz_enable_miscbuiltins=no}
    if test -n "${enable_miscbuiltins}"; then
	oz_enable_miscbuiltins=$enable_miscbuiltins
    fi
    if test "${oz_enable_miscbuiltins}" != no; then
	cat >> confdefs.h <<\EOF
#define MISC_BUILTINS 1
EOF

        echo "$ac_t""yes" 1>&6
	
    else
	echo "$ac_t""no" 1>&6
    fi
    


echo $ac_n "checking whether .align is multiple""... $ac_c" 1>&6
echo "configure:8710: checking whether .align is multiple" >&5
if test "$cross_compiling" = yes; then
  echo "$ac_t""no" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8715 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif

#ifdef __GNUC__

#include <stdio.h>

static int nonsense(int);
int main(void) {
  int j;

  goto leave;
  
 start:
  asm volatile(".align 16");
 la1:
  asm volatile(".long 1");
  asm volatile(".align 16");
 la2:
  j=nonsense(42);
  goto leave;
  
  asm volatile(".align 16");
 lb1:
  asm volatile(".long 2");
  asm volatile(".align 16");
 lb2:
  j=nonsense(4711);
  goto leave;

 leave:
  static void * fake[] = {
    && start, && la1, && la2,
    && lb1, && lb2, && leave};

  if (((((char *) && lb2) - ((char *) && lb1)) == 16) &&
      ((((char *) && la2) - ((char *) && la1)) == 16) &&
      (*((int *) && la1)==1) &&
      (*((int *) && lb1)==2)) {
    return 0;
  } 
  return -1;
    
}
static int nonsense(int i) {
  return i*i;
}

#else

BOOOOOOOM

#endif

EOF
if { (eval echo configure:8773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define AS_HAS_MULTIPLE_ALIGN 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6
fi
rm -fr conftest*
fi



echo $ac_n "checking whether .align is power of 2""... $ac_c" 1>&6
echo "configure:8792: checking whether .align is power of 2" >&5
if test "$cross_compiling" = yes; then
  echo "$ac_t""no" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8797 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif

#ifdef __GNUC__

#include <stdio.h>

static int nonsense(int);
int main(void) {
  int j;

  goto leave;
  
 start:
  asm volatile(".align 4");
 la1:
  asm volatile(".long 1");
  asm volatile(".align 4");
 la2:
  j=nonsense(42);
  goto leave;
  
  asm volatile(".align 4");
 lb1:
  asm volatile(".long 2");
  asm volatile(".align 4");
 lb2:
  j=nonsense(4711);
  goto leave;

 leave:
  static void * fake[] = {
    && start, && la1, && la2,
    && lb1, && lb2, && leave};

  if (((((char *) && lb2) - ((char *) && lb1)) == 16) &&
      ((((char *) && la2) - ((char *) && la1)) == 16) &&
      (*((int *) && la1)==1) &&
      (*((int *) && lb1)==2)) {
    return 0;
  } 
  return -1;
    
}
static int nonsense(int i) {
  return i*i;
}

#else

BOOOOOOOM

#endif

EOF
if { (eval echo configure:8855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
  cat >> confdefs.h <<\EOF
#define AS_HAS_POWER_ALIGN 1
EOF

else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6
fi
rm -fr conftest*
fi



echo $ac_n "checking alignment of secondary tag for const terms""... $ac_c" 1>&6
echo "configure:8874: checking alignment of secondary tag for const terms" >&5
if test "$cross_compiling" = yes; then
  echo "$ac_t""assume optimistic ok for cross compilation" 1>&6
else
  cat > conftest.$ac_ext <<EOF
#line 8879 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif

class Tag {
public:
  unsigned int tag;
};
class Const : public Tag {
private:
  void*ptr;
};
int main()
{
  Const c;
  return (((void*)&c)==((void*)(Tag*)&c))?0:-1;
}
EOF
if { (eval echo configure:8899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""ok" 1>&6
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  { echo "configure: error: Aargh... alignment conditions for secondary tags
are not satisfied on your platform/compiler combination" 1>&2; exit 1; }
fi
rm -fr conftest*
fi


echo $ac_n "checking if alignment of secondary tags for extensions needs padding""... $ac_c" 1>&6
echo "configure:8914: checking if alignment of secondary tags for extensions needs padding" >&5
if test "$cross_compiling" = yes; then
  echo "$ac_t""assume optimistic no for cross compilation" 1>&6
  needs_padding=no
else
  cat > conftest.$ac_ext <<EOF
#line 8920 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif

class Tag {
public:
  unsigned int tag;
};
class Ext : public Tag {
public:
  void* ptr;
  virtual void foo() {}
};
class User : public Ext {
public:
  void* uptr;
public:
  virtual void baz(){}
};
int main()
{
  User u;
  return (((((char*)(void*)(Tag*)&u) - ((char*)(void*)&u)) % 8) == 0)?0:-1;
}
EOF
if { (eval echo configure:8947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""no" 1>&6
  needs_padding=no
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""yes" 1>&6
  needs_padding=yes
fi
rm -fr conftest*
fi


NEEDS_PADDING=0

if test "$needs_padding" = "yes"; then
echo $ac_n "checking if padding works""... $ac_c" 1>&6
echo "configure:8966: checking if padding works" >&5
if test "$cross_compiling" = yes; then
  { echo "configure: error: we should not get here when cross compiling" 1>&2; exit 1; }
else
  cat > conftest.$ac_ext <<EOF
#line 8971 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int) throw();
#endif

class Tag {
public:
  unsigned int tag;
};
class Pad {
private:
  unsigned int _pad;
};
class Ext : public Pad, public Tag {
public:
  void* ptr;
  virtual void foo() {}
};
class User : public Ext {
public:
  void* uptr;
public:
  virtual void baz(){}
};
int main()
{
  User u;
  return (((((char*)(void*)(Tag*)&u) - ((char*)(void*)&u)) % 8) == 0)?0:-1;
}
EOF
if { (eval echo configure:9002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  echo "$ac_t""yes" 1>&6
  NEEDS_PADDING=1
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  echo "$ac_t""no" 1>&6
fi
rm -fr conftest*
fi

fi


OZTOOL_CXX="$CXX${CXXAVOID:+ }$CXXAVOID"


ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross


	ozm_out=
	if test -n "$PICOPTIONSCC"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="$PICOPTIONSCC"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking cc compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:9037: checking cc compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gccopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CC} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gccopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gccopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gccopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
                if test -n "$ozm_out"; then
                  break;
                fi
	    done
	    rm -f oz_conftest*
	fi
	OZTOOLDYNOPTCC="$ozm_out"
	

	ozm_out=
	if test -n "$PICOPTIONSEXTRA"
	then
	    echo 'void f(){}' > oz_conftest.c
	    oz_for="$PICOPTIONSEXTRA"
	    for ozm_opt in $oz_for
	    do
		echo $ac_n "checking cc compiler option $ozm_opt""... $ac_c" 1>&6
echo "configure:9072: checking cc compiler option $ozm_opt" >&5
		ozm_ropt=`echo $ozm_opt | sed -e 's/[^a-zA-Z0-9_]/_/g'`
		if eval "test \"`echo '$''{'oz_cv_gccopt_$ozm_ropt'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test -z "`${CC} ${ozm_out} ${ozm_opt} -c oz_conftest.c 2>&1`"; then
			eval "oz_cv_gccopt_$ozm_ropt=yes"
		    else
			eval "oz_cv_gccopt_$ozm_ropt=no"
		    fi
fi

		if eval "test \"`echo '$''{'oz_cv_gccopt_$ozm_ropt'}'`\" = yes"; then
		    ozm_out="$ozm_out $ozm_opt"
		    echo "$ac_t""yes" 1>&6
		else
		    echo "$ac_t""no" 1>&6
		fi
	    done
	    rm -f oz_conftest*
	fi
	ozm_tmp="$ozm_out"
	
if test -n "$ozm_tmp"; then
  OZTOOLDYNOPTCC="$OZTOOLDYNOPTCC $ozm_tmp"
fi
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross






trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs.  It is not useful on other systems.
# If it contains results you don't want to keep, you may remove or edit it.
#
# By default, configure uses ./config.cache as the cache file,
# creating it if it does not exist already.  You can give configure
# the --cache-file=FILE option to use a different cache file; that is
# what configure does when it calls configure scripts in
# subdirectories, so they share the cache.
# Giving --cache-file=/dev/null disables caching, for debugging configure.
# config.status only pays attention to the cache file if you give it the
# --recheck option to rerun configure.
#
EOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  *ac_space=\ *)
    # `set' does not quote correctly, so add quotes (double-quote substitution
    # turns \\\\ into \\, and sed turns \\ into \).
    sed -n \
      -e "s/'/'\\\\''/g" \
      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
    ;;
  *)
    # `set' quotes correctly as required by POSIX, so do not add quotes.
    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
    ;;
  esac >> confcache
if cmp -s $cache_file confcache; then
  :
else
  if test -w $cache_file; then
    echo "updating cache $cache_file"
    cat confcache > $cache_file
  else
    echo "not updating unwritable cache $cache_file"
  fi
fi
rm -f confcache

trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15

test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'

# Any assignment to VPATH causes Sun make to only execute
# the first set of double-colon rules, so remove it if not needed.
# If there is a colon in the path, we need to keep it.
if test "x$srcdir" = x.; then
  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
fi

trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15

DEFS=-DHAVE_CONFIG_H

# Without the "./", some shells look in PATH for config.status.
: ${CONFIG_STATUS=./config.status}

echo creating $CONFIG_STATUS
rm -f $CONFIG_STATUS
cat > $CONFIG_STATUS <<EOF
#! /bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $ac_configure_args
#
# Compiler output produced by configure, useful for debugging
# configure, is in ./config.log if it exists.

ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
for ac_option
do
  case "\$ac_option" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    echo "$CONFIG_STATUS generated by autoconf version 2.13"
    exit 0 ;;
  -help | --help | --hel | --he | --h)
    echo "\$ac_cs_usage"; exit 0 ;;
  *) echo "\$ac_cs_usage"; exit 1 ;;
  esac
done

ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"

trap 'rm -fr `echo "Makefile.vars Makefile Makefile.rules libdp/Makefile libfd/Makefile libfset/Makefile OZCONF.h:OZCONF.in oztool.sh:oztool.in extension.hh:extension.in $target-oztool:i386-mingw32-oztool.in .gdbinit conf-others.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF

# Protect against being on the right side of a sed subst in config.status.
sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
s%@exec_prefix@%$exec_prefix%g
s%@prefix@%$prefix%g
s%@program_transform_name@%$program_transform_name%g
s%@bindir@%$bindir%g
s%@sbindir@%$sbindir%g
s%@libexecdir@%$libexecdir%g
s%@datadir@%$datadir%g
s%@sysconfdir@%$sysconfdir%g
s%@sharedstatedir@%$sharedstatedir%g
s%@localstatedir@%$localstatedir%g
s%@libdir@%$libdir%g
s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@SRCDIR@%$SRCDIR%g
s%@SRCTOP@%$SRCTOP%g
s%@BUILDTOP@%$BUILDTOP%g
s%@host@%$host%g
s%@host_alias@%$host_alias%g
s%@host_cpu@%$host_cpu%g
s%@host_vendor@%$host_vendor%g
s%@host_os@%$host_os%g
s%@MAKE@%$MAKE%g
s%@SET_MAKE@%$SET_MAKE%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@INSTALL_DIR@%$INSTALL_DIR%g
s%@OZVERSION@%$OZVERSION%g
s%@HOMEURL@%$HOMEURL%g
s%@HOMECACHE@%$HOMECACHE%g
s%@OZPLATFORM@%$OZPLATFORM%g
s%@OZTOOL@%$OZTOOL%g
s%@OZBUILDDATE@%$OZBUILDDATE%g
s%@PLATFORM@%$PLATFORM%g
s%@OZLOADSEP@%$OZLOADSEP%g
s%@OZLOADWIN@%$OZLOADWIN%g
s%@DENYS_EVENTS@%$DENYS_EVENTS%g
s%@SITE_PROPERTY@%$SITE_PROPERTY%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
s%@build_vendor@%$build_vendor%g
s%@build_os@%$build_os%g
s%@AS@%$AS%g
s%@DLLTOOL@%$DLLTOOL%g
s%@DLLWRAP@%$DLLWRAP%g
s%@target@%$target%g
s%@CXX@%$CXX%g
s%@CXXCPP@%$CXXCPP%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@LEX@%$LEX%g
s%@LEXLIB@%$LEXLIB%g
s%@FLEX@%$FLEX%g
s%@YACC@%$YACC%g
s%@BISON@%$BISON%g
s%@LN_S@%$LN_S%g
s%@RANLIB@%$RANLIB%g
s%@M4@%$M4%g
s%@PERL@%$PERL%g
s%@SED@%$SED%g
s%@AR@%$AR%g
s%@DEPEND@%$DEPEND%g
s%@OZTOOL_SH@%$OZTOOL_SH%g
s%@platform@%$platform%g
s%@EMULATOR_EXE@%$EMULATOR_EXE%g
s%@LD@%$LD%g
s%@TOOLLDCMD@%$TOOLLDCMD%g
s%@oz_warn@%$oz_warn%g
s%@oz_warn_error@%$oz_warn_error%g
s%@M4_S@%$M4_S%g
s%@COPT@%$COPT%g
s%@EMULDFLAGS@%$EMULDFLAGS%g
s%@STATIC_MODULES@%$STATIC_MODULES%g
s%@DYNAMIC_MODULES@%$DYNAMIC_MODULES%g
s%@CDYNOPT@%$CDYNOPT%g
s%@OZTOOLDYNOPT@%$OZTOOLDYNOPT%g
s%@NEEDS_PADDING@%$NEEDS_PADDING%g
s%@OZTOOL_CXX@%$OZTOOL_CXX%g
s%@OZTOOLDYNOPTCC@%$OZTOOLDYNOPTCC%g

CEOF
EOF

cat >> $CONFIG_STATUS <<\EOF

# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
ac_more_lines=:
ac_sed_cmds=""
while $ac_more_lines; do
  if test $ac_beg -gt 1; then
    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
  else
    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  fi
  if test ! -s conftest.s$ac_file; then
    ac_more_lines=false
    rm -f conftest.s$ac_file
  else
    if test -z "$ac_sed_cmds"; then
      ac_sed_cmds="sed -f conftest.s$ac_file"
    else
      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
    fi
    ac_file=`expr $ac_file + 1`
    ac_beg=$ac_end
    ac_end=`expr $ac_end + $ac_max_sed_cmds`
  fi
done
if test -z "$ac_sed_cmds"; then
  ac_sed_cmds=cat
fi
EOF

cat >> $CONFIG_STATUS <<EOF

CONFIG_FILES=\${CONFIG_FILES-"Makefile.vars Makefile Makefile.rules libdp/Makefile libfd/Makefile libfset/Makefile OZCONF.h:OZCONF.in oztool.sh:oztool.in extension.hh:extension.in $target-oztool:i386-mingw32-oztool.in .gdbinit"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.

  # Remove last slash and all that follows it.  Not all systems have dirname.
  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
    # The file is in a subdirectory.
    test ! -d "$ac_dir" && mkdir "$ac_dir"
    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
    # A "../" for each directory in $ac_dir_suffix.
    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  else
    ac_dir_suffix= ac_dots=
  fi

  case "$ac_given_srcdir" in
  .)  srcdir=.
      if test -z "$ac_dots"; then top_srcdir=.
      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  *) # Relative path.
    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
    top_srcdir="$ac_dots$ac_given_srcdir" ;;
  esac

  case "$ac_given_INSTALL" in
  [/$]*) INSTALL="$ac_given_INSTALL" ;;
  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  esac

  echo creating "$ac_file"
  rm -f "$ac_file"
  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  case "$ac_file" in
  *Makefile*) ac_comsub="1i\\
# $configure_input" ;;
  *) ac_comsub= ;;
  esac

  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  sed -e "$ac_comsub
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
s%@INSTALL@%$INSTALL%g
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done
rm -f conftest.s*

# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
ac_dC='\3'
ac_dD='%g'
# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_uB='\([ 	]\)%\1#\2define\3'
ac_uC=' '
ac_uD='\4%g'
# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
ac_eB='$%\1#\2define\3'
ac_eC=' '
ac_eD='%g'

if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
  CONFIG_HEADERS="conf-others.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  case "$ac_file" in
  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  *) ac_file_in="${ac_file}.in" ;;
  esac

  echo creating $ac_file

  rm -f conftest.frag conftest.in conftest.out
  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  cat $ac_file_inputs > conftest.in

EOF

# Transform confdefs.h into a sed script conftest.vals that substitutes
# the proper values into config.h.in to produce config.h.  And first:
# Protect against being on the right side of a sed subst in config.status.
# Protect against being in an unquoted here document in config.status.
rm -f conftest.vals
cat > conftest.hdr <<\EOF
s/[\\&%]/\\&/g
s%[\\$`]%\\&%g
s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
s%ac_d%ac_u%gp
s%ac_u%ac_e%gp
EOF
sed -n -f conftest.hdr confdefs.h > conftest.vals
rm -f conftest.hdr

# This sed command replaces #undef with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >> conftest.vals <<\EOF
s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
EOF

# Break up conftest.vals because some shells have a limit on
# the size of here documents, and old seds have small limits too.

rm -f conftest.tail
while :
do
  ac_lines=`grep -c . conftest.vals`
  # grep -c gives empty output for an empty file on some AIX systems.
  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  # Write a limited-size here document to conftest.frag.
  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  echo 'CEOF
  sed -f conftest.frag conftest.in > conftest.out
  rm -f conftest.in
  mv conftest.out conftest.in
' >> $CONFIG_STATUS
  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  rm -f conftest.vals
  mv conftest.tail conftest.vals
done
rm -f conftest.vals

cat >> $CONFIG_STATUS <<\EOF
  rm -f conftest.frag conftest.h
  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  cat conftest.in >> conftest.h
  rm -f conftest.in
  if cmp -s $ac_file conftest.h 2>/dev/null; then
    echo "$ac_file is unchanged"
    rm -f conftest.h
  else
    # Remove last slash and all that follows it.  Not all systems have dirname.
      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
      # The file is in a subdirectory.
      test ! -d "$ac_dir" && mkdir "$ac_dir"
    fi
    rm -f $ac_file
    mv conftest.h $ac_file
  fi
fi; done

EOF
cat >> $CONFIG_STATUS <<EOF

EOF
cat >> $CONFIG_STATUS <<\EOF

exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1



