[project @ 1996-11-22 14:12:39 by simonm]
[ghc-hetmet.git] / configure.in
index 3a57a3c..94624ca 100644 (file)
@@ -12,88 +12,60 @@ dnl * INITIAL SETUP, CHOICE OF PLATFORM(S)
 # Do "./configure --help" to see what flags are available.
 # (Better yet, read the documentation!)
 #
+AC_INIT(mk/platform.mk.in)
+
 # -------------------------------------------------------------------------
-AC_INIT(STARTUP.in)
-#
 # Prepare to generate the following header files
 #
-AC_CONFIG_HEADER(ghc/includes/config.h)
-# and  literate/config.h ???
-# ToDo !!!!!!!!!!!!!!!!
-#
+AC_CONFIG_HEADER(ghc/includes/config.h literate/lit-deatify/config.h)
+
 # No, we don't do `--srcdir'...
 if test x"$srcdir" != 'x.' ; then
     echo "This configuration does not support the \`--srcdir' option."
     exit 1
 fi
 
+hardtop=`pwd`
+hardtop=`echo $hardtop | sed 's|^/tmp_mnt/|/|' | sed 's|^/export/|/|' | sed 's|^/grasp_tmp|/local/grasp_tmp|'`
+echo ''
+echo "*** The top of your build tree is: $hardtop"
+AC_SUBST(hardtop)
+
 # -------------------------------------------------------------------------
 dnl ** choose what blobs to build (ghc,hslibs,haggis,happy,nofib,????)
 
 # set to the name for the dir if doing it, otherwise empty
-DoingGHC='ghc'
 DoingHsLibs=''
 DoingNoFib=''
 DoingHappy=''
 DoingHaggis=''
-DoingLiterate=''
-# the following are not normally changed
-DoingMkWorld='mkworld'
-DoingGlaFpUtils='glafp-utils'
-
 MkWorldSetup='std'
 
-AC_ARG_ENABLE(ghc,
+AC_ARG_ENABLE(hslibs,
    [
 **********************************************************************
 * Configuration options for the Glasgow functional-programming tools *
 **********************************************************************
 
-First, select *which* of the tools you want to build,
-with --{enable,disable}-{ghc,hslibs,nofib,happy,haggis}.
-(The default is: only GHC (Glasgow Haskell compiler).)
+First, select *which* of the tools you want to build, with
+--{enable,disable}-{hslibs,nofib,happy,haggis}.  (Currently, you have to
+build ghc.)
 
-Second, you may set one of a few applies-in-all-cases options.
-For example, --with-tmpdir=/usr/tmp.
+Second, you may set one of a few applies-in-all-cases options.  For
+example, --with-tmpdir=/usr/tmp.
 
-Then you may set various options which are specifically for the
-tools you choose in step 1.  For GHC, perhaps --enable-concurrent.
-For NoFib, perhaps --enable-all-tests.  And so on.
+Then you may set various options which are specifically for the tools you
+choose in step 1.  For GHC, perhaps --enable-concurrent.  For NoFib,
+perhaps --enable-all-tests.  And so on.
 
-The rest of this message lists all of the configure options.  If the
-option is enabled by default, the message says how to disable it.  And
-vice versa.
+The rest of this message lists all of the configure options.  If the option
+is enabled by default, the message says how to disable it.  And vice versa.
 
-If you are confused, don't forget the installation documents that came
-with the software!
+If you are confused, don't forget the installation documents that came with
+the software!
 
 *******************************************************************
-** FOR SELECTING WHICH GLASGOW FP TOOLS TO BUILD:
-
---disable-ghc     do *not* build GHC as part of Glasgow FP tools],
-   [case "$enableval" in
-        yes) DoingGHC='ghc'
-             ;;
-        no)  DoingGHC=''
-             ;;
-        *)   echo "I don't understand this option: --enable-ghc=$enableval"
-             exit 1
-             ;;
-    esac])
-if test "xxx$DoingGHC" = 'xxxghc' -a \( ! -d ghc \) ; then
-    DoingGHC=''
-    echo 'Doing --disable-ghc, as there is no ghc directory'
-fi
-ghc_mkworld_site_ghc_jm='ghc/mkworld/site-ghc.jm'
-ghc_includes_platform_h='ghc/includes/platform.h'
-# duznae work: ghc_includes_config_h='ghc/includes/config.h'
-if test "xxx$DoingGHC" = 'xxx' ; then
-    ghc_mkworld_site_ghc_jm=''
-    ghc_includes_platform_h=''
-#   ghc_includes_config_h=''
-fi
-
-AC_ARG_ENABLE(hslibs,
+** FOR SELECTING WHICH GLASGOW FP TOOLS TO BUILD:]
    [--enable-hslibs   build suite of Haskell libraries],
    [case "$enableval" in
         yes) DoingHsLibs='hslibs'
@@ -108,10 +80,6 @@ if test "xxx$DoingHsLibs" = 'xxxhslibs' -a \( ! -d hslibs \) ; then
     DoingHsLibs=''
     echo 'Doing --disable-hslibs, as there is no hslibs directory'
 fi
