#!/bin/sh
#*=====================================================================*/
#*    serrano/prgm/project/bigloo/configure                            */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Tue Jan 25 16:05:10 1994                          */
#*    Last change :  Mon Oct 18 10:44:25 2004 (serrano)                */
#*    Copyright   :  1994-2004 Manuel Serrano, see LICENSE file        */
#*    -------------------------------------------------------------    */
#*    The Bigloo configuration file                                    */
#*    -------------------------------------------------------------    */
#*    Please, dont talk to me about autoconf. I simply dont want       */
#*    to hear about it...                                              */
#*=====================================================================*/

#*---------------------------------------------------------------------*/
#*    Bigloo revision number                                           */
#*---------------------------------------------------------------------*/
release=2.6e

#*---------------------------------------------------------------------*/
#*    User variables                                                   */
#*---------------------------------------------------------------------*/
#*--- paths -----------------------------------------------------------*/
prefix=/usr/local
bindir=$prefix/bin
libdir=$prefix/lib
fildir=$libdir/bigloo/$release
zipdir=$fildir
dlldir=$fildir
mandir=$prefix/man/man1
infodir=$prefix/info
docdir=$prefix/doc/bigloo-$release
tmpdir=/tmp
lispdir=
bee=partial

tmp=$TMPDIR

if [ "$tmp " = " " ]; then
  tmp=/tmp
fi

#*--- C back-end user configure ---------------------------------------*/
nativebackend=yes # set to "no" not to install the native (C) back-end
ccstyle=gcc
cc=$CC  # left blank for default automatic configuration
cflags=$CFLAGS
coflags="-O3"
cstrip="-s"
cpicflags="demanded" # Possible values for cpicflags are:
             #  - "no" not to use position independent code (recommended)
             #  - "demanded" auto configuration but with a preference to "no"
             #  - any legal C compiler option that enable PIC code.
             #  - blank (uninitalized) for automatic configuration of the
             #    position independent code compiler option
as=as
ar=ar
arflags=qc
ldstyle=gcc
ld=ld
strip=strip
longlong=    # The C type to represent long long integers
stringsplit="0"

#*--- Java back-end user configuration --------------------------------*/
jvmbackend=yes # set to "no" not to install the Jvm back-end
zip=zip
jar="jar cmf"
zflags=
javac=javac
jcflags=-O
java=java
jflags=
jvflags=-noverify
jshell=sh

#*--- .NET back-end user configuration --------------------------------*/
dotnetbackend=no  # set to "no" not to install the .NET back-end
dotnetclrstyle=pnet
dotnetcsccstyle=pnet
dotnetldstyle=pnet
dotnetcscc=cscc
dotnetld=cscc
dotnetclr=ilrun
dotnetclropt="-S 4096 -C 256"
dotnetshell=sh
dotnetasm=ilasm

#*--- Misc user configuration -----------------------------------------*/
shell=/bin/sh
emacs=
makeinfo=makeinfo
makeinfoopt="-U oldinfo"
texi2dvi=texi2dvi
texi2dviopt=-b
texi2html=texi2html
texi2htmlopt="-menu -monolithic -number"
texi2pdf=texi2pdf
iinfo=install-info
dlopenopt=-ldl
dirname=dirname
defaultbackend="native"
aout=""
abat=""
exe=""
cobj=o

#*--- socket library (left empty for automatic configuration) ---------*/
socketlibs=

#*--- posix threads library (left blank for autoconfiguration) --------*/
pthreadlibs=

#*--- gc source directory (left blank for default configuration) ------*/
customgc=yes
# the following two variables are relevant only when using 
# standard (i.e. already existing and operational) Boehm's GC
# and when customgc=no
stdgclib=gc
stdgcdir=/usr/include/gc

#*--- indent ----------------------------------------------------------*/
indent="/usr/local/bin/indent -npro -bap -bad -nbc -bl -ncdb -nce -nfc1 -ip0 -nlp -npcs -nsc -nsob -cli0.5 -di0 -l80 -d1 -c0 -ts2 -st"

#*--- mask of Bigloo intalled files -----------------------------------*/
bmask=755

#*--- ld shared library option ----------------------------------------*/
# set this variable to `no-share' if you don't want shared library
ldopt=
ldsoname=-soname
sharedsuffix=so
ldpreload=

#*--- should the compiler be dynamically linked?  ---------------------*/
# the legal value for that variable is `yes' or `no'
sharedcompiler=no
sharedbde=no

#*--- cygwin specific configuration -----------------------------------*/
# The location where cygwin is installed
cygwindospath=""
cygwindosjvm="yes"
cygwindosdotnet="yes"

#*--- migw specific configuration -------------------------------------*/
mingw="no"

#*---------------------------------------------------------------------*/
#*    Hacker variables                                                 */
#*    -------------------------------------------------------------    */
#*    Dont modifiy these variables unless you know what you are        */
#*    doing.                                                           */
#*---------------------------------------------------------------------*/
#*--- The basename of the compiler ------------------------------------*/
bigloo=bigloo

#*--- libraries -------------------------------------------------------*/
libraryname=$bigloo

#--- additional user library used to link bigloo applications ---------*/
extralibs="-lm"

#*--- custom GC configuration -----------------------------------------*/
gcdir=
customgclib=bigloogc

#*---------------------------------------------------------------------*/
#*                 !!! DONT EDIT AFTER THIS LINE !!!                   */
#*---------------------------------------------------------------------*/
action=all
mode=plain
makefile_cfg=Makefile.config
autoconfdir=`dirname $0 2> /dev/null`/autoconf
pwd=`pwd`
bootdir=$pwd
cgcflags=""
cgcfinalflags="-DFINALIZE_ON_DEMAND"
backptrflags="-DKEEP_BACK_PTRS"
bigloo_config_h=
bigloo_config_jvm=
bigloo_config_dotnet=
bigloo_config_el=
summary=yes
java_configured=no
dotnet_configured=no
os=posix
jvmcpath=""
jvmrcpath=""
gcspecial=
gcthread=
hardtune=
emacswarning=
stacksizerequired=2
configureinfo="no"

if [ $? != "0" ]; then
   autoconfdir="autoconf"
fi

# Argument parsing
while : ; do
  case $1 in
    "")
      break;;

    --bootconfig)
      bindir=$PWD/bin;
      libdir=$PWD/lib;
      fildir=$libdir/$release;
      zipdir=$fildir;
      dlldir=$fildir;
      bootdir=$PWD;
      mandir=$HOME/house/man
      lispdir=$HOME/emacs/site-lisp/bigloo;
      emacswarning="-eval '(setq byte-compile-error-on-warn t)'";
      docdir=$PWD/manuals;
      sharedcompiler=no;
      sharedbde=yes;
      infodir=$PWD/info;
      java=java;
      javac=javac;
      if [ "$GCCBGL " != " " ]; then
        cc=$GCCBGL;
      else
        cc=gcc-2.95;
      fi;
      ld=ld;
