-if test "xxx$DoingGHC" = 'xxxghc' ; then
-# a very big "if"!
-#
-dnl ** which builds to build?
-# builds: normal = sequential _ap_o ; _p = profiling (sequential);
-# _t = ticky; _u = unregisterized
-GhcBuild_normal='YES'
-GhcBuild_p='YES'
-GhcBuild_t='NO'
-GhcBuild_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'
-# GC builds: _2s, _1s, _du (, _gn)
-GhcBuild_2s='NO'
-GhcBuild_1s='NO'
-GhcBuild_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'
-# More could be added here...
-
-AC_ARG_ENABLE(normal-build,
- [
-*******************************************************************
-** \`GHC' (GLASGOW HASKELL COMPILER) OPTIONS:
-
-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'
- ;;
- no) GhcBuild_normal='NO'
- ;;
- *) echo "I don't understand this option: --enable-normal-build=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(profiling,
- [--disable-profiling do *not* build profiling features],
- [case "$enableval" in
- yes) GhcBuild_p='YES'
- ;;
- no) GhcBuild_p='NO'
- ;;
- *) echo "I don't understand this option: --enable-profiling=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(ticky,
- [--enable-ticky build for \`ticky-ticky' profiling (for implementors)],
- [case "$enableval" in
- yes) GhcBuild_t='YES'
- ;;
- no) GhcBuild_t='NO'
- ;;
- *) echo "I don't understand this option: --enable-ticky=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(concurrent,
- [--enable-concurrent turn on \`concurrent Haskell' features],
- [case "$enableval" in
- yes) GhcBuild_mc='YES'
- ;;
- no) GhcBuild_mc='NO'
- ;;
- *) echo "I don't understand this option: --enable-concurrent=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(profiled-concurrent,
- [--enable-profiled-concurrent turn on profiling for \`concurrent Haskell'],
- [case "$enableval" in
- yes) GhcBuild_mr='YES'
- ;;
- no) GhcBuild_mr='NO'
- ;;
- *) echo "I don't understand this option: --enable-profiled-concurrent=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(ticky-concurrent,
- [--enable-ticky-concurrent turn on \`ticky-ticky' profiling for \`concurrent Haskell'],
- [case "$enableval" in
- yes) GhcBuild_mt='YES'
- ;;
- no) GhcBuild_mt='NO'
- ;;
- *) echo "I don't understand this option: --enable-ticky-concurrent=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(parallel,
- [--enable-parallel turn on \`parallel Haskell' features],
- [case "$enableval" in
- yes) GhcBuild_mp='YES';
- ;;
- no) GhcBuild_mp='NO'
- ;;
- *) echo "I don't understand this option: --enable-parallel=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(gransim,
- [--enable-gransim turn on GranSim parallel simulator],
- [case "$enableval" in
- yes) GhcBuild_mg='YES';
- ;;
- no) GhcBuild_mg='NO'
- ;;
- *) echo "I don't understand this option: --enable-gransim=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(gc-2s,
- [--enable-gc-2s a build with the 2-space copying garbage collector],
- [case "$enableval" in
- yes) GhcBuild_2s='YES'
- ;;
- no) GhcBuild_2s='NO'
- ;;
- *) echo "I don't understand this option: --enable-gc-2s=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(gc-1s,
- [--enable-gc-1s a build with the 1-space compacting garbage collector],
- [case "$enableval" in
- yes) GhcBuild_1s='YES'
- ;;
- no) GhcBuild_1s='NO'
- ;;
- *) echo "I don't understand this option: --enable-gc-1s=$enableval"
- exit 1
- ;;
- esac])
-
-AC_ARG_ENABLE(gc-du,
- [--enable-gc-du a build with \`dual-mode' (1s/2s) garbage collector],
- [case "$enableval" in
- yes) GhcBuild_du='YES'
- ;;
- no) GhcBuild_du='NO'
- ;;
- *) echo "I don't understand this option: --enable-gc-du=$enableval"
- exit 1
- ;;
- esac])
-
-dnl some seds only allow 99 commands, meaning no more
-dnl than 99 AC_SUBSTs. AARRGGHH!!
-dnl AC_ARG_ENABLE(user-way-a,
-dnl [--enable-user-way-a build for \`user way a' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_a='YES'
-dnl ;;
-dnl no) GhcBuild_a='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-a=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-b,
-dnl [--enable-user-way-b build for \`user way b' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_b='YES'
-dnl ;;
-dnl no) GhcBuild_b='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-b=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-c,
-dnl [--enable-user-way-c build for \`user way c' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_c='YES'
-dnl ;;
-dnl no) GhcBuild_c='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-c=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-d,
-dnl [--enable-user-way-d build for \`user way d' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_d='YES'
-dnl ;;
-dnl no) GhcBuild_d='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-d=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-e,
-dnl [--enable-user-way-e build for \`user way e' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_e='YES'
-dnl ;;
-dnl no) GhcBuild_e='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-e=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-f,
-dnl [--enable-user-way-f build for \`user way f' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_f='YES'
-dnl ;;
-dnl no) GhcBuild_f='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-f=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-g,
-dnl [--enable-user-way-g build for \`user way g' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_g='YES'
-dnl ;;
-dnl no) GhcBuild_g='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-g=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-h,
-dnl [--enable-user-way-h build for \`user way h' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_h='YES'
-dnl ;;
-dnl no) GhcBuild_h='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-h=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-i,
-dnl [--enable-user-way-i build for \`user way i' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_i='YES'
-dnl ;;
-dnl no) GhcBuild_i='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-i=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-j,
-dnl [--enable-user-way-j build for \`user way j' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_j='YES'
-dnl ;;
-dnl no) GhcBuild_j='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-j=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-k,
-dnl [--enable-user-way-k build for \`user way k' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_k='YES'
-dnl ;;
-dnl no) GhcBuild_k='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-k=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-l,
-dnl [--enable-user-way-l build for \`user way l' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_l='YES'
-dnl ;;
-dnl no) GhcBuild_l='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-l=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-m,
-dnl [--enable-user-way-m build for \`user way m' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_m='YES'
-dnl ;;
-dnl no) GhcBuild_m='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-m=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-n,
-dnl [--enable-user-way-n build for \`user way n' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_n='YES'
-dnl ;;
-dnl no) GhcBuild_n='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-n=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-o,
-dnl [--enable-user-way-o build for \`user way o' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_o='YES'
-dnl ;;
-dnl no) GhcBuild_o='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-o=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-A,
-dnl [--enable-user-way-A build for \`user way A' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_A='YES'
-dnl ;;
-dnl no) GhcBuild_A='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-A=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-dnl AC_ARG_ENABLE(user-way-B,
-dnl [--enable-user-way-B build for \`user way B' (mostly for implementors)],
-dnl [case "$enableval" in
-dnl yes) GhcBuild_B='YES'
-dnl ;;
-dnl no) GhcBuild_B='NO'
-dnl ;;
-dnl *) echo "I don't understand this option: --enable-user-way-B=$enableval"
-dnl exit 1
-dnl ;;
-dnl esac])
-dnl
-AC_SUBST(GhcBuild_normal)
-AC_SUBST(GhcBuild_p)
-AC_SUBST(GhcBuild_t)
-AC_SUBST(GhcBuild_u)
-AC_SUBST(GhcBuild_mc)
-AC_SUBST(GhcBuild_mr)
-AC_SUBST(GhcBuild_mt)
-AC_SUBST(GhcBuild_mp)
-AC_SUBST(GhcBuild_mg)
-AC_SUBST(GhcBuild_2s)
-AC_SUBST(GhcBuild_1s)
-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 ** which Haskell compiler to bootstrap GHC with?
-# Figure out what Haskell compiler(s) to use for booting
-#
-# first, the defaults...
-WithGhcHc='haskell-compiler-unspecified'
-WithGhcHcType='HC_UNSPECIFIED'
-GhcBuilderVersion='26'
-
-AC_ARG_WITH(hc-for-ghc,
- [
-The Haskell compiler for bootstrapping GHC (if any); this option,
-if used, overrides --with-hc=<...>:
-
- --with-hc-for-ghc=<Haskell compiler>
- ghc* => Glasgow Haskell invoked by the name given
- C or c => Don't use a Haskell compiler;
- build from intermediate C (.hc) files.
- ],
- [case "$withval" in
- ghc* | glhc* )
- WithGhcHc=$withval
- ;;
- hbc* ) echo "HBC will not compile GHC 0.26 as is (sigh)"
- exit 1
- ;;
- c | C) WithGhcHc='C'
- WithGhcHcType='HC_USE_HC_FILES'
- ;;
- *) echo "I don't understand this option: --with-hc-for-ghc=$withval"
- exit 1
- ;;
- esac])
-
-# make sure that what they said makes sense.... set WithGhcHcType
-case $WithGhcHc in
- haskell-compiler-unspecified ) # maybe they said something earlier...
- if test $WithHc = 'haskell-compiler-unspecified' ; then
- echo "Neither --with-hc nor --with-hc-for-ghc was properly set"
- exit 1
- fi
- if test $WithHcType = 'HC_GLASGOW_GHC' ; then
- touch conftest.o
- $WithHc -v -C conftest.o > conftest.out 2>&1
- echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
- GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
- rm -rf conftest*
- fi
- ;;
- ghc* | glhc* )
- WithGhcHcType='HC_GLASGOW_GHC'
- AC_CHECK_PROG(have_ghc_ghc,$WithGhcHc,$ac_dir/$ac_word)
- if test -z "$have_ghc_ghc"; then
- echo "Can't find Glasgow Haskell to compile GHC with: $WithGhcHc"
- exit 1
- else
- touch conftest.o
- $WithGhcHc -v -C conftest.o > conftest.out 2>&1
- echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
- GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
- rm -rf conftest*
- fi
- ;;
- c | C) WithGhcHcType='HC_USE_HC_FILES'
- ;;