-hslibs_mkworld_site_hslibs_jm='hslibs/mkworld/site-hslibs.jm'
-if test "xxx$DoingHsLibs" = 'xxx' ; then
-    hslibs_mkworld_site_hslibs_jm=''
-fi
 
 AC_ARG_ENABLE(nofib,
    [--enable-nofib    build NoFib suite as part of Glasgow FP tools],
@@ -128,10 +96,6 @@ if test "xxx$DoingNoFib" = 'xxxnofib' -a \( ! -d nofib \) ; then
     DoingNoFib=''
     echo 'Doing --disable-nofib, as there is no nofib directory'
 fi
-nofib_mkworld_site_nofib_jm='nofib/mkworld/site-nofib.jm'
-if test "xxx$DoingNoFib" = 'xxx' ; then
-    nofib_mkworld_site_nofib_jm=''
-fi
 
 AC_ARG_ENABLE(happy,
    [--enable-happy    build Happy parser-generator as part of Glasgow FP tools],
@@ -165,64 +129,10 @@ if test "xxx$DoingHaggis" = 'xxxhaggis' -a \( ! -d haggis \) ; then
     echo 'Doing --disable-haggis, as there is no haggis directory'
 fi
 
-AC_ARG_ENABLE(literate,
-   [
-The following three are \`for hackers only':
---disable-literate    do *not* build literate-programming stuff],
-   [case "$enableval" in
-        yes) DoingLiterate='literate'
-             ;;
-        no)  DoingLiterate=''
-             ;;
-        *)   echo "I don't understand this option: --enable-literate=$enableval"
-             exit 1
-             ;;
-    esac])
-if test "xxx$DoingLiterate" = 'xxxliterate' -a \( ! -d literate \) ; then
-    DoingLiterate=''
-    echo 'Doing --disable-literate, as there is no literate directory'
-fi
-
-AC_ARG_ENABLE(mkworld,
-   [--disable-mkworld     do *not* build \`mkworld' configuration stuff],
-   [case "$enableval" in
-        yes) DoingMkWorld='mkworld'
-             ;;
-        no)  DoingMkWorld=''
-             ;;
-        *)   echo "I don't understand this option: --enable-mkworld=$enableval"
-             exit 1
-             ;;
-    esac])
-if test "xxx$DoingMkWorld" = 'xxxmkworld' -a \( ! -d mkworld \) ; then
-    DoingMkWorld=''
-    echo 'Doing --disable-mkworld, as there is no mkworld directory'
-fi
-
-AC_ARG_ENABLE(glafp-utils,
-   [--disable-glafp-utils do *not* build \`glafp utilities'],
-   [case "$enableval" in
-        yes) DoingGlaFpUtils='glafp-utils'
-             ;;
-        no)  DoingGlaFpUtils=''
-             ;;
-        *)   echo "I don't understand this option: --enable-glafp-utils=$enableval"
-             exit 1
-             ;;
-    esac])
-if test "xxx$DoingGlaFpUtils" = 'xxxglafp-utils' -a \( ! -d glafp-utils \) ; then
-    DoingGlaFpUtils=''
-    echo 'Doing --disable-glafp-utils, as there is no glafp-utils directory'
-fi
-
-AC_SUBST(DoingGHC)
 AC_SUBST(DoingHsLibs)
 AC_SUBST(DoingNoFib)
 AC_SUBST(DoingHappy)
 AC_SUBST(DoingHaggis)
-AC_SUBST(DoingLiterate)
-AC_SUBST(DoingMkWorld)
-AC_SUBST(DoingGlaFpUtils)
 
 # -------------------------------------------------------------------------
 dnl ** choose host(/target/build) platform
@@ -648,7 +558,7 @@ AC_ARG_WITH(hc,
         c | C)  WithHc='C'
                 ;;
         in-place )
-                WithHc='IN-PLACE'
+               WithHc='IN-PLACE'
                 ;;
         *)      echo "I don't understand this option: --with-hc=$withval"
                 exit 1
@@ -686,6 +596,7 @@ case $WithHc in
     c | C)  WithHcType='HC_USE_HC_FILES'
             ;;
     IN-PLACE) WithHcType='HC_GLASGOW_GHC'
+             WithHc='$(TOP_PWD)/ghc/driver/ghc'
            ;;
 esac
 AC_SUBST(WithHc)
@@ -699,16 +610,15 @@ AC_ARG_WITH(gcc,
    [HaveGcc=YES; WhatGccIsCalled="$withval"])
 AC_SUBST(WhatGccIsCalled)
 
-dnl ** Choose which make to use (default 'make -r')
-MakeCmd='make -r'
+dnl ** Choose which make to use (default 'make')
+MakeCmd='make'
 AC_ARG_WITH(make,
    [ 
 --with-make=<make command> 
        Use an alternate command instead of 'make'.  This is useful
        when GNU make is required (for instance when the default make
        supplied by the system won't work, as is the case on FreeBSD
-       and NetBSD).  You probably want to include the '-r' flag with
-       make, to exclude implicit suffix rules.],
+       and NetBSD).],
    [MakeCmd="$withval"]) 
 AC_SUBST(MakeCmd)
 
@@ -726,31 +636,37 @@ AC_ARG_WITH(tmpdir,
 AC_SUBST(TmpDir)
 
 dnl ** possibly set a max heap for Haskell compilations
-# let the user specify a maximum heap to be used; the old
-# "I have a 64MB machine, why not use a 32MB heap?" thing.
-HcMaxHeapWasSet='NO'
-HcMaxHeap='0'
+HcMaxHeapFlag=''
 AC_ARG_WITH(max-heap,
    [
 --with-max-heap=<heap size, e.g., 32m> 
-       Do all Haskell compilations with a heap of this size.  (If
-       you've got it, flaunt it.)],
-   [HcMaxHeapWasSet='YES'
-    HcMaxHeap="$withval"])
-AC_SUBST(HcMaxHeapWasSet)
-AC_SUBST(HcMaxHeap)
+       Do all Haskell compilations with a heap of this size.],
+   [HcMaxHeapFlag="-H$withval"])
+AC_SUBST(HcMaxHeapFlag)
+
+dnl ** possibly set a max stack for Haskell compilations
+HcMaxStackFlag=''
+AC_ARG_WITH(max-stack,
+   [
+--with-max-stack=<stack size, e.g., 4m> 
+       Do all Haskell compilations with a stack of this size.],
+   [HcMaxStackFlag="-K$withval"])
+AC_SUBST(HcMaxStackFlag)
 
 dnl ** figure out about mkdependHS
-MkDependHSCmd=':'
+MkDependHSCmd='mkdependHS'
 if test -f ./ghc/utils/mkdependHS/mkdependHS \
      -o -f ./ghc/utils/mkdependHS/mkdependHS.prl ; then
     MkDependHSCmd='TopDirPwd/ghc/utils/mkdependHS/mkdependHS'
-else
-    AC_CHECK_PROG(have_mkdependHS,mkdependHS,YES,NO)
-    if test $have_mkdependHS = 'YES' ; then
-       MkDependHSCmd='mkdependHS'
-    fi
 fi
+AC_ARG_WITH(mkdependHS,
+   [--with-mkdependHS=<mkdependHS command>
+       Use a different command instead of 'mkdependHS'.],
+   [MkDependHSCmd="$withval"])
+dnl AC_CHECK_PROG(have_mkdependHS,$MkDependHSCmd,YES,NO)
+dnl if test $have_mkdependHS = 'NO' ; then
+dnl     MkDependHSCmd=':'
+dnl fi
 AC_SUBST(MkDependHSCmd)
 
 # -------------------------------------------------------------------------
@@ -762,8 +678,12 @@ if echo $CPP | egrep gcc >/dev/null 2>&1; then
     echo > conftest.c
     gcc -v -E conftest.c >/dev/null 2>conftest.out
     echo '/(\S+\/cpp)/ && print "$1";' > conftest.pl
+    # GNUCPP: used in jmake.c (GnuCppCmd) and in mkdependC
+    # (where we could do with the usual pre-#defines)
     GNUCPP="`eval $PerlCmd -n conftest.pl conftest.out`"
     test -n "$verbose" && echo "        setting GNUCPP to $GNUCPP"
+    # RAWCPP: we do not want *any* pre-#defines...
+    # (e.g., hscpp, mkdependHS)
     RAWCPP="`eval $PerlCmd -n conftest.pl conftest.out` -traditional"
     test -n "$verbose" && echo "        setting RAWCPP to $RAWCPP"
     rm -fr conftest*
@@ -830,7 +750,7 @@ AC_HEADER_STDC
 #
 dnl ** check for specific header (.h) files that we are interested in
 #
-AC_CHECK_HEADERS(dirent.h fcntl.h grp.h malloc.h memory.h nlist.h pwd.h siginfo.h signal.h stdlib.h string.h sys/fault.h sys/file.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/vadvise.h sys/wait.h termios.h time.h types.h unistd.h utime.h vfork.h )
+AC_CHECK_HEADERS(dirent.h fcntl.h grp.h malloc.h memory.h nlist.h pwd.h siginfo.h signal.h stdlib.h string.h sys/fault.h sys/file.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/socket.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/vadvise.h sys/wait.h termios.h time.h types.h unistd.h utime.h vfork.h )
 #
 dnl ** check if it is safe to include both <time.h> and <sys/time.h>
 #
@@ -878,49 +798,45 @@ char **argv;
 }], LeadingUnderscore='YES', LeadingUnderscore='NO', LeadingUnderscore='YES')
 test -n "$verbose" && echo "    setting LeadingUnderscore to $LeadingUnderscore"
 
-# -------------------------------------------------------------------------
-dnl
-dnl * `GHC' CONFIGURATION STUFF
-
-if test "xxx$DoingGHC" = 'xxxghc' ; then
-# a very big "if"!
-#
+dnl -------------------------------------------------------
 dnl ** which builds to build?
+dnl ** (applies to anything w/ libraries (ghc, hslibs, ???)
+dnl -------------------------------------------------------
 # builds: normal = sequential _ap_o ; _p = profiling (sequential);
 # _t = ticky; _u = unregisterized
-GhcBuild_normal='YES'
-GhcBuild_p='YES'
-GhcBuild_t='NO'
-GhcBuild_u='NO'
+Build_normal='YES'
+Build_p='YES'
+Build_t='NO'
+Build_u='NO'
 # _mc = concurrent; _mr = profiled concurrent; _mt = ticky concurrent
 # _mp = parallel; _mg = gransim
-GhcBuild_mc='NO'
-GhcBuild_mr='NO'
-GhcBuild_mt='NO'
-GhcBuild_mp='NO'
-GhcBuild_mg='NO'
+Build_mc='NO'
+Build_mr='NO'
+Build_mt='NO'
+Build_mp='NO'
+Build_mg='NO'
 # GC builds: _2s, _1s, _du (, _gn)
-GhcBuild_2s='NO'
-GhcBuild_1s='NO'
-GhcBuild_du='NO'
+Build_2s='NO'
+Build_1s='NO'
+Build_du='NO'
 # user builds: a...o
-GhcBuild_a='NO'
-GhcBuild_b='NO'
-GhcBuild_c='NO'
-GhcBuild_d='NO'
-GhcBuild_e='NO'
-GhcBuild_f='NO'
-GhcBuild_g='NO'
-GhcBuild_h='NO'
-GhcBuild_i='NO'
-GhcBuild_j='NO'
-GhcBuild_k='NO'
-GhcBuild_l='NO'
-GhcBuild_m='NO'
-GhcBuild_n='NO'
-GhcBuild_o='NO'
-GhcBuild_A='NO'
-GhcBuild_B='NO'
+Build_a='NO'
+Build_b='NO'
+Build_c='NO'
+Build_d='NO'
+Build_e='NO'
+Build_f='NO'
+Build_g='NO'
+Build_h='NO'
+Build_i='NO'
+Build_j='NO'
+Build_k='NO'
+Build_l='NO'
+Build_m='NO'
+Build_n='NO'
+Build_o='NO'
+Build_A='NO'
+Build_B='NO'
 # More could be added here...
 
 AC_ARG_ENABLE(normal-build,
@@ -932,9 +848,9 @@ Choose all the \`builds' of GHC that you want:
 
 --disable-normal-build do *not* build GHC for normal sequential code],
    [case "$enableval" in
-        yes) GhcBuild_normal='YES'
+        yes) Build_normal='YES'
              ;;
-        no)  GhcBuild_normal='NO'
+        no)  Build_normal='NO'
              ;;
         *)   echo "I don't understand this option: --enable-normal-build=$enableval"
              exit 1
@@ -944,9 +860,9 @@ Choose all the \`builds' of GHC that you want:
 AC_ARG_ENABLE(profiling,
    [--disable-profiling    do *not* build profiling features],
    [case "$enableval" in
-        yes) GhcBuild_p='YES'
+        yes) Build_p='YES'
              ;;
-        no)  GhcBuild_p='NO'
+        no)  Build_p='NO'
              ;;
         *)   echo "I don't understand this option: --enable-profiling=$enableval"
              exit 1
@@ -956,9 +872,9 @@ AC_ARG_ENABLE(profiling,
 AC_ARG_ENABLE(ticky,
    [--enable-ticky         build for \`ticky-ticky' profiling (for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_t='YES'
+        yes) Build_t='YES'
              ;;
-        no)  GhcBuild_t='NO'
+        no)  Build_t='NO'
              ;;
         *)   echo "I don't understand this option: --enable-ticky=$enableval"
              exit 1
@@ -968,9 +884,9 @@ AC_ARG_ENABLE(ticky,
 AC_ARG_ENABLE(concurrent,
    [--enable-concurrent    turn on \`concurrent Haskell' features],
    [case "$enableval" in
-        yes) GhcBuild_mc='YES'
+        yes) Build_mc='YES'
              ;;
-        no)  GhcBuild_mc='NO'
+        no)  Build_mc='NO'
              ;;
         *)   echo "I don't understand this option: --enable-concurrent=$enableval"
              exit 1
@@ -980,9 +896,9 @@ AC_ARG_ENABLE(concurrent,
 AC_ARG_ENABLE(profiled-concurrent,
    [--enable-profiled-concurrent turn on profiling for \`concurrent Haskell'],
    [case "$enableval" in
-        yes) GhcBuild_mr='YES'
+        yes) Build_mr='YES'
              ;;
-        no)  GhcBuild_mr='NO'
+        no)  Build_mr='NO'
              ;;
         *)   echo "I don't understand this option: --enable-profiled-concurrent=$enableval"
              exit 1
@@ -992,9 +908,9 @@ AC_ARG_ENABLE(profiled-concurrent,
 AC_ARG_ENABLE(ticky-concurrent,
    [--enable-ticky-concurrent turn on \`ticky-ticky' profiling for \`concurrent Haskell'],
    [case "$enableval" in
-        yes) GhcBuild_mt='YES'
+        yes) Build_mt='YES'
              ;;
-        no)  GhcBuild_mt='NO'
+        no)  Build_mt='NO'
              ;;
         *)   echo "I don't understand this option: --enable-ticky-concurrent=$enableval"
              exit 1
@@ -1004,9 +920,9 @@ AC_ARG_ENABLE(ticky-concurrent,
 AC_ARG_ENABLE(parallel,
    [--enable-parallel      turn on \`parallel Haskell' features],
    [case "$enableval" in
-        yes) GhcBuild_mp='YES';
+        yes) Build_mp='YES';
              ;;
-        no)  GhcBuild_mp='NO'
+        no)  Build_mp='NO'
              ;;
         *)   echo "I don't understand this option: --enable-parallel=$enableval"
              exit 1
@@ -1016,9 +932,9 @@ AC_ARG_ENABLE(parallel,
 AC_ARG_ENABLE(gransim,
    [--enable-gransim       turn on GranSim parallel simulator],
    [case "$enableval" in
-        yes) GhcBuild_mg='YES';
+        yes) Build_mg='YES';
              ;;
-        no)  GhcBuild_mg='NO'
+        no)  Build_mg='NO'
              ;;
         *)   echo "I don't understand this option: --enable-gransim=$enableval"
              exit 1
@@ -1028,9 +944,9 @@ AC_ARG_ENABLE(gransim,
 AC_ARG_ENABLE(gc-2s,
    [--enable-gc-2s         a build with the 2-space copying garbage collector],
    [case "$enableval" in
-        yes) GhcBuild_2s='YES'
+        yes) Build_2s='YES'
              ;;
-        no)  GhcBuild_2s='NO'
+        no)  Build_2s='NO'
              ;;
         *)   echo "I don't understand this option: --enable-gc-2s=$enableval"
              exit 1
@@ -1040,9 +956,9 @@ AC_ARG_ENABLE(gc-2s,
 AC_ARG_ENABLE(gc-1s,
    [--enable-gc-1s         a build with the 1-space compacting garbage collector],
    [case "$enableval" in
-        yes) GhcBuild_1s='YES'
+        yes) Build_1s='YES'
              ;;
-        no)  GhcBuild_1s='NO'
+        no)  Build_1s='NO'
              ;;
         *)   echo "I don't understand this option: --enable-gc-1s=$enableval"
              exit 1
@@ -1052,9 +968,9 @@ AC_ARG_ENABLE(gc-1s,
 AC_ARG_ENABLE(gc-du,
    [--enable-gc-du         a build with \`dual-mode' (1s/2s) garbage collector],
    [case "$enableval" in
-        yes) GhcBuild_du='YES'
+        yes) Build_du='YES'
              ;;
-        no)  GhcBuild_du='NO'
+        no)  Build_du='NO'
              ;;
         *)   echo "I don't understand this option: --enable-gc-du=$enableval"
              exit 1
@@ -1064,9 +980,9 @@ AC_ARG_ENABLE(gc-du,
 AC_ARG_ENABLE(user-way-a,
    [--enable-user-way-a    build for \`user way a' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_a='YES'
+        yes) Build_a='YES'
              ;;
-        no)  GhcBuild_a='NO'
+        no)  Build_a='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-a=$enableval"
              exit 1
@@ -1076,9 +992,9 @@ AC_ARG_ENABLE(user-way-a,
 AC_ARG_ENABLE(user-way-b,
    [--enable-user-way-b    build for \`user way b' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_b='YES'
+        yes) Build_b='YES'
              ;;
-        no)  GhcBuild_b='NO'
+        no)  Build_b='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-b=$enableval"
              exit 1
@@ -1088,9 +1004,9 @@ AC_ARG_ENABLE(user-way-b,
 AC_ARG_ENABLE(user-way-c,
    [--enable-user-way-c    build for \`user way c' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_c='YES'
+        yes) Build_c='YES'
              ;;
-        no)  GhcBuild_c='NO'
+        no)  Build_c='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-c=$enableval"
              exit 1
@@ -1100,9 +1016,9 @@ AC_ARG_ENABLE(user-way-c,
 AC_ARG_ENABLE(user-way-d,
    [--enable-user-way-d    build for \`user way d' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_d='YES'
+        yes) Build_d='YES'
              ;;
-        no)  GhcBuild_d='NO'
+        no)  Build_d='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-d=$enableval"
              exit 1
@@ -1112,9 +1028,9 @@ AC_ARG_ENABLE(user-way-d,
 AC_ARG_ENABLE(user-way-e,
    [--enable-user-way-e    build for \`user way e' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_e='YES'
+        yes) Build_e='YES'
              ;;
-        no)  GhcBuild_e='NO'
+        no)  Build_e='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-e=$enableval"
              exit 1
@@ -1124,9 +1040,9 @@ AC_ARG_ENABLE(user-way-e,
 AC_ARG_ENABLE(user-way-f,
    [--enable-user-way-f    build for \`user way f' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_f='YES'
+        yes) Build_f='YES'
              ;;
-        no)  GhcBuild_f='NO'
+        no)  Build_f='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-f=$enableval"
              exit 1
@@ -1136,9 +1052,9 @@ AC_ARG_ENABLE(user-way-f,
 AC_ARG_ENABLE(user-way-g,
    [--enable-user-way-g    build for \`user way g' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_g='YES'
+        yes) Build_g='YES'
              ;;
-        no)  GhcBuild_g='NO'
+        no)  Build_g='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-g=$enableval"
              exit 1
@@ -1148,9 +1064,9 @@ AC_ARG_ENABLE(user-way-g,
 AC_ARG_ENABLE(user-way-h,
    [--enable-user-way-h    build for \`user way h' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_h='YES'
+        yes) Build_h='YES'
              ;;
-        no)  GhcBuild_h='NO'
+        no)  Build_h='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-h=$enableval"
              exit 1
@@ -1160,9 +1076,9 @@ AC_ARG_ENABLE(user-way-h,
 AC_ARG_ENABLE(user-way-i,
    [--enable-user-way-i    build for \`user way i' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_i='YES'
+        yes) Build_i='YES'
              ;;
-        no)  GhcBuild_i='NO'
+        no)  Build_i='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-i=$enableval"
              exit 1
@@ -1172,9 +1088,9 @@ AC_ARG_ENABLE(user-way-i,
 AC_ARG_ENABLE(user-way-j,
    [--enable-user-way-j    build for \`user way j' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_j='YES'
+        yes) Build_j='YES'
              ;;
-        no)  GhcBuild_j='NO'
+        no)  Build_j='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-j=$enableval"
              exit 1
@@ -1184,9 +1100,9 @@ AC_ARG_ENABLE(user-way-j,
 AC_ARG_ENABLE(user-way-k,
    [--enable-user-way-k    build for \`user way k' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_k='YES'
+        yes) Build_k='YES'
              ;;
-        no)  GhcBuild_k='NO'
+        no)  Build_k='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-k=$enableval"
              exit 1
@@ -1196,9 +1112,9 @@ AC_ARG_ENABLE(user-way-k,
 AC_ARG_ENABLE(user-way-l,
    [--enable-user-way-l    build for \`user way l' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_l='YES'
+        yes) Build_l='YES'
              ;;
-        no)  GhcBuild_l='NO'
+        no)  Build_l='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-l=$enableval"
              exit 1
@@ -1208,9 +1124,9 @@ AC_ARG_ENABLE(user-way-l,
 AC_ARG_ENABLE(user-way-m,
    [--enable-user-way-m    build for \`user way m' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_m='YES'
+        yes) Build_m='YES'
              ;;
-        no)  GhcBuild_m='NO'
+        no)  Build_m='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-m=$enableval"
              exit 1
@@ -1220,9 +1136,9 @@ AC_ARG_ENABLE(user-way-m,
 AC_ARG_ENABLE(user-way-n,
    [--enable-user-way-n    build for \`user way n' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_n='YES'
+        yes) Build_n='YES'
              ;;
-        no)  GhcBuild_n='NO'
+        no)  Build_n='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-n=$enableval"
              exit 1
@@ -1232,9 +1148,9 @@ AC_ARG_ENABLE(user-way-n,
 AC_ARG_ENABLE(user-way-o,
    [--enable-user-way-o    build for \`user way o' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_o='YES'
+        yes) Build_o='YES'
              ;;
-        no)  GhcBuild_o='NO'
+        no)  Build_o='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-o=$enableval"
              exit 1
@@ -1244,9 +1160,9 @@ AC_ARG_ENABLE(user-way-o,
 AC_ARG_ENABLE(user-way-A,
    [--enable-user-way-A    build for \`user way A' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_A='YES'
+        yes) Build_A='YES'
              ;;
-        no)  GhcBuild_A='NO'
+        no)  Build_A='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-A=$enableval"
              exit 1
@@ -1256,51 +1172,22 @@ AC_ARG_ENABLE(user-way-A,
 AC_ARG_ENABLE(user-way-B,
    [--enable-user-way-B    build for \`user way B' (mostly for implementors)],
    [case "$enableval" in
-        yes) GhcBuild_B='YES'
+        yes) Build_B='YES'
              ;;
-        no)  GhcBuild_B='NO'
+        no)  Build_B='NO'
              ;;
         *)   echo "I don't understand this option: --enable-user-way-B=$enableval"
              exit 1
              ;;
     esac])
 
-dnl We do not use AC_SUBST to communicate the GhcBuild_* info,
+dnl We do not use AC_SUBST to communicate the Build_* info,
 dnl as some seds (notably OSF) only allow 99 commands (!!!).
 dnl We will do the equivalent by a HACK further down.
 
-dnl AC_SUBST(GhcBuild_normal)
-dnl AC_SUBST(GhcBuild_p)
-dnl AC_SUBST(GhcBuild_t)
-dnl AC_SUBST(GhcBuild_u)
-dnl AC_SUBST(GhcBuild_mc)
-dnl AC_SUBST(GhcBuild_mr)
-dnl AC_SUBST(GhcBuild_mt)
-dnl AC_SUBST(GhcBuild_mp)
-dnl AC_SUBST(GhcBuild_mg)
-dnl AC_SUBST(GhcBuild_2s)
-dnl AC_SUBST(GhcBuild_1s)
-dnl AC_SUBST(GhcBuild_du)
-dnl AC_SUBST(GhcBuild_a)
-dnl AC_SUBST(GhcBuild_b)
-dnl AC_SUBST(GhcBuild_c)
-dnl AC_SUBST(GhcBuild_d)
-dnl AC_SUBST(GhcBuild_e)
-dnl AC_SUBST(GhcBuild_f)
-dnl AC_SUBST(GhcBuild_g)
-dnl AC_SUBST(GhcBuild_h)
-dnl AC_SUBST(GhcBuild_i)
-dnl AC_SUBST(GhcBuild_j)
-dnl AC_SUBST(GhcBuild_k)
-dnl AC_SUBST(GhcBuild_l)
-dnl AC_SUBST(GhcBuild_m)
-dnl AC_SUBST(GhcBuild_n)
-dnl AC_SUBST(GhcBuild_o)
-dnl AC_SUBST(GhcBuild_A)
-dnl AC_SUBST(GhcBuild_B)
-
-#---------------------------------------------------------------
-#
+# -------------------------------------------------------------------------
+dnl GHC CONFIGURATION STUFF
+
 dnl ** which Haskell compiler to bootstrap GHC with?
 # Figure out what Haskell compiler(s) to use for booting
 #
@@ -1399,9 +1286,9 @@ fi
 AC_SUBST(GhcWithRegisterised)
 
 if test $GhcWithRegisterised = 'NO'; then
-    GhcBuild_u='YES'
-    GhcBuild_normal='NO'
-    GhcBuild_p='NO'
+    Build_u='YES'
+    Build_normal='NO'
+    Build_p='NO'
 fi
 # ToDo: make sure we can do concurrent for platform/circs...
 # ToDo: make sure we can do profiling for platform/circs...
@@ -1535,40 +1422,16 @@ AC_ARG_ENABLE(sockets-library,
     esac])
 AC_SUBST(GhcWithSockets)
 
-dnl ** build the interpreter?
-BuildGHCI='NO'
-AC_ARG_ENABLE(ghci,
-   [--enable-ghci             build Glasgow Haskell interpreter (HACKERS ONLY)],
-   [case "$enableval" in
-        yes) BuildGHCI='YES'
-             ;;
-        no)  BuildGHCI='NO'
-             ;;
-        *)   echo "I don't understand this option: --enable-ghci=$enableval"
-             exit 1
-             ;;
-    esac])
-AC_SUBST(BuildGHCI)
-
-# Here, by HACK means, we dump all the GhcBuild_ info
+# Here, by HACK means, we dump all the Build_ info
 # into a file.  See comment above.
-rm -f ghc/mkworld/buildinfo.jm
-echo creating ghc/mkworld/buildinfo.jm
-cat > ghc/mkworld/buildinfo.jm <<EOF
-XCOMM ** DO NOT EDIT! **
-XCOMM This file is obliterated every time 'configure' is run!
-
-EOF
+rm -f ghc/mk/buildinfo.mk
+echo creating ghc/mk/buildinfo.mk
+touch ghc/mk/buildinfo.mk
 for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
-    eval "yy=\$GhcBuild_$xx"
-    echo "#ifndef GhcBuild_$xx"     >> ghc/mkworld/buildinfo.jm
-    echo "#define GhcBuild_$xx $yy" >> ghc/mkworld/buildinfo.jm
-    echo "#endif"                  >> ghc/mkworld/buildinfo.jm
+    eval "yy=\$Build_$xx"
+    echo "Build_$xx = $yy" >> ghc/mk/buildinfo.mk
 done
 
-# here ends a very big if DoingGHC = 'ghc' ...
-fi
-
 # -------------------------------------------------------------------------
 dnl
 dnl * `HsLibs' CONFIGURATION STUFF
@@ -1596,7 +1459,7 @@ option, if used, overrides --with-hc=<...>:
                 WithHsLibsHc=$withval
                 ;;
         in-place )
-                WithHsLibsHc='IN-PLACE'
+               WithHsLibsHc='IN-PLACE'
                 ;;
         *)      echo "I don't understand this option: --with-hc-for-hslibs=$withval"
                 exit 1
@@ -1620,27 +1483,26 @@ case $WithHsLibsHc in
             fi
             ;;
     IN-PLACE) WithHsLibsHcType='HC_GLASGOW_GHC'
+             WithHsLibsHc='$(TOP_PWD)/ghc/driver/ghc'
            ;;
 esac
 AC_SUBST(WithHsLibsHc)
 AC_SUBST(WithHsLibsHcType)
 
-# Here, by HACK means, we dump all the GhcBuild_ info
+# Here, by HACK means, we dump all the Build_ info
 # into a file.  See comment above.
-rm -f hslibs/mkworld/buildinfo.jm
-echo creating hslibs/mkworld/buildinfo.jm
-cat > hslibs/mkworld/buildinfo.jm <<EOF
-XCOMM ** DO NOT EDIT! **
-XCOMM This file is obliterated every time 'configure' is run!
+rm -f hslibs/mk/buildinfo.mk
+echo creating hslibs/mk/buildinfo.mk
+cat > hslibs/mk/buildinfo.mk <<EOF
+# ** DO NOT EDIT! **
+# This file is obliterated every time 'configure' is run!
 
 EOF
-dnl Do not really know what to put here:
-dnl for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
-dnl     eval "yy=\$GhcBuild_$xx"
-dnl    echo "#ifndef GhcBuild_$xx"     >> ghc/mkworld/buildinfo.jm
-dnl    echo "#define GhcBuild_$xx $yy" >> ghc/mkworld/buildinfo.jm
-dnl    echo "#endif"               >> ghc/mkworld/buildinfo.jm
-dnl done
+for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
+    eval "yy=\$Build_$xx"
+    echo "Build_$xx = $yy" >> hslibs/mk/buildinfo.mk
+done
+
 
 # here ends a very big if DoingHsLibs = 'hslibs' ...
 fi
@@ -1679,7 +1541,7 @@ The Haskell compiler to compile Happy; this option, if used, overrides
         nhc* )  WithHappyHc=$withval
                 ;;
         in-place )
-                WithHappyHc='IN-PLACE'
+               WithHappyHc='IN-PLACE'
                 ;;
         *)      echo "I don't understand this option: --with-hc-for-happy=$withval"
                 exit 1
