-# first, the defaults...
-WithGhcHc='haskell-compiler-unspecified'
-WithGhcHcType='HC_UNSPECIFIED'
-GhcBuilderVersion='28'
-
-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'
- ;;
-esac
-AC_SUBST(GhcBuilderVersion)
-AC_SUBST(WithGhcHc)
-AC_SUBST(WithGhcHcType)
-
-dnl ** use portable (slow) C? -- preferably not
-GhcWithRegisterised='YES'
-AC_ARG_ENABLE(portable-C,
- [Other things for GHC:
-
---enable-portable-C use portable C (slow), not \`registerised' (fast)],
- [case "$enableval" in
- yes) GhcWithRegisterised='NO'
- ;;
- no) GhcWithRegisterised='YES'
- ;;
- *) echo "I don't understand this option: --enable-portable-C=$enableval"
- exit 1
- ;;
- esac])
-
-if test $GhcWithRegisterised = 'YES'; then
- case $HostPlatform in
- alpha-* | hppa1.1-* | i386-* | m68k-* | mips-* | powerpc-* | sparc-* )
- ;;
- *)
- echo "Don't know non-portable C tricks for this platform: $HostPlatform"
- GhcWithRegisterised='NO'
- ;;
- esac
-fi
-AC_SUBST(GhcWithRegisterised)
-
-if test $GhcWithRegisterised = 'NO'; then
- 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...
-# ToDo: make sure we can do parallel for platform/circs...
-# ToDo: make sure we can do gransim for platform/circs...
-
-dnl ** build GHC compiler proper (\`hsc') from .hc files?
-GhcWithHscBuiltViaC='NO'
-AC_ARG_ENABLE(hsc-built-via-C,
- [--enable-hsc-built-via-C build compiler proper (hsc) from intermediate .hc
- files (disabled by default)],
- [case "$enableval" in
- yes) GhcWithHscBuiltViaC='YES'
- ;;
- no) GhcWithHscBuiltViaC='NO'
- ;;
- *) echo "I don't understand this option: --enable-hsc-built-via-C=$enableval"
- exit 1
- ;;
- esac])
-case $WithGhcHc in
- haskell-compiler-unspecified ) # maybe they said something earlier...
- if test $WithHcType = 'HC_USE_HC_FILES' ; then
- GhcWithHscBuiltViaC='YES'
- fi
- ;;
- c | C) GhcWithHscBuiltViaC='YES'
- ;;
- *) ;;
-esac
-AC_SUBST(GhcWithHscBuiltViaC)
-
-dnl ** build \`hsc' with -O?
-GhcWithHscOptimised='YES'
-AC_ARG_ENABLE(hsc-optimised,
- [--disable-hsc-optimised don't build compiler proper (hsc) with -O],
- [case "$enableval" in
- yes) GhcWithHscOptimised='YES'
- ;;
- no) GhcWithHscOptimised='NO'
- ;;
- *) echo "I don't understand this option: --enable-hsc-optimised=$enableval"
- exit 1
- ;;
- esac])
-AC_SUBST(GhcWithHscOptimised)
-
-dnl ** build \`hsc' with -DDEBUG?
-GhcWithHscDebug='NO'
-AC_ARG_ENABLE(hsc-debug,
- [--enable-hsc-debug build compiler proper (hsc) with -DDEBUG],
- [case "$enableval" in
- yes) GhcWithHscDebug='YES'
- ;;
- no) GhcWithHscDebug='NO'
- ;;
- *) echo "I don't understand this option: --enable-hsc-debug=$enableval"
- exit 1
- ;;
- esac])
-AC_SUBST(GhcWithHscDebug)
-
-dnl ** omit native-code generator from \`hsc'?
-GhcWithNativeCodeGen='YES'
-AC_ARG_ENABLE(native-code-generator,
- [--enable-native-code-generator build an n.c.g.
- [enabled for supported platforms]],
- [case "$enableval" in
- yes) GhcWithNativeCodeGen='YES'
- ;;
- no) GhcWithNativeCodeGen='NO'
- ;;
- *) echo "I don't understand this option: --enable-native-code-generator=$enableval"
- exit 1
- ;;
- esac])
-if test $GhcWithNativeCodeGen = 'YES'; then
- case $TargetPlatform in
- i386-* | alpha-* | sparc-* )
- ;;
- *)
- echo "Don't have a native-code generator for this platform: $TargetPlatform"
- GhcWithNativeCodeGen='NO'
- ;;
- esac
-fi
-AC_SUBST(GhcWithNativeCodeGen)
-
-dnl ** include Marlow's deforester in \`hsc'?
-GhcWithDeforester='NO'
-AC_ARG_ENABLE(deforester,
- [--enable-deforester build deforester into compiler (HACKERS ONLY)],
- [case "$enableval" in
- yes) GhcWithDeforester='YES'
- ;;
- no) GhcWithDeforester='NO'
- ;;
- *) echo "I don't understand this option: --enable-deforester=$enableval"
- exit 1
- ;;
- esac])
-AC_SUBST(GhcWithDeforester)
-
-dnl ** include Readline library?
-GhcWithReadline='NO'
-AC_ARG_ENABLE(readline-library,
- [--enable-readline-library include (GNU) readline library in -syslib GHC],
- [case "$enableval" in
- yes) GhcWithReadline='YES'
- ;;
- no) GhcWithReadline='NO'
- ;;
- *) echo "I don't understand this option: --enable-readline-library=$enableval"
- exit 1
- ;;
- esac])
-AC_SUBST(GhcWithReadline)
-
-dnl ** include Sockets library?
-GhcWithSockets='NO'
-AC_ARG_ENABLE(sockets-library,
- [--enable-sockets-library include the network-interface (sockets) library in -syslib GHC],
- [case "$enableval" in
- yes) GhcWithSockets='YES'
- ;;
- no) GhcWithSockets='NO'
- ;;
- *) echo "I don't understand this option: --enable-sockets-library=$enableval"
- exit 1
- ;;
- esac])
-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
-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
-done
-
-# here ends a very big if DoingGHC = 'ghc' ...
-fi
-
-# -------------------------------------------------------------------------
-dnl
-dnl * `HsLibs' CONFIGURATION STUFF