#      cflags="$cflags -Wpointer-arith -Wswitch -Wtrigraphs -fno-merge-constants";
#      cflags="$cflags -Wpointer-arith -Wswitch -Wtrigraphs";
      cflags="$cflags -Wswitch -Wtrigraphs";
      cpicflags="no";
      dotnetbackend="force";
      dotnetclr=ilrun;
      dotnetclropt="-S 4096 -C 256";
      dotnetcscc=cscc;
      dotnetld=cscc;
      dotnetasm=ilasm;
      mode=plain;
      configureinfo="yes";
      action="all";;

    --bigloo_config.h)
      action="bigloo_config";;
    
    --bigloo_config.h=*)
      action="bigloo_config";
      bigloo_config_h="`echo $1 | sed 's/^[^=]*=//'`";;

    --bigloo_config.jvm=*)
      action="bigloo_config";
      bigloo_config_jvm="`echo $1 | sed 's/^[^=]*=//'`";;

    --bigloo_config.dotnet=*)
      action="bigloo_config";
      bigloo_config_dotnet="`echo $1 | sed 's/^[^=]*=//'`";;

    --bigloo_config.el=*)
      action="bigloo_config_el";
      bigloo_config_el="`echo $1 | sed 's/^[^=]*=//'`";;

    --Makefile.config)
      action="Makefile.config";;

    --bindir=*)
      bindir="`echo $1 | sed 's/^[^=]*=//'`";;

    --libdir=*)
      libdir="`echo $1 | sed 's/^[^=]*=//'`";
      fildir=$libdir/bigloo/$release;
      zipdir=$fildir;
      dlldir=$fildir;;

    --fildir=*)
      fildir="`echo $1 | sed 's/^[^=]*=//'`";;

    --zipdir=*)
      zipdir="`echo $1 | sed 's/^[^=]*=//'`";;

    --dlldir=*)
      dlldir="`echo $1 | sed 's/^[^=]*=//'`";;

    --mandir=*)
      mandir="`echo $1 | sed 's/^[^=]*=//'`";;

    --infodir=*)
      infodir="`echo $1 | sed 's/^[^=]*=//'`";;

    --docdir=*)
      docdir="`echo $1 | sed 's/^[^=]*=//'`";;

    --tmpdir=*)
      tmpdir="`echo $1 | sed 's/^[^=]*=//'`";;

    --tmp=*)
      tmp="`echo $1 | sed 's/^[^=]*=//'`";;

    --emacs=*)
      emacs="`echo $1 | sed 's/^[^=]*=//'`";;

    --xemacs=*)
      emacs="`echo $1 | sed 's/^[^=]*=//'`";;

    --indent=*)
      indent="`echo $1 | sed 's/^[^=]*=//'`";;

    --dirname=*)
      dirname="`echo $1 | sed 's/^[^=]*=//'`";;

    --lispdir=*)
      lispdir="`echo $1 | sed 's/^[^=]*=//'`";;

    --prefix=*)
      prefix="`echo $1 | sed 's/^[^=]*=//'`";
      bindir=$prefix/bin;
      libdir=$prefix/lib;
      fildir=$libdir/bigloo/$release;
      zipdir=$fildir;
      dlldir=$fildir;
      mandir=$prefix/man/man1;
      infodir=$prefix/info;
      docdir=$prefix/doc/bigloo-$release;;

    --cc=*)
      cc="`echo $1 | sed 's/^[^=]*=//'`";;

    --as=*)
      as="`echo $1 | sed 's/^[^=]*=//'`";;

    --ld=*)
      ld="`echo $1 | sed 's/^[^=]*=//'`";;

    --cflags=*)
      cflags="`echo $1 | sed 's/^[^=]*=//'`";;

    --coflags=*)
      coflags="`echo $1 | sed 's/^[^=]*=//'`";;

    --stringsplit=*)
      stringsplit="`echo $1 | sed 's/^[^=]*=//'`";;

    --native=*)
      nativebackend="`echo $1 | sed 's/^[^=]*=//'`";;

    --sharedcompiler=*)
      sharedcompiler="`echo $1 | sed 's/^[^=]*=//'`";;

    --sharedbde=*)
      sharedbde="`echo $1 | sed 's/^[^=]*=//'`";;

    --bee=partial)
      bee="partial";;

    --bee=full)
      bee="full";;

    --a.out=*)
      aout="`echo $1 | sed 's/^[^=]*=//'`";;

    --a.bat=*)
      abat="`echo $1 | sed 's/^[^=]*=//'`";;

    --jvm=*)
      jvmbackend="`echo $1 | sed 's/^[^=]*=//'`";;

    --java=*)
      java="`echo $1 | sed 's/^[^=]*=//'`";;

    --javac=*)
      javac="`echo $1 | sed 's/^[^=]*=//'`";;

    --javaprefix=*)
      java="`echo $1 | sed 's/^[^=]*=//'`"/java;
      javac="`echo $1 | sed 's/^[^=]*=//'`"/javac;
      jar="`echo $1 | sed 's/^[^=]*=//'`/jar cmf";;

    --javashell=sh)
      jshell="sh";;

    --javashell=msdos)
      jshell="msdos";;

    --native-default-backend)
      defaultbackend="native";;

    --jvm-default-backend)
      defaultbackend="jvm";;

    --dotnet=*)
      dotnetbackend="`echo $1 | sed 's/^[^=]*=//'`";;

    --dotnetld=*)
      dotnetld="`echo $1 | sed 's/^[^=]*=//'`";;

    --dotnetldlibopt=*)
      dotnetldlibopt="`echo $1 | sed 's/^[^=]*=//'`";;

    --dotnetldlibdiropt=*)
      dotnetldlibdiropt="`echo $1 | sed 's/^[^=]*=//'`";;

    --dotnetclr=*)
      dotnetclr="`echo $1 | sed 's/^[^=]*=//'`";;

    --dotnetclropt=*)
      dotnetclropt="`echo $1 | sed 's/^[^=]*=//'`";;

    --dotnetshell=sh)
      jshell="sh";;

    --dotnetshell=msdos)
      jshell="msdos";;

    --dotnetasm=*)
      dotnetasm="`echo $1 | sed 's/^[^=]*=//'`";;

    --no-share)
      ldopt="no-share";;

    --no-ldpreload)
      ldpreload="no";;

    --os-win32)
      os="win32";;

    --cygwin-dos-path=*)
      cygwindospath="`echo $1 | sed 's/^[^=]*=//'`";;

    --cygwin-dos-jvm=yes)
      cygwindosjvm="yes";;

    --cygwin-dos-jvm=no)
      cygwindosjvm="no";;

    --cygwin-dos-dotnet=yes)
      cygwindosdotnet="yes";;

    --cygwin-dos-dotnet=no)
      cygwindosdotnet="no";;

    --arch=athlon)
      hardtune="athlon";
      gcspecial=-DUSE_3DNOW_PREFETCH;;

    --arch=athlon-tbird)
      hardtune="athlon-tbird";
      gcspecial=-DUSE_3DNOW_PREFETCH;;

    --arch=athlon-xp)
      hardtune="athlon-xp";
      gcspecial=-DUSE_3DNOW_PREFETCH;;

    --arch=athlon-mp)
      hardtune="athlon-mp";
      gcspecial=-DUSE_3DNOW_PREFETCH;;

    --arch=k6-2)
      hardtune="k6-2";
      gcspecial=-DUSE_3DNOW_PREFETCH;;

    --arch=k6-3)
      hardtune="k6-3";
      gcspecial=-DUSE_3DNOW_PREFETCH;;

    --arch=pentium3)
      hardtune="pentium3";
      gcspecial=-DUSE_I686_PREFETCH;;

    --arch=pentium4)
      hardtune="pentium4";
      gcspecial=-DUSE_I686_PREFETCH;;

    --arch=i586)
      hardtune="i586";;

    --arch=i686)
      hardtune="i686";;

    --no-summary)
      summary=no;;

    --icc)
      cc=icc;
      as=icc;
      ldopt="no-share";
      coflags="$coflags -O3 -ip";
      extralibs="";
      cstrip="no";;

    --pnet)
      dotnetclrstyle=pnet;
      dotnetcsccstyle=pnet;
      dotnetldstyle=pnet;
      dotnetclr=ilrun;
      dotnetclropt="-S 4096 -C 256";
      dotnetcscc=cscc;
      dotnetld=cscc;
      dotnetasm=ilasm;;

    --mono)
      dotnetclrstyle=mono;
      dotnetcsccstyle=mono;
      dotnetldstyle=mono;
      dotnetclr=mono;
      dotnetclropt="";
      dotnetcscc=cscc;
      dotnetld=cscc;
      dotnetasm=ilasm;;

    --dotnetldstyle=*)
      dotnetldstyle=="`echo $1 | sed 's/^[^=]*=//'`";;

    --dotnetcsccstyle=*)
      dotnetcsccstyle=="`echo $1 | sed 's/^[^=]*=//'`";;

    --dotnetclrstyle=*)
      dotnetclrstyle=="`echo $1 | sed 's/^[^=]*=//'`";;

    --customgc=yes)
      customgc=yes;;

    --customgc=no)
      customgc=no;;

    --finalization=yes)
      cgcfinalflags=;;

    --finalization=no)
      cgcfinalflags=-DFINALIZE_ON_DEMAND;;

    --stack-check=no)
      stacksizerequired=0;;

    --benchmark=no)
      mode=plain;;

    --benchmark=yes)
      mode=benchmark;;

    --cpicflags=*)
      cpicflags="`echo $1 | sed 's/^[^=]*=//'`";;

    --configureinfo=no)
      configureinfo="no";;

    --configureinfo=yes)
      configureinfo="yes";;

    --mingw=yes)
      mingw="yes";;

    -*)
      if [ "$1" != "-h" -a "$1" != "-help" -a "$1" != "--help" ]; then
        echo "*** ERROR: Illegal option \"$1\""
        echo ""
        echo ""
        echo "Usage: configure [options]" >&2;
        echo "" >&2;
      fi
      echo "Bigloo compiler:"  >&2;
      echo "   --native=yes|no [default yes]" >&2;
      echo "   --jvm=yes|no|force [default yes]" >&2;
      echo "   --dotnet=yes|no|force [default yes]" >&2;
      echo "   --customgc=yes|no [default yes]" >&2;
      echo "   --bee=partial|full [default partial]" >&2;
      echo "" >&2;
      echo "Path:"  >&2;
      echo "   --prefix=dir (sets bin, lib, zip, man, info and doc dirs)" >&2;
      echo "   --bindir=file" >&2;
      echo "   --libdir=file" >&2;
      echo "   --fildir=file" >&2;
      echo "   --zipdir=file" >&2;
      echo "   --dlldir=file" >&2;
      echo "   --mandir=file" >&2;
      echo "   --infodir=file" >&2;
      echo "   --docdir=file" >&2;
      echo "   --tmpdir=file (Bigloo tmp dir)" >&2;
      echo "   --tmp=file (Installation tmp dir)" >&2;
      echo "   --lispdir=file" >&2;
      echo "" >&2;
      echo "Tools and compilers:"  >&2;
      echo "   --cc=comp [default gcc]" >&2;
      echo "   --ld=comp [default gcc]" >&2;
      echo "   --as=asm" >&2;
      echo "   --cflags=compilation_flags" >&2;
      echo "   --coflags=optimization_flags" >&2;
      echo "   --cpicflags=pic_flags" >&2;
      echo "   --emacs=file" >&2;
      echo "   --xemacs=file (deprecated, use \"--emacs\" option)" >&2;
      echo "   --indent=file" >&2;
      echo "   --icc (configure for icc)"  >&2;
      echo "" >&2;
      echo "Host configuration:"  >&2;
      echo "   --arch=[i586|i686|athlon|athlon-tbird|athlon-mp|athlon-xp|k6-2|k6-3|pentium3|pentium4] (configure for specified hardware)"  >&2;
      echo "   --a.out=file" >&2;
      echo "   --a.bat=file" >&2;
      echo "   --dirname=file-or-command" >&2;
      echo "   --os-win32" >&2;
      echo "   --cygwin-dos-path=[dos path]" >&2;
      echo "   --cygwin-dos-jvm=yes|no [default yes]" >&2;
      echo "   --no-share" >&2;
      echo "   --no-ldpreload" >&2;
      echo "   --sharedbde=yes|no [default no] (link Bde tools against shared libraries)" >&2;
      echo "   --sharedcompiler=yes|no [default no] (link Bigloo against shared libraries)" >&2;
      echo "" >&2;
      echo "JVM configuration:"  >&2;
      echo "   --java=file" >&2;
      echo "   --javac=file" >&2;
      echo "   --javaprefix=dir" >&2;
      echo "   --javashell=shell [should be sh or msdos (default sh)]" >&2;
      echo "   --native-default-backend" >&2;
      echo "   --jvm-default-backend" >&2;
      echo "" >&2;
      echo ".NET configuration:"  >&2;
      echo "   --pnet (configure for GNU pnet)"  >&2;
      echo "   --mono (configure for Ximian Mono)"  >&2;
      echo "   --dotnetldstyle=style [should be pnet, mono]" >&2;
      echo "   --dotnetcsccstyle=style [should be pnet, mono]" >&2;
      echo "   --dotnetclrstyle=style [should be pnet, mono]" >&2;
      echo "   --dotnetcscc=file" >&2;
      echo "   --dotnetld=file" >&2;
      echo "   --dotnetclr=file" >&2;
      echo "   --dotnetclropt=options" >&2;
      echo "   --dotnetshell=shell [should be sh or msdos (default sh)]" >&2;
      echo "   --dotnetasm=asm [optional]" >&2;
      echo "" >&2;
      echo "Misc:"  >&2;
      echo "   --finalization=yes|no [default no]" >&2;
      echo "   --benchmark=yes|no [default no] (must use --arch too)" >&2;
      echo "   --stack-check=no" >&2;
      echo "" >&2;
      echo "Configuration settings:"  >&2;
      echo "   --bigloo_config.h[=file]" >&2;
      echo "   --bigloo_config.jvm[=file]" >&2;
      echo "   --Makefile.config=file" >&2;
      echo "   --no-summary" >&2;
      echo "   --bootconfig" >&2;
      echo "   --configureinfo=yes|no [default no]" >&2;
      exit 3;
  esac
  shift
done

# The bigloo_config.h file
if [ "$bigloo_config_h " = " " ]; then
  bigloo_config_h=lib/$release/bigloo_config.h
fi

# The bigloo_config.jvm file
if [ "$bigloo_config_jvm " = " " ]; then
  bigloo_config_jvm=runtime/Jlib/configure.java
fi

# The bigloo_config.dotnet file
if [ "$bigloo_config_dotnet " = " " ]; then
  bigloo_config_dotnet=runtime/CSlib/configure.cs
fi

# The bigloo_bmacs.el file
if [ "$bigloo_config_el " = " " ]; then
  bigloo_config_el=bmacs/bmacs-config.el
fi

# The gc directory
if [ "$gcdir " = " " ]; then
   gcdir=../gc-boehm
fi

# Start configuring
if [ "$summary" = "yes" ]; then
  echo "** Configure **"
  echo 
fi

# Cleaning
/bin/rm -f configure.log

#*---------------------------------------------------------------------*/
#*    Testing the Posix OS                                             */
#*---------------------------------------------------------------------*/
posixos=`$autoconfdir/os`

# Setting the default a.out production according to the OS
if [ "$aout " = " " ]; then
  case $posixos in
    cygwin|mingw)
      aout=a.exe;;
    *)
      aout=a.out;;
  esac
fi

if [ "$abat " = " " ]; then
  case $posixos in
    cygwin|mingw)
      abat=a.bat;;
    *)
      abat=a.out;;
  esac
fi

if [ $posixos = "cygwin" ]; then
  exe=".exe";
  jshell="msdos";

  if [ "$cygwindospath " = " " ]; then
    cygwindospath=`$autoconfdir/cygwindospath`
  fi

  if [ "$cygwindospath " = " " ]; then
    echo "*** ERROR:Can't find out where cygwin is installed."
    echo "Run configure with the --cygwin-dos-path option."
    exit 1
  else
    cygwindospath=`echo "$cygwindospath" | sed -e 's|/$||g'`
    if [ ! -d $cygwindospath ]; then
      echo "*** ERROR:Can't find cygwindospath \"$cygwindospath\""
      exit 1
    fi
    cygwindospath=`echo "$cygwindospath" | sed -e 's/\\\\/\\\\\\\\/g'`
    zipdir=`echo $zipdir | sed -e 's/\/cygdrive\/\([a-z]\)\//\1:\//')`
    zipdir=`echo $zipdir | sed -e "s/^\//$cygwindospath\\\\\\\\\\\\\\\\/")`
    zipdir=`echo $zipdir | sed -e 's/\//\\\\\\\\/g'`
    zipdir=`echo $zipdir | sed -e 's/\([^\\\\]\)\\\\\([^\\\\]\)/\1\\\\\\\\\2/g'`
    syszipdir=$zipdir
    dlldir=`echo $dlldir | sed -e 's/\/cygdrive\/\([a-z]\)\//\1:\//')`
    dlldir=`echo $dlldir | sed -e "s/^\//$cygwindospath\\\\\\\\\\\\\\\\/")`
    dlldir=`echo $dlldir | sed -e 's/\//\\\\\\\\/g'`
    sysdlldir=$dlldir
  fi
elif [ "$posixos" = "mingw" ]; then
  exe=".exe"
  os="win32"
  cflags="$cflags -D_MINGW_VER"
  sharedsuffix="dll"
  extralibs="$extralibs -Wl,--stack,8000000"
else
  syszipdir=$zipdir
  sysdlldir=$dlldir
fi

#*---------------------------------------------------------------------*/
#*    gcflags                                                          */
#*---------------------------------------------------------------------*/
cgcflags=`$autoconfdir/gcflags --user=$user --tmp=$tmp --cc="$cc" --cflags="$cflags" --posixos="$posixos"`;

#*---------------------------------------------------------------------*/
#*    Emacs configuration                                              */
#*---------------------------------------------------------------------*/
if [ "$emacs " = " " ]; then
  emacs=emacs
  emacsversion=`$autoconfdir/emacsbrand --emacs=emacs 2> /dev/null`
  if [ "$emacsversion" = "false" ]; then
    emacs=xemacs
    emacsversion=`$autoconfdir/emacsbrand --emacs=xemacs 2> /dev/null`
  fi
else
  emacsversion=`$autoconfdir/emacsbrand --emacs=$emacs 2> /dev/null`
fi

if [ "$emacsversion" != "false" ]; then
  if [ "$lispdir " = " " ]; then
    emacslisppath=`$autoconfdir/emacslisppath --emacs=$emacs 2> /dev/null`
  else
    emacslisppath=`$autoconfdir/emacslisppath --emacs=$emacs --path=$lispdir 2> /dev/null`
  fi
  if [ "$emacslisppath" = "" ]; then
    emacsversion="false";
  fi
else
  emacslisppath=""
fi

#*---------------------------------------------------------------------*/
#*    If the operating system is win32 we have to turn the / into \ in */
#*    path names                                                       */
#*---------------------------------------------------------------------*/
if [ $os = "win32" ]; then
  ldopt="no-share"
  if [ "$posixos" != "mingw" ]; then
      bindir=`echo $bindir | sed -e 's/\//\\\\\\\\/g' | sed -e 's/[.]//g'`
      libdir=`echo $libdir | sed -e 's/\//\\\\\\\\/g' | sed -e 's/[.]//g'`
      fildir=`echo $fildir | sed -e 's/\//\\\\\\\\/g' | sed -e 's/[.]//g'`
      zipdir=`echo $zipdir | sed -e 's/\//\\\\\\\\/g' | sed -e 's/[.]//g'`
      dlldir=`echo $dlldir | sed -e 's/\//\\\\\\\\/g' | sed -e 's/[.]//g'`
      mandir=`echo $mandir | sed -e 's/\//\\\\\\\\/g' | sed -e 's/[.]//g'`
      infodir=`echo $infodir | sed -e 's/\//\\\\\\\\/g' | sed -e 's/[.]//g'`
      docdir=`echo $docdir | sed -e 's/\//\\\\\\\\/g' | sed -e 's/[.]//g'`
      lispdir=`echo $lispdir | sed -e 's/\//\\\\\\\\/g' | sed -e 's/[.]//g'`
  fi
fi

#*---------------------------------------------------------------------*/
#*    We don't support shared libraries on cygwin yet.                 */
#*---------------------------------------------------------------------*/
if [ $posixos = "cygwin" ]; then
  ldopt="no-share"
  jvmcpath="-classpath \".;..;../objs/class_s\""
  jvmrcpath="-classpath \".;../lib/$release/bigloo_s.zip;objs_jvm\""
  jvmftcpath="-classpath \".;../../../../../lib/$release/bigloo_s.zip\""
  dotnetftdllpath="-L../../../../lib/$release"
  dotnetlinkbigloodll="-lbigloo_s-$release.dll"
  if [ "$cygwindosjvm" = "yes" ]; then
    jshell="msdos"
  fi 
  if [ "$cygwindosdotnet" = "yes" ]; then
    dotnetshell="msdos"
  fi 