@@ -1719,6 +1581,7 @@ case $WithHappyHc in
             fi
             ;;
     IN-PLACE) WithHappyHcType='HC_GLASGOW_GHC'
+                WithHappyHc='$(TOP_PWD)/ghc/driver/ghc'
            ;;
 esac
 AC_SUBST(WithHappyHc)
@@ -1754,7 +1617,7 @@ used, overrides --with-hc=<...>:
                 WithHaggisHc=$withval
                 ;;
         in-place )
-                WithHaggisHc='IN-PLACE'
+               WithHaggicHs='IN-PLACE'
                 ;;
         *)      echo "I don't understand this option: --with-hc-for-haggis=$withval"
                 exit 1
@@ -1778,40 +1641,15 @@ case $WithHaggisHc in
             fi
             ;;
     IN-PLACE) WithHaggisHcType='HC_GLASGOW_GHC'
+                WithHaggisHc='$(TOP_PWD)/ghc/driver/ghc'
            ;;
 esac
 AC_SUBST(WithHaggisHc)
 AC_SUBST(WithHaggisHcType)
 
-# here ends a very big if DoingHaggis = 'haggis' ...
-fi
-#
-# -------------------------------------------------------------------------
-dnl
-dnl * `Literate' CONFIGURATION STUFF
-
-if test "xxx$DoingLiterate" = 'xxxliterate' ; then
-# a very big "if"!
-
-BuildInfoUtils='NO'
-AC_ARG_ENABLE(info-utils,
-   [
-*******************************************************************
-** Literate programming system OPTIONS:
+# builds stuff?? ToDo
 
---enable-info-utils       build GNU info/makeinfo utilities],
-   [case "$enableval" in
-        yes) BuildInfoUtils='YES'
-             ;;
-        no)  BuildInfoUtils='NO'
-             ;;
-        *)   echo "I don't understand this option: --enable-info-utils=$enableval"
-             exit 1
-             ;;
-    esac])
-AC_SUBST(BuildInfoUtils)
-
-# here ends a very big if DoingLiterate = 'literate' ...
+# here ends a very big if DoingHaggis = 'haggis' ...
 fi
 #
 # -------------------------------------------------------------------------
@@ -1849,7 +1687,7 @@ used, overrides --with-hc=<...>:
         nhc* )  WithNoFibHc=$withval
                 ;;
         in-place )
-                WithNoFibHc='IN-PLACE'
+               WithNoFibHc='IN-PLACE'
                 ;;
         *)      echo "I don't understand this option: --with-hc-for-nofib=$withval"
                 exit 1
@@ -1889,6 +1727,7 @@ case $WithNoFibHc in
             fi
             ;;
     IN-PLACE) WithNoFibHcType='HC_GLASGOW_GHC'
+                WithNoFibHc='$(TOP_PWD)/ghc/driver/ghc'
            ;;
 esac
 AC_SUBST(WithNoFibHc)
@@ -2057,18 +1896,24 @@ dnl AC_SUBST(IncludeParallelNoFibTests)
 
 # Here, by HACK means, we dump all the Include*NoFibTests info
 # into a file.  See comment above.
-rm -f nofib/mkworld/buildinfo.jm
-echo creating nofib/mkworld/buildinfo.jm
+rm -f nofib/mk/buildinfo.mk
+echo creating nofib/mk/buildinfo.mk
 cat > nofib/mkworld/buildinfo.jm <<EOF
-XCOMM ** DO NOT EDIT! **
-XCOMM This file is obliterated every time 'configure' is run!
+# ** DO NOT EDIT! **
+# This file is obliterated every time 'configure' is run!
 
 EOF
 for xx in Real Spectral Imaginary GHC_ONLY Specialise PRIVATE Parallel ; do
     eval "yy=\$Include${xx}NoFibTests"
-    echo "#ifndef Include${xx}NoFibTests"     >> nofib/mkworld/buildinfo.jm
-    echo "#define Include${xx}NoFibTests $yy" >> nofib/mkworld/buildinfo.jm
-    echo "#endif"                            >> nofib/mkworld/buildinfo.jm
+    echo "Include${xx}NoFibTests = $yy" >> nofib/mk/buildinfo.mk
+done
+
+# Here, by HACK means, we add all the Build_ info
+# into a file.  See comment above.
+for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
+    eval "yy=\$Build_$xx"
+    echo "Build_$xx = $yy"     >> nofib/mk/buildinfo.mk
 done
 
 # here ends a very big if DoingNoFib = 'nofib' ...
@@ -2080,9 +1925,9 @@ dnl * extract non-header files with substitution (end)
 #
 AC_SUBST(MkWorldSetup)
 
-AC_OUTPUT(Makefile STARTUP mkworld/site.jm mkworld/platform.h mkworld/config.h $ghc_mkworld_site_ghc_jm $ghc_includes_platform_h $hslibs_mkworld_site_hslibs_jm $nofib_mkworld_site_nofib_jm)
+AC_OUTPUT(mk/platform.mk mk/utils.mk mk/install.mk ghc/mk/ghcconfig.mk ghc/includes/platform.h)
 
 echo '************************************************'
-echo '*** NOW DO: sh < STARTUP'
+echo '*** NOW DO: make boot; make all'
 echo '************************************************'
 exit 0