[project @ 1996-11-22 14:12:39 by simonm]
[ghc-hetmet.git] / configure.in
index b799d4f..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)
 
 # -------------------------------------------------------------------------
@@ -764,7 +680,7 @@ if echo $CPP | egrep gcc >/dev/null 2>&1; then
     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="gcc -E"
+    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)
@@ -1270,14 +1186,8 @@ dnl as some seds (notably OSF) only allow 99 commands (!!!).
 dnl We will do the equivalent by a HACK further down.
 
 # -------------------------------------------------------------------------
-dnl
-dnl * `GHC' CONFIGURATION STUFF
+dnl GHC CONFIGURATION STUFF
 
-if test "xxx$DoingGHC" = 'xxxghc' ; then
-# a very big "if"!
-#
-#---------------------------------------------------------------
-#
 dnl ** which Haskell compiler to bootstrap GHC with?
 # Figure out what Haskell compiler(s) to use for booting
 #
@@ -1514,23 +1424,14 @@ AC_SUBST(GhcWithSockets)
 
 # 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=\$Build_$xx"
-    echo "#ifndef Build_$xx"     >> ghc/mkworld/buildinfo.jm
-    echo "#define Build_$xx $yy" >> ghc/mkworld/buildinfo.jm
-    echo "#endif"               >> ghc/mkworld/buildinfo.jm
+    echo "Build_$xx = $yy" >> ghc/mk/buildinfo.mk
 done
 
-# here ends a very big if DoingGHC = 'ghc' ...
-fi
-
 # -------------------------------------------------------------------------
 dnl
 dnl * `HsLibs' CONFIGURATION STUFF
@@ -1558,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
@@ -1582,6 +1483,7 @@ case $WithHsLibsHc in
             fi
             ;;
     IN-PLACE) WithHsLibsHcType='HC_GLASGOW_GHC'
+             WithHsLibsHc='$(TOP_PWD)/ghc/driver/ghc'
            ;;
 esac
 AC_SUBST(WithHsLibsHc)
@@ -1589,20 +1491,19 @@ AC_SUBST(WithHsLibsHcType)
 
 # 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
 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 "#ifndef Build_$xx"     >> hslibs/mkworld/buildinfo.jm
-    echo "#define Build_$xx $yy" >> hslibs/mkworld/buildinfo.jm
-    echo "#endif"               >> hslibs/mkworld/buildinfo.jm
+    echo "Build_$xx = $yy" >> hslibs/mk/buildinfo.mk
 done
 
+
 # here ends a very big if DoingHsLibs = 'hslibs' ...
 fi
 #
@@ -1640,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
@@ -1680,6 +1581,7 @@ case $WithHappyHc in
             fi
             ;;
     IN-PLACE) WithHappyHcType='HC_GLASGOW_GHC'
+                WithHappyHc='$(TOP_PWD)/ghc/driver/ghc'
            ;;
 esac
 AC_SUBST(WithHappyHc)
@@ -1715,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
@@ -1739,6 +1641,7 @@ case $WithHaggisHc in
             fi
             ;;
     IN-PLACE) WithHaggisHcType='HC_GLASGOW_GHC'
+                WithHaggisHc='$(TOP_PWD)/ghc/driver/ghc'
            ;;
 esac
 AC_SUBST(WithHaggisHc)
@@ -1751,34 +1654,6 @@ 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:
-
---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' ...
-fi
-#
-# -------------------------------------------------------------------------
-dnl
 dnl * `NoFib' CONFIGURATION STUFF
 
 if test "xxx$DoingNoFib" = 'xxxnofib' ; then
@@ -1812,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
@@ -1852,6 +1727,7 @@ case $WithNoFibHc in
             fi
             ;;
     IN-PLACE) WithNoFibHcType='HC_GLASGOW_GHC'
+                WithNoFibHc='$(TOP_PWD)/ghc/driver/ghc'
            ;;
 esac
 AC_SUBST(WithNoFibHc)
@@ -2020,34 +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 dump all the Build_ info
+# Here, by HACK means, we add all the Build_ info
 # into a file.  See comment above.
-rm -f nofib/mkworld/buildinfo.jm
-echo creating nofib/mkworld/buildinfo.jm
-cat > nofib/mkworld/buildinfo.jm <<EOF
-XCOMM ** DO NOT EDIT! **
-XCOMM This file is obliterated every time 'configure' is run!
-
-EOF
 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 "#ifndef Build_$xx"     >> nofib/mkworld/buildinfo.jm
-    echo "#define Build_$xx $yy" >> nofib/mkworld/buildinfo.jm
-    echo "#endif"               >> nofib/mkworld/buildinfo.jm
+    echo "Build_$xx = $yy"     >> nofib/mk/buildinfo.mk
 done
 
 # here ends a very big if DoingNoFib = 'nofib' ...
@@ -2059,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