elif [ "$posixos" = "mingw" ]; then
    echo "PosixOS = MINGW ==> We're not doing shared libraries here"
    echo "                    mingw gcc won't produce the right exception"
    echo "                    code for Boehm's GC in DLL's"
    ldopt="no-share"
else
  case $dotnetldstyle in
    pnet|mono) 
      dotnetftdllpath="-L../../../../lib/$release";
      dotnetlinkbigloodll="-lbigloo_s-$release.dll";;
    *)
      echo "*** Don't know how to link .NET application [" $dotnetldstyl "]";
      exit 3;;
  esac
fi

#*---------------------------------------------------------------------*/
#*    all action                                                       */
#*---------------------------------------------------------------------*/
if [ $action = "all" ]; then
  if [ ! -d bin ]; then
     mkdir bin || exit 3
  fi
  if [ ! -d lib ]; then
     mkdir lib || exit 3
  fi
  if [ ! -d lib/$release ]; then
     mkdir lib/$release || exit 3
  fi
fi

#*---------------------------------------------------------------------*/
#*    Finding a user name                                              */
#*---------------------------------------------------------------------*/
user=`$autoconfdir/user`

#*---------------------------------------------------------------------*/
#*    Testing C compiler                                               */
#*---------------------------------------------------------------------*/
if [ "$cc " = " " ]; then
   $autoconfdir/cctest --cc="gcc" --user=$user --tmp=$tmp
   if [ $? != "0" ]; then
     $autoconfdir/cctest --cc="cc" --user=$user --tmp=$tmp
     if [ $? != "0" ]; then
       echo "*** ERROR:configure:Can't configure a C compiler. Aborting";
     else
       cc=cc;
     fi
   else
     cc=gcc
   fi
else  
  $autoconfdir/cctest --cc="$cc" --user=$user --tmp=$tmp
  if [ $? != "0" ]; then
    echo "*** ERROR:configure:the C compiler ($cc) does not seem to work. Aborting";
    exit 1;
  fi
fi

#*---------------------------------------------------------------------*/
#*    Benchmark mode                                                   */
#*---------------------------------------------------------------------*/
if [ "$mode" = "benchmark" ]; then
  ccprefix="`echo $cc | sed 's/[0-9]*//g'`"  # remove version numbers
  case $hardtune in
    i586,i686)
      if [ "$ccprefix" = "gcc" ]; then
        coflags="$coflags -march=$hardtune -mcpu=$hardtune -mpreferred-stack-boundary=2 -fomit-frame-pointer -fschedule-insns2 -ffast-math";
      fi
      gcspecial=-DDONT_ADD_BYTE_AT_END;;
        
    pentium3,pentium4)
      if [ "$ccprefix" = "gcc" ]; then
        coflags="$coflags -march=$hardtune -mpreferred-stack-boundary=2 -fomit-frame-pointer -fschedule-insns2 -ffast-math";
      fi 
      gcspecial="-DUSE_I686_PREFETCH -DDONT_ADD_BYTE_AT_END";;
        
    athlon|athlon-mp|athlon-tbird|athlon-xp)
      if [ "$ccprefix" = "gcc" ]; then
        coflags="$coflags -march=$hardtune -mpreferred-stack-boundary=2 -fomit-frame-pointer -fschedule-insns2 -ffast-math";
      fi
      gcspecial="-DUSE_3DNOW_PREFETCH -DDONT_ADD_BYTE_AT_END";;

    k6-2,k6-3)
      if [ "$ccprefix" = "gcc" ]; then
        coflags="$coflags -march=$hardtune -mpreferred-stack-boundary=2 -fomit-frame-pointer -fschedule-insns2 -ffast-math";
      fi
      gcspecial="-DUSE_3DNOW_PREFETCH -DDONT_ADD_BYTE_AT_END";;
  esac
fi

#*---------------------------------------------------------------------*/
#*    Testing stack size                                               */
#*---------------------------------------------------------------------*/
if [ $posixos != "cygwin" ]; then
  if [ "$posixos" != "mingw" ]; then
    if [ ! "$stacksizerequired" = "0" ]; then
      $autoconfdir/stacksize --cc="$cc" --user=$user --tmp=$tmp --stacksize=$stacksizerequired 2> /dev/null
      if [ $? != "0" ]; then
        echo "*** ERROR:configure:the execution stack is too small.";
        echo ""
        echo "Bigloo REQUIRES a larger stack (it needs a stack of about $stacksizerequired MB to compile).";
        echo "In general, it is possible to adjust the stack size by the means of";
        echo "a shell command.";
        echo "On most Unix systems, it is frequently called \"ulimit\" or \"unlimit\".";
        echo "For instance, with Bash you should try \"ulimit -s 4096\"."
        echo "With Zsh, try \"unlimit\"."
        echo ""
        echo "Another solution, if you know what you are doing,";
        echo "is to use the configure option \"--stack-check=no\". This will";
        echo "simply, disable stack size checking.";
        exit 1;
      fi
    fi
  fi
fi

