1 dnl == autoconf source for the Glasgow FP tools ==
2 dnl (grep for '^dnl' to see the outline of this file)
4 dnl * INITIAL SETUP, CHOICE OF PLATFORM(S)
7 # (c) The AQUA Project, Glasgow University, 1994-1995
9 # Configure script for the Glasgow functional programming tools
10 # (created automagically by autoconf...do not edit by hand)
12 # Do "./configure --help" to see what flags are available.
13 # (Better yet, read the documentation!)
15 AC_INIT(mk/platform.mk.in)
17 # -------------------------------------------------------------------------
18 # Prepare to generate the following header files
20 AC_CONFIG_HEADER(ghc/includes/config.h literate/lit-deatify/config.h)
22 # No, we don't do `--srcdir'...
23 if test x"$srcdir" != 'x.' ; then
24 echo "This configuration does not support the \`--srcdir' option."
29 hardtop=`echo $hardtop | sed 's|^/tmp_mnt/|/|' | sed 's|^/export/|/|' | sed 's|^/grasp_tmp|/local/grasp_tmp|'`
31 echo "*** The top of your build tree is: $hardtop"
34 # -------------------------------------------------------------------------
35 dnl ** choose what blobs to build (ghc,hslibs,haggis,happy,nofib,????)
37 # set to the name for the dir if doing it, otherwise empty
46 **********************************************************************
47 * Configuration options for the Glasgow functional-programming tools *
48 **********************************************************************
50 First, select *which* of the tools you want to build, with
51 --{enable,disable}-{hslibs,nofib,happy,haggis}. (Currently, you have to
54 Second, you may set one of a few applies-in-all-cases options. For
55 example, --with-tmpdir=/usr/tmp.
57 Then you may set various options which are specifically for the tools you
58 choose in step 1. For GHC, perhaps --enable-concurrent. For NoFib,
59 perhaps --enable-all-tests. And so on.
61 The rest of this message lists all of the configure options. If the option
62 is enabled by default, the message says how to disable it. And vice versa.
64 If you are confused, don't forget the installation documents that came with
67 *******************************************************************
68 ** FOR SELECTING WHICH GLASGOW FP TOOLS TO BUILD:]
69 [--enable-hslibs build suite of Haskell libraries],
71 yes) DoingHsLibs='hslibs'
75 *) echo "I don't understand this option: --enable-hslibs=$enableval"
79 if test "xxx$DoingHsLibs" = 'xxxhslibs' -a \( ! -d hslibs \) ; then
81 echo 'Doing --disable-hslibs, as there is no hslibs directory'
85 [--enable-nofib build NoFib suite as part of Glasgow FP tools],
87 yes) DoingNoFib='nofib'
91 *) echo "I don't understand this option: --enable-nofib=$enableval"
95 if test "xxx$DoingNoFib" = 'xxxnofib' -a \( ! -d nofib \) ; then
97 echo 'Doing --disable-nofib, as there is no nofib directory'
101 [--enable-happy build Happy parser-generator as part of Glasgow FP tools],
102 [case "$enableval" in
103 yes) DoingHappy='happy'
107 *) echo "I don't understand this option: --enable-happy=$enableval"
111 if test "xxx$DoingHappy" = 'xxxhappy' -a \( ! -d happy \) ; then
113 echo 'Doing --disable-happy, as there is no happy directory'
116 AC_ARG_ENABLE(haggis,
117 [--enable-haggis build Haggis GUI toolkit as part of Glasgow FP tools],
118 [case "$enableval" in
119 yes) DoingHaggis='haggis'
123 *) echo "I don't understand this option: --enable-haggis=$enableval"
127 if test "xxx$DoingHaggis" = 'xxxhaggis' -a \( ! -d haggis \) ; then
129 echo 'Doing --disable-haggis, as there is no haggis directory'
132 AC_SUBST(DoingHsLibs)
135 AC_SUBST(DoingHaggis)
137 # -------------------------------------------------------------------------
138 dnl ** choose host(/target/build) platform
139 # Guess host/target/build platform(s) if necessary.
140 # Partly stolen from GCC "configure".
142 if test "x$target" = xNONE ; then
143 if test "x$nonopt" != xNONE ; then
146 # This way of testing the result of a command substitution is
147 # defined by Posix.2 (section 3.9.1) as well as traditional shells.
148 if target=`$srcdir/config.guess` ; then
149 echo "Configuring for a ${target} host." 1>&2
151 echo 'Config.guess failed to determine the host type. You need \
152 to specify one.' 1>&2
153 if test -r config.status ; then
154 tail +2 config.status 1>&2
161 # "$host" defaults to "$target"
162 if test "x$host" = xNONE ; then
165 # "$build" defaults to "$host"
166 if test "x$build" = xNONE ; then
169 echo "This configuration does not support the \`--build' option."
173 dnl ** canonicalize platform names
174 # Canonicali[sz]e those babies
175 BuildPlatform=`/bin/sh $srcdir/config.sub $build` || exit 1
176 HostPlatform=`/bin/sh $srcdir/config.sub $host` || exit 1
177 TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1
179 if test x"$TargetPlatform" != x"$HostPlatform" ; then
180 echo "GHC configuration does not support differing host/target (i.e., cross-compiling)"
184 # The following will be more difficult when we *are* cross-compiling.
185 # Suitable names to slam in *_CPP are in platform.h.in.
186 # We also record the architecture, vendor, and operating system (OS)
188 case $HostPlatform in
189 alpha-dec-osf[[1234]]*)
190 HostPlatform=alpha-dec-osf1 # canonicalise for our purposes
191 TargetPlatform=alpha-dec-osf1 # this will work for now... (hack)
192 BuildPlatform=alpha-dec-osf1 #hack
193 HostPlatform_CPP='alpha_dec_osf1'
199 HostPlatform=hppa1.1-hp-hpux # canonicalise for our purposes (hack)
200 TargetPlatform=hppa1.1-hp-hpux
201 BuildPlatform=hppa1.1-hp-hpux
202 HostPlatform_CPP='hppa1_1_hp_hpux'
203 HostArch_CPP='hppa1_1'
207 i[[3456]]86-*-linuxaout*)
208 HostPlatform=i386-unknown-linuxaout # hack again
209 TargetPlatform=i386-unknown-linuxaout
210 BuildPlatform=i386-unknown-linuxaout
211 HostPlatform_CPP='i386_unknown_linuxaout'
213 HostVendor_CPP='unknown'
214 HostOS_CPP='linuxaout'
216 i[[3456]]86-*-linux*)
217 HostPlatform=i386-unknown-linux # hack again
218 TargetPlatform=i386-unknown-linux
219 BuildPlatform=i386-unknown-linux
220 HostPlatform_CPP='i386_unknown_linux'
222 HostVendor_CPP='unknown'
225 i[[3456]]86-*-freebsd*)
226 HostPlatform=i386-unknown-freebsd # hack again
227 TargetPlatform=i386-unknown-freebsd
228 BuildPlatform=i386-unknown-freebsd
229 HostPlatform_CPP='i386_unknown_freebsd'
231 HostVendor_CPP='unknown'
234 i[[3456]]86-*-netbsd*)
235 HostPlatform=i386-unknown-netbsd # hack again
236 TargetPlatform=i386-unknown-netbsd
237 BuildPlatform=i386-unknown-netbsd
238 HostPlatform_CPP='i386_unknown_netbsd'
240 HostVendor_CPP='unknown'
243 i[[3456]]86-*-solaris2*)
244 HostPlatform=i386-unknown-solaris2 # hack again
245 TargetPlatform=i386-unknown-solaris2
246 BuildPlatform=i386-unknown-solaris2
247 HostPlatform_CPP='i386_unknown_solaris2'
249 HostVendor_CPP='unknown'
250 HostOS_CPP='solaris2'
253 HostPlatform_CPP='m68k_next_nextstep2'
255 HostVendor_CPP='next'
256 HostOS_CPP='nextstep2'
259 HostPlatform_CPP='m68k_next_nextstep3'
261 HostVendor_CPP='next'
262 HostOS_CPP='nextstep3'
264 i[[3456]]86-next-nextstep3)
265 HostPlatform=i386-next-nextstep3 # hack again
266 TargetPlatform=i386-next-nextstep3
267 BuildPlatform=i386-next-nextstep3
268 HostPlatform_CPP='i386_next_nextstep3'
270 HostVendor_CPP='next'
271 HostOS_CPP='nextstep3'
274 HostPlatform=m68k-sun-sunos4
275 TargetPlatform=m68k-sun-sunos4 #hack
276 BuildPlatform=m68k-sun-sunos4 #hack
277 HostPlatform_CPP='m68k_sun_sunos4'
283 HostPlatform_CPP='mips_dec_ultrix'
284 HostArch_CPP='mipsel' # NB a little different
289 HostPlatform=mips-sgi-irix
290 TargetPlatform=mips-sgi-irix #hack
291 BuildPlatform=mips-sgi-irix #hack
292 HostPlatform_CPP='mips_sgi_irix'
293 HostArch_CPP='mipseb' # NB a little different
298 HostPlatform=powerpc-ibm-aix
299 TargetPlatform=powerpc-ibm-aix #hack
300 BuildPlatform=powerpc-ibm-aix #hack
301 HostPlatform_CPP='powerpc_ibm_aix'
302 HostArch_CPP='powerpc'
307 HostPlatform=sparc-sun-sunos4
308 TargetPlatform=sparc-sun-sunos4 #hack
309 BuildPlatform=sparc-sun-sunos4 #hack
310 HostPlatform_CPP='sparc_sun_sunos4'
316 HostPlatform=sparc-sun-solaris2
317 TargetPlatform=sparc-sun-solaris2 #hack
318 BuildPlatform=sparc-sun-solaris2 #hack
319 HostPlatform_CPP='sparc_sun_solaris2'
322 HostOS_CPP='solaris2'
325 echo "Unrecognised platform: $HostPlatform"
330 test -n "$verbose" && echo "Host platform set to $HostPlatform"
331 test -n "$verbose" -a x"$HostPlatform" != x"$TargetPlatform" \
332 && echo "Target platform set to $TargetPlatform"
333 test -n "$verbose" -a x"$BuildPlatform" != x"$HostPlatform" \
334 && echo "Build platform set to $BuildPlatform"
336 BuildPlatform_CPP=$HostPlatform_CPP
337 TargetPlatform_CPP=$HostPlatform_CPP
338 BuildArch_CPP=$HostArch_CPP
339 TargetArch_CPP=$HostArch_CPP
340 BuildOS_CPP=$HostOS_CPP
341 TargetOS_CPP=$HostOS_CPP
342 BuildVendor_CPP=$HostVendor_CPP
343 TargetVendor_CPP=$HostVendor_CPP
344 dnl Cannot afford all these AC_SUBSTs (because of braindead seds w/ 99 cmd limits
345 dnl AC_SUBST(BuildPlatform)
346 AC_SUBST(HostPlatform)
347 dnl AC_SUBST(TargetPlatform)
348 AC_SUBST(HostPlatform_CPP)
349 dnl AC_SUBST(BuildPlatform_CPP)
350 dnl AC_SUBST(TargetPlatform_CPP)
351 AC_SUBST(HostArch_CPP)
352 dnl AC_SUBST(BuildArch_CPP)
353 dnl AC_SUBST(TargetArch_CPP)
355 dnl AC_SUBST(BuildOS_CPP)
356 dnl AC_SUBST(TargetOS_CPP)
357 AC_SUBST(HostVendor_CPP)
358 dnl AC_SUBST(BuildVendor_CPP)
359 dnl AC_SUBST(TargetVendor_CPP)
361 # -------------------------------------------------------------------------
363 dnl * _GENERAL_ CONFIGURATION CHECKS
365 dnl ** are we at Glasgow?
367 if test -d /local/fp -a -d /users/fp/simonpj; then
368 echo "Brilliant! You must be a Glaswegian."
370 if test "x$prefix" = xNONE; then
372 echo "Assuming installation prefix of $prefix"
374 if test "x$exec_prefix" = xNONE; then
375 # Sigh: the defn of exec_prefix does not include the bin* bit...
377 exec_prefix=/local/fp
378 echo "Assuming binary installation prefix of $exec_prefix"
384 test -n "$verbose" && echo " setting AT_GLASGOW to $AT_GLASGOW"
392 dnl ** look for `perl', but watch out for version 4.035
394 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
395 if test -z "$PerlCmd"; then
396 echo "You must install perl before you can continue"
397 echo "Perhaps it is already installed, but not in your PATH?"
400 $PerlCmd -v >conftest.out 2>&1
401 if egrep "version 4" conftest.out >/dev/null 2>&1; then
402 if egrep "Patch level: 35" conftest.out >/dev/null 2>&1; then
404 ************************************************************************
405 Uh-oh...looks like you have Perl 4.035.
407 Perl version 4.035 has a bug to do with recursion that will bite if
408 you run the lit2texi script, when making Info files from
409 literate files of various sorts. Either use the current version
410 (4.036), an older version (e.g., perl 4.019) or apply the patch in
411 glafp-utils/perl-4.035-fixes to your 4.035 perl.
412 ************************************************************************
416 if egrep "version 5" conftest.out >/dev/null 2>&1; then
419 echo "I'm not sure if your version of perl will work,"
420 echo "but it's worth a shot, eh?"
426 dnl ** does #!.../perl work? (sometimes it's too long...)
427 echo "checking if \`#!$PerlCmd' works in shell scripts"
432 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
433 if test $? -ne 69; then
436 echo "It doesn't! Perhaps \`#!$PerlCmd' is too long (often 32 characters max)"
441 dnl ** check if perl library is properly installed
442 # (by seeing if a "do 'getopts.pl'" works...
443 if $PerlCmd -e 'do "getopts.pl" || exit(1); exit(0);' > /dev/null 2>&1 ; then
446 echo "I think your perl library is misinstalled."
447 echo "The following script did not work:"
448 echo ' do "getopts.pl" || exit(1); exit(0);'
453 dnl ** look for GCC and find out which version
454 # Figure out which C compiler to use. Gcc is preferred.
455 # If gcc, make sure it's at least 2.1
458 if test -z "$GCC"; then
459 echo "You would be better off with gcc"
460 echo "Perhaps it is already installed, but not in your PATH?"
463 gcc -v > conftest.out 2>&1
464 echo '/version (\d+)\.(\d+)/ && $1*10+$2 > 20 && print "YES";' > conftest.pl
465 HaveGcc=`eval $PerlCmd -n conftest.pl conftest.out`
466 if test -z "$HaveGcc"; then
467 echo "I'm not sure if your version of gcc will work,"
468 echo "but it's worth a shot, eh?"
476 dnl ** figure out how to do context diffs
477 # (NB: NeXTStep thinks diff'ing a file against itself is "trouble")
481 if diff -C 1 conftest1 conftest2 > /dev/null 2>&1 ; then
482 ContextDiffCmd='diff -C 1'
484 if diff -c1 conftest1 conftest2 > /dev/null 2>&1 ; then
485 ContextDiffCmd='diff -c1'
487 echo "Can't figure out how to do context diffs."
488 echo "Neither \`diff -C 1' nor \`diff -c1' works."
492 rm -f conftest1 conftest2
493 AC_SUBST(ContextDiffCmd)
495 dnl ** look for a decent parser generator (bison preferred)
498 AC_CHECK_PROG(YaccCmd, bison, bison -y)
499 if test -z "$YaccCmd"; then
500 echo "Can't find bison out there..."
501 AC_CHECK_PROG(WhatCmd, what, what, :)
502 AC_CHECK_PROG(YaccCmd, yacc, $ac_dir/$ac_word)
503 if test -z "$YaccCmd"; then
504 echo "But that's okay...I can't find yacc either."
507 $WhatCmd $YaccCmd > conftest.out
508 if egrep 'y1\.c 1\..*SMI' conftest.out >/dev/null 2>&1; then
509 echo "I don't trust your $YaccCmd; it looks like an old Sun yacc"
510 if test -x /usr/lang/yacc; then
511 echo "I'm going to use /usr/lang/yacc instead"
512 YaccCmd=/usr/lang/yacc
514 echo "I'm assuming the worst...no parser generator at all"
517 elif egrep 'y1\.c.*Revision: 4\.2\.6\.3.*DEC' conftest.out >/dev/null 2>&1; then
518 echo "I don't trust your $YaccCmd; it looks like a lame DEC yacc"
519 echo "I'm assuming the worst...no parser generator at all"
522 echo "But that's okay...as far as I know, your yacc will work."
528 dnl ** Find lex command (lex or flex) and library (-ll or -lfl)
532 #--------------------------------------------------------------
533 WithHc='haskell-compiler-unspecified'
534 WithHcType='HC_UNSPECIFIED'
538 *******************************************************************
539 ** GENERAL OPTIONS WHICH APPLY TO ALL TOOLS:
541 --with-hc=<Haskell compiler>
542 ghc* => Glasgow Haskell invoked by the name given
543 hbc* => Chalmers HBC, invoked by the name given
544 nhc* => Niklas Rojemo's "nhc", invoked by the name given
545 C or c => Don't use a Haskell compiler;
546 build from intermediate C (.hc) files.
547 in-place => Use ghc/driver/ghc; i.e. you've built GHC
548 and you want to use it un-installed ("in-place").
554 hbc* ) WithHc=$withval
556 nhc* ) WithHc=$withval
563 *) echo "I don't understand this option: --with-hc=$withval"
568 # make sure that what they said makes sense.... set WithHcType
570 haskell-compiler-unspecified ) # maybe they will say something later...
573 WithHcType='HC_GLASGOW_GHC'
574 AC_CHECK_PROG(have_ghc,$WithHc,$ac_dir/$ac_word)
575 if test -z "$have_ghc"; then
576 echo "Can't find Glasgow Haskell to compile with: $WithHc"
580 hbc* ) # Look for the dastardly competition
581 WithHcType='HC_CHALMERS_HBC'
582 AC_CHECK_PROG(have_hbc,$WithHc,YES,NO)
583 if test $have_hbc = 'NO' ; then
584 echo "Can't find Chalmers HBC to compile with: $WithHc"
588 nhc* ) # Look for Niklas Rojemo's "nhc"
589 WithHcType='HC_ROJEMO_NHC'
590 AC_CHECK_PROG(have_nhc,$WithHc,YES,NO)
591 if test $have_nhc = 'NO' ; then
592 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHc"
596 c | C) WithHcType='HC_USE_HC_FILES'
598 IN-PLACE) WithHcType='HC_GLASGOW_GHC'
599 WithHc='$(TOP_PWD)/ghc/driver/ghc'
605 dnl ** Possibly use something else instead of 'gcc'.
608 [--with-gcc=<gcc command>
609 Use a different command instead of 'gcc' for the GNU C compiler.],
610 [HaveGcc=YES; WhatGccIsCalled="$withval"])
611 AC_SUBST(WhatGccIsCalled)
613 dnl ** Choose which make to use (default 'make')
617 --with-make=<make command>
618 Use an alternate command instead of 'make'. This is useful
619 when GNU make is required (for instance when the default make
620 supplied by the system won't work, as is the case on FreeBSD
622 [MakeCmd="$withval"])
625 dnl ** possibly choose a different tmpdir (default /tmp)
626 # let the user decide where the best tmpdir is
627 # /tmp is the default; /usr/tmp is sometimes a good choice.
628 # Very site-specific.
632 --with-tmpdir=<temp directory>
633 Use an alternative directory for temporary files (presumably
634 because /tmp is too small).],
638 dnl ** possibly set a max heap for Haskell compilations
640 AC_ARG_WITH(max-heap,
642 --with-max-heap=<heap size, e.g., 32m>
643 Do all Haskell compilations with a heap of this size.],
644 [HcMaxHeapFlag="-H$withval"])
645 AC_SUBST(HcMaxHeapFlag)
647 dnl ** possibly set a max stack for Haskell compilations
649 AC_ARG_WITH(max-stack,
651 --with-max-stack=<stack size, e.g., 4m>
652 Do all Haskell compilations with a stack of this size.],
653 [HcMaxStackFlag="-K$withval"])
654 AC_SUBST(HcMaxStackFlag)
656 dnl ** figure out about mkdependHS
657 MkDependHSCmd='mkdependHS'
658 if test -f ./ghc/utils/mkdependHS/mkdependHS \
659 -o -f ./ghc/utils/mkdependHS/mkdependHS.prl ; then
660 MkDependHSCmd='TopDirPwd/ghc/utils/mkdependHS/mkdependHS'
662 AC_ARG_WITH(mkdependHS,
663 [--with-mkdependHS=<mkdependHS command>
664 Use a different command instead of 'mkdependHS'.],
665 [MkDependHSCmd="$withval"])
666 dnl AC_CHECK_PROG(have_mkdependHS,$MkDependHSCmd,YES,NO)
667 dnl if test $have_mkdependHS = 'NO' ; then
668 dnl MkDependHSCmd=':'
670 AC_SUBST(MkDependHSCmd)
672 # -------------------------------------------------------------------------
674 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
677 if echo $CPP | egrep gcc >/dev/null 2>&1; then
679 gcc -v -E conftest.c >/dev/null 2>conftest.out
680 echo '/(\S+\/cpp)/ && print "$1";' > conftest.pl
681 # GNUCPP: used in jmake.c (GnuCppCmd) and in mkdependC
682 # (where we could do with the usual pre-#defines)
683 GNUCPP="`eval $PerlCmd -n conftest.pl conftest.out`"
684 test -n "$verbose" && echo " setting GNUCPP to $GNUCPP"
685 # RAWCPP: we do not want *any* pre-#defines...
686 # (e.g., hscpp, mkdependHS)
687 RAWCPP="`eval $PerlCmd -n conftest.pl conftest.out` -traditional"
688 test -n "$verbose" && echo " setting RAWCPP to $RAWCPP"
691 # ToDo: what are GNUCPP and RAWCPP if the above if didn't fire? WDP 95/02
695 dnl ** figure out how to do a BSD-ish install
699 dnl ** figure out what arguments to feed to `ar'
701 AC_CHECK_PROG(ArCmd,ar,$ac_dir/$ac_word)
702 if test -z "$ArCmd"; then
703 echo "You don't seem to have ar...I have no idea how to make a library"
706 if $ArCmd clqs conftest.a >/dev/null 2>/dev/null; then
709 elif $ArCmd cqs conftest.a >/dev/null 2>/dev/null; then
712 elif $ArCmd clq conftest.a >/dev/null 2>/dev/null; then
715 elif $ArCmd cq conftest.a >/dev/null 2>/dev/null; then
718 elif $ArCmd cq conftest.a 2>&1 | grep 'no archive members specified' >/dev/null 2>/dev/null; then
722 echo "I can't figure out how to use your $ArCmd"
726 test -n "$ArCmd" && test -n "$verbose" && echo " setting ArCmd to $ArCmd"
729 dnl ** figure out if we need `ranlib'
731 if test -z "$NeedRanLib"; then
732 # we hackily override a few platforms on a case-by-case basis
733 case $HostPlatform in
740 test -n "$verbose" && echo " setting RANLIB to $RANLIB"
742 if test -n "$NeedRanLib"; then
747 dnl ** check for full ANSI header (.h) files
751 dnl ** check for specific header (.h) files that we are interested in
753 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 )
755 dnl ** check if it is safe to include both <time.h> and <sys/time.h>
759 dnl ** how do we get a timezone name?
763 dnl ** determine the type of signal()
767 dnl ** check for specific library functions that we are interested in
769 AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect setitimer stat sysconf timelocal times vadvise vfork)
771 dnl ** can we get alloca?
775 dnl ** determine whether or not const works
779 dnl ** check for leading underscores in symbol names
780 # We assume that they _aren't_ there if anything goes wrong.
782 echo checking for a leading underscore in symbol names
786 struct nlist xYzzY[] = {{"_xYzzY", 0},{0}};
794 if(nlist(argv[0], xYzzY) == 0 && xYzzY[0].n_value != 0)
798 }], LeadingUnderscore='YES', LeadingUnderscore='NO', LeadingUnderscore='YES')
799 test -n "$verbose" && echo " setting LeadingUnderscore to $LeadingUnderscore"
801 dnl -------------------------------------------------------
802 dnl ** which builds to build?
803 dnl ** (applies to anything w/ libraries (ghc, hslibs, ???)
804 dnl -------------------------------------------------------
805 # builds: normal = sequential _ap_o ; _p = profiling (sequential);
806 # _t = ticky; _u = unregisterized
811 # _mc = concurrent; _mr = profiled concurrent; _mt = ticky concurrent
812 # _mp = parallel; _mg = gransim
818 # GC builds: _2s, _1s, _du (, _gn)
840 # More could be added here...
842 AC_ARG_ENABLE(normal-build,
844 *******************************************************************
845 ** \`GHC' (GLASGOW HASKELL COMPILER) OPTIONS:
847 Choose all the \`builds' of GHC that you want:
849 --disable-normal-build do *not* build GHC for normal sequential code],
850 [case "$enableval" in
851 yes) Build_normal='YES'
853 no) Build_normal='NO'
855 *) echo "I don't understand this option: --enable-normal-build=$enableval"
860 AC_ARG_ENABLE(profiling,
861 [--disable-profiling do *not* build profiling features],
862 [case "$enableval" in
867 *) echo "I don't understand this option: --enable-profiling=$enableval"
873 [--enable-ticky build for \`ticky-ticky' profiling (for implementors)],
874 [case "$enableval" in
879 *) echo "I don't understand this option: --enable-ticky=$enableval"
884 AC_ARG_ENABLE(concurrent,
885 [--enable-concurrent turn on \`concurrent Haskell' features],
886 [case "$enableval" in
891 *) echo "I don't understand this option: --enable-concurrent=$enableval"
896 AC_ARG_ENABLE(profiled-concurrent,
897 [--enable-profiled-concurrent turn on profiling for \`concurrent Haskell'],
898 [case "$enableval" in
903 *) echo "I don't understand this option: --enable-profiled-concurrent=$enableval"
908 AC_ARG_ENABLE(ticky-concurrent,
909 [--enable-ticky-concurrent turn on \`ticky-ticky' profiling for \`concurrent Haskell'],
910 [case "$enableval" in
915 *) echo "I don't understand this option: --enable-ticky-concurrent=$enableval"
920 AC_ARG_ENABLE(parallel,
921 [--enable-parallel turn on \`parallel Haskell' features],
922 [case "$enableval" in
927 *) echo "I don't understand this option: --enable-parallel=$enableval"
932 AC_ARG_ENABLE(gransim,
933 [--enable-gransim turn on GranSim parallel simulator],
934 [case "$enableval" in
939 *) echo "I don't understand this option: --enable-gransim=$enableval"
945 [--enable-gc-2s a build with the 2-space copying garbage collector],
946 [case "$enableval" in
951 *) echo "I don't understand this option: --enable-gc-2s=$enableval"
957 [--enable-gc-1s a build with the 1-space compacting garbage collector],
958 [case "$enableval" in
963 *) echo "I don't understand this option: --enable-gc-1s=$enableval"
969 [--enable-gc-du a build with \`dual-mode' (1s/2s) garbage collector],
970 [case "$enableval" in
975 *) echo "I don't understand this option: --enable-gc-du=$enableval"
980 AC_ARG_ENABLE(user-way-a,
981 [--enable-user-way-a build for \`user way a' (mostly for implementors)],
982 [case "$enableval" in
987 *) echo "I don't understand this option: --enable-user-way-a=$enableval"
992 AC_ARG_ENABLE(user-way-b,
993 [--enable-user-way-b build for \`user way b' (mostly for implementors)],
994 [case "$enableval" in
999 *) echo "I don't understand this option: --enable-user-way-b=$enableval"
1004 AC_ARG_ENABLE(user-way-c,
1005 [--enable-user-way-c build for \`user way c' (mostly for implementors)],
1006 [case "$enableval" in
1011 *) echo "I don't understand this option: --enable-user-way-c=$enableval"
1016 AC_ARG_ENABLE(user-way-d,
1017 [--enable-user-way-d build for \`user way d' (mostly for implementors)],
1018 [case "$enableval" in
1023 *) echo "I don't understand this option: --enable-user-way-d=$enableval"
1028 AC_ARG_ENABLE(user-way-e,
1029 [--enable-user-way-e build for \`user way e' (mostly for implementors)],
1030 [case "$enableval" in
1035 *) echo "I don't understand this option: --enable-user-way-e=$enableval"
1040 AC_ARG_ENABLE(user-way-f,
1041 [--enable-user-way-f build for \`user way f' (mostly for implementors)],
1042 [case "$enableval" in
1047 *) echo "I don't understand this option: --enable-user-way-f=$enableval"
1052 AC_ARG_ENABLE(user-way-g,
1053 [--enable-user-way-g build for \`user way g' (mostly for implementors)],
1054 [case "$enableval" in
1059 *) echo "I don't understand this option: --enable-user-way-g=$enableval"
1064 AC_ARG_ENABLE(user-way-h,
1065 [--enable-user-way-h build for \`user way h' (mostly for implementors)],
1066 [case "$enableval" in
1071 *) echo "I don't understand this option: --enable-user-way-h=$enableval"
1076 AC_ARG_ENABLE(user-way-i,
1077 [--enable-user-way-i build for \`user way i' (mostly for implementors)],
1078 [case "$enableval" in
1083 *) echo "I don't understand this option: --enable-user-way-i=$enableval"
1088 AC_ARG_ENABLE(user-way-j,
1089 [--enable-user-way-j build for \`user way j' (mostly for implementors)],
1090 [case "$enableval" in
1095 *) echo "I don't understand this option: --enable-user-way-j=$enableval"
1100 AC_ARG_ENABLE(user-way-k,
1101 [--enable-user-way-k build for \`user way k' (mostly for implementors)],
1102 [case "$enableval" in
1107 *) echo "I don't understand this option: --enable-user-way-k=$enableval"
1112 AC_ARG_ENABLE(user-way-l,
1113 [--enable-user-way-l build for \`user way l' (mostly for implementors)],
1114 [case "$enableval" in
1119 *) echo "I don't understand this option: --enable-user-way-l=$enableval"
1124 AC_ARG_ENABLE(user-way-m,
1125 [--enable-user-way-m build for \`user way m' (mostly for implementors)],
1126 [case "$enableval" in
1131 *) echo "I don't understand this option: --enable-user-way-m=$enableval"
1136 AC_ARG_ENABLE(user-way-n,
1137 [--enable-user-way-n build for \`user way n' (mostly for implementors)],
1138 [case "$enableval" in
1143 *) echo "I don't understand this option: --enable-user-way-n=$enableval"
1148 AC_ARG_ENABLE(user-way-o,
1149 [--enable-user-way-o build for \`user way o' (mostly for implementors)],
1150 [case "$enableval" in
1155 *) echo "I don't understand this option: --enable-user-way-o=$enableval"
1160 AC_ARG_ENABLE(user-way-A,
1161 [--enable-user-way-A build for \`user way A' (mostly for implementors)],
1162 [case "$enableval" in
1167 *) echo "I don't understand this option: --enable-user-way-A=$enableval"
1172 AC_ARG_ENABLE(user-way-B,
1173 [--enable-user-way-B build for \`user way B' (mostly for implementors)],
1174 [case "$enableval" in
1179 *) echo "I don't understand this option: --enable-user-way-B=$enableval"
1184 dnl We do not use AC_SUBST to communicate the Build_* info,
1185 dnl as some seds (notably OSF) only allow 99 commands (!!!).
1186 dnl We will do the equivalent by a HACK further down.
1188 # -------------------------------------------------------------------------
1189 dnl GHC CONFIGURATION STUFF
1191 dnl ** which Haskell compiler to bootstrap GHC with?
1192 # Figure out what Haskell compiler(s) to use for booting
1194 # first, the defaults...
1195 WithGhcHc='haskell-compiler-unspecified'
1196 WithGhcHcType='HC_UNSPECIFIED'
1197 GhcBuilderVersion='28'
1199 AC_ARG_WITH(hc-for-ghc,
1201 The Haskell compiler for bootstrapping GHC (if any); this option,
1202 if used, overrides --with-hc=<...>:
1204 --with-hc-for-ghc=<Haskell compiler>
1205 ghc* => Glasgow Haskell invoked by the name given
1206 C or c => Don't use a Haskell compiler;
1207 build from intermediate C (.hc) files.
1213 hbc* ) echo "HBC will not compile GHC 0.26 as is (sigh)"
1216 c | C) WithGhcHc='C'
1217 WithGhcHcType='HC_USE_HC_FILES'
1219 *) echo "I don't understand this option: --with-hc-for-ghc=$withval"
1224 # make sure that what they said makes sense.... set WithGhcHcType
1226 haskell-compiler-unspecified ) # maybe they said something earlier...
1227 if test $WithHc = 'haskell-compiler-unspecified' ; then
1228 echo "Neither --with-hc nor --with-hc-for-ghc was properly set"
1231 if test $WithHcType = 'HC_GLASGOW_GHC' ; then
1233 $WithHc -v -C conftest.o > conftest.out 2>&1
1234 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1235 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1240 WithGhcHcType='HC_GLASGOW_GHC'
1241 AC_CHECK_PROG(have_ghc_ghc,$WithGhcHc,$ac_dir/$ac_word)
1242 if test -z "$have_ghc_ghc"; then
1243 echo "Can't find Glasgow Haskell to compile GHC with: $WithGhcHc"
1247 $WithGhcHc -v -C conftest.o > conftest.out 2>&1
1248 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1249 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1253 c | C) WithGhcHcType='HC_USE_HC_FILES'
1256 AC_SUBST(GhcBuilderVersion)
1258 AC_SUBST(WithGhcHcType)
1260 dnl ** use portable (slow) C? -- preferably not
1261 GhcWithRegisterised='YES'
1262 AC_ARG_ENABLE(portable-C,
1263 [Other things for GHC:
1265 --enable-portable-C use portable C (slow), not \`registerised' (fast)],
1266 [case "$enableval" in
1267 yes) GhcWithRegisterised='NO'
1269 no) GhcWithRegisterised='YES'
1271 *) echo "I don't understand this option: --enable-portable-C=$enableval"
1276 if test $GhcWithRegisterised = 'YES'; then
1277 case $HostPlatform in
1278 alpha-* | hppa1.1-* | i386-* | m68k-* | mips-* | powerpc-* | sparc-* )
1281 echo "Don't know non-portable C tricks for this platform: $HostPlatform"
1282 GhcWithRegisterised='NO'
1286 AC_SUBST(GhcWithRegisterised)
1288 if test $GhcWithRegisterised = 'NO'; then
1293 # ToDo: make sure we can do concurrent for platform/circs...
1294 # ToDo: make sure we can do profiling for platform/circs...
1295 # ToDo: make sure we can do parallel for platform/circs...
1296 # ToDo: make sure we can do gransim for platform/circs...
1298 dnl ** build GHC compiler proper (\`hsc') from .hc files?
1299 GhcWithHscBuiltViaC='NO'
1300 AC_ARG_ENABLE(hsc-built-via-C,
1301 [--enable-hsc-built-via-C build compiler proper (hsc) from intermediate .hc
1302 files (disabled by default)],
1303 [case "$enableval" in
1304 yes) GhcWithHscBuiltViaC='YES'
1306 no) GhcWithHscBuiltViaC='NO'
1308 *) echo "I don't understand this option: --enable-hsc-built-via-C=$enableval"
1313 haskell-compiler-unspecified ) # maybe they said something earlier...
1314 if test $WithHcType = 'HC_USE_HC_FILES' ; then
1315 GhcWithHscBuiltViaC='YES'
1318 c | C) GhcWithHscBuiltViaC='YES'
1322 AC_SUBST(GhcWithHscBuiltViaC)
1324 dnl ** build \`hsc' with -O?
1325 GhcWithHscOptimised='YES'
1326 AC_ARG_ENABLE(hsc-optimised,
1327 [--disable-hsc-optimised don't build compiler proper (hsc) with -O],
1328 [case "$enableval" in
1329 yes) GhcWithHscOptimised='YES'
1331 no) GhcWithHscOptimised='NO'
1333 *) echo "I don't understand this option: --enable-hsc-optimised=$enableval"
1337 AC_SUBST(GhcWithHscOptimised)
1339 dnl ** build \`hsc' with -DDEBUG?
1340 GhcWithHscDebug='NO'
1341 AC_ARG_ENABLE(hsc-debug,
1342 [--enable-hsc-debug build compiler proper (hsc) with -DDEBUG],
1343 [case "$enableval" in
1344 yes) GhcWithHscDebug='YES'
1346 no) GhcWithHscDebug='NO'
1348 *) echo "I don't understand this option: --enable-hsc-debug=$enableval"
1352 AC_SUBST(GhcWithHscDebug)
1354 dnl ** omit native-code generator from \`hsc'?
1355 GhcWithNativeCodeGen='YES'
1356 AC_ARG_ENABLE(native-code-generator,
1357 [--enable-native-code-generator build an n.c.g.
1358 [enabled for supported platforms]],
1359 [case "$enableval" in
1360 yes) GhcWithNativeCodeGen='YES'
1362 no) GhcWithNativeCodeGen='NO'
1364 *) echo "I don't understand this option: --enable-native-code-generator=$enableval"
1368 if test $GhcWithNativeCodeGen = 'YES'; then
1369 case $TargetPlatform in
1370 i386-* | alpha-* | sparc-* )
1373 echo "Don't have a native-code generator for this platform: $TargetPlatform"
1374 GhcWithNativeCodeGen='NO'
1378 AC_SUBST(GhcWithNativeCodeGen)
1380 dnl ** include Marlow's deforester in \`hsc'?
1381 GhcWithDeforester='NO'
1382 AC_ARG_ENABLE(deforester,
1383 [--enable-deforester build deforester into compiler (HACKERS ONLY)],
1384 [case "$enableval" in
1385 yes) GhcWithDeforester='YES'
1387 no) GhcWithDeforester='NO'
1389 *) echo "I don't understand this option: --enable-deforester=$enableval"
1393 AC_SUBST(GhcWithDeforester)
1395 dnl ** include Readline library?
1396 GhcWithReadline='NO'
1397 AC_ARG_ENABLE(readline-library,
1398 [--enable-readline-library include (GNU) readline library in -syslib GHC],
1399 [case "$enableval" in
1400 yes) GhcWithReadline='YES'
1402 no) GhcWithReadline='NO'
1404 *) echo "I don't understand this option: --enable-readline-library=$enableval"
1408 AC_SUBST(GhcWithReadline)
1410 dnl ** include Sockets library?
1412 AC_ARG_ENABLE(sockets-library,
1413 [--enable-sockets-library include the network-interface (sockets) library in -syslib GHC],
1414 [case "$enableval" in
1415 yes) GhcWithSockets='YES'
1417 no) GhcWithSockets='NO'
1419 *) echo "I don't understand this option: --enable-sockets-library=$enableval"
1423 AC_SUBST(GhcWithSockets)
1425 # Here, by HACK means, we dump all the Build_ info
1426 # into a file. See comment above.
1427 rm -f ghc/mk/buildinfo.mk
1428 echo creating ghc/mk/buildinfo.mk
1429 touch ghc/mk/buildinfo.mk
1430 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
1431 eval "yy=\$Build_$xx"
1432 echo "Build_$xx = $yy" >> ghc/mk/buildinfo.mk
1435 # -------------------------------------------------------------------------
1437 dnl * `HsLibs' CONFIGURATION STUFF
1439 if test "xxx$DoingHsLibs" = 'xxxhslibs' ; then
1442 dnl ** which Haskell compiler to use on hslibs?
1443 WithHsLibsHc='haskell-compiler-unspecified'
1444 WithHsLibsHcType='HC_UNSPECIFIED'
1446 AC_ARG_WITH(hc-for-hslibs,
1448 *******************************************************************
1449 ** \`HsLibs' HASKELL LIBRARIES OPTIONS:
1451 The Haskell compiler to compile the Haskell Libraries suite; this
1452 option, if used, overrides --with-hc=<...>:
1454 --with-hc-for-hslibs=<Haskell compiler>
1455 ghc* => Glasgow Haskell invoked by the name given
1456 and you want to use it un-installed ("in-place").],
1459 WithHsLibsHc=$withval
1462 WithHsLibsHc='IN-PLACE'
1464 *) echo "I don't understand this option: --with-hc-for-hslibs=$withval"
1469 # make sure that what they said makes sense.... set WithHsLibsHcType
1470 case $WithHsLibsHc in
1471 haskell-compiler-unspecified ) # maybe they said something earlier...
1472 if test $WithHc = 'haskell-compiler-unspecified' ; then
1473 echo "Neither --with-hc nor --with-hc-for-hslibs was properly set"
1478 WithHsLibsHcType='HC_GLASGOW_GHC'
1479 AC_CHECK_PROG(have_ghc_hslibs,$WithHsLibsHc,$ac_dir/$ac_word)
1480 if test -z "$have_ghc_hslibs"; then
1481 echo "Can't find Glasgow Haskell to compile HsLibs with: $WithHsLibsHc"
1485 IN-PLACE) WithHsLibsHcType='HC_GLASGOW_GHC'
1486 WithHsLibsHc='$(TOP_PWD)/ghc/driver/ghc'
1489 AC_SUBST(WithHsLibsHc)
1490 AC_SUBST(WithHsLibsHcType)
1492 # Here, by HACK means, we dump all the Build_ info
1493 # into a file. See comment above.
1494 rm -f hslibs/mk/buildinfo.mk
1495 echo creating hslibs/mk/buildinfo.mk
1496 cat > hslibs/mk/buildinfo.mk <<EOF
1497 # ** DO NOT EDIT! **
1498 # This file is obliterated every time 'configure' is run!
1501 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
1502 eval "yy=\$Build_$xx"
1503 echo "Build_$xx = $yy" >> hslibs/mk/buildinfo.mk
1507 # here ends a very big if DoingHsLibs = 'hslibs' ...
1510 # -------------------------------------------------------------------------
1512 dnl * `Happy' CONFIGURATION STUFF
1514 if test "xxx$DoingHappy" = 'xxxhappy' ; then
1517 dnl ** which Haskell compiler to use on happy?
1518 WithHappyHc='haskell-compiler-unspecified'
1519 WithHappyHcType='HC_UNSPECIFIED'
1521 AC_ARG_WITH(hc-for-happy,
1523 *******************************************************************
1524 ** \`Happy' PARSER-GENERATOR OPTIONS:
1526 The Haskell compiler to compile Happy; this option, if used, overrides
1529 --with-hc-for-happy=<Haskell compiler>
1530 ghc* => Glasgow Haskell invoked by the name given
1531 hbc* => Chalmers HBC, invoked by the name given
1532 nhc* => Niklas Rojemo's "nhc", invoked by the name given
1533 in-place => Use ghc/driver/ghc; i.e. you've built GHC
1534 and you want to use it un-installed ("in-place").],
1537 WithHappyHc=$withval
1539 hbc* ) WithHappyHc=$withval
1541 nhc* ) WithHappyHc=$withval
1544 WithHappyHc='IN-PLACE'
1546 *) echo "I don't understand this option: --with-hc-for-happy=$withval"
1551 # make sure that what they said makes sense.... set WithHappyHcType
1552 case $WithHappyHc in
1553 haskell-compiler-unspecified ) # maybe they said something earlier...
1554 if test $WithHc = 'haskell-compiler-unspecified' ; then
1555 echo "Neither --with-hc nor --with-hc-for-happy was properly set"
1560 WithHappyHcType='HC_GLASGOW_GHC'
1561 AC_CHECK_PROG(have_ghc_happy,$WithHappyHc,$ac_dir/$ac_word)
1562 if test -z "$have_ghc_happy"; then
1563 echo "Can't find Glasgow Haskell to compile Happy with: $WithHappyHc"
1567 hbc* ) # Look for the dastardly competition
1568 WithHappyHcType='HC_CHALMERS_HBC'
1569 AC_CHECK_PROG(have_hbc,$WithHappyHc,YES,NO)
1570 if test $have_hbc = 'NO' ; then
1571 echo "Can't find Chalmers HBC to compile with: $WithHappyHc"
1575 nhc* ) # Look for Niklas Rojemo's "nhc"
1576 WithHappyHcType='HC_ROJEMO_NHC'
1577 AC_CHECK_PROG(have_nhc,$WithHappyHc,YES,NO)
1578 if test $have_nhc = 'NO' ; then
1579 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHappyHc"
1583 IN-PLACE) WithHappyHcType='HC_GLASGOW_GHC'
1584 WithHappyHc='$(TOP_PWD)/ghc/driver/ghc'
1587 AC_SUBST(WithHappyHc)
1588 AC_SUBST(WithHappyHcType)
1590 # here ends a very big if DoingHappy = 'happy' ...
1593 # -------------------------------------------------------------------------
1595 dnl * `Haggis' CONFIGURATION STUFF
1597 if test "xxx$DoingHaggis" = 'xxxhaggis' ; then
1600 dnl ** which Haskell compiler to use on haggis?
1601 WithHaggisHc='haskell-compiler-unspecified'
1602 WithHaggisHcType='HC_UNSPECIFIED'
1604 AC_ARG_WITH(hc-for-haggis,
1606 *******************************************************************
1607 ** \`Haggis' HASKELL GUI TOOLKIT OPTIONS:
1609 The Haskell compiler to compile the Haggis toolkit; this option, if
1610 used, overrides --with-hc=<...>:
1612 --with-hc-for-haggis=<Haskell compiler>
1613 ghc* => Glasgow Haskell invoked by the name given
1614 and you want to use it un-installed ("in-place").],
1617 WithHaggisHc=$withval
1620 WithHaggicHs='IN-PLACE'
1622 *) echo "I don't understand this option: --with-hc-for-haggis=$withval"
1627 # make sure that what they said makes sense.... set WithHaggisHcType
1628 case $WithHaggisHc in
1629 haskell-compiler-unspecified ) # maybe they said something earlier...
1630 if test $WithHc = 'haskell-compiler-unspecified' ; then
1631 echo "Neither --with-hc nor --with-hc-for-haggis was properly set"
1636 WithHaggisHcType='HC_GLASGOW_GHC'
1637 AC_CHECK_PROG(have_ghc_haggis,$WithHaggisHc,$ac_dir/$ac_word)
1638 if test -z "$have_ghc_haggis"; then
1639 echo "Can't find Glasgow Haskell to compile Haggis with: $WithHaggisHc"
1643 IN-PLACE) WithHaggisHcType='HC_GLASGOW_GHC'
1644 WithHaggisHc='$(TOP_PWD)/ghc/driver/ghc'
1647 AC_SUBST(WithHaggisHc)
1648 AC_SUBST(WithHaggisHcType)
1650 # builds stuff?? ToDo
1652 # here ends a very big if DoingHaggis = 'haggis' ...
1655 # -------------------------------------------------------------------------
1657 dnl * `NoFib' CONFIGURATION STUFF
1659 if test "xxx$DoingNoFib" = 'xxxnofib' ; then
1662 dnl ** which Haskell compiler to test with NoFib?
1663 WithNoFibHc='haskell-compiler-unspecified'
1664 WithNoFibHcType='HC_UNSPECIFIED'
1666 AC_ARG_WITH(hc-for-nofib,
1668 *******************************************************************
1669 ** NoFib HASKELL BENCHMARK SUITE OPTIONS:
1671 The Haskell compiler to compile the NoFib programs; this option, if
1672 used, overrides --with-hc=<...>:
1674 --with-hc-for-nofib=<Haskell compiler>
1675 ghc* => Glasgow Haskell invoked by the name given
1676 hbc* => Chalmers HBC, invoked by the name given
1677 nhc* => Niklas Rojemo's "nhc", invoked by the name given
1678 in-place => Use ghc/driver/ghc; i.e. you've built GHC
1679 and you want to use it un-installed ("in-place").
1683 WithNoFibHc=$withval
1685 hbc* ) WithNoFibHc=$withval
1687 nhc* ) WithNoFibHc=$withval
1690 WithNoFibHc='IN-PLACE'
1692 *) echo "I don't understand this option: --with-hc-for-nofib=$withval"
1697 # make sure that what they said makes sense.... set WithHappyHcType
1698 case $WithNoFibHc in
1699 haskell-compiler-unspecified ) # maybe they said something earlier...
1700 if test $WithHc = 'haskell-compiler-unspecified' ; then
1701 echo "Neither --with-hc nor --with-hc-for-nofib was properly set"
1706 WithNoFibHcType='HC_GLASGOW_GHC'
1707 AC_CHECK_PROG(have_ghc_nofib,$WithNoFibHc,$ac_dir/$ac_word)
1708 if test -z "$have_ghc_nofib"; then
1709 echo "Can't find Glasgow Haskell to compile NoFib with: $WithNoFibHc"
1713 hbc* ) # Look for the dastardly competition
1714 WithNoFibHcType='HC_CHALMERS_HBC'
1715 AC_CHECK_PROG(have_hbc,$WithNoFibHc,YES,NO)
1716 if test $have_hbc = 'NO' ; then
1717 echo "Can't find Chalmers HBC to compile NoFib with: $WithNoFibHc"
1721 nhc* ) # Look for Niklas Rojemo's "nhc"
1722 WithNoFibHcType='HC_ROJEMO_NHC'
1723 AC_CHECK_PROG(have_nhc,$WithNoFibHc,YES,NO)
1724 if test $have_nhc = 'NO' ; then
1725 echo "Can't find Niklas Rojemo's NHC to compile NoFib with: $WithNoFibHc"
1729 IN-PLACE) WithNoFibHcType='HC_GLASGOW_GHC'
1730 WithNoFibHc='$(TOP_PWD)/ghc/driver/ghc'
1733 AC_SUBST(WithNoFibHc)
1734 AC_SUBST(WithNoFibHcType)
1736 dnl ** what mkworld \`setup' should be used?
1739 --with-setup=<setup> : What mkworld \`setup' should be used?
1740 Choices: ghc, hbc, nhc
1743 ghc ) MkWorldSetup='ghc'
1745 hbc ) MkWorldSetup='hbc'
1747 nhc ) MkWorldSetup='nhc'
1749 *) echo "I don't understand this option: --with-setup=$withval"
1754 if test $MkWorldSetup = 'std' ; then
1755 echo 'You must do --with-setup=... (one of: ghc, hbc, or nhc) for NoFib'
1759 # ---------------------------------------
1760 # What sets of tests should be run.
1762 IncludeRealNoFibTests='YES' # defaults
1763 IncludeSpectralNoFibTests='YES'
1764 IncludeImaginaryNoFibTests='YES'
1765 IncludeSpecialiseNoFibTests='NO'
1766 IncludeGHC_ONLYNoFibTests='NO'
1767 IncludePRIVATENoFibTests='NO'
1768 IncludeParallelNoFibTests='NO'
1770 dnl ** should *all* NoFib tests be run?
1771 # special catch-all variant
1772 AC_ARG_ENABLE(all-tests,
1773 [Possibly turn on *all* of the possible tests (a sane choice
1776 --enable-all-tests do *all* tests],
1777 [case "$enableval" in
1778 yes) IncludeGHC_ONLYNoFibTests='YES'
1779 IncludeSpecialiseNoFibTests='YES'
1780 IncludePRIVATENoFibTests='YES'
1781 IncludeParallelNoFibTests='YES'
1783 no) IncludeGHC_ONLYNoFibTests='NO'
1784 IncludeSpecialiseNoFibTests='NO'
1785 IncludePRIVATENoFibTests='NO'
1786 IncludeParallelNoFibTests='NO'
1788 IncludeRealNoFibTests='NO'
1789 IncludeSpectralNoFibTests='NO'
1790 IncludeImaginaryNoFibTests='NO'
1792 *) echo "I don't understand this option: --enable-all-tests=$enableval"
1797 dnl ** turn on/off individual categories of tests...
1798 # individual categories
1799 AC_ARG_ENABLE(imaginary-tests,
1801 Enable/disable individual categories of tests:
1803 --disable-imaginary-tests do *not* include imaginary tests],
1804 [case "$enableval" in
1805 yes) IncludeImaginaryNoFibTests='YES'
1807 no) IncludeImaginaryNoFibTests='NO'
1809 *) echo "I don't understand this option: --enable-imaginary-tests=$enableval"
1814 AC_ARG_ENABLE(spectral-tests,
1815 [--disable-spectral-tests do *not* include spectral tests],
1816 [case "$enableval" in
1817 yes) IncludeSpectralNoFibTests='YES'
1819 no) IncludeSpectralNoFibTests='NO'
1821 *) echo "I don't understand this option: --enable-spectral-tests=$enableval"
1826 AC_ARG_ENABLE(real-tests,
1827 [--disable-real-tests do *not* include real tests],
1828 [case "$enableval" in
1829 yes) IncludeRealNoFibTests='YES'
1831 no) IncludeRealNoFibTests='NO'
1833 *) echo "I don't understand this option: --enable-real-tests=$enableval"
1838 AC_ARG_ENABLE(GHC-ONLY-tests,
1839 [--enable-GHC-ONLY-tests include GHC_ONLY tests],
1840 [case "$enableval" in
1841 yes) IncludeGHC_ONLYNoFibTests='YES'
1843 no) IncludeGHC_ONLYNoFibTests='NO'
1845 *) echo "I don't understand this option: --enable-GHC-ONLY-tests=$enableval"
1850 AC_ARG_ENABLE(specialise-tests,
1851 [--enable-specialise-tests include specialisation tests],
1852 [case "$enableval" in
1853 yes) IncludeSpecialiseNoFibTests='YES'
1855 no) IncludeSpecialiseNoFibTests='NO'
1857 *) echo "I don't understand this option: --enable-specialise-tests=$enableval"
1862 AC_ARG_ENABLE(PRIVATE-tests,
1863 [--enable-PRIVATE-tests include PRIVATE tests],
1864 [case "$enableval" in
1865 yes) IncludePRIVATENoFibTests='YES'
1867 no) IncludePRIVATENoFibTests='NO'
1869 *) echo "I don't understand this option: --enable-PRIVATE-tests=$enableval"
1874 AC_ARG_ENABLE(parallel-tests,
1875 [--enable-parallel-tests include parallel tests
1877 [case "$enableval" in
1878 yes) IncludeParallelNoFibTests='YES'
1880 no) IncludeParallelNoFibTests='NO'
1882 *) echo "I don't understand this option: --enable-parallel-tests=$enableval"
1887 dnl not AC_SUBSTd because of 99-command seds (sigh)
1888 dnl (See what follows instead)
1889 dnl AC_SUBST(IncludeRealNoFibTests)
1890 dnl AC_SUBST(IncludeSpectralNoFibTests)
1891 dnl AC_SUBST(IncludeImaginaryNoFibTests)
1892 dnl AC_SUBST(IncludeGHC_ONLYNoFibTests)
1893 dnl AC_SUBST(IncludeSpecialiseNoFibTests)
1894 dnl AC_SUBST(IncludePRIVATENoFibTests)
1895 dnl AC_SUBST(IncludeParallelNoFibTests)
1897 # Here, by HACK means, we dump all the Include*NoFibTests info
1898 # into a file. See comment above.
1899 rm -f nofib/mk/buildinfo.mk
1900 echo creating nofib/mk/buildinfo.mk
1901 cat > nofib/mkworld/buildinfo.jm <<EOF
1902 # ** DO NOT EDIT! **
1903 # This file is obliterated every time 'configure' is run!
1906 for xx in Real Spectral Imaginary GHC_ONLY Specialise PRIVATE Parallel ; do
1907 eval "yy=\$Include${xx}NoFibTests"
1908 echo "Include${xx}NoFibTests = $yy" >> nofib/mk/buildinfo.mk
1911 # Here, by HACK means, we add all the Build_ info
1912 # into a file. See comment above.
1914 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
1915 eval "yy=\$Build_$xx"
1916 echo "Build_$xx = $yy" >> nofib/mk/buildinfo.mk
1919 # here ends a very big if DoingNoFib = 'nofib' ...
1922 # -------------------------------------------------------------------------
1924 dnl * extract non-header files with substitution (end)
1926 AC_SUBST(MkWorldSetup)
1928 AC_OUTPUT(mk/platform.mk mk/utils.mk mk/install.mk ghc/mk/ghcconfig.mk ghc/includes/platform.h)
1930 echo '************************************************'
1931 echo '*** NOW DO: make boot; make all'
1932 echo '************************************************'