[project @ 1996-01-11 14:06:51 by partain]
[ghc-hetmet.git] / configure.in
1 dnl == autoconf source for the Glasgow FP tools ==
2 dnl (grep for '^dnl' to see the outline of this file)
3 dnl
4 dnl * INITIAL SETUP, CHOICE OF PLATFORM(S)
5 #!/bin/sh
6 #
7 # (c) The AQUA Project, Glasgow University, 1994-1995
8 #
9 # Configure script for the Glasgow functional programming tools
10 # (created automagically by autoconf...do not edit by hand)
11 #
12 # Do "./configure --help" to see what flags are available.
13 # (Better yet, read the documentation!)
14 #
15 # -------------------------------------------------------------------------
16 AC_INIT(STARTUP.in)
17 #
18 # Prepare to generate the following header files
19 #
20 AC_CONFIG_HEADER(ghc/includes/config.h literate/config.h)
21 # ToDo !!!!!!!!!!!!!!!!
22 #
23 # No, we don't do `--srcdir'...
24 if test x"$srcdir" != 'x.' ; then
25     echo "This configuration does not support the \`--srcdir' option."
26     exit 1
27 fi
28
29 # -------------------------------------------------------------------------
30 dnl ** choose what blobs to build (ghc,haggis,happy,nofib,????)
31
32 # set to the name for the dir if doing it, otherwise empty
33 DoingGHC='ghc'
34 DoingNoFib=''
35 DoingHappy=''
36 DoingHaggis=''
37 # the following are not normally changed
38 DoingLiterate='literate'
39 DoingMkWorld='mkworld'
40 DoingGlaFpUtils='glafp-utils'
41
42 MkWorldSetup='std'
43
44 AC_ARG_ENABLE(ghc,
45    [
46 **********************************************************************
47 * Configuration options for the Glasgow functional-programming tools *
48 **********************************************************************
49
50 First, select *which* of the tools you want to build,
51 with --{enable,disable}-{ghc,nofib,happy,haggis}.
52 (The default is: only GHC (Glasgow Haskell compiler).)
53
54 Second, you may set one of a few applies-in-all-cases options.
55 For example, --with-tmpdir=/usr/tmp.
56
57 Then you may set various options which are specifically for the
58 tools you choose in step 1.  For GHC, perhaps --enable-concurrent.
59 For NoFib, perhaps --enable-all-tests.  And so on.
60
61 The rest of this message lists all of the configure options.  If the
62 option is enabled by default, the message says how to disable it.  And
63 vice versa.
64
65 If you are confused, don't forget the installation documents that came
66 with the software!
67
68 *******************************************************************
69 ** FOR SELECTING WHICH GLASGOW FP TOOLS TO BUILD:
70
71 --disable-ghc     do *not* build GHC as part of Glasgow FP tools],
72    [case "$enableval" in
73         yes) DoingGHC='ghc'
74              ;;
75         no)  DoingGHC=''
76              ;;
77         *)   echo "I don't understand this option: --enable-ghc=$enableval"
78              exit 1
79              ;;
80     esac])
81 if test "xxx$DoingGHC" = 'xxxghc' -a \( ! -d ghc \) ; then
82     DoingGHC=''
83     echo 'Doing --disable-ghc, as there is no ghc directory'
84 fi
85 ghc_mkworld_site_ghc_jm='ghc/mkworld/site-ghc.jm'
86 ghc_includes_platform_h='ghc/includes/platform.h'
87 # duznae work: ghc_includes_config_h='ghc/includes/config.h'
88 if test "xxx$DoingGHC" = 'xxx' ; then
89     ghc_mkworld_site_ghc_jm=''
90     ghc_includes_platform_h=''
91 #   ghc_includes_config_h=''
92 fi
93
94 AC_ARG_ENABLE(nofib,
95    [--enable-nofib    build NoFib suite as part of Glasgow FP tools],
96    [case "$enableval" in
97         yes) DoingNoFib='nofib'
98              ;;
99         no)  DoingNoFib=''
100              ;;
101         *)   echo "I don't understand this option: --enable-nofib=$enableval"
102              exit 1
103              ;;
104     esac])
105 if test "xxx$DoingNoFib" = 'xxxnofib' -a \( ! -d nofib \) ; then
106     DoingNoFib=''
107     echo 'Doing --disable-nofib, as there is no nofib directory'
108 fi
109 nofib_mkworld_site_nofib_jm='nofib/mkworld/site-nofib.jm'
110 if test "xxx$DoingNoFib" = 'xxx' ; then
111     nofib_mkworld_site_nofib_jm=''
112 fi
113
114 AC_ARG_ENABLE(happy,
115    [--enable-happy    build Happy parser-generator as part of Glasgow FP tools],
116    [case "$enableval" in
117         yes) DoingHappy='happy'
118              ;;
119         no)  DoingHappy=''
120              ;;
121         *)   echo "I don't understand this option: --enable-happy=$enableval"
122              exit 1
123              ;;
124     esac])
125 if test "xxx$DoingHappy" = 'xxxhappy' -a \( ! -d happy \) ; then
126     DoingHappy=''
127     echo 'Doing --disable-happy, as there is no happy directory'
128 fi
129
130 AC_ARG_ENABLE(haggis,
131    [--disable-haggis  build Haggis GUI toolkit as part of Glasgow FP tools],
132    [case "$enableval" in
133         yes) DoingHaggis='haggis'
134              ;;
135         no)  DoingHaggis=''
136              ;;
137         *)   echo "I don't understand this option: --enable-haggis=$enableval"
138              exit 1
139              ;;
140     esac])
141 if test "xxx$DoingHaggis" = 'xxxhaggis' -a \( ! -d haggis \) ; then
142     DoingHaggis=''
143     echo 'Doing --disable-haggis, as there is no haggis directory'
144 fi
145
146 AC_ARG_ENABLE(literate,
147    [
148 The following three are \`for hackers only':
149 --disable-literate    do *not* build literate-programming stuff],
150    [case "$enableval" in
151         yes) DoingLiterate='literate'
152              ;;
153         no)  DoingLiterate=''
154              ;;
155         *)   echo "I don't understand this option: --enable-literate=$enableval"
156              exit 1
157              ;;
158     esac])
159 if test "xxx$DoingLiterate" = 'xxxliterate' -a \( ! -d literate \) ; then
160     DoingLiterate=''
161     echo 'Doing --disable-literate, as there is no literate directory'
162 fi
163
164 AC_ARG_ENABLE(mkworld,
165    [--disable-mkworld     do *not* build \`mkworld' configuration stuff],
166    [case "$enableval" in
167         yes) DoingMkWorld='mkworld'
168              ;;
169         no)  DoingMkWorld=''
170              ;;
171         *)   echo "I don't understand this option: --enable-mkworld=$enableval"
172              exit 1
173              ;;
174     esac])
175 if test "xxx$DoingMkWorld" = 'xxxmkworld' -a \( ! -d mkworld \) ; then
176     DoingMkWorld=''
177     echo 'Doing --disable-mkworld, as there is no mkworld directory'
178 fi
179
180 AC_ARG_ENABLE(glafp-utils,
181    [--disable-glafp-utils do *not* build \`glafp utilities'],
182    [case "$enableval" in
183         yes) DoingGlaFpUtils='glafp-utils'
184              ;;
185         no)  DoingGlaFpUtils=''
186              ;;
187         *)   echo "I don't understand this option: --enable-glafp-utils=$enableval"
188              exit 1
189              ;;
190     esac])
191 if test "xxx$DoingGlaFpUtils" = 'xxxglafp-utils' -a \( ! -d glafp-utils \) ; then
192     DoingGlaFpUtils=''
193     echo 'Doing --disable-glafp-utils, as there is no glafp-utils directory'
194 fi
195
196 AC_SUBST(DoingGHC)
197 AC_SUBST(DoingNoFib)
198 AC_SUBST(DoingHappy)
199 AC_SUBST(DoingHaggis)
200 AC_SUBST(DoingLiterate)
201 AC_SUBST(DoingMkWorld)
202 AC_SUBST(DoingGlaFpUtils)
203
204 # -------------------------------------------------------------------------
205 dnl ** choose host(/target/build) platform
206 # Guess host/target/build platform(s) if necessary.
207 # Partly stolen from GCC "configure".
208 #
209 if test "x$target" = xNONE ; then
210     if test "x$nonopt" != xNONE; then
211         target=$nonopt
212     else
213         # This way of testing the result of a command substitution is
214         # defined by Posix.2 (section 3.9.1) as well as traditional shells.
215         if target=`$srcdir/config.guess` ; then
216             echo "Configuring for a ${target} host." 1>&2
217         else
218             echo 'Config.guess failed to determine the host type.  You need \
219 to specify one.' 1>&2
220             if [ -r config.status ]
221             then
222                 tail +2 config.status 1>&2
223             fi
224             exit 1
225         fi
226     fi
227 fi
228
229 # "$host" defaults to "$target"
230 if test "x$host" = xNONE ; then
231     host=$target
232 fi
233 # "$build" defaults to "$host"
234 if test "x$build" = xNONE ; then
235     build=$host
236 else
237     echo "This configuration does not support the \`--build' option."
238     exit 1
239 fi
240
241 dnl ** canonicalize platform names
242 # Canonicali[sz]e those babies
243 BuildPlatform=`/bin/sh $srcdir/config.sub $build` || exit 1
244 HostPlatform=`/bin/sh $srcdir/config.sub $host` || exit 1
245 TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1
246
247 if test x"$TargetPlatform" != x"$HostPlatform" ; then
248     echo "GHC configuration does not support differing host/target (i.e., cross-compiling)"
249     exit 1
250 fi
251
252 # The following will be more difficult when we *are* cross-compiling.
253 # Suitable names to slam in *_CPP are in platform.h.in.
254 # We also record the architecture, vendor, and operating system (OS)
255 # separately.
256 case $HostPlatform in
257 alpha-dec-osf1* | alpha-dec-osf2*)
258         HostPlatform=alpha-dec-osf1 # canonicalise for our purposes
259         TargetPlatform=alpha-dec-osf1 # this will work for now... (hack)
260         BuildPlatform=alpha-dec-osf1 #hack
261         HostPlatform_CPP='alpha_dec_osf1'
262         HostArch_CPP='alpha'
263         HostVendor_CPP='dec'
264         HostOS_CPP='osf1'
265         ;;
266 hppa1.1-hp-hpux*)
267         HostPlatform=hppa1.1-hp-hpux # canonicalise for our purposes (hack)
268         TargetPlatform=hppa1.1-hp-hpux
269         BuildPlatform=hppa1.1-hp-hpux
270         HostPlatform_CPP='hppa1_1_hp_hpux'
271         HostArch_CPP='hppa1_1'
272         HostVendor_CPP='hp'
273         HostOS_CPP='hpux'
274         ;;
275 i386-*-linuxaout*)
276         HostPlatform=i386-unknown-linuxaout # hack again
277         TargetPlatform=i386-unknown-linuxaout
278         BuildPlatform=i386-unknown-linuxaout
279         HostPlatform_CPP='i386_unknown_linuxaout'
280         HostArch_CPP='i386'
281         HostVendor_CPP='unknown'
282         HostOS_CPP='linuxaout'
283         ;;
284 i486-*-linuxaout*)
285         HostPlatform=i386-unknown-linuxaout # hack again: NB: name for arch is *i386*!
286         TargetPlatform=i386-unknown-linuxaout
287         BuildPlatform=i386-unknown-linuxaout
288         HostPlatform_CPP='i386_unknown_linuxaout'
289         HostArch_CPP='i386'
290         HostVendor_CPP='unknown'
291         HostOS_CPP='linuxaout'
292         ;;
293 i386-*-linux*)
294         HostPlatform=i386-unknown-linux # hack again
295         TargetPlatform=i386-unknown-linux
296         BuildPlatform=i386-unknown-linux
297         HostPlatform_CPP='i386_unknown_linux'
298         HostArch_CPP='i386'
299         HostVendor_CPP='unknown'
300         HostOS_CPP='linux'
301         ;;
302 i486-*-linux*)
303         HostPlatform=i386-unknown-linux # hack again: NB: name for arch is *i386*!
304         TargetPlatform=i386-unknown-linux
305         BuildPlatform=i386-unknown-linux
306         HostPlatform_CPP='i386_unknown_linux'
307         HostArch_CPP='i386'
308         HostVendor_CPP='unknown'
309         HostOS_CPP='linux'
310         ;;
311 i386-*-freebsd*)
312         HostPlatform_CPP='i386_unknown_freebsd'
313         HostArch_CPP='i386'
314         HostVendor_CPP='unknown'
315         HostOS_CPP='freebsd'
316         ;;
317 i486-*-freebsd*)
318         HostPlatform_CPP='i386_unknown_freebsd'
319         HostArch_CPP='i386'
320         HostVendor_CPP='unknown'
321         HostOS_CPP='freebsd'
322         ;;
323 i386-*-netbsd*)
324         HostPlatform_CPP='i386_unknown_netbsd'
325         HostArch_CPP='i386'
326         HostVendor_CPP='unknown'
327         HostOS_CPP='netbsd'
328         ;;
329 i486-*-netbsd*)
330         HostPlatform_CPP='i386_unknown_netbsd'
331         HostArch_CPP='i386'
332         HostVendor_CPP='unknown'
333         HostOS_CPP='netbsd'
334         ;;
335 i386-*-solaris2*)
336         HostPlatform=i386-unknown-solaris2 # hack again
337         TargetPlatform=i386-unknown-solaris2
338         BuildPlatform=i386-unknown-solaris2
339         HostPlatform_CPP='i386_unknown_solaris2'
340         HostArch_CPP='i386'
341         HostVendor_CPP='unknown'
342         HostOS_CPP='solaris2'
343         ;;
344 m68k-next-nextstep2)
345         HostPlatform_CPP='m68k_next_nextstep2'
346         HostArch_CPP='m68k'
347         HostVendor_CPP='next'
348         HostOS_CPP='nextstep2'
349         ;;
350 m68k-next-nextstep3)
351         HostPlatform_CPP='m68k_next_nextstep3'
352         HostArch_CPP='m68k'
353         HostVendor_CPP='next'
354         HostOS_CPP='nextstep3'
355         ;;
356 i386-next-nextstep3)
357         HostPlatform=i386-next-nextstep3 # hack again
358         TargetPlatform=i386-next-nextstep3
359         BuildPlatform=i386-next-nextstep3
360         HostPlatform_CPP='i386_next_nextstep3'
361         HostArch_CPP='i386'
362         HostVendor_CPP='next'
363         HostOS_CPP='nextstep3'
364         ;;
365 m68k-sun-sunos4*)
366         HostPlatform=m68k-sun-sunos4
367         TargetPlatform=m68k-sun-sunos4 #hack
368         BuildPlatform=m68k-sun-sunos4 #hack
369         HostPlatform_CPP='m68k_sun_sunos4'
370         HostArch_CPP='m68k'
371         HostVendor_CPP='sun'
372         HostOS_CPP='sunos4'
373         ;;
374 mips-dec-ultrix*)
375         HostPlatform_CPP='mips_dec_ultrix'
376         HostArch_CPP='mipsel'   # NB a little different
377         HostVendor_CPP='dec'
378         HostOS_CPP='ultrix'
379         ;;
380 mips-sgi-irix*)
381         HostPlatform=mips-sgi-irix
382         TargetPlatform=mips-sgi-irix #hack
383         BuildPlatform=mips-sgi-irix #hack
384         HostPlatform_CPP='mips_sgi_irix'
385         HostArch_CPP='mipseb'   # NB a little different
386         HostVendor_CPP='sgi'
387         HostOS_CPP='irix'
388         ;;
389 powerpc-ibm-aix*)
390         HostPlatform=powerpc-ibm-aix
391         TargetPlatform=powerpc-ibm-aix #hack
392         BuildPlatform=powerpc-ibm-aix #hack
393         HostPlatform_CPP='powerpc_ibm_aix'
394         HostArch_CPP='powerpc'
395         HostVendor_CPP='ibm'
396         HostOS_CPP='aix'
397         ;;
398 sparc-sun-sunos4*)
399         HostPlatform=sparc-sun-sunos4
400         TargetPlatform=sparc-sun-sunos4 #hack
401         BuildPlatform=sparc-sun-sunos4 #hack
402         HostPlatform_CPP='sparc_sun_sunos4'
403         HostArch_CPP='sparc'
404         HostVendor_CPP='sun'
405         HostOS_CPP='sunos4'
406         ;;
407 sparc-sun-solaris2*)
408         HostPlatform=sparc-sun-solaris2
409         TargetPlatform=sparc-sun-solaris2 #hack
410         BuildPlatform=sparc-sun-solaris2 #hack
411         HostPlatform_CPP='sparc_sun_solaris2'
412         HostArch_CPP='sparc'
413         HostVendor_CPP='sun'
414         HostOS_CPP='solaris2'
415         ;;
416 *)
417         echo "Unrecognised platform: $HostPlatform"
418         exit 1
419         ;;
420 esac
421
422 test -n "$verbose" && echo "Host platform set to $HostPlatform"
423 test -n "$verbose" -a x"$HostPlatform" != x"$TargetPlatform" \
424         && echo "Target platform set to $TargetPlatform"
425 test -n "$verbose" -a x"$BuildPlatform" != x"$HostPlatform" \
426         && echo "Build platform set to $BuildPlatform"
427
428 BuildPlatform_CPP=$HostPlatform_CPP
429 TargetPlatform_CPP=$HostPlatform_CPP
430 BuildArch_CPP=$HostArch_CPP
431 TargetArch_CPP=$HostArch_CPP
432 BuildOS_CPP=$HostOS_CPP
433 TargetOS_CPP=$HostOS_CPP
434 BuildVendor_CPP=$HostVendor_CPP
435 TargetVendor_CPP=$HostVendor_CPP
436 dnl Cannot afford all these AC_SUBSTs (because of braindead seds w/ 99 cmd limits
437 dnl AC_SUBST(BuildPlatform)
438 AC_SUBST(HostPlatform)
439 dnl AC_SUBST(TargetPlatform)
440 AC_SUBST(HostPlatform_CPP)
441 dnl AC_SUBST(BuildPlatform_CPP)
442 dnl AC_SUBST(TargetPlatform_CPP)
443 AC_SUBST(HostArch_CPP)
444 dnl AC_SUBST(BuildArch_CPP)
445 dnl AC_SUBST(TargetArch_CPP)
446 AC_SUBST(HostOS_CPP)
447 dnl AC_SUBST(BuildOS_CPP)
448 dnl AC_SUBST(TargetOS_CPP)
449 AC_SUBST(HostVendor_CPP)
450 dnl AC_SUBST(BuildVendor_CPP)
451 dnl AC_SUBST(TargetVendor_CPP)
452
453 # -------------------------------------------------------------------------
454 dnl
455 dnl * _GENERAL_ CONFIGURATION CHECKS
456 #
457 dnl ** are we at Glasgow?
458 #
459 if test -d /local/fp -a -d /users/fp/simonpj; then
460     echo "Brilliant!  You must be a Glaswegian."
461     AT_GLASGOW=1
462     if test "x$prefix" = xNONE; then
463         prefix=/local/fp
464         echo "Assuming installation prefix of $prefix"
465     fi
466     if test "x$exec_prefix" = xNONE; then
467         # Sigh: the defn of exec_prefix does not include the bin* bit...
468         # WDP 94/07
469         exec_prefix=/local/fp
470         echo "Assuming binary installation prefix of $exec_prefix"
471     fi
472 else
473     AT_GLASGOW=0
474 fi
475 AC_SUBST(AT_GLASGOW)
476 test -n "$verbose" && echo "    setting AT_GLASGOW to $AT_GLASGOW"
477 #
478 #
479 #
480 dnl ** does #! work?
481 #
482 AC_SYS_INTERPRETER()
483 #
484 dnl ** look for `perl', but watch out for version 4.035
485 #
486 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
487 if test -z "$PerlCmd"; then
488     echo "You must install perl before you can continue"
489     echo "Perhaps it is already installed, but not in your PATH?"
490     exit 1
491 else
492     $PerlCmd -v >conftest.out 2>&1
493     if egrep "version 4" conftest.out >/dev/null 2>&1; then
494         if egrep "Patch level: 35" conftest.out >/dev/null 2>&1; then
495             echo "
496 ************************************************************************
497 Uh-oh...looks like you have Perl 4.035.
498
499 Perl version 4.035 has a bug to do with recursion that will bite if
500 you run the lit2texi script, when making Info files from
501 literate files of various sorts.  Either use the current version
502 (4.036), an older version (e.g., perl 4.019) or apply the patch in
503 glafp-utils/perl-4.035-fixes to your 4.035 perl.
504 ************************************************************************
505 "
506         fi
507     else
508         if egrep "version 5" conftest.out >/dev/null 2>&1; then
509             :
510         else
511             echo "I'm not sure if your version of perl will work,"
512             echo "but it's worth a shot, eh?"
513         fi
514     fi
515     rm -fr conftest*
516 fi
517 #
518 dnl ** does #!.../perl work? (sometimes it's too long...)
519 echo "checking if \`#!$PerlCmd' works in shell scripts"
520 echo "#!$PerlCmd"'
521 exit $1;
522 ' > conftest
523 chmod u+x conftest
524 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
525 if test $? -ne 69; then
526    echo "It does!"
527 else
528    echo "It doesn't!  Perhaps \`#!$PerlCmd' is too long (often 32 characters max)"
529    exit 1
530 fi
531 rm -f conftest
532 #
533 dnl ** check if perl library is properly installed
534 # (by seeing if a "do 'getopts.pl'" works...
535 if $PerlCmd -e 'do "getopts.pl" || exit(1); exit(0);' > /dev/null 2>&1 ; then
536     :
537 else
538     echo "I think your perl library is misinstalled."
539     echo "The following script did not work:"
540     echo '      do "getopts.pl" || exit(1); exit(0);'
541     exit 1
542 fi
543 #
544 #
545 dnl ** look for GCC and find out which version
546 # Figure out which C compiler to use.  Gcc is preferred.
547 # If gcc, make sure it's at least 2.1
548 #
549 AC_PROG_CC
550 if test -z "$GCC"; then
551     echo "You would be better off with gcc"
552     echo "Perhaps it is already installed, but not in your PATH?"
553     HaveGcc='NO'
554 else
555     gcc -v > conftest.out 2>&1
556     echo '/version (\d+)\.(\d+)/ && $1*10+$2 > 20 && print "YES";' > conftest.pl
557     HaveGcc=`eval $PerlCmd -n conftest.pl conftest.out`
558     if test -z "$HaveGcc"; then
559         echo "I'm not sure if your version of gcc will work,"
560         echo "but it's worth a shot, eh?"
561         HaveGcc='YES'
562     fi
563     rm -fr conftest*
564 fi
565 AC_SUBST(HaveGcc)
566 AC_C_CROSS
567 #
568 dnl ** figure out how to do context diffs
569 # (NB: NeXTStep thinks diff'ing a file against itself is "trouble")
570 #
571 echo foo > conftest1
572 echo foo > conftest2
573 if diff -C 1 conftest1 conftest2 > /dev/null 2>&1 ; then
574     ContextDiffCmd='diff -C 1'
575 else
576     if diff -c1 conftest1 conftest2 > /dev/null 2>&1 ; then
577         ContextDiffCmd='diff -c1'
578     else
579         echo "Can't figure out how to do context diffs."
580         echo "Neither \`diff -C 1' nor \`diff -c1' works."
581         exit 1
582     fi
583 fi
584 rm -f conftest1 conftest2
585 AC_SUBST(ContextDiffCmd)
586 #
587 dnl ** look for a decent parser generator (bison preferred)
588 #
589 #
590 AC_CHECK_PROG(YaccCmd, bison, bison -y)
591 if test -z "$YaccCmd"; then
592     echo "Can't find bison out there..."
593     AC_CHECK_PROG(WhatCmd, what, what, :)
594     AC_CHECK_PROG(YaccCmd, yacc, $ac_dir/$ac_word)
595     if test -z "$YaccCmd"; then
596         echo "But that's okay...I can't find yacc either."
597         YaccCmd=:
598     else
599         $WhatCmd $YaccCmd > conftest.out
600         if egrep 'y1\.c 1\..*SMI' conftest.out >/dev/null 2>&1; then
601             echo "I don't trust your $YaccCmd; it looks like an old Sun yacc"
602             if test -x /usr/lang/yacc; then
603                 echo "I'm going to use /usr/lang/yacc instead"
604                 YaccCmd=/usr/lang/yacc
605             else
606                 echo "I'm assuming the worst...no parser generator at all"
607                 YaccCmd=:
608             fi
609         elif egrep 'y1\.c.*Revision: 4\.2\.6\.3.*DEC' conftest.out >/dev/null 2>&1; then
610             echo "I don't trust your $YaccCmd; it looks like a lame DEC yacc"
611             echo "I'm assuming the worst...no parser generator at all"
612             YaccCmd=:
613         else
614             echo "But that's okay...as far as I know, your yacc will work."
615         fi
616         rm -fr conftest*
617     fi
618 fi
619
620 #--------------------------------------------------------------
621 WithHc='haskell-compiler-unspecified'
622 WithHcType='HC_UNSPECIFIED'
623
624 AC_ARG_WITH(hc,
625    [
626 *******************************************************************
627 ** GENERAL OPTIONS WHICH APPLY TO ALL TOOLS:
628
629 --with-hc=<Haskell compiler>
630           ghc*     => Glasgow Haskell invoked by the name given
631           hbc*     => Chalmers HBC, invoked by the name given
632           nhc*     => Niklas Rojemo's "nhc", invoked by the name given
633           C or c   => Don't use a Haskell compiler;
634                       build from intermediate C (.hc) files.
635           in-place => Use ghc/driver/ghc; i.e. you've built GHC
636                       and you want to use it un-installed ("in-place").
637    ],
638    [case "$withval" in
639         ghc* | glhc* )
640                 WithHc=$withval
641                 ;;
642         hbc* )  WithHc=$withval
643                 ;;
644         nhc* )  WithHc=$withval
645                 ;;
646         c | C)  WithHc='C'
647                 ;;
648         in-place )
649                 WithHc='IN-PLACE'
650                 ;;
651         *)      echo "I don't understand this option: --with-hc=$withval"
652                 exit 1
653                 ;;
654     esac])
655
656 # make sure that what they said makes sense.... set WithHcType
657 case $WithHc in
658     haskell-compiler-unspecified ) # maybe they will say something later...
659             ;;
660     ghc* | glhc* )
661             WithHcType='HC_GLASGOW_GHC'
662             AC_CHECK_PROG(have_ghc,$WithHc,$ac_dir/$ac_word)
663             if test -z "$have_ghc"; then
664                 echo "Can't find Glasgow Haskell to compile with: $WithHc"
665                 exit 1
666             fi
667             ;;
668     hbc* )  # Look for the dastardly competition
669             WithHcType='HC_CHALMERS_HBC'
670             AC_CHECK_PROG(have_hbc,$WithHc,YES,NO)
671             if test $have_hbc = 'NO' ; then
672                 echo "Can't find Chalmers HBC to compile with: $WithHc"
673                 exit 1
674             fi
675             ;;
676     nhc* )  # Look for Niklas Rojemo's "nhc"
677             WithHcType='HC_ROJEMO_NHC'
678             AC_CHECK_PROG(have_nhc,$WithHc,YES,NO)
679             if test $have_nhc = 'NO' ; then
680                 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHc"
681                 exit 1
682             fi
683             ;;
684     c | C)  WithHcType='HC_USE_HC_FILES'
685             ;;
686     IN-PLACE) WithHcType='HC_GLASGOW_GHC'
687             ;;
688 esac
689 AC_SUBST(WithHc)
690 AC_SUBST(WithHcType)
691
692 dnl ** possibly choose a different tmpdir (default /tmp)
693 # let the user decide where the best tmpdir is
694 # /tmp is the default; /usr/tmp is sometimes a good choice.
695 # Very site-specific.
696 TmpDir='/tmp'
697 AC_ARG_WITH(tmpdir,
698    [--with-tmpdir=<temp directory> Use an alternative directory for
699 temporary files (presumably because /tmp is too small).],
700    [TmpDir="$withval"])
701 AC_SUBST(TmpDir)
702
703 dnl ** possibly set a max heap for Haskell compilations
704 # let the user specify a maximum heap to be used; the old
705 # "I have a 64MB machine, why not use a 32MB heap?" thing.
706 HcMaxHeapWasSet='NO'
707 HcMaxHeap='0'
708 AC_ARG_WITH(max-heap,
709    [
710 --with-max-heap=<heap size, e.g., 32m> Do all Haskell compilations
711 with a heap of this size.  (If you've got it, flaunt it.)],
712    [HcMaxHeapWasSet='YES'
713     HcMaxHeap="$withval"])
714 AC_SUBST(HcMaxHeapWasSet)
715 AC_SUBST(HcMaxHeap)
716
717 dnl ** figure out about mkdependHS
718 MkDependHSCmd=':'
719 if test -f ./ghc/utils/mkdependHS/mkdependHS \
720      -o -f ./ghc/utils/mkdependHS/mkdependHS.prl ; then
721     MkDependHSCmd='TopDirPwd/ghc/utils/mkdependHS/mkdependHS'
722 else
723     AC_CHECK_PROG(have_mkdependHS,mkdependHS,YES,NO)
724     if test $have_mkdependHS = 'YES' ; then
725         MkDependHSCmd='mkdependHS'
726     fi
727 fi
728 AC_SUBST(MkDependHSCmd)
729
730 # -------------------------------------------------------------------------
731 #
732 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
733 #
734 AC_PROG_CPP
735 if echo $CPP | egrep gcc >/dev/null 2>&1; then
736     echo > conftest.c
737     gcc -v -E conftest.c >/dev/null 2>conftest.out
738     echo '/(\S+\/cpp)/ && print "$1";' > conftest.pl
739     GNUCPP="`eval $PerlCmd -n conftest.pl conftest.out`"
740     test -n "$verbose" && echo "        setting GNUCPP to $GNUCPP"
741     RAWCPP="`eval $PerlCmd -n conftest.pl conftest.out` -traditional"
742     test -n "$verbose" && echo "        setting RAWCPP to $RAWCPP"
743     rm -fr conftest*
744 fi
745 # ToDo: what are GNUCPP and RAWCPP if the above if didn't fire? WDP 95/02
746 AC_SUBST(GNUCPP)
747 AC_SUBST(RAWCPP)
748 #
749 dnl ** figure out how to do a BSD-ish install
750 #
751 AC_PROG_INSTALL
752 #
753 dnl ** figure out what arguments to feed to `ar'
754 #
755 AC_CHECK_PROG(ArCmd,ar,$ac_dir/$ac_word)
756 if test -z "$ArCmd"; then
757     echo "You don't seem to have ar...I have no idea how to make a library"
758     exit 1;
759 fi
760 if $ArCmd clqs conftest.a >/dev/null 2>/dev/null; then
761     ArCmd="$ArCmd clqs"
762     NeedRanLib=''
763 elif $ArCmd cqs conftest.a >/dev/null 2>/dev/null; then
764     ArCmd="$ArCmd cqs"
765     NeedRanLib=''
766 elif $ArCmd clq conftest.a >/dev/null 2>/dev/null; then
767     ArCmd="$ArCmd clq"
768     NeedRanLib='YES'
769 elif $ArCmd cq conftest.a >/dev/null 2>/dev/null; then
770     ArCmd="$ArCmd cq"
771     NeedRanLib='YES'
772 else
773     echo "I can't figure out how to use your $ArCmd"
774     exit 1
775 fi
776 rm -rf conftest*
777 test -n "$ArCmd" && test -n "$verbose" && echo "        setting ArCmd to $ArCmd"
778 AC_SUBST(ArCmd)
779 #
780 dnl ** figure out if we need `ranlib'
781 #
782 if test -z "$NeedRanLib"; then
783     # we hackily override a few platforms on a case-by-case basis
784     case $HostPlatform in
785     i386-*-linuxaout)
786         NeedRanLib='YES'
787         ;;
788     *)  RANLIB=':'
789         ;;
790     esac
791     test -n "$verbose" && echo "        setting RANLIB to $RANLIB"
792 fi
793 if test -n "$NeedRanLib"; then
794     AC_PROG_RANLIB
795 fi
796 AC_SUBST(RANLIB)
797 #
798 dnl ** check for full ANSI header (.h) files
799 #
800 AC_HEADER_STDC
801 #
802 dnl ** check for specific header (.h) files that we are interested in
803 #
804 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 )
805 #
806 dnl ** check if it is safe to include both <time.h> and <sys/time.h>
807 #
808 AC_HEADER_TIME
809 #
810 dnl ** how do we get a timezone name?
811 #
812 AC_STRUCT_TIMEZONE
813
814 dnl ** determine the type of signal()
815 #
816 AC_TYPE_SIGNAL
817 #
818 dnl ** decide whether or not flex lexers need to be linked with -lfl
819 #
820 AC_CHECK_LIB(fl,yywrap,
821     FlexLibAvailable='YES',
822     FlexLibAvailable='NO')
823 AC_SUBST(FlexLibAvailable)
824 #
825 dnl ** Decide whether or not lex lexers need to be linked with -ll
826 # (Linux, for example, does not have "lex", only "flex")
827 #
828 AC_CHECK_LIB(l,yywrap,
829     LexLibAvailable='YES',
830     LexLibAvailable='NO')
831 AC_SUBST(LexLibAvailable)
832 #
833 dnl ** check for specific library functions that we are interested in
834 #
835 AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect setitimer stat sysconf timelocal times vadvise vfork)
836 #
837 dnl ** can we get alloca?
838 #
839 AC_FUNC_ALLOCA
840 #
841 dnl ** determine whether or not const works
842 #
843 AC_C_CONST
844 #
845 dnl ** check for leading underscores in symbol names
846 # We assume that they _aren't_ there if anything goes wrong.
847 #
848 echo checking for a leading underscore in symbol names
849 AC_TRY_RUN(
850 [#ifdef HAVE_NLIST_H
851 #include <nlist.h>
852 struct nlist xYzzY[] = {{"_xYzzY", 0},{0}};
853 #endif
854
855 main(argc, argv)
856 int argc;
857 char **argv;
858 {
859 #ifdef HAVE_NLIST_H
860     if(nlist(argv[0], xYzzY) == 0 && xYzzY[0].n_value != 0)
861         exit(0);
862 #endif
863     exit(1);
864 }], LeadingUnderscore='YES', LeadingUnderscore='NO', LeadingUnderscore='YES')
865 test -n "$verbose" && echo "    setting LeadingUnderscore to $LeadingUnderscore"
866
867 # -------------------------------------------------------------------------
868 dnl
869 dnl * `GHC' CONFIGURATION STUFF
870
871 if test "xxx$DoingGHC" = 'xxxghc' ; then
872 # a very big "if"!
873 #
874 dnl ** which builds to build?
875 # builds: normal = sequential _ap_o ; _p = profiling (sequential);
876 # _t = ticky; _u = unregisterized
877 GhcBuild_normal='YES'
878 GhcBuild_p='YES'
879 GhcBuild_t='NO'
880 GhcBuild_u='NO'
881 # _mc = concurrent; _mr = profiled concurrent; _mt = ticky concurrent
882 # _mp = parallel; _mg = gransim
883 GhcBuild_mc='NO'
884 GhcBuild_mr='NO'
885 GhcBuild_mt='NO'
886 GhcBuild_mp='NO'
887 GhcBuild_mg='NO'
888 # GC builds: _2s, _1s, _du (, _gn)
889 GhcBuild_2s='NO'
890 GhcBuild_1s='NO'
891 GhcBuild_du='NO'
892 # user builds: a...o
893 GhcBuild_a='NO'
894 GhcBuild_b='NO'
895 GhcBuild_c='NO'
896 GhcBuild_d='NO'
897 GhcBuild_e='NO'
898 GhcBuild_f='NO'
899 GhcBuild_g='NO'
900 GhcBuild_h='NO'
901 GhcBuild_i='NO'
902 GhcBuild_j='NO'
903 GhcBuild_k='NO'
904 GhcBuild_l='NO'
905 GhcBuild_m='NO'
906 GhcBuild_n='NO'
907 GhcBuild_o='NO'
908 GhcBuild_A='NO'
909 GhcBuild_B='NO'
910 # More could be added here...
911
912 AC_ARG_ENABLE(normal-build,
913    [
914 *******************************************************************
915 ** \`GHC' (GLASGOW HASKELL COMPILER) OPTIONS:
916
917 Choose all the \`builds' of GHC that you want:
918
919 --disable-normal-build do *not* build GHC for normal sequential code],
920    [case "$enableval" in
921         yes) GhcBuild_normal='YES'
922              ;;
923         no)  GhcBuild_normal='NO'
924              ;;
925         *)   echo "I don't understand this option: --enable-normal-build=$enableval"
926              exit 1
927              ;;
928     esac])
929
930 AC_ARG_ENABLE(profiling,
931    [--disable-profiling    do *not* build profiling features],
932    [case "$enableval" in
933         yes) GhcBuild_p='YES'
934              ;;
935         no)  GhcBuild_p='NO'
936              ;;
937         *)   echo "I don't understand this option: --enable-profiling=$enableval"
938              exit 1
939              ;;
940     esac])
941
942 AC_ARG_ENABLE(ticky,
943    [--enable-ticky         build for \`ticky-ticky' profiling (for implementors)],
944    [case "$enableval" in
945         yes) GhcBuild_t='YES'
946              ;;
947         no)  GhcBuild_t='NO'
948              ;;
949         *)   echo "I don't understand this option: --enable-ticky=$enableval"
950              exit 1
951              ;;
952     esac])
953
954 AC_ARG_ENABLE(concurrent,
955    [--enable-concurrent    turn on \`concurrent Haskell' features],
956    [case "$enableval" in
957         yes) GhcBuild_mc='YES'
958              ;;
959         no)  GhcBuild_mc='NO'
960              ;;
961         *)   echo "I don't understand this option: --enable-concurrent=$enableval"
962              exit 1
963              ;;
964     esac])
965
966 AC_ARG_ENABLE(profiled-concurrent,
967    [--enable-profiled-concurrent turn on profiling for \`concurrent Haskell'],
968    [case "$enableval" in
969         yes) GhcBuild_mr='YES'
970              ;;
971         no)  GhcBuild_mr='NO'
972              ;;
973         *)   echo "I don't understand this option: --enable-profiled-concurrent=$enableval"
974              exit 1
975              ;;
976     esac])
977
978 AC_ARG_ENABLE(ticky-concurrent,
979    [--enable-ticky-concurrent turn on \`ticky-ticky' profiling for \`concurrent Haskell'],
980    [case "$enableval" in
981         yes) GhcBuild_mt='YES'
982              ;;
983         no)  GhcBuild_mt='NO'
984              ;;
985         *)   echo "I don't understand this option: --enable-ticky-concurrent=$enableval"
986              exit 1
987              ;;
988     esac])
989
990 AC_ARG_ENABLE(parallel,
991    [--enable-parallel      turn on \`parallel Haskell' features],
992    [case "$enableval" in
993         yes) GhcBuild_mp='YES';
994              ;;
995         no)  GhcBuild_mp='NO'
996              ;;
997         *)   echo "I don't understand this option: --enable-parallel=$enableval"
998              exit 1
999              ;;
1000     esac])
1001
1002 AC_ARG_ENABLE(gransim,
1003    [--enable-gransim       turn on GranSim parallel simulator],
1004    [case "$enableval" in
1005         yes) GhcBuild_mg='YES';
1006              ;;
1007         no)  GhcBuild_mg='NO'
1008              ;;
1009         *)   echo "I don't understand this option: --enable-gransim=$enableval"
1010              exit 1
1011              ;;
1012     esac])
1013
1014 AC_ARG_ENABLE(gc-2s,
1015    [--enable-gc-2s         a build with the 2-space copying garbage collector],
1016    [case "$enableval" in
1017         yes) GhcBuild_2s='YES'
1018              ;;
1019         no)  GhcBuild_2s='NO'
1020              ;;
1021         *)   echo "I don't understand this option: --enable-gc-2s=$enableval"
1022              exit 1
1023              ;;
1024     esac])
1025
1026 AC_ARG_ENABLE(gc-1s,
1027    [--enable-gc-1s         a build with the 1-space compacting garbage collector],
1028    [case "$enableval" in
1029         yes) GhcBuild_1s='YES'
1030              ;;
1031         no)  GhcBuild_1s='NO'
1032              ;;
1033         *)   echo "I don't understand this option: --enable-gc-1s=$enableval"
1034              exit 1
1035              ;;
1036     esac])
1037
1038 AC_ARG_ENABLE(gc-du,
1039    [--enable-gc-du         a build with \`dual-mode' (1s/2s) garbage collector],
1040    [case "$enableval" in
1041         yes) GhcBuild_du='YES'
1042              ;;
1043         no)  GhcBuild_du='NO'
1044              ;;
1045         *)   echo "I don't understand this option: --enable-gc-du=$enableval"
1046              exit 1
1047              ;;
1048     esac])
1049
1050 dnl  some seds only allow 99 commands, meaning no more
1051 dnl  than 99 AC_SUBSTs.  AARRGGHH!!
1052 dnl AC_ARG_ENABLE(user-way-a,
1053 dnl    [--enable-user-way-a    build for \`user way a' (mostly for implementors)],
1054 dnl    [case "$enableval" in
1055 dnl         yes) GhcBuild_a='YES'
1056 dnl              ;;
1057 dnl         no)  GhcBuild_a='NO'
1058 dnl              ;;
1059 dnl         *)   echo "I don't understand this option: --enable-user-way-a=$enableval"
1060 dnl              exit 1
1061 dnl              ;;
1062 dnl     esac])
1063 dnl 
1064 dnl AC_ARG_ENABLE(user-way-b,
1065 dnl    [--enable-user-way-b    build for \`user way b' (mostly for implementors)],
1066 dnl    [case "$enableval" in
1067 dnl         yes) GhcBuild_b='YES'
1068 dnl              ;;
1069 dnl         no)  GhcBuild_b='NO'
1070 dnl              ;;
1071 dnl         *)   echo "I don't understand this option: --enable-user-way-b=$enableval"
1072 dnl              exit 1
1073 dnl              ;;
1074 dnl     esac])
1075 dnl 
1076 dnl AC_ARG_ENABLE(user-way-c,
1077 dnl    [--enable-user-way-c    build for \`user way c' (mostly for implementors)],
1078 dnl    [case "$enableval" in
1079 dnl         yes) GhcBuild_c='YES'
1080 dnl              ;;
1081 dnl         no)  GhcBuild_c='NO'
1082 dnl              ;;
1083 dnl         *)   echo "I don't understand this option: --enable-user-way-c=$enableval"
1084 dnl              exit 1
1085 dnl              ;;
1086 dnl     esac])
1087 dnl 
1088 dnl AC_ARG_ENABLE(user-way-d,
1089 dnl    [--enable-user-way-d    build for \`user way d' (mostly for implementors)],
1090 dnl    [case "$enableval" in
1091 dnl         yes) GhcBuild_d='YES'
1092 dnl              ;;
1093 dnl         no)  GhcBuild_d='NO'
1094 dnl              ;;
1095 dnl         *)   echo "I don't understand this option: --enable-user-way-d=$enableval"
1096 dnl              exit 1
1097 dnl              ;;
1098 dnl     esac])
1099 dnl 
1100 dnl AC_ARG_ENABLE(user-way-e,
1101 dnl    [--enable-user-way-e    build for \`user way e' (mostly for implementors)],
1102 dnl    [case "$enableval" in
1103 dnl         yes) GhcBuild_e='YES'
1104 dnl              ;;
1105 dnl         no)  GhcBuild_e='NO'
1106 dnl              ;;
1107 dnl         *)   echo "I don't understand this option: --enable-user-way-e=$enableval"
1108 dnl              exit 1
1109 dnl              ;;
1110 dnl     esac])
1111 dnl 
1112 dnl AC_ARG_ENABLE(user-way-f,
1113 dnl    [--enable-user-way-f    build for \`user way f' (mostly for implementors)],
1114 dnl    [case "$enableval" in
1115 dnl         yes) GhcBuild_f='YES'
1116 dnl              ;;
1117 dnl         no)  GhcBuild_f='NO'
1118 dnl              ;;
1119 dnl         *)   echo "I don't understand this option: --enable-user-way-f=$enableval"
1120 dnl              exit 1
1121 dnl              ;;
1122 dnl     esac])
1123 dnl 
1124 dnl AC_ARG_ENABLE(user-way-g,
1125 dnl    [--enable-user-way-g    build for \`user way g' (mostly for implementors)],
1126 dnl    [case "$enableval" in
1127 dnl         yes) GhcBuild_g='YES'
1128 dnl              ;;
1129 dnl         no)  GhcBuild_g='NO'
1130 dnl              ;;
1131 dnl         *)   echo "I don't understand this option: --enable-user-way-g=$enableval"
1132 dnl              exit 1
1133 dnl              ;;
1134 dnl     esac])
1135 dnl 
1136 dnl AC_ARG_ENABLE(user-way-h,
1137 dnl    [--enable-user-way-h    build for \`user way h' (mostly for implementors)],
1138 dnl    [case "$enableval" in
1139 dnl         yes) GhcBuild_h='YES'
1140 dnl              ;;
1141 dnl         no)  GhcBuild_h='NO'
1142 dnl              ;;
1143 dnl         *)   echo "I don't understand this option: --enable-user-way-h=$enableval"
1144 dnl              exit 1
1145 dnl              ;;
1146 dnl     esac])
1147 dnl 
1148 dnl AC_ARG_ENABLE(user-way-i,
1149 dnl    [--enable-user-way-i    build for \`user way i' (mostly for implementors)],
1150 dnl    [case "$enableval" in
1151 dnl         yes) GhcBuild_i='YES'
1152 dnl              ;;
1153 dnl         no)  GhcBuild_i='NO'
1154 dnl              ;;
1155 dnl         *)   echo "I don't understand this option: --enable-user-way-i=$enableval"
1156 dnl              exit 1
1157 dnl              ;;
1158 dnl     esac])
1159 dnl 
1160 dnl AC_ARG_ENABLE(user-way-j,
1161 dnl    [--enable-user-way-j    build for \`user way j' (mostly for implementors)],
1162 dnl    [case "$enableval" in
1163 dnl         yes) GhcBuild_j='YES'
1164 dnl              ;;
1165 dnl         no)  GhcBuild_j='NO'
1166 dnl              ;;
1167 dnl         *)   echo "I don't understand this option: --enable-user-way-j=$enableval"
1168 dnl              exit 1
1169 dnl              ;;
1170 dnl     esac])
1171 dnl 
1172 dnl AC_ARG_ENABLE(user-way-k,
1173 dnl    [--enable-user-way-k    build for \`user way k' (mostly for implementors)],
1174 dnl    [case "$enableval" in
1175 dnl         yes) GhcBuild_k='YES'
1176 dnl              ;;
1177 dnl         no)  GhcBuild_k='NO'
1178 dnl              ;;
1179 dnl         *)   echo "I don't understand this option: --enable-user-way-k=$enableval"
1180 dnl              exit 1
1181 dnl              ;;
1182 dnl     esac])
1183 dnl 
1184 dnl AC_ARG_ENABLE(user-way-l,
1185 dnl    [--enable-user-way-l    build for \`user way l' (mostly for implementors)],
1186 dnl    [case "$enableval" in
1187 dnl         yes) GhcBuild_l='YES'
1188 dnl              ;;
1189 dnl         no)  GhcBuild_l='NO'
1190 dnl              ;;
1191 dnl         *)   echo "I don't understand this option: --enable-user-way-l=$enableval"
1192 dnl              exit 1
1193 dnl              ;;
1194 dnl     esac])
1195 dnl 
1196 dnl AC_ARG_ENABLE(user-way-m,
1197 dnl    [--enable-user-way-m    build for \`user way m' (mostly for implementors)],
1198 dnl    [case "$enableval" in
1199 dnl         yes) GhcBuild_m='YES'
1200 dnl              ;;
1201 dnl         no)  GhcBuild_m='NO'
1202 dnl              ;;
1203 dnl         *)   echo "I don't understand this option: --enable-user-way-m=$enableval"
1204 dnl              exit 1
1205 dnl              ;;
1206 dnl     esac])
1207 dnl 
1208 dnl AC_ARG_ENABLE(user-way-n,
1209 dnl    [--enable-user-way-n    build for \`user way n' (mostly for implementors)],
1210 dnl    [case "$enableval" in
1211 dnl         yes) GhcBuild_n='YES'
1212 dnl              ;;
1213 dnl         no)  GhcBuild_n='NO'
1214 dnl              ;;
1215 dnl         *)   echo "I don't understand this option: --enable-user-way-n=$enableval"
1216 dnl              exit 1
1217 dnl              ;;
1218 dnl     esac])
1219 dnl 
1220 dnl AC_ARG_ENABLE(user-way-o,
1221 dnl    [--enable-user-way-o    build for \`user way o' (mostly for implementors)],
1222 dnl    [case "$enableval" in
1223 dnl         yes) GhcBuild_o='YES'
1224 dnl              ;;
1225 dnl         no)  GhcBuild_o='NO'
1226 dnl              ;;
1227 dnl         *)   echo "I don't understand this option: --enable-user-way-o=$enableval"
1228 dnl              exit 1
1229 dnl              ;;
1230 dnl     esac])
1231 dnl 
1232 dnl AC_ARG_ENABLE(user-way-A,
1233 dnl    [--enable-user-way-A    build for \`user way A' (mostly for implementors)],
1234 dnl    [case "$enableval" in
1235 dnl         yes) GhcBuild_A='YES'
1236 dnl              ;;
1237 dnl         no)  GhcBuild_A='NO'
1238 dnl              ;;
1239 dnl         *)   echo "I don't understand this option: --enable-user-way-A=$enableval"
1240 dnl              exit 1
1241 dnl              ;;
1242 dnl     esac])
1243 dnl 
1244 dnl AC_ARG_ENABLE(user-way-B,
1245 dnl    [--enable-user-way-B    build for \`user way B' (mostly for implementors)],
1246 dnl    [case "$enableval" in
1247 dnl         yes) GhcBuild_B='YES'
1248 dnl              ;;
1249 dnl         no)  GhcBuild_B='NO'
1250 dnl              ;;
1251 dnl         *)   echo "I don't understand this option: --enable-user-way-B=$enableval"
1252 dnl              exit 1
1253 dnl              ;;
1254 dnl     esac])
1255 dnl 
1256 AC_SUBST(GhcBuild_normal)
1257 AC_SUBST(GhcBuild_p)
1258 AC_SUBST(GhcBuild_t)
1259 AC_SUBST(GhcBuild_u)
1260 AC_SUBST(GhcBuild_mc)
1261 AC_SUBST(GhcBuild_mr)
1262 AC_SUBST(GhcBuild_mt)
1263 AC_SUBST(GhcBuild_mp)
1264 AC_SUBST(GhcBuild_mg)
1265 AC_SUBST(GhcBuild_2s)
1266 AC_SUBST(GhcBuild_1s)
1267 AC_SUBST(GhcBuild_du)
1268 dnl AC_SUBST(GhcBuild_a)
1269 dnl AC_SUBST(GhcBuild_b)
1270 dnl AC_SUBST(GhcBuild_c)
1271 dnl AC_SUBST(GhcBuild_d)
1272 dnl AC_SUBST(GhcBuild_e)
1273 dnl AC_SUBST(GhcBuild_f)
1274 dnl AC_SUBST(GhcBuild_g)
1275 dnl AC_SUBST(GhcBuild_h)
1276 dnl AC_SUBST(GhcBuild_i)
1277 dnl AC_SUBST(GhcBuild_j)
1278 dnl AC_SUBST(GhcBuild_k)
1279 dnl AC_SUBST(GhcBuild_l)
1280 dnl AC_SUBST(GhcBuild_m)
1281 dnl AC_SUBST(GhcBuild_n)
1282 dnl AC_SUBST(GhcBuild_o)
1283 dnl AC_SUBST(GhcBuild_A)
1284 dnl AC_SUBST(GhcBuild_B)
1285
1286 #---------------------------------------------------------------
1287 #
1288 dnl ** which Haskell compiler to bootstrap GHC with?
1289 # Figure out what Haskell compiler(s) to use for booting
1290 #
1291 # first, the defaults...
1292 WithGhcHc='haskell-compiler-unspecified'
1293 WithGhcHcType='HC_UNSPECIFIED'
1294 GhcBuilderVersion='26'
1295
1296 AC_ARG_WITH(hc-for-ghc,
1297    [
1298 The Haskell compiler for bootstrapping GHC (if any); this option,
1299 if used, overrides --with-hc=<...>:
1300
1301     --with-hc-for-ghc=<Haskell compiler>
1302           ghc*     => Glasgow Haskell invoked by the name given
1303           C or c   => Don't use a Haskell compiler;
1304                       build from intermediate C (.hc) files.
1305    ],
1306    [case "$withval" in
1307         ghc* | glhc* )
1308                 WithGhcHc=$withval
1309                 ;;
1310         hbc* )  echo "HBC will not compile GHC 0.26 as is (sigh)"
1311                 exit 1
1312                 ;;
1313         c | C)  WithGhcHc='C'
1314                 WithGhcHcType='HC_USE_HC_FILES'
1315                 ;;
1316         *)      echo "I don't understand this option: --with-hc-for-ghc=$withval"
1317                 exit 1
1318                 ;;
1319     esac])
1320
1321 # make sure that what they said makes sense.... set WithGhcHcType
1322 case $WithGhcHc in
1323     haskell-compiler-unspecified ) # maybe they said something earlier...
1324             if test $WithHc = 'haskell-compiler-unspecified' ; then
1325                 echo "Neither --with-hc nor --with-hc-for-ghc was properly set"
1326                 exit 1
1327             fi
1328             if test $WithHcType = 'HC_GLASGOW_GHC' ; then
1329                 touch conftest.o
1330                 $WithHc -v -C conftest.o > conftest.out 2>&1
1331                 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1332                 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1333                 rm -rf conftest*
1334             fi
1335             ;;
1336     ghc* | glhc* )
1337             WithGhcHcType='HC_GLASGOW_GHC'
1338             AC_CHECK_PROG(have_ghc,$WithGhcHc,$ac_dir/$ac_word)
1339             if test -z "$have_ghc"; then
1340                 echo "Can't find Glasgow Haskell to compile with: $WithGhcHc"
1341                 exit 1
1342             else
1343                 touch conftest.o
1344                 $WithGhcHc -v -C conftest.o > conftest.out 2>&1
1345                 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1346                 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1347                 rm -rf conftest*
1348             fi
1349             ;;
1350     c | C)  WithGhcHcType='HC_USE_HC_FILES'
1351             ;;
1352 esac
1353 AC_SUBST(GhcBuilderVersion)
1354 AC_SUBST(WithGhcHc)
1355 AC_SUBST(WithGhcHcType)
1356
1357 dnl ** use portable (slow) C? -- preferably not
1358 GhcWithRegisterised='YES'
1359 AC_ARG_ENABLE(portable-C,
1360    [Other things for GHC:
1361
1362 --enable-portable-C       use portable C (slow), not \`registerised' (fast)],
1363    [case "$enableval" in
1364         yes) GhcWithRegisterised='NO'
1365              ;;
1366         no)  GhcWithRegisterised='YES'
1367              ;;
1368         *)   echo "I don't understand this option: --enable-portable-C=$enableval"
1369              exit 1
1370              ;;
1371     esac])
1372
1373 if test $GhcWithRegisterised = 'YES'; then
1374     case $HostPlatform in
1375     alpha-* | hppa1.1-* | i386-* | m68k-* | mips-* | powerpc-* | sparc-* )
1376        ;;
1377     *)
1378        echo "Don't know non-portable C tricks for this platform: $HostPlatform"
1379        GhcWithRegisterised='NO'
1380        ;;
1381     esac
1382 fi
1383 AC_SUBST(GhcWithRegisterised)
1384
1385 if test $GhcWithRegisterised = 'NO'; then
1386     GhcBuild_u='YES'
1387     GhcBuild_normal='NO'
1388     GhcBuild_p='NO'
1389 fi
1390 # ToDo: make sure we can do concurrent for platform/circs...
1391 # ToDo: make sure we can do profiling for platform/circs...
1392 # ToDo: make sure we can do parallel for platform/circs...
1393 # ToDo: make sure we can do gransim for platform/circs...
1394
1395 dnl ** build GHC compiler proper (\`hsc') from .hc files?
1396 GhcWithHscBuiltViaC='NO'
1397 AC_ARG_ENABLE(hsc-built-via-C,
1398    [--enable-hsc-built-via-C  build compiler proper (hsc) from intermediate .hc
1399                           files (disabled by default)],
1400    [case "$enableval" in
1401         yes) GhcWithHscBuiltViaC='YES'
1402              ;;
1403         no)  GhcWithHscBuiltViaC='NO'
1404              ;;
1405         *)   echo "I don't understand this option: --enable-hsc-built-via-C=$enableval"
1406              exit 1
1407              ;;
1408     esac])
1409 case $WithGhcHc in
1410     haskell-compiler-unspecified ) # maybe they said something earlier...
1411             if test $WithHcType = 'HC_USE_HC_FILES' ; then
1412                 GhcWithHscBuiltViaC='YES'
1413             fi
1414             ;;
1415     c | C)  GhcWithHscBuiltViaC='YES'
1416             ;;
1417     *)      ;;
1418 esac
1419 AC_SUBST(GhcWithHscBuiltViaC)
1420
1421 dnl ** build \`hsc' with -O?
1422 GhcWithHscOptimised='YES'
1423 AC_ARG_ENABLE(hsc-optimised,
1424    [--disable-hsc-optimised   don't build compiler proper (hsc) with -O],
1425    [case "$enableval" in
1426         yes) GhcWithHscOptimised='YES'
1427              ;;
1428         no)  GhcWithHscOptimised='NO'
1429              ;;
1430         *)   echo "I don't understand this option: --enable-hsc-optimised=$enableval"
1431              exit 1
1432              ;;
1433     esac])
1434 AC_SUBST(GhcWithHscOptimised)
1435
1436 dnl ** build \`hsc' with -DDEBUG?
1437 GhcWithHscDebug='NO'
1438 AC_ARG_ENABLE(hsc-debug,
1439    [--enable-hsc-debug        build compiler proper (hsc) with -DDEBUG],
1440    [case "$enableval" in
1441         yes) GhcWithHscDebug='YES'
1442              ;;
1443         no)  GhcWithHscDebug='NO'
1444              ;;
1445         *)   echo "I don't understand this option: --enable-hsc-debug=$enableval"
1446              exit 1
1447              ;;
1448     esac])
1449 AC_SUBST(GhcWithHscDebug)
1450
1451 dnl ** omit native-code generator from \`hsc'?
1452 GhcWithNativeCodeGen='YES'
1453 AC_ARG_ENABLE(native-code-generator,
1454    [--enable-native-code-generator  build an n.c.g.
1455                           [enabled for supported platforms]],
1456    [case "$enableval" in
1457         yes) GhcWithNativeCodeGen='YES'
1458              ;;
1459         no)  GhcWithNativeCodeGen='NO'
1460              ;;
1461         *)   echo "I don't understand this option: --enable-native-code-generator=$enableval"
1462              exit 1
1463              ;;
1464     esac])
1465 if test $GhcWithNativeCodeGen = 'YES'; then
1466     case $TargetPlatform in
1467     i386-* | alpha-* | sparc-* )
1468        ;;
1469     *)
1470        echo "Don't have a native-code generator for this platform: $TargetPlatform"
1471        GhcWithNativeCodeGen='NO'
1472        ;;
1473     esac
1474 fi
1475 AC_SUBST(GhcWithNativeCodeGen)
1476
1477 dnl ** include Marlow's deforester in \`hsc'?
1478 GhcWithDeforester='NO'
1479 AC_ARG_ENABLE(deforester,
1480    [--enable-deforester       build deforester into compiler (HACKERS ONLY)],
1481    [case "$enableval" in
1482         yes) GhcWithDeforester='YES'
1483              ;;
1484         no)  GhcWithDeforester='NO'
1485              ;;
1486         *)   echo "I don't understand this option: --enable-deforester=$enableval"
1487              exit 1
1488              ;;
1489     esac])
1490 AC_SUBST(GhcWithDeforester)
1491
1492 dnl ** include Readline library?
1493 GhcWithReadline='NO'
1494 AC_ARG_ENABLE(readline-library,
1495    [--enable-readline-library include (GNU) readline library in -syslib GHC],
1496    [case "$enableval" in
1497         yes) GhcWithReadline='YES'
1498              ;;
1499         no)  GhcWithReadline='NO'
1500              ;;
1501         *)   echo "I don't understand this option: --enable-readline-library=$enableval"
1502              exit 1
1503              ;;
1504     esac])
1505 AC_SUBST(GhcWithReadline)
1506
1507 dnl ** include Sockets library?
1508 GhcWithSockets='NO'
1509 AC_ARG_ENABLE(sockets-library,
1510    [--enable-sockets-library  include the network-interface (sockets) library in -syslib GHC],
1511    [case "$enableval" in
1512         yes) GhcWithSockets='YES'
1513              ;;
1514         no)  GhcWithSockets='NO'
1515              ;;
1516         *)   echo "I don't understand this option: --enable-sockets-library=$enableval"
1517              exit 1
1518              ;;
1519     esac])
1520 AC_SUBST(GhcWithSockets)
1521
1522 dnl ** build the interpreter?
1523 BuildGHCI='NO'
1524 AC_ARG_ENABLE(ghci,
1525    [--enable-ghci             build Glasgow Haskell interpreter (HACKERS ONLY)],
1526    [case "$enableval" in
1527         yes) BuildGHCI='YES'
1528              ;;
1529         no)  BuildGHCI='NO'
1530              ;;
1531         *)   echo "I don't understand this option: --enable-ghci=$enableval"
1532              exit 1
1533              ;;
1534     esac])
1535 AC_SUBST(BuildGHCI)
1536
1537 # here ends a very big if DoingGHC = 'ghc' ...
1538 fi
1539
1540 #
1541 # -------------------------------------------------------------------------
1542 dnl
1543 dnl * `Happy' CONFIGURATION STUFF
1544
1545 if test "xxx$DoingHappy" = 'xxxhappy' ; then
1546 # a very big "if"!
1547
1548 dnl ** which Haskell compiler to use on happy?
1549 WithHappyHc='haskell-compiler-unspecified'
1550 WithHappyHcType='HC_UNSPECIFIED'
1551
1552 AC_ARG_WITH(hc-for-happy,
1553    [
1554 *******************************************************************
1555 ** \`Happy' PARSER-GENERATOR OPTIONS:
1556
1557 The Haskell compiler to compile Happy; this option, if used, overrides
1558 --with-hc=<...>:
1559
1560     --with-hc-for-happy=<Haskell compiler>
1561           ghc*     => Glasgow Haskell invoked by the name given
1562           hbc*     => Chalmers HBC, invoked by the name given
1563           nhc*     => Niklas Rojemo's "nhc", invoked by the name given
1564           in-place => Use ghc/driver/ghc; i.e. you've built GHC
1565                       and you want to use it un-installed ("in-place").],
1566    [case "$withval" in
1567         ghc* | glhc* )
1568                 WithHappyHc=$withval
1569                 ;;
1570         hbc* )  WithHappyHc=$withval
1571                 ;;
1572         nhc* )  WithHappyHc=$withval
1573                 ;;
1574         in-place )
1575                 WithHappyHc='IN-PLACE'
1576                 ;;
1577         *)      echo "I don't understand this option: --with-hc-for-happy=$withval"
1578                 exit 1
1579                 ;;
1580     esac])
1581
1582 # make sure that what they said makes sense.... set WithHappyHcType
1583 case $WithHappyHc in
1584     haskell-compiler-unspecified ) # maybe they said something earlier...
1585             if test $WithHc = 'haskell-compiler-unspecified' ; then
1586                 echo "Neither --with-hc nor --with-hc-for-happy was properly set"
1587                 exit 1
1588             fi
1589             ;;
1590     ghc* | glhc* )
1591             WithHappyHcType='HC_GLASGOW_GHC'
1592             AC_CHECK_PROG(have_ghc,$WithHappyHc,$ac_dir/$ac_word)
1593             if test -z "$have_ghc"; then
1594                 echo "Can't find Glasgow Haskell to compile with: $WithHappyHc"
1595                 exit 1
1596             fi
1597             ;;
1598     hbc* )  # Look for the dastardly competition
1599             WithHappyHcType='HC_CHALMERS_HBC'
1600             AC_CHECK_PROG(have_hbc,$WithHappyHc,YES,NO)
1601             if test $have_hbc = 'NO' ; then
1602                 echo "Can't find Chalmers HBC to compile with: $WithHappyHc"
1603                 exit 1
1604             fi
1605             ;;
1606     nhc* )  # Look for Niklas Rojemo's "nhc"
1607             WithHappyHcType='HC_ROJEMO_NHC'
1608             AC_CHECK_PROG(have_nhc,$WithHappyHc,YES,NO)
1609             if test $have_nhc = 'NO' ; then
1610                 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHappyHc"
1611                 exit 1
1612             fi
1613             ;;
1614     IN-PLACE) WithHappyHcType='HC_GLASGOW_GHC'
1615             ;;
1616 esac
1617 AC_SUBST(WithHappyHc)
1618 AC_SUBST(WithHappyHcType)
1619
1620 # here ends a very big if DoingHappy = 'happy' ...
1621 fi
1622 #
1623 # -------------------------------------------------------------------------
1624 dnl
1625 dnl * `Haggis' CONFIGURATION STUFF
1626
1627 if test "xxx$DoingHaggis" = 'xxxhaggis' ; then
1628 # a very big "if"!
1629
1630 dnl ** which Haskell compiler to use on haggis?
1631 WithHaggisHc='haskell-compiler-unspecified'
1632 WithHaggisHcType='HC_UNSPECIFIED'
1633
1634 AC_ARG_WITH(hc-for-haggis,
1635    [
1636 *******************************************************************
1637 ** \`Haggis' HASKELL GUI TOOLKIT OPTIONS:
1638
1639 The Haskell compiler to compile the Haggis toolkit; this option, if
1640 used, overrides --with-hc=<...>:
1641
1642     --with-hc-for-haggis=<Haskell compiler>
1643           ghc*     => Glasgow Haskell invoked by the name given
1644                       and you want to use it un-installed ("in-place").],
1645    [case "$withval" in
1646         ghc* | glhc* )
1647                 WithHaggisHc=$withval
1648                 ;;
1649         in-place )
1650                 WithHaggisHc='IN-PLACE'
1651                 ;;
1652         *)      echo "I don't understand this option: --with-hc-for-haggis=$withval"
1653                 exit 1
1654                 ;;
1655     esac])
1656
1657 # make sure that what they said makes sense.... set WithHaggisHcType
1658 case $WithHaggisHc in
1659     haskell-compiler-unspecified ) # maybe they said something earlier...
1660             if test $WithHc = 'haskell-compiler-unspecified' ; then
1661                 echo "Neither --with-hc nor --with-hc-for-haggis was properly set"
1662                 exit 1
1663             fi
1664             ;;
1665     ghc* | glhc* )
1666             WithHaggisHcType='HC_GLASGOW_GHC'
1667             AC_CHECK_PROG(have_ghc,$WithHaggisHc,$ac_dir/$ac_word)
1668             if test -z "$have_ghc"; then
1669                 echo "Can't find Glasgow Haskell to compile with: $WithHaggisHc"
1670                 exit 1
1671             fi
1672             ;;
1673     IN-PLACE) WithHaggisHcType='HC_GLASGOW_GHC'
1674             ;;
1675 esac
1676 AC_SUBST(WithHaggisHc)
1677 AC_SUBST(WithHaggisHcType)
1678
1679 # here ends a very big if DoingHaggis = 'haggis' ...
1680 fi
1681 #
1682 # -------------------------------------------------------------------------
1683 dnl
1684 dnl * `Literate' CONFIGURATION STUFF
1685
1686 if test "xxx$DoingLiterate" = 'xxxliterate' ; then
1687 # a very big "if"!
1688
1689 BuildInfoUtils='NO'
1690 AC_ARG_ENABLE(info-utils,
1691    [
1692 *******************************************************************
1693 ** Literate programming system OPTIONS:
1694
1695 --enable-info-utils       build GNU info/makeinfo utilities],
1696    [case "$enableval" in
1697         yes) BuildInfoUtils='YES'
1698              ;;
1699         no)  BuildInfoUtils='NO'
1700              ;;
1701         *)   echo "I don't understand this option: --enable-info-utils=$enableval"
1702              exit 1
1703              ;;
1704     esac])
1705 AC_SUBST(BuildInfoUtils)
1706
1707 # here ends a very big if DoingLiterate = 'literate' ...
1708 fi
1709 #
1710 # -------------------------------------------------------------------------
1711 dnl
1712 dnl * `NoFib' CONFIGURATION STUFF
1713
1714 if test "xxx$DoingNoFib" = 'xxxnofib' ; then
1715 # a very big "if"!
1716
1717 dnl ** which Haskell compiler to test with NoFib?
1718 WithNoFibHc='haskell-compiler-unspecified'
1719 WithNoFibHcType='HC_UNSPECIFIED'
1720
1721 AC_ARG_WITH(hc-for-nofib,
1722    [
1723 *******************************************************************
1724 ** NoFib HASKELL BENCHMARK SUITE OPTIONS:
1725
1726 The Haskell compiler to compile the NoFib programs; this option, if
1727 used, overrides --with-hc=<...>:
1728
1729     --with-hc-for-nofib=<Haskell compiler>
1730           ghc*     => Glasgow Haskell invoked by the name given
1731           hbc*     => Chalmers HBC, invoked by the name given
1732           nhc*     => Niklas Rojemo's "nhc", invoked by the name given
1733           in-place => Use ghc/driver/ghc; i.e. you've built GHC
1734                       and you want to use it un-installed ("in-place").
1735    ],
1736    [case "$withval" in
1737         ghc* | glhc* )
1738                 WithNoFibHc=$withval
1739                 ;;
1740         hbc* )  WithNoFibHc=$withval
1741                 ;;
1742         nhc* )  WithNoFibHc=$withval
1743                 ;;
1744         in-place )
1745                 WithNoFibHc='IN-PLACE'
1746                 ;;
1747         *)      echo "I don't understand this option: --with-hc-for-nofib=$withval"
1748                 exit 1
1749                 ;;
1750     esac])
1751
1752 # make sure that what they said makes sense.... set WithHappyHcType
1753 case $WithNoFibHc in
1754     haskell-compiler-unspecified ) # maybe they said something earlier...
1755             if test $WithHc = 'haskell-compiler-unspecified' ; then
1756                 echo "Neither --with-hc nor --with-hc-for-nofib was properly set"
1757                 exit 1
1758             fi
1759             ;;
1760     ghc* | glhc* )
1761             WithNoFibHcType='HC_GLASGOW_GHC'
1762             AC_CHECK_PROG(have_ghc,$WithNoFibHc,$ac_dir/$ac_word)
1763             if test -z "$have_ghc"; then
1764                 echo "Can't find Glasgow Haskell to compile with: $WithNoFibHc"
1765                 exit 1
1766             fi
1767             ;;
1768     hbc* )  # Look for the dastardly competition
1769             WithNoFibHcType='HC_CHALMERS_HBC'
1770             AC_CHECK_PROG(have_hbc,$WithNoFibHc,YES,NO)
1771             if test $have_hbc = 'NO' ; then
1772                 echo "Can't find Chalmers HBC to compile with: $WithNoFibHc"
1773                 exit 1
1774             fi
1775             ;;
1776     nhc* )  # Look for Niklas Rojemo's "nhc"
1777             WithNoFibHcType='HC_ROJEMO_NHC'
1778             AC_CHECK_PROG(have_nhc,$WithNoFibHc,YES,NO)
1779             if test $have_nhc = 'NO' ; then
1780                 echo "Can't find Niklas Rojemo's NHC to compile with: $WithNoFibHc"
1781                 exit 1
1782             fi
1783             ;;
1784     IN-PLACE) WithNoFibHcType='HC_GLASGOW_GHC'
1785             ;;
1786 esac
1787 AC_SUBST(WithNoFibHc)
1788 AC_SUBST(WithNoFibHcType)
1789
1790 dnl ** what mkworld \`setup' should be used?
1791 AC_ARG_WITH(setup,
1792    [
1793 --with-setup=<setup> : What mkworld \`setup' should be used?
1794                        Choices: ghc, hbc, nhc
1795 ],
1796    [case "$withval" in
1797         ghc )   MkWorldSetup='ghc'
1798                 ;;
1799         hbc )   MkWorldSetup='hbc'
1800                 ;;
1801         nhc )   MkWorldSetup='nhc'
1802                 ;;
1803         *)      echo "I don't understand this option: --with-setup=$withval"
1804                 exit 1
1805                 ;;
1806     esac])
1807
1808 if test $MkWorldSetup = 'std' ; then
1809     echo 'You must do --with-setup=... (one of: ghc, hbc, or nhc) for NoFib'
1810     exit 1
1811 fi
1812
1813 # ---------------------------------------
1814 # What sets of tests should be run.
1815 #
1816 IncludeRealNoFibTests='YES'     # defaults
1817 IncludeSpectralNoFibTests='YES'
1818 IncludeImaginaryNoFibTests='YES'
1819 IncludePENDINGNoFibTests='NO'
1820 IncludeUNUSEDNoFibTests='NO'
1821 IncludeGHC_ONLYNoFibTests='NO'
1822 IncludePRIVATENoFibTests='NO'
1823 IncludeParallelNoFibTests='NO'
1824
1825 dnl ** should *all* NoFib tests be run?
1826 # special catch-all variant
1827 AC_ARG_ENABLE(all-tests,
1828    [Possibly turn on *all* of the possible tests (a sane choice
1829 only if using GHC):
1830
1831 --enable-all-tests    do *all* tests],
1832    [case "$enableval" in
1833         yes) IncludePENDINGNoFibTests='YES'
1834              IncludeUNUSEDNoFibTests='YES'
1835              IncludeGHC_ONLYNoFibTests='YES'
1836              IncludePRIVATENoFibTests='YES'
1837              IncludeParallelNoFibTests='YES'
1838              ;;
1839         no) IncludePENDINGNoFibTests='NO'
1840              IncludeUNUSEDNoFibTests='NO'
1841              IncludeGHC_ONLYNoFibTests='NO'
1842              IncludePRIVATENoFibTests='NO'
1843              IncludeParallelNoFibTests='NO'
1844
1845              IncludeRealNoFibTests='NO'
1846              IncludeSpectralNoFibTests='NO'
1847              IncludeImaginaryNoFibTests='NO'
1848              ;;
1849         *)   echo "I don't understand this option: --enable-all-tests=$enableval"
1850              exit 1
1851              ;;
1852     esac])
1853
1854 dnl ** turn on/off individual categories of tests...
1855 # individual categories
1856 AC_ARG_ENABLE(imaginary-tests,
1857    [
1858 Enable/disable individual categories of tests:
1859
1860 --disable-imaginary-tests do *not* include imaginary tests],
1861    [case "$enableval" in
1862         yes) IncludeImaginaryNoFibTests='YES'
1863              ;;
1864         no)  IncludeImaginaryNoFibTests='NO'
1865              ;;
1866         *)   echo "I don't understand this option: --enable-imaginary-tests=$enableval"
1867              exit 1
1868              ;;
1869     esac])
1870
1871 AC_ARG_ENABLE(spectral-tests,
1872    [--disable-spectral-tests  do *not* include spectral tests],
1873    [case "$enableval" in
1874         yes) IncludeSpectralNoFibTests='YES'
1875              ;;
1876         no)  IncludeSpectralNoFibTests='NO'
1877              ;;
1878         *)   echo "I don't understand this option: --enable-spectral-tests=$enableval"
1879              exit 1
1880              ;;
1881     esac])
1882
1883 AC_ARG_ENABLE(real-tests,
1884    [--disable-real-tests      do *not* include real tests],
1885    [case "$enableval" in
1886         yes) IncludeRealNoFibTests='YES'
1887              ;;
1888         no)  IncludeRealNoFibTests='NO'
1889              ;;
1890         *)   echo "I don't understand this option: --enable-real-tests=$enableval"
1891              exit 1
1892              ;;
1893     esac])
1894
1895 AC_ARG_ENABLE(PENDING-tests,
1896    [--enable-PENDING-tests    include PENDING tests],
1897    [case "$enableval" in
1898         yes) IncludePENDINGNoFibTests='YES'
1899              ;;
1900         no)  IncludePENDINGNoFibTests='NO'
1901              ;;
1902         *)   echo "I don't understand this option: --enable-PENDING-tests=$enableval"
1903              exit 1
1904              ;;
1905     esac])
1906
1907 AC_ARG_ENABLE(UNUSED-tests,
1908    [--enable-UNUSED-tests     include UNUSED tests],
1909    [case "$enableval" in
1910         yes) IncludeUNUSEDNoFibTests='YES'
1911              ;;
1912         no)  IncludeUNUSEDNoFibTests='NO'
1913              ;;
1914         *)   echo "I don't understand this option: --enable-UNUSED-tests=$enableval"
1915              exit 1
1916              ;;
1917     esac])
1918
1919 AC_ARG_ENABLE(GHC-ONLY-tests,
1920    [--enable-GHC-ONLY-tests   include GHC_ONLY tests],
1921    [case "$enableval" in
1922         yes) IncludeGHC_ONLYNoFibTests='YES'
1923              ;;
1924         no)  IncludeGHC_ONLYNoFibTests='NO'
1925              ;;
1926         *)   echo "I don't understand this option: --enable-GHC-ONLY-tests=$enableval"
1927              exit 1
1928              ;;
1929     esac])
1930
1931 AC_ARG_ENABLE(PRIVATE-tests,
1932    [--enable-PRIVATE-tests    include PRIVATE tests],
1933    [case "$enableval" in
1934         yes) IncludePRIVATENoFibTests='YES'
1935              ;;
1936         no)  IncludePRIVATENoFibTests='NO'
1937              ;;
1938         *)   echo "I don't understand this option: --enable-PRIVATE-tests=$enableval"
1939              exit 1
1940              ;;
1941     esac])
1942
1943 AC_ARG_ENABLE(parallel-tests,
1944    [--enable-parallel-tests   include parallel tests
1945 ],
1946    [case "$enableval" in
1947         yes) IncludeParallelNoFibTests='YES'
1948              ;;
1949         no)  IncludeParallelNoFibTests='NO'
1950              ;;
1951         *)   echo "I don't understand this option: --enable-parallel-tests=$enableval"
1952              exit 1
1953              ;;
1954     esac])
1955
1956 AC_SUBST(IncludeRealNoFibTests)
1957 AC_SUBST(IncludeSpectralNoFibTests)
1958 AC_SUBST(IncludeImaginaryNoFibTests)
1959 AC_SUBST(IncludePENDINGNoFibTests)
1960 AC_SUBST(IncludeUNUSEDNoFibTests)
1961 AC_SUBST(IncludeGHC_ONLYNoFibTests)
1962 AC_SUBST(IncludeSpecialiseNoFibTests)
1963 AC_SUBST(IncludePRIVATENoFibTests)
1964 AC_SUBST(IncludeParallelNoFibTests)
1965
1966 # here ends a very big if DoingNoFib = 'nofib' ...
1967 fi
1968 #
1969 # -------------------------------------------------------------------------
1970 dnl
1971 dnl * extract non-header files with substitution (end)
1972 #
1973 AC_SUBST(MkWorldSetup)
1974
1975 AC_OUTPUT(Makefile STARTUP mkworld/site.jm mkworld/platform.h mkworld/config.h $ghc_mkworld_site_ghc_jm $ghc_includes_platform_h $nofib_mkworld_site_nofib_jm)
1976
1977 echo '************************************************'
1978 echo '*** NOW DO: sh < STARTUP'
1979 echo '************************************************'
1980 exit 0