#*---------------------------------------------------------------------*/
#*    bigloo_config.h / configure.java / configure.cs / ...            */
#*    -------------------------------------------------------------    */
#*    This part of the configure script produces the files             */
#*    runtime/Include/bigloo_config.h, runtime/Jlib/configure.java and */
#*    runtime/CSlib/configure.cs. These files contain all the machine- */
#*    dependant information used by Bigloo.                            */
#*---------------------------------------------------------------------*/
if [ $action = "all" -o $action = "bigloo_config" ]; then

  # Tell what we are doing
  echo "Configuring $bigloo_config_h, $bigloo_config_jvm, $bigloo_config_dotnet:"

  # We first cleanup the files
  rm -f $bigloo_config_h 2> /dev/null
  echo "/* Automatically generated file (don't edit) */" > $bigloo_config_h
  echo "/* `date` */" >> $bigloo_config_h
  echo "" >> $bigloo_config_h

  echo "#ifndef BIGLOO_CONFIG_H" >> $bigloo_config_h
  echo "#define BIGLOO_CONFIG_H" >> $bigloo_config_h
  echo "" >> $bigloo_config_h

  rm -f $bigloo_config_jvm 2> /dev/null
  echo "/* Automatically generated file (don't edit) */" > $bigloo_config_jvm
  echo "/* `date` */" >> $bigloo_config_jvm
  echo "" >> $bigloo_config_jvm
  echo "package bigloo;" >> $bigloo_config_jvm
  echo "public class configure {" >> $bigloo_config_jvm

  rm -f $bigloo_config_dotnet 2> /dev/null
  echo "/* Automatically generated file (don't edit) */" > $bigloo_config_dotnet
  echo "/* `date` */" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_dotnet
  echo "namespace bigloo {" >> $bigloo_config_dotnet
  echo "public class configure {" >> $bigloo_config_dotnet

  # The release number
  echo "#undef BGL_RELEASE_NUMBER" >> $bigloo_config_h
  echo "#define BGL_RELEASE_NUMBER \"$release\"" >> $bigloo_config_h
  echo "  public static final byte[] BGL_RELEASE_NUMBER = \"$release\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] BGL_RELEASE_NUMBER = foreign.getbytes( \"$release\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # The specific version
  echo "#undef BGL_SPECIFIC_VERSION" >> $bigloo_config_h
  echo "#define BGL_SPECIFIC_VERSION \"\"" >> $bigloo_config_h
  echo "  public static final byte[] BGL_SPECIFIC_VERSION = \"\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] BGL_SPECIFIC_VERSION = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # The default back-end
  echo "#undef BGL_DEFAULT_BACK_END" >> $bigloo_config_h
  echo "#define BGL_DEFAULT_BACK_END \"$defaultbackend\"" >> $bigloo_config_h
  echo "  public static final byte[] BGL_DEFAULT_BACK_END = \"$defaultbackend\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] BGL_DEFAULT_BACK_END = foreign.getbytes( \"$defaultbackend\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # The default binary target
  echo "#undef BGL_DEFAULT_A_OUT" >> $bigloo_config_h
  echo "#define BGL_DEFAULT_A_OUT \"$aout\"" >> $bigloo_config_h
  echo "" >> $bigloo_config_h

  # The default script target
  echo "#undef BGL_DEFAULT_A_BAT" >> $bigloo_config_h
  echo "#define BGL_DEFAULT_A_BAT \"$abat\"" >> $bigloo_config_h
  echo "" >> $bigloo_config_h

  # The -O C compiler options
  coflags=`$autoconfdir/ccoptim --user=$user --tmp=$tmp --cc="$cc" --cflags="$coflags" --posixos="$posixos"`

  # The -s C linker options
  if [ "$cstrip" != "no" ]; then
    csflags=`$autoconfdir/ccstrip --user=$user --tmp=$tmp --cc="$cc" --cflags="$cstrip"`;
  else
    csflags="";
  fi

  # The -p C compiler options
  cpflags=`$autoconfdir/ccprof --user=$user --tmp=$tmp --cc="$cc"`

  # The stack direction
  stackgrows=`$autoconfdir/stackdown --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:stack. Aborting";
     exit 1;
  fi

  echo "#undef STACK_GROWS_DOWN" >> $bigloo_config_h
  if( test $stackgrows = "1" ); then
    echo "   stack grows: down"
    echo "#define STACK_GROWS_DOWN 1" >> $bigloo_config_h
    echo "  public static final boolean STACK_GROWS_DOWN = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool STACK_GROWS_DOWN = true;" >> $bigloo_config_dotnet
  else
    echo "   stack grows: up"
    echo "#define STACK_GROWS_DOWN 0" >> $bigloo_config_h
    echo "  public static final boolean STACK_GROWS_DOWN = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool STACK_GROWS_DOWN = false;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # The pointer alignment
  alignment=`$autoconfdir/alignment --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:alignment. Aborting";
     exit 1;
  fi

  echo "   log2 ptr alignment: " $alignment
  echo "#undef PTR_ALIGNMENT" >> $bigloo_config_h
  echo "#define PTR_ALIGNMENT $alignment" >> $bigloo_config_h
  echo "  public static final int PTR_ALIGNMENT = $alignment;" >> $bigloo_config_jvm
  echo "  public static readonly int PTR_ALIGNMENT = $alignment;" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # setjmp/longjmp
  prefix=`$autoconfdir/setjmp --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:setjmp. Aborting";
     exit 1;
  fi

  setjmp="$prefix"setjmp
  longjmp="$prefix"longjmp

  echo "   setjmp: $setjmp longjmp: $longjmp"
  echo "#undef SETJMP" >> $bigloo_config_h
  echo "#define SETJMP $setjmp" >> $bigloo_config_h
  echo "  public static final byte[] SETJMP = \"$setjmp\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] SETJMP = foreign.getbytes( \"$setjmp\" );" >> $bigloo_config_dotnet
  echo "#undef LONGJMP" >> $bigloo_config_h
  echo "#define LONGJMP $longjmp" >> $bigloo_config_h
  echo "  public static final byte[] LONGJMP = \"$longjmp\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] LONGJMP = foreign.getbytes( \"$longjmp\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # Does the system have bcopy?
  bcopy=`$autoconfdir/bcopy --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:bcopy. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_BCOPY" >> $bigloo_config_h
  if( test $bcopy = "1" ); then
    echo "   bcopy: yes"
    echo "#define HAVE_BCOPY 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_BCOPY = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_BCOPY = true;" >> $bigloo_config_dotnet
  else
    echo "   bcopy: no"
    echo "#define HAVE_BCOPY 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_BCOPY = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_BCOPY = false;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # The number of window register
  window=`$autoconfdir/winreg --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:winreg. Aborting";
     exit 1;
  fi

  echo "   nb window register: " $window
  echo "#undef NB_WINDOW_REGISTER" >> $bigloo_config_h
  echo "#define NB_WINDOW_REGISTER $window" >> $bigloo_config_h
  echo "  public static final int NB_WINDOW_REGISTER = $window;" >> $bigloo_config_jvm
  echo "  public static readonly int NB_WINDOW_REGISTER = $window;" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # Does the system have sigsetmask?
  sigsetmask=`$autoconfdir/sigsetmask --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:sigsetmask. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_SIGSETMASK" >> $bigloo_config_h
  if( test $sigsetmask = "0" ); then
    echo "   sigsetmask: no"
    echo "#define HAVE_SIGSETMASK 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_SIGSETMASK = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_SIGSETMASK = false;" >> $bigloo_config_dotnet
   else
    echo "   sigsetmask: yes"
    echo "#define HAVE_SIGSETMASK 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_SIGSETMASK = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_SIGSETMASK = true;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # Does the system have sigprocmask?
  sigprocmask=`$autoconfdir/sigprocmask --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:sigprocmask. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_SIGPROCMASK" >> $bigloo_config_h
  if( test $sigprocmask = "0" ); then
    echo "   sigprocmask: no"
    echo "#define HAVE_SIGPROCMASK 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_SIGPROCMASK = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_SIGPROCMASK = false;" >> $bigloo_config_dotnet
  else
    echo "   sigprocmask: yes"
    echo "#define HAVE_SIGPROCMASK 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_SIGPROCMASK = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_SIGPROCMASK = true;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # A warning if neither sigsetmask nor sigprocmask is defined
  if( test $sigsetmask = "0" -a $sigprocmask = "0"); then
     echo "*** WARNING:sigsetmask nor sigprocmask: yes"
     echo "(^C disabled in the interpreter)."
  fi

  # Does the system have alloca?
  alloca=`$autoconfdir/alloca --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:alloca. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_ALLOCA" >> $bigloo_config_h
  if( test $alloca = "1" ); then
    echo "   alloca: yes"
    echo "#define HAVE_ALLOCA 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_ALLOCA = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_ALLOCA = true;" >> $bigloo_config_dotnet
  else
    echo "   alloca: no"
    echo "#define HAVE_ALLOCA 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_ALLOCA = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_ALLOCA = false;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # Does the system have getcwd?
  getcwd=`$autoconfdir/getcwd --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:getcwd. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_GETCWD" >> $bigloo_config_h
  if( test $getcwd = "0" ); then
    echo "   getcwd: no"
    echo "#define HAVE_GETCWD 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_GETCWD = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_GETCWD = false;" >> $bigloo_config_dotnet
  else
    echo "   getcwd: yes"
    echo "#define HAVE_GETCWD 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_GETCWD = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_GETCWD = true;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # Does the system have getwd?
  getwd=`$autoconfdir/getwd --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:getwd. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_GETWD" >> $bigloo_config_h
  if( test $getwd = "0" ); then
    echo "   getwd: no"
    echo "#define HAVE_GETWD 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_GETWD = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_GETWD = false;" >> $bigloo_config_dotnet
  else
    echo "   getwd: yes"
    echo "#define HAVE_GETWD 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_GETWD = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_GETWD = true;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # Where to find the socket api
  socket=`$autoconfdir/socket --user=$user --tmp=$tmp --cc="$cc" --lib="$socketlibs"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:socket. Aborting";
     exit 1;
  fi

  if [ "$socket " = " " ]; then
    echo "   socket: yes"
  else
    echo "   socket: $socket"
    extralibs="$socket $extralibs"
  fi

  # Are the static constants aligned?
  cnstalign=`$autoconfdir/cnstalign --user=$user --tmp=$tmp --cc="$cc" --alignment=$alignment`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:cnstalign. Aborting";
     exit 1;
  fi

  enforcedcnstalign=`$autoconfdir/enforcedcnstalign --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:enforcedcnstalign. Aborting";
     exit 1;
  fi

  echo "#undef CONSTANT_ALIGNED" >> $bigloo_config_h
  if( test $cnstalign = "1" ); then
    echo "   constant alignment: ok"
    echo "#define CONSTANT_ALIGNED 1" >> $bigloo_config_h
    echo "  public static final boolean CONSTANT_ALIGNED = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool CONSTANT_ALIGNED = true;" >> $bigloo_config_dotnet
  elif( test $cnstalign = "0" ); then
    if( test $enforcedcnstalign = "1" ); then
       echo "   constant alignment: enforced"
       echo "#define CONSTANT_ALIGNED 0" >> $bigloo_config_h
       echo "  public static final boolean CONSTANT_ALIGNED = false;" >> $bigloo_config_jvm
       echo "  public static readonly bool CONSTANT_ALIGNED = false;" >> $bigloo_config_dotnet
    else
       echo "*** ERROR:configure:illegal alignment."
       echo "It is then impossible install Bigloo on this architecture, sorry."
       exit 1
    fi
  fi
  echo "" >> $bigloo_config_h

  # Endianness
  endian=`$autoconfdir/bigendian --user=$user --tmp=$tmp --cc="$cc"`
  if( test $endian = "1" ); then
    echo "   Endianness: big"
    echo "#undef BGL_BIG_ENDIAN" >> $bigloo_config_h
    echo "#define BGL_BIG_ENDIAN 1" >> $bigloo_config_h
    echo "  public static final boolean BGL_BIG_ENDIAN = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool BGL_BIG_ENDIAN = true;" >> $bigloo_config_dotnet
  else
    echo "   Endianness: little"
    echo "#undef BGL_BIG_ENDIAN" >> $bigloo_config_h
    echo "#define BGL_BIG_ENDIAN 0" >> $bigloo_config_h
    echo "  public static final boolean BGL_BIG_ENDIAN = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool BGL_BIG_ENDIAN = false;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # Does this system implements pipe?
  pipe=`$autoconfdir/pipe --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:pipe. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_PIPE" >> $bigloo_config_h
  if( test $pipe = "0" ); then
    echo "   popen/pclose: no"
    echo "#define HAVE_PIPE 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_PIPE = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_PIPE = false;" >> $bigloo_config_dotnet
  else
    echo "   popen/pclose: yes"
    echo "#define HAVE_PIPE 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_PIPE = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_PIPE = true;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # Does this compiler implements longlong?
  longlong=`$autoconfdir/longlong --user=$user --tmp=$tmp --cc="$cc" --longlong="$longlong"`

  echo "#undef BGL_LONGLONG_T" >> $bigloo_config_h
  if [ "$longlong " = " " ]; then
    echo "   long long: no"
    echo "#define BGL_LONGLONG_T long" >> $bigloo_config_h
    echo "#define BGL_HAVE_LLABS 0" >> $bigloo_config_h
    echo "#define BGL_LLABS abs" >> $bigloo_config_h
    echo "#define BGL_HAVE_STRTOLL 0" >> $bigloo_config_h
    echo "#define BGL_STRTOLL strtol" >> $bigloo_config_h
  else
    llabs=`$autoconfdir/llabs --user=$user --tmp=$tmp --cc="$cc" --longlong="$longlong"`
    strtoll=`$autoconfdir/strtoll --user=$user --tmp=$tmp --cc="$cc" --longlong="$longlong"`
    echo "   long long: yes [$longlong]"
    echo "#define BGL_LONGLONG_T $longlong" >> $bigloo_config_h
    if [ "$llabs " != " " ]; then
      echo "   llabs: yes [$llabs]"
      echo "#define BGL_HAVE_LLABS 1" >> $bigloo_config_h
      echo "#define BGL_LLABS $llabs" >> $bigloo_config_h
    else
      echo "   llabs: no"
      echo "#define BGL_HAVE_LLABS 0" >> $bigloo_config_h
      echo "#define BGL_LLABS abs" >> $bigloo_config_h
    fi
    if [ "$strtoll " != " " ]; then
      echo "   strtoll: yes [$strtoll]"
      echo "#define BGL_HAVE_STRTOLL 1" >> $bigloo_config_h
      echo "#define BGL_STRTOLL $strtoll" >> $bigloo_config_h
    else
      echo "   strtoll: no"
      echo "#define BGL_HAVE_STRTOLL 0" >> $bigloo_config_h
      echo "#define BGL_STRTOLL(_1,_2,_3) (($longlong)strtol((_1),(_2),(_3)))" >> $bigloo_config_h
    fi
  fi
  echo "" >> $bigloo_config_h

  # Is sigchld available for us
  sigchld=`$autoconfdir/sigchld --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:sigchld. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_SIGCHLD" >> $bigloo_config_h
  if( test "$sigchld" = "1" ); then
    echo "   sigchld: yes"
    echo "#define HAVE_SIGCHLD 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_SIGCHLD = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_SIGCHLD = true;" >> $bigloo_config_dotnet
  else
    echo "   sigchld: no"
    echo "#define HAVE_SIGCHLD 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_SIGCHLD = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_SIGCHLD = false;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h
  
  # Is sigaction available
  sigaction=`$autoconfdir/sigaction --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:sigaction. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_SIGACTION" >> $bigloo_config_h
  if( test $sigaction = "1" ); then
    echo "   sigaction: yes"
    echo "#define HAVE_SIGACTION 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_SIGACTION = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_SIGACTION = true;" >> $bigloo_config_dotnet
  else
    echo "   sigaction: no"
    echo "#define HAVE_SIGACTION 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_SIGACTION = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_SIGACTION = false;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h
  
  # Is select available
  select=`$autoconfdir/select --user=$user --tmp=$tmp --cc="$cc"`
  echo "#undef BGL_HAVE_SELECT" >> $bigloo_config_h
  
  if [ "$select" = "1" ]; then
    echo "   select: yes"
    echo "#define BGL_HAVE_SELECT 1" >> $bigloo_config_h
    echo "  public static final boolean BGL_HAVE_SELECT = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool BGL_HAVE_SELECT = true;" >> $bigloo_config_dotnet
  else
    echo "   select: no"
    echo "#define BGL_HAVE_SELECT 0" >> $bigloo_config_h
    echo "  public static final boolean BGL_HAVE_SELECT = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool BGL_HAVE_SELECT = false;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h
  
  # Is termio available
  termio=`$autoconfdir/termio --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:termio. Aborting";
     exit 1;
  fi

  echo "#undef HAVE_TERMIO" >> $bigloo_config_h
  if( test $termio = "1" ); then
    echo "   termio: yes"
    echo "#define HAVE_TERMIO 1" >> $bigloo_config_h
    echo "  public static final boolean HAVE_TERMIO = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_TERMIO = true;" >> $bigloo_config_dotnet
  else
    echo "   termio: no"
    echo "#define HAVE_TERMIO 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_TERMIO = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_TERMIO = false;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h
  
  # Does the system support posix-file-ops
  posixfileops=`$autoconfdir/posixfileops --user=$user --tmp=$tmp --cc="$cc"`
  echo "#undef POSIX_FILE_OPS" >> $bigloo_config_h
  if( test "$posixfileops" = "1" ); then
    echo "   posix file operations: yes"
    echo "#define POSIX_FILE_OPS 1" >> $bigloo_config_h
  else
    echo "   posix file operations: no"
    echo "#define POSIX_FILE_OPS 0" >> $bigloo_config_h
  fi
  echo "" >> $bigloo_config_h

  # Does the system support sendfile
  sendfile=`$autoconfdir/sendfile --user=$user --tmp=$tmp --cc="$cc"`
  echo "#undef BGL_HAVE_SENDFILE" >> $bigloo_config_h
  if( test "$sendfile" = "1" ); then
    echo "   sendfile: yes"
    echo "#define BGL_HAVE_SENDFILE 1" >> $bigloo_config_h
  else
    echo "   sendfile: no"
    echo "#define BGL_HAVE_SENDFILE 0" >> $bigloo_config_h
  fi
  echo "" >> $bigloo_config_h

  # Does the system support nanosleep
  nanosleep=`$autoconfdir/sleep --user=$user --tmp=$tmp --cc="$cc" --cflags="-DBGL_NANOSLEEP"`
  echo "#undef BGL_NANOSLEEP" >> $bigloo_config_h
  if( test "$nanosleep" = "1" ); then
    echo "   nanosleep: yes"
    echo "#define BGL_NANOSLEEP 1" >> $bigloo_config_h
  else
    echo "   nanosleep: no"
    echo "#define BGL_NANOSLEEP 0" >> $bigloo_config_h
  fi
  echo "" >> $bigloo_config_h

  # Does the system support normalsleep
  normalSleep=`$autoconfdir/sleep --user=$user --tmp=$tmp --cc="$cc" --cflags="-DBGL_SLEEP"`
  echo "#undef BGL_SLEEP" >> $bigloo_config_h
  if( test "$normalSleep" = "1" ); then
    echo "   normal sleep: yes"
    echo "#define BGL_SLEEP 1" >> $bigloo_config_h
  else
    echo "   normal sleep: no"
    echo "#define BGL_SLEEP 0" >> $bigloo_config_h
  fi
  echo "" >> $bigloo_config_h

  # The timezone variable
  timezone=`$autoconfdir/timezone --user=$user --tmp=$tmp --cc="$cc" --cflags="$coflags"`
  echo "#undef BGL_TIMEZONE" >> $bigloo_config_h
  echo "#define BGL_TIMEZONE $timezone" >> $bigloo_config_h
  echo "" >> $bigloo_config_h

  # The shared libraries
  echo "#undef HAVE_SHARED_LIBRARY" >> $bigloo_config_h
  if [ "$ldopt" = "no-share" ]; then
    echo "   shared library: no"
    echo "#define HAVE_SHARED_LIBRARY 0" >> $bigloo_config_h
    echo "  public static final boolean HAVE_SHARED_LIBRARY = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_SHARED_LIBRARY = false;" >> $bigloo_config_dotnet
  else
    ldopt=`$autoconfdir/ldshare --user=$user --tmp=$tmp --cc="$cc" --ld="$ld" --ldopt="$ldopt"`
    if [ "$ldopt" = "no-share" ]; then
      echo "   shared library: no (because I don't know ld option)"
      echo "#define HAVE_SHARED_LIBRARY 0" >> $bigloo_config_h
      echo "  public static final boolean HAVE_SHARED_LIBRARY = false;" >> $bigloo_config_jvm
      echo "  public static readonly bool HAVE_SHARED_LIBRARY = false;" >> $bigloo_config_dotnet
    else
      echo "   shared library: yes"
      echo "#define HAVE_SHARED_LIBRARY 1" >> $bigloo_config_h
      echo "  public static final boolean HAVE_SHARED_LIBRARY = true;" >> $bigloo_config_jvm
      echo "  public static readonly bool HAVE_SHARED_LIBRARY = true;" >> $bigloo_config_dotnet

      ldpreload=`$autoconfdir/ldpreload --user=$user --tmp=$tmp --cc="$cc" --ld="$ld" --ldopt="$ldopt"`
      echo "   ld preload: $ldpreload"
    fi
  fi

  # Does the system have dlopen?
  if [ "$ldopt " != "no-share" ]; then
    dlopen=`$autoconfdir/dlopen --user=$user --tmp=$tmp --cc="$cc" --dlopt="$dlopenopt"`
    if [ "$dlopen" != "0" ]; then
      echo "   dlopen: yes [$dlopen]"
      echo "#define HAVE_DLOPEN 1" >> $bigloo_config_h
      echo "#define DLOPEN_LD_OPT \"$dlopen\"" >> $bigloo_config_h
      echo "  public static final boolean HAVE_DLOPEN = true;" >> $bigloo_config_jvm
      echo "  public static readonly bool HAVE_DLOPEN = true;" >> $bigloo_config_dotnet
      echo "  public static final byte[] DLOPEN_LD_OPT = \"$dlopen\".getBytes();" >> $bigloo_config_jvm
      echo "  public static readonly byte[] DLOPEN_LD_OPT = foreign.getbytes( \"$dlopen\" );" >> $bigloo_config_dotnet
      extralibs="$dlopen $extralibs"
    else
      echo "   dlopen: no"
      echo "#define HAVE_DLOPEN 0" >> $bigloo_config_h
      echo "#define DLOPEN_LD_OPT \"\"" >> $bigloo_config_h
    fi
  else
    echo "   dlopen: no"
    dlopen=0
    echo "#define HAVE_DLOPEN 0" >> $bigloo_config_h
    echo "#define DLOPEN_LD_OPT \"\"" >> $bigloo_config_h
    echo "  public static final boolean HAVE_DLOPEN = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool HAVE_DLOPEN = false;" >> $bigloo_config_dotnet
    echo "  public static final byte[] DLOPEN_LD_OPT = \"\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] DLOPEN_LD_OPT = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet
  fi

  # We check the standard GC if we have to use one
  if [ "$customgc" = "no" ]; then
     gclib=`$autoconfdir/gcstd --user=$user --tmp=$tmp --cc="$cc" --cflags="$coflags" --gcdir="$stdgcdir" --gclib="$stdgclib" --dlopen=$dlopen`
     if [ $? != "0" ]; then
        echo "*** ERROR:configure:Standard GC. Aborting";
        echo "You are trying to configure Bigloo so that it uses an existing"
        echo "GC library. The configuration script is enable to make this"
        echo "library working properly."
        echo "Try to configure Bigloo with \"--customgc=yes\"."
        exit 1;
     fi
     gcdir=$stdgcdir
  else
     gclib=$customgclib;
  fi

  # for now only the port is Unix
  echo "   operating system: unix"
  if [ "$posixos" = "mingw" ]; then
      echo "     (well actually it's a win32 MinGW System ;-)"
  fi
  $autoconfdir/unix --user=$user --tmpdir=$tmpdir --posixos="$posixos" >> $bigloo_config_h
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:os. Aborting";
     exit 1;
  fi

  echo "" >> $bigloo_config_h
  echo "" >> $bigloo_config_jvm
  echo "" >> $bigloo_config_dotnet

  # which shell to use
  `$shell -c "ls -l > /dev/null 2> /dev/null"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:$shell. Aborting";
     exit 1;
  fi

  echo "   shell: $shell"
  echo "#undef SHELL" >> $bigloo_config_h
  echo "#define SHELL \"$shell\"" >> $bigloo_config_h
  echo "  public static final byte[] SHELL = \"$shell\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] SHELL = foreign.getbytes( \"$shell\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # the C compiler style
  echo "   c compiler style: $ccstyle"
  echo "#undef C_COMPILER_STYLE" >> $bigloo_config_h
  echo "#define C_COMPILER_STYLE \"$ccstyle\"" >> $bigloo_config_h
  echo "  public static final byte[] C_COMPILER_STYLE = \"$ccstyle\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_COMPILER_STYLE = foreign.getbytes( \"$ccstyle\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # which C compiler to use
  echo "   c compiler: $cc"
  echo "#undef C_COMPILER" >> $bigloo_config_h
  echo "#define C_COMPILER \"$cc\"" >> $bigloo_config_h
  echo "  public static final byte[] C_COMPILER = \"$cc\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_COMPILER = foreign.getbytes( \"$cc\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C compiler option
  echo "   c option: $cflags"
  echo "#undef C_FLAGS" >> $bigloo_config_h
  echo "#define C_FLAGS \"$cflags\"" >> $bigloo_config_h
  echo "  public static final byte[] C_FLAGS = \"$cflags\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_FLAGS = foreign.getbytes( \"$cflags\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C compiler -o option
  echo "#undef C_COMPILER_O_OPTION" >> $bigloo_config_h
  echo "#define C_COMPILER_O_OPTION \"-o \"" >> $bigloo_config_h
  echo "  public static final byte[] C_COMPILER_O_OPTION = \"-o \".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_COMPILER_O_OPTION = foreign.getbytes( \"-o \" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C compiler -g option
  echo "#undef C_COMPILER_DEBUG_OPTION" >> $bigloo_config_h
  echo "#define C_COMPILER_DEBUG_OPTION \"-g\"" >> $bigloo_config_h
  echo "  public static final byte[] C_COMPILER_DEBUG_OPTION = \"-g\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_COMPILER_DEBUG_OPTION = foreign.getbytes( \"-g\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C object file extension
  echo "#undef C_OBJECT_FILE_EXTENSION" >> $bigloo_config_h
  echo "#define C_OBJECT_FILE_EXTENSION \"$cobj\"" >> $bigloo_config_h
  echo "  public static final byte[] C_OBJECT_FILE_EXTENSION = \"$cobj\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_OBJECT_FILE_EXTENSION = foreign.getbytes( \"$cobj\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C compiler optimization option
  echo "   c compiler optimization: $coflags"
  echo "#undef C_COMPILER_OPTIM_FLAGS" >> $bigloo_config_h
  echo "#define C_COMPILER_OPTIM_FLAGS \"$coflags $cflags\"" >> $bigloo_config_h
  echo "  public static final byte[] C_COMPILER_OPTIM_FLAGS = \"$coflags\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_COMPILER_OPTIM_FLAGS = foreign.getbytes( \"$coflags\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C linker strip option
  echo "   c linker strip: $csflags"
  echo "#undef C_STRIP_FLAGS" >> $bigloo_config_h
  echo "#define C_STRIP_FLAGS \"$csflags\"" >> $bigloo_config_h
  echo "  public static final byte[] C_STRIP_FLAGS = \"$csflags\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_STRIP_FLAGS = foreign.getbytes( \"$csflags\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C linker style
  echo "#undef C_LINKER_STYLE" >> $bigloo_config_h
  echo "#define C_LINKER_STYLE \"$ldstyle\"" >> $bigloo_config_h
  echo "  public static final byte[] C_LINKER_STYLE = \"$ldstyle\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_LINKER_STYLE = foreign.getbytes( \"$ldstyle\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C linker -o option
  echo "#undef C_LINKER_O_OPTION" >> $bigloo_config_h
  echo "#define C_LINKER_O_OPTION \"-o \"" >> $bigloo_config_h
  echo "  public static final byte[] C_LINKER_O_OPTION = \"-o \".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_LINKER_O_OPTION = foreign.getbytes( \"-o \" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C linker -g option
  echo "#undef C_LINKER_DEBUG_OPTION" >> $bigloo_config_h
  echo "#define C_LINKER_DEBUG_OPTION \"-g \"" >> $bigloo_config_h
  echo "  public static final byte[] C_LINKER_DEBUG_OPTION = \"-g \".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_LINKER_DEBUG_OPTION = foreign.getbytes( \"-g \" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C linker optimization option
  echo "#undef C_LINKER_OPTIM_FLAGS" >> $bigloo_config_h
  echo "#define C_LINKER_OPTIM_FLAGS \"\"" >> $bigloo_config_h
  echo "  public static final byte[] C_LINKER_OPTIM_FLAGS = \"\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_LINKER_OPTIM_FLAGS = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C profile compiler option
  echo "   c compiler profiling: $cpflags"
  echo "#undef C_PROFILE_FLAGS" >> $bigloo_config_h
  echo "#define C_PROFILE_FLAGS \"$cpflags $cflags\"" >> $bigloo_config_h
  echo "  public static final byte[] C_PROFILE_FLAGS = \"$cpflags $cflags\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] C_PROFILE_FLAGS = foreign.getbytes( \"$cpflags $cflags\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # C compiler support split strings
  echo "#undef C_STRING_SPLIT" >> $bigloo_config_h
  if [ $stringsplit != "0" ]; then
    echo "#define C_STRING_SPLIT 1" >> $bigloo_config_h
    echo "  public static final boolean C_STRING_SPLIT = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool C_STRING_SPLIT = true;" >> $bigloo_config_dotnet
  else
    echo "#define C_STRING_SPLIT 0" >> $bigloo_config_h
    echo "  public static final boolean C_STRING_SPLIT = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool C_STRING_SPLIT = false;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # the library directory
  echo "   library directory: $libdir"
  echo "#undef BGL_LD_LIBRARY_DIR" >> $bigloo_config_h
  echo "#define BGL_LD_LIBRARY_DIR \"$libdir\"" >> $bigloo_config_h
  echo "  public static final byte[] LD_LIBRARY_DIR = \"$libdir\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] LD_LIBRARY_DIR = foreign.getbytes( \"$libdir\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # the library files directory
  echo "   files directory: $fildir"
  echo "#undef LIBRARY_DIRECTORY" >> $bigloo_config_h
  echo "#define LIBRARY_DIRECTORY \"$fildir\"" >> $bigloo_config_h
  echo "  public static final byte[] LIBRARY_DIRECTORY = \"$fildir\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] LIBRARY_DIRECTORY = foreign.getbytes( \"$fildir\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # The GC library file
  echo "   GC library: $gclib"
  echo "#undef BGL_GC_LIBRARY" >> $bigloo_config_h
  echo "#define BGL_GC_LIBRARY \"$gclib\"" >> $bigloo_config_h
  echo "  public static final byte[] BGL_GC_LIBRARY = \"$gclib\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] BGL_GC_LIBRARY = foreign.getbytes( \"$gclib\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # Are we using a standard GC or a custom GC
  if [ $customgc = "yes" ]; then
    echo "   custom GC: yes"
    echo "#undef BGL_GC_CUSTOM" >> $bigloo_config_h
    echo "#define BGL_GC_CUSTOM 1" >> $bigloo_config_h
    echo "  public static final boolean BGL_GC_CUSTOM = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool BGL_GC_CUSTOM = true;" >> $bigloo_config_dotnet
    echo "" >> $bigloo_config_h
  else
    echo "   custom GC: no"
    echo "#undef BGL_GC_CUSTOM" >> $bigloo_config_h
    echo "#define BGL_GC_CUSTOM 0" >> $bigloo_config_h
    echo "  public static final boolean BGL_GC_CUSTOM = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool BGL_GC_CUSTOM = false;" >> $bigloo_config_dotnet
    echo "" >> $bigloo_config_h
  fi

  # the zip directory
  echo "   zip directory: $syszipdir"
  echo "#undef ZIP_DIRECTORY" >> $bigloo_config_h
  echo "#define ZIP_DIRECTORY \"$syszipdir\"" >> $bigloo_config_h
  echo "  public static final byte[] ZIP_DIRECTORY = \"$syszipdir\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] ZIP_DIRECTORY = foreign.getbytes( \"$syszipdir\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # the dll directory
  echo "   dll directory: $sysdlldir"
  echo "#undef DLL_DIRECTORY" >> $bigloo_config_h
  echo "#define DLL_DIRECTORY \"$sysdlldir\"" >> $bigloo_config_h
  echo "  public static final byte[] DLL_DIRECTORY = \"$sysdlldir\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] DLL_DIRECTORY = foreign.getbytes( \"$sysdlldir\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # additionals non bigloo library
  echo "   additional libraries: $extralibs"
  echo "#undef USER_LIBRARIES" >> $bigloo_config_h
  echo "#define USER_LIBRARIES \"$extralibs\"" >> $bigloo_config_h
  echo "  public static final byte[] USER_LIBRARIES = \"$extralibs\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] USER_LIBRARIES = foreign.getbytes( \"$extralibs\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # the C beautifier
  echo "#undef C_BEAUTIFIER" >> $bigloo_config_h
  if( test `$autoconfdir/indent --user=$user --tmp=$tmp --cc="$cc" --cflags="$cflags" --indent="$indent"` != "1" ); then
    echo "   c beautifier: no"
    echo "#define C_BEAUTIFIER \"\"" >> $bigloo_config_h
    echo "  public static final byte[] C_BEAUTIFIER = \"\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] C_BEAUTIFIER = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet
  else
    echo "   c beautifier: $indent"
    echo "#define C_BEAUTIFIER \"$indent\"" >> $bigloo_config_h
    echo "  public static final byte[] C_BEAUTIFIER = \"$indent\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] C_BEAUTIFIER = foreign.getbytes( \"$indent\" );" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # the dirname command
  echo "#undef DIRNAME_CMD" >> $bigloo_config_h
  dirname=`$autoconfdir/dirname --user=$user --tmp=$tmp --cc="$cc" --cflags="$cflags" --dirname="$dirname"`
  echo "   dirname: $dirname"
  echo "#define DIRNAME_CMD \"$dirname\"" >> $bigloo_config_h
  echo "  public static final byte[] DIRNAME_CMD = \"$dirname\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] DIRNAME_CMD = foreign.getbytes( \"$dirname\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # library basename
  echo "   library basename: $libraryname"
  echo "#undef LIBRARY_BASE_NAME" >> $bigloo_config_h
  echo "#define LIBRARY_BASE_NAME \"$libraryname\"" >> $bigloo_config_h
  echo "  public static final byte[] LIBRARY_BASE_NAME = \"$libraryname\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] LIBRARY_BASE_NAME = foreign.getbytes( \"$libraryname\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # double precision
  prec=`$autoconfdir/doubleprec --user=$user --tmp=$tmp --cc="$cc"`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:doubleprec. Aborting";
     exit 1;
  fi

  echo "   double precision: $prec"
  echo "#undef DOUBLE_PRECISION" >> $bigloo_config_h
  echo "#define DOUBLE_PRECISION $prec" >> $bigloo_config_h
  echo "  public static final int DOUBLE_PRECISION = $prec;" >> $bigloo_config_jvm
  echo "  public static readonly int DOUBLE_PRECISION = $prec;" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # static link additional option
  ldstaticopt=`$autoconfdir/ldstaticopt --user=$user --tmp=$tmp --posixos="$posixos"`
  echo "#undef ADDITIONAL_STATIC_LINK_OPTION" >> $bigloo_config_h
  echo "#define ADDITIONAL_STATIC_LINK_OPTION \"$ldstaticopt\"" >> $bigloo_config_h
  echo "  public static final byte[] ADDITIONAL_STATIC_LINK_OPTION = \"$ldstaticopt\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] ADDITIONAL_STATIC_LINK_OPTION = foreign.getbytes( \"$ldstaticopt\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # shared link additional option
  ldsharedopt=`$autoconfdir/ldsharedopt --user=$user --tmp=$tmp $libdir  --cc="$cc" --posixos="$posixos"`
  echo "#undef ADDITIONAL_SHARED_LINK_OPTION" >> $bigloo_config_h
  echo "#define ADDITIONAL_SHARED_LINK_OPTION \"$ldsharedopt\"" >> $bigloo_config_h
  echo "  public static final byte[] ADDITIONAL_SHARED_LINK_OPTION = \"$ldsharedopt\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] ADDITIONAL_SHARED_LINK_OPTION = foreign.getbytes( \"$ldsharedopt\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # Have bigloo_abort? (Under Windows, DLLs cannot reference symbols that will only be provided by executables)
  echo "#undef BGL_HAVE_BIGLOO_ABORT" >> $bigloo_config_h
  echo "#define BGL_HAVE_BIGLOO_ABORT 0" >> $bigloo_config_h
  echo "  public static final boolean BGL_HAVE_BIGLOO_ABORT = false;" >> $bigloo_config_jvm
  echo "  public static readonly bool BGL_HAVE_BIGLOO_ABORT = false;" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # Heap debug C compilation option
  echo "   heap debugging copt: $backptrflags"
  echo "#undef BGL_HEAP_DEBUG_COPT" >> $bigloo_config_h
  echo "#define BGL_HEAP_DEBUG_COPT \"$backptrflags\"" >> $bigloo_config_h
  echo "  public static final byte[] BGL_HEAP_DEBUG_COPT = \"$backptrflags\".getBytes();" >> $bigloo_config_jvm
  echo "  public static readonly byte[] BGL_HEAP_DEBUG_COPT = foreign.getbytes( \"$backptrflags\" );" >> $bigloo_config_dotnet
  echo "" >> $bigloo_config_h

  # bdb configuration
  echo "#undef BGL_HAVE_BDB" >> $bigloo_config_h
  if [ "$bee" = "partial" ]; then
    echo "   bdb library installation: no"
    echo "#define BGL_HAVE_BDB 0" >> $bigloo_config_h
    echo "  public static final boolean BGL_HAVE_BDB = false;" >> $bigloo_config_jvm
    echo "  public static readonly bool BGL_HAVE_BDB = false;" >> $bigloo_config_dotnet
  else
    echo "   bdb library installation: yes"
    echo "#define BGL_HAVE_BDB 1" >> $bigloo_config_h
    echo "  public static final boolean BGL_HAVE_BDB = true;" >> $bigloo_config_jvm
    echo "  public static readonly bool BGL_HAVE_BDB = true;" >> $bigloo_config_dotnet
  fi
  echo "" >> $bigloo_config_h

  # Java configuration
  if [ "$jvmbackend" = "yes" -o "$jvmbackend" = "force" ]; then
    if [ "$jshell" != "sh" ]; then
       if [ "$jshell" != "msdos" ]; then
          echo "*** ERROR:configure:Illegal Java shell \"$jshell\" (should be either \"sh\" or \"msdos\")";
          exit 3
       fi
    fi

    if [ "$jvmbackend" = "yes" ]; then
      if [ "$posixos" = "cygwin" -a "$cygwindosjvm" = "yes" ]; then
        cpsep=";";
      else
        cpsep=":";
      fi
      $autoconfdir/javatest --java=$java \
                            --jflags=$jflags \
                            --jvflags=$jvflags \
                            --javac=$javac \
                            --jcflags=$jcflags \
                            --user=$user \
                            --tmp=$tmp \
                            --cpsep="$cpsep"

      if [ $? = 0 ]; then
        echo "   java: yes"
      else
        echo "   java: no"
        echo "*** ERROR:configure:Can't configure Java. Command:"
        echo "$autoconfdir/javatest --java=$java --jflags=$jflags --jvflags=$jvflags --javac=$javac --jcflags=$jcflags --user=$user --tmp=$tmp --cpsep=\"$cpsep\""
        echo "failed unexpectedly (see configure.log for details)."
        echo ""
        echo "To give up with the JVM backend, use:"
        echo "  ./configure --jvm=no"
        exit 3
      fi
    fi
    java_configured=yes

    echo "#undef BGL_JAVA" >> $bigloo_config_h
    echo "#define BGL_JAVA \"$java\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_JAVA = \"$java\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_JAVA = foreign.getbytes( \"$java\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_JAVA_OPT" >> $bigloo_config_h
    echo "#define BGL_JAVA_OPT \"$jflags\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_JAVA_OPT = \"$jflags\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_JAVA_OPT = foreign.getbytes( \"$jflags\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_JAVA_VOPT" >> $bigloo_config_h
    echo "#define BGL_JAVA_VOPT \"$jvflags\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_JAVA_VOPT = \"$jvflags\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_JAVA_VOPT = foreign.getbytes( \"$jvflags\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_JAVA_SHELL" >> $bigloo_config_h
    echo "#define BGL_JAVA_SHELL \"$jshell\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_JAVA_SHELL = \"$jshell\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_JAVA_SHELL = foreign.getbytes( \"$jshell\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_JAR" >> $bigloo_config_h
    echo "#define BGL_JAR \"$jar\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_JAR = \"$jar\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_JAR = foreign.getbytes( \"$jar\" );" >> $bigloo_config_dotnet
  else
    echo "#undef BGL_JAVA" >> $bigloo_config_h
    echo "#define BGL_JAVA \"java\"" >> $bigloo_config_h
    echo "#undef BGL_JAVA_OPT" >> $bigloo_config_h
    echo "#define BGL_JAVA_OPT \"\"" >> $bigloo_config_h
    echo "#undef BGL_JAVA_VOPT" >> $bigloo_config_h
    echo "#define BGL_JAVA_VOPT \"\"" >> $bigloo_config_h
    echo "#undef BGL_JAR" >> $bigloo_config_h
    echo "#define BGL_JAR \"\"" >> $bigloo_config_h
    echo "#undef BGL_JAVA_SHELL" >> $bigloo_config_h
    echo "#define BGL_JAVA_SHELL \"sh\"" >> $bigloo_config_h
  fi

  # .NET configuration
  if [ "$dotnetbackend" = "yes" -o "$dotnetbackend" = "force" ]; then
    if [ "$dotnetshell" != "sh" ]; then
       if [ "$dotnetshell" != "msdos" ]; then
          echo "*** ERROR:configure:Illegal .NET shell \"$dotnetshell\" (should be either \"sh\" or \"msdos\")";
          exit 3
       fi
    fi

    if [ "$dotnetbackend" = "yes" ]; then
      if [ "$posixos" = "cygwin" -a "$cygwindosdotnet" = "yes" ]; then
        cpsep=";";
      else
        cpsep=":";
      fi
      $autoconfdir/dotnettest --clr=$dotnetclr \
                              --clropt="$dotnetclropt" \
                              --clrld=$dotnetclrld \
                              --cscc=$dotnetcscc \
                              --user=$user \
                              --tmp=$tmp \
                              --cpsep="$cpsep"

      if [ $? = 0 ]; then
        echo "   .NET: yes"
      else
        echo "   .NET: no"
        echo "*** ERROR:configure:Can't configure .NET. Command:"
        echo "$autoconfdir/dotnet --clr=$dotnetclr --clropt=$dotnetclropt --clrld=$dotnetclrld --cscc=$dotnetcscc --user=$user --tmp=$tmp --cpsep=\"$cpsep\""
        echo "failed unexpectedly (see configure.log for details)."
        echo ""
        echo "To give up with the .NET backend, use:"
        echo "  ./configure --dotnet=no"
        exit 3
      fi
    fi
    dotnet_configured=yes

    echo "" >> $bigloo_config_h
    echo "#undef BGL_DOTNET_LD" >> $bigloo_config_h
    echo "#define BGL_DOTNET_LD \"$dotnetld\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_LD = \"$dotnetld\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_LD = foreign.getbytes( \"$dotnetld\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_DOTNET_LD_STYLE" >> $bigloo_config_h
    echo "#define BGL_DOTNET_LD_STYLE \"$dotnetldstyle\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_LD_STYLE = \"$dotnetldstyle\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_LD_STYLE = foreign.getbytes( \"$dotnetldstyle\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_DOTNET_CLR" >> $bigloo_config_h
    echo "#define BGL_DOTNET_CLR \"$dotnetclr\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_CLR = \"$dotnetclr\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_CLR = foreign.getbytes( \"$dotnetclr\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_DOTNET_CLR_STYLE" >> $bigloo_config_h
    echo "#define BGL_DOTNET_CLR_STYLE \"$dotnetclrstyle\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_CLR_STYLE = \"$dotnetclrstyle\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_CLR_STYLE = foreign.getbytes( \"$dotnetclrstyle\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_DOTNET_CLR_OPT" >> $bigloo_config_h
    echo "#define BGL_DOTNET_CLR_OPT \"$dotnetclropt\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_CLR_OPT = \"$dotnetclropt\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_CLR_OPT = foreign.getbytes( \"$dotnetclropt\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_DOTNET_SHELL" >> $bigloo_config_h
    echo "#define BGL_DOTNET_SHELL \"$dotnetshell\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_SHELL = \"$dotnetshell\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_SHELL = foreign.getbytes( \"$dotnetshell\" );" >> $bigloo_config_dotnet

    echo "" >> $bigloo_config_h
    echo "#undef BGL_DOTNET_ASM" >> $bigloo_config_h
    echo "#define BGL_DOTNET_ASM \"$dotnetasm\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_ASM = \"$dotnetld\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_ASM = foreign.getbytes( \"$dotnetld\" );" >> $bigloo_config_dotnet

  else
    echo "" >> $bigloo_config_h
    echo "#undef BGL_DOTNET_LD" >> $bigloo_config_h
    echo "#define BGL_DOTNET_LD \"\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_LD = \"\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_LD = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet

    echo "#undef BGL_DOTNET_LD_STYLE" >> $bigloo_config_h
    echo "#define BGL_DOTNET_LD_STYLE \"\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_LD_STYLE = \"\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_LD_STYLE = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet

    echo "#undef BGL_DOTNET_CLR" >> $bigloo_config_h
    echo "#define BGL_DOTNET_CLR \"\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_CLR = \"\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_CLR = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet

    echo "#undef BGL_DOTNET_CLR_STYLE" >> $bigloo_config_h
    echo "#define BGL_DOTNET_CLR_STYLE \"\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_CLR_STYLE = \"\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_CLR_STYLE = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet

    echo "#undef BGL_DOTNET_CLR_OPT" >> $bigloo_config_h
    echo "#define BGL_DOTNET_CLR_OPT \"\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_CLR_OPT = \"\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_CLR_OPT = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet

    echo "#undef BGL_DOTNET_SHELL" >> $bigloo_config_h
    echo "#define BGL_DOTNET_SHELL \"\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_SHELL = \"\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_SHELL = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet

    echo "#undef BGL_DOTNET_ASM" >> $bigloo_config_h
    echo "#define BGL_DOTNET_ASM \"\"" >> $bigloo_config_h
    echo "  public static final byte[] BGL_DOTNET_ASM = \"\".getBytes();" >> $bigloo_config_jvm
    echo "  public static readonly byte[] BGL_DOTNET_ASM = foreign.getbytes( \"\" );" >> $bigloo_config_dotnet
  fi

  echo "" >> $bigloo_config_h
  echo "#undef BGL_IMPORT" >> $bigloo_config_h
  echo "#define BGL_IMPORT extern" >> $bigloo_config_h

  echo "" >> $bigloo_config_h
  echo "#undef BGL_EXPORTED_DECL" >> $bigloo_config_h
  echo "#define BGL_EXPORTED_DECL extern" >> $bigloo_config_h

  echo "" >> $bigloo_config_h
  echo "#undef BGL_EXPORTED_DEF" >> $bigloo_config_h
  echo "#define BGL_EXPORTED_DEF" >> $bigloo_config_h

  echo "" >> $bigloo_config_h
  echo "#undef BGL_RUNTIME_DECL" >> $bigloo_config_h
  echo "#define BGL_RUNTIME_DECL extern" >> $bigloo_config_h

  echo "" >> $bigloo_config_h
  echo "#undef BGL_RUNTIME_DEF" >> $bigloo_config_h
  echo "#define BGL_RUNTIME_DEF" >> $bigloo_config_h

  echo "}" >> $bigloo_config_jvm

  echo "}" >> $bigloo_config_dotnet
  echo "}" >> $bigloo_config_dotnet

  echo "" >> $bigloo_config_h
  echo "#endif" >> $bigloo_config_h

  echo
fi

#*---------------------------------------------------------------------*/
#*    bigloo_config.el                                                 */
#*---------------------------------------------------------------------*/
if [ $action = "all" -o $action = "bigloo_config_el" ]; then
  # Tell what we are doning
  echo "Configuring $bigloo_config_el:"

  rm -f $bigloo_config_el 2> /dev/null
  echo ";; Automatically generated file (don't edit) */" > $bigloo_config_el
  echo ";; `date`" >> $bigloo_config_el
  echo "" >> $bigloo_config_el
  echo "(provide 'bmacs-config)" >> $bigloo_config_el
  echo "(defvar bmacs-docdir \"$docdir\")" >> $bigloo_config_el
  echo "(defvar bmacs-lispdir \"$emacslisppath\")" >> $bigloo_config_el
  echo ""
fi
  
#*---------------------------------------------------------------------*/
#*    Makefile.config                                                  */
#*    -------------------------------------------------------------    */
#*    This part of the configure script produces the file              */
#*    Makefile.config. This file contains machine dependant            */
#*    informations and location where Bigloo is to be installed.       */
#*---------------------------------------------------------------------*/
if [ $action = "all" -o $action = "Makefile.config" ]; then

  # Tell what we are doning
  echo "Configuring $makefile_cfg":

  # We create an unexisting temporary file name
  name=$tmp/foo
  while( test -f "$name.s" -o -f "$name.o" ); do
    name="$name"x;
  done

  # We first cleanup the file
  rm -f $makefile_cfg 2> /dev/null
  touch $makefile_cfg

  # The -pic C compiler options
  if [ "$cpicflags" = "no" ]; then
    cpicflags=""
  else
    if [ "$ldopt" = "no-share" ]; then
      cpicflags=""
    else
      if [ "$cpicflags" = "demanded" -o "$cpicflags " = " " ]; then
        cpicflags=`$autoconfdir/ccpic --user=$user --tmp=$tmp --cc="$cc" --cflags="$cpicflags"`
        if [ "$cpicflags " = " " ]; then
          cpicflags=`$autoconfdir/ccpic2 --user=$user --tmp=$tmp --cc="$cc" --cpicflags="$cpicflags" --cflags="$cflags" --ld="$ld" --ldopt="$ldopt"`
        fi
      fi
    fi
  fi

  if [ "$cpicflags " = " " ]; then
    cpicflags=-DBGL_NO_PIC;
  fi

  # The Bigloo release number
  echo "RELEASE=$release" >> $makefile_cfg
  echo >> $makefile_cfg

  # The rm command
  echo "RM=/bin/rm" >> $makefile_cfg
  echo >> $makefile_cfg

  # The bee support
  echo "INSTALLBEE=$bee" >> $makefile_cfg
  echo >> $makefile_cfg

  # The Boot directory
  echo "BOOTDIR=$bootdir" >> $makefile_cfg
  echo "BOOTBINDIR=$bootdir/bin" >> $makefile_cfg
  echo "BOOTLIBDIR=$bootdir/lib/$release" >> $makefile_cfg
  echo >> $makefile_cfg

  # Directories
  echo "DESTDIR=" >> $makefile_cfg
  echo "BINDIR=$bindir" >> $makefile_cfg
  echo 'LIBDIR=$(DESTDIR)'"$libdir" >> $makefile_cfg
  echo "FILDIR=$fildir" >> $makefile_cfg
  echo 'ZIPDIR=$(DESTDIR)'"$zipdir" >> $makefile_cfg
  echo 'SYSZIPDIR=$(DESTDIR)'"$syszipdir" >> $makefile_cfg
  echo 'DLLDIR=$(DESTDIR)'"$dlldir" >> $makefile_cfg
  echo 'SYSDLLDIR=$(DESTDIR)'"$sysdlldir" >> $makefile_cfg
  echo 'MANDIR=$(DESTDIR)'"$mandir" >> $makefile_cfg
  echo 'INFODIR=$(DESTDIR)'"$infodir" >> $makefile_cfg
  echo 'DOCDIR=$(DESTDIR)'"$docdir" >> $makefile_cfg
  echo "TMP=$tmp" >> $makefile_cfg
  echo >> $makefile_cfg

  # Native backend
  echo "NATIVEBACKEND=$nativebackend" >> $makefile_cfg

  # The basename
  echo "LIBRARYNAME=$libraryname" >> $makefile_cfg
  echo >> $makefile_cfg

  # The C compiler
  echo "CC=$cc" >> $makefile_cfg
  echo "CFLAGS=$coflags $cflags" >> $makefile_cfg
  echo "CSTRIPFLAGS=$csflags" >> $makefile_cfg
  echo "CPICFLAGS=$cpicflags" >> $makefile_cfg
  echo "CFLAGS_P=$""(CFLAGS) $cpflags" >> $makefile_cfg
  echo "CGCFLAGS=$cgcflags $cgcfinalflags $gcspecial" >> $makefile_cfg
  echo "EXTRALIBS=$extralibs" >> $makefile_cfg
  echo "BACKPTRFLAGS=$backptrflags" >> $makefile_cfg
  echo >> $makefile_cfg

  # The GC library
  echo "   GC dir: $gcdir"
  echo "GCLIB=$gclib" >> $makefile_cfg
  if [ $customgc = "yes" ]; then
     echo "GCCUSTOM=yes" >> $makefile_cfg
     echo 'GCDIR=$(BOOTDIR)/gc-boehm' >> $makefile_cfg
     echo 'GCINCLUDE=-I$(GCDIR) -I$(GCDIR)/include -I$(GCDIR)/include/private' >> $makefile_cfg
  else
     echo "GCCUSTOM=no" >> $makefile_cfg
     echo "GCDIR=$gcdir" >> $makefile_cfg
     echo 'GCINCLUDE=-I$(GCDIR) -I$(GCDIR)/private' >> $makefile_cfg
  fi
  echo >> $makefile_cfg

  # additional bigloo compiler link flags (some architecture such as AIX
  # require a special to link huge executable)
  ldextraopt=`$autoconfdir/ldextraopt --user=$user --tmp=$tmp --cc="$cc" --posixos="$posixos"`

  echo "EXTRA_LD_OPT=$ldextraopt" >> $makefile_cfg
  if [ $sharedcompiler = "yes" ]; then
     echo "SHRD_COMP=yes" >> $makefile_cfg;
  else
     echo "SHRD_COMP=no" >> $makefile_cfg;
  fi

  if [ $sharedbde = "yes" ]; then
     echo "SHRD_BDE_OPT=" >> $makefile_cfg;
  else
     echo "SHRD_BDE_OPT=-static-bigloo" >> $makefile_cfg;
  fi

  # Executable suffix
  echo "EXE_SUFFIX=$exe" >> $makefile_cfg;

  # The assembler
  echo "   checking $as"
  as=`$autoconfdir/ascpp --user=$user --tmp=$tmp -as="$as" -cc="$cc" --name=$name`
  if [ $? != "0" ]; then
     echo "*** ERROR:configure:as. Aborting";
     exit 1;
  fi

  if [ "$as " = " " ]; then
    echo "*** ERROR:configure:$as:can't find as that invokes cpp,";
    echo "set as variable."
    rm -f $name.s $name.o
    exit 1;
  else
    echo "AS=$as" >> $makefile_cfg
  fi
  echo >> $makefile_cfg

  # Ar checking
  echo "   checking $ar $arflags"

  (cd $tmp;
   compile="$ar $arflags $name.a $name.o > /dev/null 2> /dev/null";
   if eval $compile; then
     /bin/rm -f $name.s $name.o $name.a
   else
      arflags="-q -c";
      compile="$ar $arflags $name.a $name.o > /dev/null 2> /dev/null";
      if eval $compile; then
        /bin/rm -f $name.s $name.o $name.a
      else
        echo "*** ERROR:configure:ar:Can't automatically setup ar flags";
        echo "Please, set ar flags up inside ./configure";
        /bin/rm -f $name.s $name.o $name.a;
        exit 1
      fi
   fi) || exit $*
  echo "AR=$ar" >> $makefile_cfg
  echo "ARFLAGS=$arflags" >> $makefile_cfg

  # Does the system require ranlib?
  if( test `$autoconfdir/ranlib --user=$user --tmp=$tmp --cc="$cc"` = "0" ); then
     echo "   ranlib: no"
     echo "RANLIB=true" >> $makefile_cfg
  else
     echo "   ranlib: yes"
     echo "RANLIB=ranlib" >> $makefile_cfg
  fi

  # The shared libraries
  if [ "$ldopt" = "no-share" ]; then
    echo "SHAREDLIBRARYSUPPORT=no" >> $makefile_cfg
    echo "LDPRELOADSUPPORT=no" >> $makefile_cfg
    echo "LD=true# (true means no dynamic library)" >> $makefile_cfg

    echo "LDSONAME=" >> $makefile_cfg
  else
    echo "SHAREDLIBRARYSUPPORT=yes" >> $makefile_cfg
    echo "LDPRELOADSUPPORT=$ldpreload" >> $makefile_cfg
    echo "LD=$ld $ldopt" >> $makefile_cfg

    # shared link additional soname option
    ldsoname=`$autoconfdir/ldsoname --user=$user --tmp=$tmp $libdir --cc="$cc" --ld="$ld" --posixos="$posixos"`
    echo "LDSONAME=$ldsoname" >> $makefile_cfg
  fi
  echo >> $makefile_cfg

  # The suffix of shared library
  echo "SHAREDSUFFIX=$sharedsuffix" >> $makefile_cfg
  echo >> $makefile_cfg

  # The dlopen facility
  if [ "$dlopen" != "0" ]; then
    echo "DLOPENSUPPORT=yes" >> $makefile_cfg
  else
    echo "DLOPENSUPPORT=no" >> $makefile_cfg
  fi

  echo >> $makefile_cfg
  # Does the system supports threads
  if [ "$gcthread " = " " ]; then
     gcthread=`$autoconfdir/thread --user=$user --tmp=$tmp --cc="$cc" --cflags="$cgcfinalflags" --posixos="$posixos"`;
  fi
  echo "   gcthread: $gcthread"
  echo "CGCTHREADFLAGS=$gcthread" >> $makefile_cfg

  # find out the C library for posix threads
  if [ "$pthreadlibs " = " " ]; then
     pthreadlibs=`$autoconfdir/pthread --user=$user --tmp=$tmp --cc="$cc" --posixos="$posixos"`;
  fi
  echo "   pthreadlibs: $pthreadlibs"
  echo "PTHREADLIBS=$pthreadlibs" >> $makefile_cfg

  # Patch the code of the thread when using non custom GC
  if [ "$pthreadlibs" != "no" ]; then
    if [ $customgc = "no" ]; then
      cat fthread/src/Misc/fthread.init.in | sed -e "s|bigloogc_fth|$gclib|g" >  fthread/src/Misc/fthread.init
    else
      cp fthread/src/Misc/fthread.init.in fthread/src/Misc/fthread.init
    fi
  fi

  # Does the system supports strip
  if( `$autoconfdir/strip --strip=$strip --user=$user --tmp=$tmp --cc="$cc"` ); then
     echo "   strip: $strip"
     echo "STRIP=$strip" >> $makefile_cfg
     echo "" >> $makefile_cfg
  else
     echo "   strip: no"
     echo "STRIP=true" >> $makefile_cfg
     echo "" >> $makefile_cfg
  fi

  # Display emacs
  echo "   emacs: $emacsversion"
  echo "   emacslisppath: $emacslisppath"
  echo "EMACS=$emacs" >> $makefile_cfg
  echo "EMACSDIR=$emacslisppath" >>  $makefile_cfg
  echo "EMACSBRAND=$emacsversion" >> $makefile_cfg
  echo "EWARN=$emacswarning" >> $makefile_cfg
  echo >> $makefile_cfg

  # bmask
  echo "BMASK=$bmask" >> $makefile_cfg
  echo >> $makefile_cfg

  # The info version
  if [ "$configureinfo" = "yes" ]; then
    infoinfo=`$autoconfdir/info --user=$user \
                                --tmp=$tmp \
                                --makeinfo="$makeinfo" \
                                --texi2dvi="$texi2dvi" \
                                --texi2dviopt="$texi2dviopt" \
                                --texi2pdf="$texi2pdf" \
                                --texi2html="$texi2html" \
                                --texi2htmlopt="$texi2htmlopt"`

    if [ "$?" = "0" ]; then
       for p in $infoinfo; do
          case $p in
            "")
               break;;
            makeinfover=*)
               makeinfover="`echo $p | sed 's/^[-a-z_.]*=//'`";;
            texi2dvi=*)
               texi2dvi="`echo $p | sed 's/^[-a-z0-9_.]*=//'`";;
            texi2dviopt=*)
               texi2dviopt="`echo $p | sed 's/^[-a-z0-9_.]*=//'`";;
            texi2pdf=*)
               texi2pdf="`echo $p | sed 's/^[-a-z0-9_.]*=//'`";;
            texi2html=*)
               texi2html="`echo $p | sed 's/^[-a-z0-9_.]*=//'`";;
            texi2htmlopt=*)
               texi2htmlopt="`echo $p | sed 's/^[^=]*=//'`";;
          esac
       done
       if [ "$makeinfover" = "old" ]; then
           makeinfoopt="-D oldinfo"
       fi

       echo "MAKEINFO=$makeinfo" >> $makefile_cfg
       echo "MAKEINFOOPT=$makeinfoopt" >> $makefile_cfg
       echo "TEXI2DVI=$texi2dvi" >> $makefile_cfg
       echo "TEXI2DVIOPT=$texi2dviopt" >> $makefile_cfg
       echo "TEXI2HTML=$texi2html" >> $makefile_cfg
       echo "TEXI2HTMLOPT=$texi2htmlopt" >> $makefile_cfg
       echo "TEXI2PDF=$texi2pdf" >> $makefile_cfg
    else
       echo "   makeinfo: no"
       makeinfo=no
       makeinfoopt=
       texi2dvi=
       texi2dviopt=
       texi2html=
       texi2htmlopt=
       texi2pdf=

       echo "MAKEINFO=" >> $makefile_cfg
    fi
  fi

  # The info installation
  echo "   checking install-info"
  if [ "$iinfo " = " " ]; then
    installinfo=`$autoconfdir/installinfo --user=$user --tmp=$tmp --cc=$cc --exe=$exe`
  else
    installinfo=`$autoconfdir/installinfo --user=$user --tmp=$tmp --cc=$cc --installinfo=$iinfo --exe=$exe`
  fi

  if [ "installinfo " = " " ]; then
     echo "   install-info: no"
     echo "INSTALLINFO=\"\"" >> $makefile_cfg
  else
     installinfodir=`$autoconfdir/installinfodir --user=$user --tmp=$tmp --cc=$cc --installinfo=$installinfo --exe=$exe`
     echo "   install-info: $installinfo"
     echo "   install-info dir opt: $installinfodir"
     echo "INSTALLINFO=$installinfo" >> $makefile_cfg
     echo "INSTALLINFODIROPT=$installinfodir" >> $makefile_cfg
  fi

  # The java configuration
  if [ "$jvmbackend" = "yes" -o "$jvmbackend" = "force" ]; then

    if [ "$jvmbackend" = "yes" ]; then
      $autoconfdir/ziptest --zip=$zip --zflags=$zflags --user=$user --tmp=$tmp

      if [ $? = 0 ]; then
         echo "   zip: yes"
      else
         echo "   zip: no"
         echo "*** ERROR:configure:Can't configure JVM back-end"
         exit 3
      fi

      $autoconfdir/jartest --jar=$jar --user=$user --tmp=$tmp

      if [ $? = 0 ]; then
         echo "   jar: yes"
      else
         echo "   jar: no"
         echo "*** ERROR:configure:Can't configure JVM back-end"
         exit 3
      fi

      if [ "$java_configured" = "no" ]; then
        $autoconfdir/javatest --java=$java --jflags=$jflags --jvflags=$jvflags \
                              --javac=$javac --jcflags=$jcflags --user=$user --tmp=$tmp

        if [ $? = 0 ]; then
           echo "   java: yes"
        else
           echo "   java: no"
           echo "*** ERROR:configure:Can't configure JVM back-end"
           exit 3
        fi
        java_configured=yes
      fi
    else
        java_configured=yes
    fi

    echo "" >> $makefile_cfg
    echo "JVMBACKEND=yes" >> $makefile_cfg
    echo "JAVA=$java" >> $makefile_cfg
    echo "JFLAGS=$jflags" >> $makefile_cfg
    echo "JVFLAGS=$jvflags" >> $makefile_cfg
    echo "JAVAC=$javac" >> $makefile_cfg
    echo "JCFLAGS=$jcflags" >> $makefile_cfg
    echo "ZIP=$zip" >> $makefile_cfg
    echo "ZFLAGS=$zflags" >> $makefile_cfg
    echo "JAR=$jar" >> $makefile_cfg
    echo "JSHELL=$jshell" >> $makefile_cfg

    # How to link the Java files
    echo "" >> $makefile_cfg
    echo "JVMCPATH=$jvmcpath" >> $makefile_cfg
    echo "JVMRCPATH=$jvmrcpath" >> $makefile_cfg
    echo "JVMFTCPATH=$jvmftcpath" >> $makefile_cfg
    echo "JVMCLASSPATHSEP=\"$cpsep\"" >> $makefile_cfg

    # Cygwin prefix
    if [ "$posixos" = "cygwin" ]; then
      echo "" >> $makefile_cfg
      echo CYGWINPREFIX=`echo "$cygwindospath" | sed -e 's/\\\\/\\\\\\\\/g'` >> $makefile_cfg
      bigloozip=$bootdir/lib/$release
      bigloozip=`echo $bigloozip | sed -e 's/\/cygdrive\/\([a-z]\)\//\1:\//')`        # corrects pathes like /cygdrive/...
      bigloozip=`echo $bigloozip | sed -e "s/^\//$cygwindospath\\\\\\\\\\\\\\\\/")`   # corrects pathes like /usr...
      echo "CYGWINJVMPATH=-classpath \".;"`echo $bigloozip | sed -e 's/\//\\\\\\\\/g'`"\\\\bigloo.zip\"" >> $makefile_cfg
    fi
  else
    echo "" >> $makefile_cfg
    echo "JVMBACKEND=no" >> $makefile_cfg
  fi

  # The dotnet configuration
  if [ "$dotnetbackend" = "yes" -o "$dotnetbackend" = "force" ]; then
    # Dotnet configuration
    echo "" >> $makefile_cfg
    echo "DOTNETBACKEND=yes" >> $makefile_cfg
    echo "DOTNETCSCC=$dotnetcscc" >> $makefile_cfg
    echo "DOTNETCSCCSTYLE=$dotnetcsccstyle" >> $makefile_cfg
    echo "DOTNETASM=$dotnetasm" >> $makefile_cfg
    echo "DOTNETLD=$dotnetld" >> $makefile_cfg
    echo "DOTNETLDSTYLE=$dotnetldstyle" >> $makefile_cfg
    echo "" >> $makefile_cfg
    echo "DOTNETFTDLLPATH=$dotnetftdllpath" >> $makefile_cfg
    echo "DOTNETLINKBIGLOODLL=$dotnetlinkbigloodll" >> $makefile_cfg
  else
    echo "" >> $makefile_cfg
    echo "DOTNETBACKEND=no" >> $makefile_cfg
  fi
fi

# Bigloo compilation flags
echo "" >> $makefile_cfg
echo "BFLAGS=-O3" >> $makefile_cfg

# script extension
echo "" >> $makefile_cfg
case $posixos in
  cygwin)
    echo "SCRIPTEXTENSION=.bat" >> $makefile_cfg;;
  *)
   echo "SCRIPTEXTENSION=" >> $makefile_cfg;;
esac

# C Object suffix
echo "C_OBJ_EXTENSION=$cobj" >> $makefile_cfg
echo >> $makefile_cfg

#*---------------------------------------------------------------------*/
#*    Ok, we are done now                                              */
#*---------------------------------------------------------------------*/
bcke="native (yes)"
if [ "$jvmbackend" = "yes" -o "$jvmbackend" = "force" ]; then
  bcke="$bcke JVM (yes)"
else
  bcke="$bcke JVM (no)"
fi
if [ "$dotnetbackend" = "yes" -o "$dotnetbackend" = "force" ]; then
  bcke="$bcke .NET (yes)"
else
  bcke="$bcke .NET (no)"
fi
echo  >> configure.log
echo  >> configure.log
echo "** Configuration summary **" >> configure.log
echo  >> configure.log
echo "Release features:" >> configure.log
echo "  Bigloo release number................. $release" >> configure.log
echo "  Bigloo supported backends............. $bcke" >> configure.log
echo "  Bigloo default backend................ $defaultbackend" >> configure.log
if [ "$mode" = "benchmark" ]; then
  echo "  Benchmark mode........................ yes" >> configure.log
else
  echo "  Benchmark mode........................ no" >> configure.log
fi
if [ $customgc = "yes" ];then
   echo "  Bigloo gc............................. custom ($gclib-$release)" >> configure.log
else
   echo "  Bigloo gc............................. standard ($gclib, $stdgcdir)" >> configure.log
fi
if [ "$pthreadlibs" = "no" ]; then
  echo "  support for native threads............ no" >> configure.log
else
  echo "  support for native threads............ yes" >> configure.log
fi
if [ "$ldopt" = "no-share" ]; then
  echo "  support for dynamic libraries......... no" >> configure.log
else
  echo "  support for dynamic libraries......... yes" >> configure.log
fi
echo "  Bee support........................... $bee" >> configure.log
echo >> configure.log
echo "Directories where Bigloo will be installed:" >> configure.log
echo "  binaries.............................. $bindir" >> configure.log
echo "  libraries............................. $libdir" >> configure.log
echo "  files directory....................... $fildir" >> configure.log
echo "  standard zip.......................... $zipdir" >> configure.log
if [ "$syszipdir " != "$zipdir " ]; then
  echo "  standard zip (os dependent)........... $syszipdir" >> configure.log
fi
echo "  standard dll.......................... $dlldir" >> configure.log
if [ "$sysdlldir " != "$dlldir " ]; then
  echo "  standard dll (os dependent)........... $sysdlldir" >> configure.log
fi
echo "  manual pages.......................... $mandir" >> configure.log
echo "  info documentation.................... $infodir" >> configure.log
echo "  lisp files............................ $lispdir" >> configure.log
echo "  temporary dir......................... $tmp" >> configure.log
echo >> configure.log
echo "Compilers and linkers:" >> configure.log
echo "  C compiler used....................... $cc" >> configure.log
echo "  options for compiling................. $cflags" >> configure.log
echo "  options for optimizing................ $coflags" >> configure.log
echo "  options for stripping................. $csflags" >> configure.log
echo "  options for PIC code.................. $cpicflags" >> configure.log
echo "  options for profiling................. $cpflags" >> configure.log
echo "  options for linking................... $extralibs" >> configure.log
echo "  assembly.............................. $as" >> configure.log
echo "  static library builder................ $ar" >> configure.log
echo "  shared library builder................ $ld" >> configure.log
echo "  options for building static libs...... $arflags" >> configure.log
echo "  socket libraries...................... $socketlibs" >> configure.log
echo "  thread libraries...................... $pthreadlibs" >> configure.log
if [ "$ldopt" != "no-share" ]; then
  echo "  suffix of shared libraries............ $sharedsuffix" >> configure.log
  echo "  options for linking with shared libs.. $ldopt" >> configure.log
fi
echo "  dynamically linked compiler........... $sharedcompiler" >> configure.log
echo "  dynamically linked bde tools.......... $sharedbde" >> configure.log
echo >> configure.log
if [ "$jvmbackend" = "yes" -o "$jvmbackend" = "force" ]; then
  echo "JVM:" >> configure.log
  if [ "$posixos" = "cygwin" ]; then
    echo "  Cygwin dos path....................... $cygwindospath" >> configure.log
  fi
  echo "  java default shell.................... $jshell" >> configure.log
  echo "  javac................................. $javac" >> configure.log
  echo "  options for compiling java............ $jcflags" >> configure.log
  echo "  java.................................. $java" >> configure.log
  echo "  options for running java.............. $jflags" >> configure.log
  echo "  options no byte code verification..... $jvflags" >> configure.log
  echo "  zip................................... $zip" >> configure.log
  echo "  zip flags............................. $zflags" >> configure.log
  echo "  jar................................... $jar" >> configure.log
fi
echo >> configure.log
if [ "$dotnetbackend" = "yes" -o "$dotnetbackend" = "force" ]; then
  echo ".NET:" >> configure.log
  if [ "$posixos" = "cygwin" ]; then
    echo "  Cygwin dos path....................... $cygwindospath" >> configure.log
  fi
  echo "  .NET default shell.................... $dotnetshell" >> configure.log
  echo "  .NET linker........................... $dotnetld (style=$dotnetldstyle)" >> configure.log
  echo "  .C# compiler.......................... $dotnetcscc (style=$dotnetcsccstyle)" >> configure.log
  echo "  clr................................... $dotnetclr (style=$dotnetclrstyle)" >> configure.log
  echo "  options to run the clr................ $dotnetclropt" >> configure.log
fi
echo >> configure.log
echo "GC configuration:" >> configure.log
if [ $customgc = "yes" ]; then
  echo "  options for compiling the collector... $cgcflags $cgcfinalflags $gcspecial" >> configure.log
  echo "  options for compiling with threads.... $gcthread" >> configure.log
  echo "  options for compiling with debug...... $backptrflags" >> configure.log
else
  echo "  pre-installed standard GC............. $gclib" >> configure.log
fi
echo >> configure.log
echo "Emacs configuration:" >> configure.log
echo "  emacs................................. $emacs" >> configure.log
echo "  emacs brand........................... $emacsversion" >> configure.log
if [ $emacsversion = "generic" ]; then
  echo "  lisp directory........................ no support (update emacs)" >> configure.log
else
  echo "  lisp directory........................ $emacslisppath" >> configure.log
fi
echo >> configure.log
echo "Misc configuration:" >> configure.log
echo "  mask for installed files.............. $bmask" >> configure.log
echo  >> configure.log
echo "System configuration:" >> configure.log
echo "  hardware tuning....................... $hardtune" >> configure.log
echo "  operating system...................... $posixos" >> configure.log
echo "  default executable name............... $aout" >> configure.log
echo  >> configure.log

#*---------------------------------------------------------------------*/
#*    Ok, we are done now                                              */
#*---------------------------------------------------------------------*/
if [ "$summary" = "yes" ]; then
  bcke="native (yes)"
  if [ "$jvmbackend" = "yes" -o "$jvmbackend" = "force" ]; then
    bcke="$bcke JVM (yes)"
  else
    bcke="$bcke JVM (no)"
  fi
  if [ "$dotnetbackend" = "yes" -o "$dotnetbackend" = "force" ]; then
    bcke="$bcke .NET (yes)"
  else
    bcke="$bcke .NET (no)"
  fi
  echo 
  echo 
  echo "** Configuration summary **"
  echo 
  echo "Release features:"
  echo "  Bigloo release number................. $release"
  echo "  Bigloo supported backends............. $bcke"
  echo "  Bigloo default backend................ $defaultbackend"
  if [ "$mode" = "benchmark" ]; then
    echo "  Benchmark mode........................ yes"
  else
    echo "  Benchmark mode........................ no"
  fi
  if [ $customgc = "yes" ];then
     echo "  Bigloo gc............................. custom ($gclib-$release)"
  else
     echo "  Bigloo gc............................. standard ($gclib, $stdgcdir)"
  fi
  if [ "$pthreadlibs" = "no" ]; then
    echo "  support for native threads............ no"
  else
    echo "  support for native threads............ yes"
  fi
  if [ "$ldopt" = "no-share" ]; then
    echo "  support for dynamic libraries......... no"
  else
    echo "  support for dynamic libraries......... yes"
  fi
  echo "  Bee support........................... $bee"
  echo
  echo "Directories where Bigloo will be installed:"
  echo "  binaries.............................. $bindir"
  echo "  libraries............................. $libdir"
  echo "  files directory....................... $fildir"
  echo "  standard zip.......................... $zipdir"
  if [ "$syszipdir " != "$zipdir " ]; then
    echo "  standard zip (os dependent)........... $syszipdir"
  fi
  echo "  standard dll.......................... $dlldir"
  if [ "$sysdlldir " != "$dlldir " ]; then
    echo "  standard dll (os dependent)........... $sysdlldir"
  fi
  echo "  manual pages.......................... $mandir"
  echo "  info documentation.................... $infodir"
  echo "  lisp files............................ $lispdir"
  echo "  temporary dir......................... $tmp"
  echo
  echo "Emacs configuration:"
  echo "  emacs................................. $emacs"
  echo "  emacs brand........................... $emacsversion"
  if [ $emacsversion = "generic" ]; then
    echo "  lisp directory........................ no support (update emacs)"
  else
    echo "  lisp directory........................ $emacslisppath"
  fi
  echo 
fi
