4958303d80a9ee920ad4d178927342cb648cf870
[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 rs6000-ibm-aix*)
390         HostPlatform_CPP='rs6000_ibm_aix'
391         HostArch_CPP='rs6000'
392         HostVendor_CPP='ibm'
393         HostOS_CPP='aix'
394         ;;
395 sparc-sun-sunos4*)
396         HostPlatform=sparc-sun-sunos4
397         TargetPlatform=sparc-sun-sunos4 #hack
398         BuildPlatform=sparc-sun-sunos4 #hack
399         HostPlatform_CPP='sparc_sun_sunos4'
400         HostArch_CPP='sparc'
401         HostVendor_CPP='sun'
402         HostOS_CPP='sunos4'
403         ;;
404 sparc-sun-solaris2*)
405         HostPlatform=sparc-sun-solaris2
406         TargetPlatform=sparc-sun-solaris2 #hack
407         BuildPlatform=sparc-sun-solaris2 #hack
408         HostPlatform_CPP='sparc_sun_solaris2'
409         HostArch_CPP='sparc'
410         HostVendor_CPP='sun'
411         HostOS_CPP='solaris2'
412         ;;
413 *)
414         echo "Unrecognised platform: $HostPlatform"
415         exit 1
416         ;;
417 esac
418
419 test -n "$verbose" && echo "Host platform set to $HostPlatform"
420 test -n "$verbose" -a x"$HostPlatform" != x"$TargetPlatform" \
421         && echo "Target platform set to $TargetPlatform"
422 test -n "$verbose" -a x"$BuildPlatform" != x"$HostPlatform" \
423         && echo "Build platform set to $BuildPlatform"
424
425 BuildPlatform_CPP=$HostPlatform_CPP
426 TargetPlatform_CPP=$HostPlatform_CPP
427 BuildArch_CPP=$HostArch_CPP
428 TargetArch_CPP=$HostArch_CPP
429 BuildOS_CPP=$HostOS_CPP
430 TargetOS_CPP=$HostOS_CPP
431 BuildVendor_CPP=$HostVendor_CPP
432 TargetVendor_CPP=$HostVendor_CPP
433 dnl Cannot afford all these AC_SUBSTs (because of braindead seds w/ 99 cmd limits
434 dnl AC_SUBST(BuildPlatform)
435 AC_SUBST(HostPlatform)
436 dnl AC_SUBST(TargetPlatform)
437 AC_SUBST(HostPlatform_CPP)
438 dnl AC_SUBST(BuildPlatform_CPP)
439 dnl AC_SUBST(TargetPlatform_CPP)
440 AC_SUBST(HostArch_CPP)
441 dnl AC_SUBST(BuildArch_CPP)
442 dnl AC_SUBST(TargetArch_CPP)
443 AC_SUBST(HostOS_CPP)
444 dnl AC_SUBST(BuildOS_CPP)
445 dnl AC_SUBST(TargetOS_CPP)
446 AC_SUBST(HostVendor_CPP)
447 dnl AC_SUBST(BuildVendor_CPP)
448 dnl AC_SUBST(TargetVendor_CPP)
449
450 # -------------------------------------------------------------------------
451 dnl
452 dnl * _GENERAL_ CONFIGURATION CHECKS
453 #
454 dnl ** are we at Glasgow?
455 #
456 if test -d /local/fp -a -d /users/fp/simonpj; then
457     echo "Brilliant!  You must be a Glaswegian."
458     AT_GLASGOW=1
459     if test "x$prefix" = xNONE; then
460         prefix=/local/fp
461         echo "Assuming installation prefix of $prefix"
462     fi
463     if test "x$exec_prefix" = xNONE; then
464         # Sigh: the defn of exec_prefix does not include the bin* bit...
465         # WDP 94/07
466         exec_prefix=/local/fp
467         echo "Assuming binary installation prefix of $exec_prefix"
468     fi
469 else
470     AT_GLASGOW=0
471 fi
472 AC_SUBST(AT_GLASGOW)
473 test -n "$verbose" && echo "    setting AT_GLASGOW to $AT_GLASGOW"
474 #
475 #
476 #
477 dnl ** does #! work?
478 #
479 AC_SYS_INTERPRETER()
480 #
481 dnl ** look for `perl', but watch out for version 4.035
482 #
483 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
484 if test -z "$PerlCmd"; then
485     echo "You must install perl before you can continue"
486     echo "Perhaps it is already installed, but not in your PATH?"
487     exit 1
488 else
489     $PerlCmd -v >conftest.out 2>&1
490     if egrep "version 4" conftest.out >/dev/null 2>&1; then
491         if egrep "Patch level: 35" conftest.out >/dev/null 2>&1; then
492             echo "
493 ************************************************************************
494 Uh-oh...looks like you have Perl 4.035.
495
496 Perl version 4.035 has a bug to do with recursion that will bite if
497 you run the lit2texi script, when making Info files from
498 literate files of various sorts.  Either use the current version
499 (4.036), an older version (e.g., perl 4.019) or apply the patch in
500 glafp-utils/perl-4.035-fixes to your 4.035 perl.
501 ************************************************************************
502 "
503         fi
504     else
505         echo "I'm not sure if your version of perl will work,"
506         echo "but it's worth a shot, eh?"
507     fi
508     rm -fr conftest*
509 fi
510 #
511 dnl ** does #!.../perl work? (sometimes it's too long...)
512 echo "checking if \`#!$PerlCmd' works in shell scripts"
513 echo "#!$PerlCmd"'
514 exit $1;
515 ' > conftest
516 chmod u+x conftest
517 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
518 if test $? -ne 69; then
519    echo "It does!"
520 else
521    echo "It doesn't!  Perhaps \`#!$PerlCmd' is too long (often 32 characters max)"
522    exit 1
523 fi
524 rm -f conftest
525 #
526 dnl ** check if perl library is properly installed
527 # (by seeing if a "do 'getopts.pl'" works...
528 if $PerlCmd -e 'do "getopts.pl" || exit(1); exit(0);' > /dev/null 2>&1 ; then
529     :
530 else
531     echo "I think your perl library is misinstalled."
532     echo "The following script did not work:"
533     echo '      do "getopts.pl" || exit(1); exit(0);'
534     exit 1
535 fi
536 #
537 #
538 dnl ** look for GCC and find out which version
539 # Figure out which C compiler to use.  Gcc is preferred.
540 # If gcc, make sure it's at least 2.1
541 #
542 AC_PROG_CC
543 if test -z "$GCC"; then
544     echo "You would be better off with gcc"
545     echo "Perhaps it is already installed, but not in your PATH?"
546     HaveGcc='NO'
547 else
548     gcc -v > conftest.out 2>&1
549     echo '/version (\d+)\.(\d+)/ && $1*10+$2 > 20 && print "YES";' > conftest.pl
550     HaveGcc=`eval $PerlCmd -n conftest.pl conftest.out`
551     if test -z "$HaveGcc"; then
552         echo "I'm not sure if your version of gcc will work,"
553         echo "but it's worth a shot, eh?"
554         HaveGcc='YES'
555     fi
556     rm -fr conftest*
557 fi
558 AC_SUBST(HaveGcc)
559 AC_C_CROSS
560 #
561 dnl ** figure out how to do context diffs
562 # (NB: NeXTStep thinks diff'ing a file against itself is "trouble")
563 #
564 echo foo > conftest1
565 echo foo > conftest2
566 if diff -C 1 conftest1 conftest2 > /dev/null 2>&1 ; then
567     ContextDiffCmd='diff -C 1'
568 else
569     if diff -c1 conftest1 conftest2 > /dev/null 2>&1 ; then
570         ContextDiffCmd='diff -c1'
571     else
572         echo "Can't figure out how to do context diffs."
573         echo "Neither \`diff -C 1' nor \`diff -c1' works."
574         exit 1
575     fi
576 fi
577 rm -f conftest1 conftest2
578 AC_SUBST(ContextDiffCmd)
579 #
580 dnl ** look for a decent parser generator (bison preferred)
581 #
582 #
583 AC_CHECK_PROG(YaccCmd, bison, bison -y)
584 if test -z "$YaccCmd"; then
585     echo "Can't find bison out there..."
586     AC_CHECK_PROG(WhatCmd, what, what, :)
587     AC_CHECK_PROG(YaccCmd, yacc, $ac_dir/$ac_word)
588     if test -z "$YaccCmd"; then
589         echo "But that's okay...I can't find yacc either."
590         YaccCmd=:
591     else
592         $WhatCmd $YaccCmd > conftest.out
593         if egrep 'y1\.c 1\..*SMI' conftest.out >/dev/null 2>&1; then
594             echo "I don't trust your $YaccCmd; it looks like an old Sun yacc"
595             if test -x /usr/lang/yacc; then
596                 echo "I'm going to use /usr/lang/yacc instead"
597                 YaccCmd=/usr/lang/yacc
598             else
599                 echo "I'm assuming the worst...no parser generator at all"
600                 YaccCmd=:
601             fi
602         elif egrep 'y1\.c.*Revision: 4\.2\.6\.3.*DEC' conftest.out >/dev/null 2>&1; then
603             echo "I don't trust your $YaccCmd; it looks like a lame DEC yacc"
604             echo "I'm assuming the worst...no parser generator at all"
605             YaccCmd=:
606         else
607             echo "But that's okay...as far as I know, your yacc will work."
608         fi
609         rm -fr conftest*
610     fi
611 fi
612
613 #--------------------------------------------------------------
614 WithHc='haskell-compiler-unspecified'
615 WithHcType='HC_UNSPECIFIED'
616
617 AC_ARG_WITH(hc,
618    [
619 *******************************************************************
620 ** GENERAL OPTIONS WHICH APPLY TO ALL TOOLS:
621
622 --with-hc=<Haskell compiler>
623           ghc*     => Glasgow Haskell invoked by the name given
624           hbc*     => Chalmers HBC, invoked by the name given
625           nhc*     => Niklas Rojemo's "nhc", invoked by the name given
626           C or c   => Don't use a Haskell compiler;
627                       build from intermediate C (.hc) files.
628           in-place => Use ghc/driver/ghc; i.e. you've built GHC
629                       and you want to use it un-installed ("in-place").
630    ],
631    [case "$withval" in
632         ghc* | glhc* )
633                 WithHc=$withval
634                 ;;
635         hbc* )  WithHc=$withval
636                 ;;
637         nhc* )  WithHc=$withval
638                 ;;
639         c | C)  WithHc='C'
640                 ;;
641         in-place )
642                 WithHc='IN-PLACE'
643                 ;;
644         *)      echo "I don't understand this option: --with-hc=$withval"
645                 exit 1
646                 ;;
647     esac])
648
649 # make sure that what they said makes sense.... set WithHcType
650 case $WithHc in
651     haskell-compiler-unspecified ) # maybe they will say something later...
652             ;;
653     ghc* | glhc* )
654             WithHcType='HC_GLASGOW_GHC'
655             AC_CHECK_PROG(have_ghc,$WithHc,$ac_dir/$ac_word)
656             if test -z "$have_ghc"; then
657                 echo "Can't find Glasgow Haskell to compile with: $WithHc"
658                 exit 1
659             fi
660             ;;
661     hbc* )  # Look for the dastardly competition
662             WithHcType='HC_CHALMERS_HBC'
663             AC_CHECK_PROG(have_hbc,$WithHc,YES,NO)
664             if test $have_hbc = 'NO' ; then
665                 echo "Can't find Chalmers HBC to compile with: $WithHc"
666                 exit 1
667             fi
668             ;;
669     nhc* )  # Look for Niklas Rojemo's "nhc"
670             WithHcType='HC_ROJEMO_NHC'
671             AC_CHECK_PROG(have_nhc,$WithHc,YES,NO)
672             if test $have_nhc = 'NO' ; then
673                 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHc"
674                 exit 1
675             fi
676             ;;
677     c | C)  WithHcType='HC_USE_HC_FILES'
678             ;;
679     IN-PLACE) WithHcType='HC_GLASGOW_GHC'
680             ;;
681 esac
682 AC_SUBST(WithHc)
683 AC_SUBST(WithHcType)
684
685 dnl ** possibly choose a different tmpdir (default /tmp)
686 # let the user decide where the best tmpdir is
687 # /tmp is the default; /usr/tmp is sometimes a good choice.
688 # Very site-specific.
689 TmpDir='/tmp'
690 AC_ARG_WITH(tmpdir,
691    [--with-tmpdir=<temp directory> Use an alternative directory for
692 temporary files (presumably because /tmp is too small).],
693    [TmpDir="$withval"])
694 AC_SUBST(TmpDir)
695
696 dnl ** possibly set a max heap for Haskell compilations
697 # let the user specify a maximum heap to be used; the old
698 # "I have a 64MB machine, why not use a 32MB heap?" thing.
699 HcMaxHeapWasSet='NO'
700 HcMaxHeap='0'
701 AC_ARG_WITH(max-heap,
702    [
703 --with-max-heap=<heap size, e.g., 32m> Do all Haskell compilations
704 with a heap of this size.  (If you've got it, flaunt it.)],
705    [HcMaxHeapWasSet='YES'
706     HcMaxHeap="$withval"])
707 AC_SUBST(HcMaxHeapWasSet)
708 AC_SUBST(HcMaxHeap)
709
710 dnl ** figure out about mkdependHS
711 MkDependHSCmd=':'
712 if test -f ./ghc/utils/mkdependHS/mkdependHS \
713      -o -f ./ghc/utils/mkdependHS/mkdependHS.prl ; then
714     MkDependHSCmd='TopDirPwd/ghc/utils/mkdependHS/mkdependHS'
715 else
716     AC_CHECK_PROG(have_mkdependHS,mkdependHS,YES,NO)
717     if test $have_mkdependHS = 'YES' ; then
718         MkDependHSCmd='mkdependHS'
719     fi
720 fi
721 AC_SUBST(MkDependHSCmd)
722
723 # -------------------------------------------------------------------------
724 #
725 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
726 #
727 AC_PROG_CPP
728 if echo $CPP | egrep gcc >/dev/null 2>&1; then
729     echo > conftest.c
730     gcc -v -E conftest.c >/dev/null 2>conftest.out
731     echo '/(\S+\/cpp)/ && print "$1";' > conftest.pl
732     GNUCPP="`eval $PerlCmd -n conftest.pl conftest.out`"
733     test -n "$verbose" && echo "        setting GNUCPP to $GNUCPP"
734     RAWCPP="`eval $PerlCmd -n conftest.pl conftest.out` -traditional"
735     test -n "$verbose" && echo "        setting RAWCPP to $RAWCPP"
736     rm -fr conftest*
737 fi
738 # ToDo: what are GNUCPP and RAWCPP if the above if didn't fire? WDP 95/02
739 AC_SUBST(GNUCPP)
740 AC_SUBST(RAWCPP)
741 #
742 dnl ** figure out how to do a BSD-ish install
743 #
744 AC_PROG_INSTALL
745 #
746 dnl ** figure out what arguments to feed to `ar'
747 #
748 AC_CHECK_PROG(ArCmd,ar,$ac_dir/$ac_word)
749 if test -z "$ArCmd"; then
750     echo "You don't seem to have ar...I have no idea how to make a library"
751     exit 1;
752 fi
753 if $ArCmd clqs conftest.a >/dev/null 2>/dev/null; then
754     ArCmd="$ArCmd clqs"
755     NeedRanLib=''
756 elif $ArCmd cqs conftest.a >/dev/null 2>/dev/null; then
757     ArCmd="$ArCmd cqs"
758     NeedRanLib=''
759 elif $ArCmd clq conftest.a >/dev/null 2>/dev/null; then
760     ArCmd="$ArCmd clq"
761     NeedRanLib='YES'
762 elif $ArCmd cq conftest.a >/dev/null 2>/dev/null; then
763     ArCmd="$ArCmd cq"
764     NeedRanLib='YES'
765 else
766     echo "I can't figure out how to use your $ArCmd"
767     exit 1
768 fi
769 rm -rf conftest*
770 test -n "$ArCmd" && test -n "$verbose" && echo "        setting ArCmd to $ArCmd"
771 AC_SUBST(ArCmd)
772 #
773 dnl ** figure out if we need `ranlib'
774 #
775 if test -z "$NeedRanLib"; then
776     # we hackily override a few platforms on a case-by-case basis
777     case $HostPlatform in
778     i386-*-linuxaout)
779         NeedRanLib='YES'
780         ;;
781     *)  RANLIB=':'
782         ;;
783     esac
784     test -n "$verbose" && echo "        setting RANLIB to $RANLIB"
785 fi
786 if test -n "$NeedRanLib"; then
787     AC_PROG_RANLIB
788 fi
789 AC_SUBST(RANLIB)
790 #
791 dnl ** check for full ANSI header (.h) files
792 #
793 AC_HEADER_STDC
794 #
795 dnl ** check for specific header (.h) files that we are interested in
796 #
797 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 )
798 #
799 dnl ** check if it is safe to include both <time.h> and <sys/time.h>
800 #
801 AC_HEADER_TIME
802 #
803 dnl ** how do we get a timezone name?
804 #
805 AC_STRUCT_TIMEZONE
806
807 dnl ** determine the type of signal()
808 #
809 AC_TYPE_SIGNAL
810 #
811 dnl ** decide whether or not flex lexers need to be linked with -lfl
812 #
813 AC_CHECK_LIB(fl,yywrap,
814     FlexLibAvailable='YES',
815     FlexLibAvailable='NO')
816 AC_SUBST(FlexLibAvailable)
817 #
818 dnl ** Decide whether or not lex lexers need to be linked with -ll
819 # (Linux, for example, does not have "lex", only "flex")
820 #
821 AC_CHECK_LIB(l,yywrap,
822     LexLibAvailable='YES',
823     LexLibAvailable='NO')
824 AC_SUBST(LexLibAvailable)
825 #
826 dnl ** check for specific library functions that we are interested in
827 #
828 AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect setitimer stat sysconf timelocal times vadvise vfork)
829 #
830 dnl ** can we get alloca?
831 #
832 AC_FUNC_ALLOCA
833 #
834 dnl ** determine whether or not const works
835 #
836 AC_C_CONST
837 #
838 dnl ** check for leading underscores in symbol names
839 # We assume that they _aren't_ there if anything goes wrong.
840 #
841 echo checking for a leading underscore in symbol names
842 AC_TRY_RUN(
843 [#ifdef HAVE_NLIST_H
844 #include <nlist.h>
845 struct nlist xYzzY[] = {{"_xYzzY", 0},{0}};
846 #endif
847
848 main(argc, argv)
849 int argc;
850 char **argv;
851 {
852 #ifdef HAVE_NLIST_H
853     if(nlist(argv[0], xYzzY) == 0 && xYzzY[0].n_value != 0)
854         exit(0);
855 #endif
856     exit(1);
857 }], LeadingUnderscore='YES', LeadingUnderscore='NO', LeadingUnderscore='YES')
858 test -n "$verbose" && echo "    setting LeadingUnderscore to $LeadingUnderscore"
859
860 # -------------------------------------------------------------------------
861 dnl
862 dnl * `GHC' CONFIGURATION STUFF
863
864 if test "xxx$DoingGHC" = 'xxxghc' ; then
865 # a very big "if"!
866 #
867 dnl ** which builds to build?
868 # builds: normal = sequential _ap_o ; _p = profiling (sequential);
869 # _t = ticky; _u = unregisterized
870 GhcBuild_normal='YES'
871 GhcBuild_p='YES'
872 GhcBuild_t='NO'
873 GhcBuild_u='NO'
874 # _mc = concurrent; _mr = profiled concurrent; _mt = ticky concurrent
875 # _mp = parallel; _mg = gransim
876 GhcBuild_mc='NO'
877 GhcBuild_mr='NO'
878 GhcBuild_mt='NO'
879 GhcBuild_mp='NO'
880 GhcBuild_mg='NO'
881 # GC builds: _2s, _1s, _du (, _gn)
882 GhcBuild_2s='NO'
883 GhcBuild_1s='NO'
884 GhcBuild_du='NO'
885 # user builds: a...o
886 GhcBuild_a='NO'
887 GhcBuild_b='NO'
888 GhcBuild_c='NO'
889 GhcBuild_d='NO'
890 GhcBuild_e='NO'
891 GhcBuild_f='NO'
892 GhcBuild_g='NO'
893 GhcBuild_h='NO'
894 GhcBuild_i='NO'
895 GhcBuild_j='NO'
896 GhcBuild_k='NO'
897 GhcBuild_l='NO'
898 GhcBuild_m='NO'
899 GhcBuild_n='NO'
900 GhcBuild_o='NO'
901
902 AC_ARG_ENABLE(normal-build,
903    [
904 *******************************************************************
905 ** \`GHC' (GLASGOW HASKELL COMPILER) OPTIONS:
906
907 Choose all the \`builds' of GHC that you want:
908
909 --disable-normal-build do *not* build GHC for normal sequential code],
910    [case "$enableval" in
911         yes) GhcBuild_normal='YES'
912              ;;
913         no)  GhcBuild_normal='NO'
914              ;;
915         *)   echo "I don't understand this option: --enable-normal-build=$enableval"
916              exit 1
917              ;;
918     esac])
919
920 AC_ARG_ENABLE(profiling,
921    [--disable-profiling    do *not* build profiling features],
922    [case "$enableval" in
923         yes) GhcBuild_p='YES'
924              ;;
925         no)  GhcBuild_p='NO'
926              ;;
927         *)   echo "I don't understand this option: --enable-profiling=$enableval"
928              exit 1
929              ;;
930     esac])
931
932 AC_ARG_ENABLE(ticky,
933    [--enable-ticky         build for \`ticky-ticky' profiling (for implementors)],
934    [case "$enableval" in
935         yes) GhcBuild_t='YES'
936              ;;
937         no)  GhcBuild_t='NO'
938              ;;
939         *)   echo "I don't understand this option: --enable-ticky=$enableval"
940              exit 1
941              ;;
942     esac])
943
944 AC_ARG_ENABLE(concurrent,
945    [--enable-concurrent    turn on \`concurrent Haskell' features],
946    [case "$enableval" in
947         yes) GhcBuild_mc='YES'
948              ;;
949         no)  GhcBuild_mc='NO'
950              ;;
951         *)   echo "I don't understand this option: --enable-concurrent=$enableval"
952              exit 1
953              ;;
954     esac])
955
956 AC_ARG_ENABLE(profiled-concurrent,
957    [--enable-profiled-concurrent turn on profiling for \`concurrent Haskell'],
958    [case "$enableval" in
959         yes) GhcBuild_mr='YES'
960              ;;
961         no)  GhcBuild_mr='NO'
962              ;;
963         *)   echo "I don't understand this option: --enable-profiled-concurrent=$enableval"
964              exit 1
965              ;;
966     esac])
967
968 AC_ARG_ENABLE(ticky-concurrent,
969    [--enable-ticky-concurrent turn on \`ticky-ticky' profiling for \`concurrent Haskell'],
970    [case "$enableval" in
971         yes) GhcBuild_mt='YES'
972              ;;
973         no)  GhcBuild_mt='NO'
974              ;;
975         *)   echo "I don't understand this option: --enable-ticky-concurrent=$enableval"
976              exit 1
977              ;;
978     esac])
979
980 AC_ARG_ENABLE(parallel,
981    [--enable-parallel      turn on \`parallel Haskell' features],
982    [case "$enableval" in
983         yes) GhcBuild_mp='YES';
984              ;;
985         no)  GhcBuild_mp='NO'
986              ;;
987         *)   echo "I don't understand this option: --enable-parallel=$enableval"
988              exit 1
989              ;;
990     esac])
991
992 AC_ARG_ENABLE(gransim,
993    [--enable-gransim       turn on GranSim parallel simulator],
994    [case "$enableval" in
995         yes) GhcBuild_mg='YES';
996              ;;
997         no)  GhcBuild_mg='NO'
998              ;;
999         *)   echo "I don't understand this option: --enable-gransim=$enableval"
1000              exit 1
1001              ;;
1002     esac])
1003
1004 AC_ARG_ENABLE(gc-2s,
1005    [--enable-gc-2s         a build with the 2-space copying garbage collector],
1006    [case "$enableval" in
1007         yes) GhcBuild_2s='YES'
1008              ;;
1009         no)  GhcBuild_2s='NO'
1010              ;;
1011         *)   echo "I don't understand this option: --enable-gc-2s=$enableval"
1012              exit 1
1013              ;;
1014     esac])
1015
1016 AC_ARG_ENABLE(gc-1s,
1017    [--enable-gc-1s         a build with the 1-space compacting garbage collector],
1018    [case "$enableval" in
1019         yes) GhcBuild_1s='YES'
1020              ;;
1021         no)  GhcBuild_1s='NO'
1022              ;;
1023         *)   echo "I don't understand this option: --enable-gc-1s=$enableval"
1024              exit 1
1025              ;;
1026     esac])
1027
1028 AC_ARG_ENABLE(gc-du,
1029    [--enable-gc-du         a build with \`dual-mode' (1s/2s) garbage collector],
1030    [case "$enableval" in
1031         yes) GhcBuild_du='YES'
1032              ;;
1033         no)  GhcBuild_du='NO'
1034              ;;
1035         *)   echo "I don't understand this option: --enable-gc-du=$enableval"
1036              exit 1
1037              ;;
1038     esac])
1039
1040 dnl  some seds only allow 99 commands, meaning no more
1041 dnl  than 99 AC_SUBSTs.  AARRGGHH!!
1042 dnl AC_ARG_ENABLE(user-way-a,
1043 dnl    [--enable-user-way-a    build for \`user way a' (mostly for implementors)],
1044 dnl    [case "$enableval" in
1045 dnl         yes) GhcBuild_a='YES'
1046 dnl              ;;
1047 dnl         no)  GhcBuild_a='NO'
1048 dnl              ;;
1049 dnl         *)   echo "I don't understand this option: --enable-user-way-a=$enableval"
1050 dnl              exit 1
1051 dnl              ;;
1052 dnl     esac])
1053 dnl 
1054 dnl AC_ARG_ENABLE(user-way-b,
1055 dnl    [--enable-user-way-b    build for \`user way b' (mostly for implementors)],
1056 dnl    [case "$enableval" in
1057 dnl         yes) GhcBuild_b='YES'
1058 dnl              ;;
1059 dnl         no)  GhcBuild_b='NO'
1060 dnl              ;;
1061 dnl         *)   echo "I don't understand this option: --enable-user-way-b=$enableval"
1062 dnl              exit 1
1063 dnl              ;;
1064 dnl     esac])
1065 dnl 
1066 dnl AC_ARG_ENABLE(user-way-c,
1067 dnl    [--enable-user-way-c    build for \`user way c' (mostly for implementors)],
1068 dnl    [case "$enableval" in
1069 dnl         yes) GhcBuild_c='YES'
1070 dnl              ;;
1071 dnl         no)  GhcBuild_c='NO'
1072 dnl              ;;
1073 dnl         *)   echo "I don't understand this option: --enable-user-way-c=$enableval"
1074 dnl              exit 1
1075 dnl              ;;
1076 dnl     esac])
1077 dnl 
1078 dnl AC_ARG_ENABLE(user-way-d,
1079 dnl    [--enable-user-way-d    build for \`user way d' (mostly for implementors)],
1080 dnl    [case "$enableval" in
1081 dnl         yes) GhcBuild_d='YES'
1082 dnl              ;;
1083 dnl         no)  GhcBuild_d='NO'
1084 dnl              ;;
1085 dnl         *)   echo "I don't understand this option: --enable-user-way-d=$enableval"
1086 dnl              exit 1
1087 dnl              ;;
1088 dnl     esac])
1089 dnl 
1090 dnl AC_ARG_ENABLE(user-way-e,
1091 dnl    [--enable-user-way-e    build for \`user way e' (mostly for implementors)],
1092 dnl    [case "$enableval" in
1093 dnl         yes) GhcBuild_e='YES'
1094 dnl              ;;
1095 dnl         no)  GhcBuild_e='NO'
1096 dnl              ;;
1097 dnl         *)   echo "I don't understand this option: --enable-user-way-e=$enableval"
1098 dnl              exit 1
1099 dnl              ;;
1100 dnl     esac])
1101 dnl 
1102 dnl AC_ARG_ENABLE(user-way-f,
1103 dnl    [--enable-user-way-f    build for \`user way f' (mostly for implementors)],
1104 dnl    [case "$enableval" in
1105 dnl         yes) GhcBuild_f='YES'
1106 dnl              ;;
1107 dnl         no)  GhcBuild_f='NO'
1108 dnl              ;;
1109 dnl         *)   echo "I don't understand this option: --enable-user-way-f=$enableval"
1110 dnl              exit 1
1111 dnl              ;;
1112 dnl     esac])
1113 dnl 
1114 dnl AC_ARG_ENABLE(user-way-g,
1115 dnl    [--enable-user-way-g    build for \`user way g' (mostly for implementors)],
1116 dnl    [case "$enableval" in
1117 dnl         yes) GhcBuild_g='YES'
1118 dnl              ;;
1119 dnl         no)  GhcBuild_g='NO'
1120 dnl              ;;
1121 dnl         *)   echo "I don't understand this option: --enable-user-way-g=$enableval"
1122 dnl              exit 1
1123 dnl              ;;
1124 dnl     esac])
1125 dnl 
1126 dnl AC_ARG_ENABLE(user-way-h,
1127 dnl    [--enable-user-way-h    build for \`user way h' (mostly for implementors)],
1128 dnl    [case "$enableval" in
1129 dnl         yes) GhcBuild_h='YES'
1130 dnl              ;;
1131 dnl         no)  GhcBuild_h='NO'
1132 dnl              ;;
1133 dnl         *)   echo "I don't understand this option: --enable-user-way-h=$enableval"
1134 dnl              exit 1
1135 dnl              ;;
1136 dnl     esac])
1137 dnl 
1138 dnl AC_ARG_ENABLE(user-way-i,
1139 dnl    [--enable-user-way-i    build for \`user way i' (mostly for implementors)],
1140 dnl    [case "$enableval" in
1141 dnl         yes) GhcBuild_i='YES'
1142 dnl              ;;
1143 dnl         no)  GhcBuild_i='NO'
1144 dnl              ;;
1145 dnl         *)   echo "I don't understand this option: --enable-user-way-i=$enableval"
1146 dnl              exit 1
1147 dnl              ;;
1148 dnl     esac])
1149 dnl 
1150 dnl AC_ARG_ENABLE(user-way-j,
1151 dnl    [--enable-user-way-j    build for \`user way j' (mostly for implementors)],
1152 dnl    [case "$enableval" in
1153 dnl         yes) GhcBuild_j='YES'
1154 dnl              ;;
1155 dnl         no)  GhcBuild_j='NO'
1156 dnl              ;;
1157 dnl         *)   echo "I don't understand this option: --enable-user-way-j=$enableval"
1158 dnl              exit 1
1159 dnl              ;;
1160 dnl     esac])
1161 dnl 
1162 dnl AC_ARG_ENABLE(user-way-k,
1163 dnl    [--enable-user-way-k    build for \`user way k' (mostly for implementors)],
1164 dnl    [case "$enableval" in
1165 dnl         yes) GhcBuild_k='YES'
1166 dnl              ;;
1167 dnl         no)  GhcBuild_k='NO'
1168 dnl              ;;
1169 dnl         *)   echo "I don't understand this option: --enable-user-way-k=$enableval"
1170 dnl              exit 1
1171 dnl              ;;
1172 dnl     esac])
1173 dnl 
1174 dnl AC_ARG_ENABLE(user-way-l,
1175 dnl    [--enable-user-way-l    build for \`user way l' (mostly for implementors)],
1176 dnl    [case "$enableval" in
1177 dnl         yes) GhcBuild_l='YES'
1178 dnl              ;;
1179 dnl         no)  GhcBuild_l='NO'
1180 dnl              ;;
1181 dnl         *)   echo "I don't understand this option: --enable-user-way-l=$enableval"
1182 dnl              exit 1
1183 dnl              ;;
1184 dnl     esac])
1185 dnl 
1186 dnl AC_ARG_ENABLE(user-way-m,
1187 dnl    [--enable-user-way-m    build for \`user way m' (mostly for implementors)],
1188 dnl    [case "$enableval" in
1189 dnl         yes) GhcBuild_m='YES'
1190 dnl              ;;
1191 dnl         no)  GhcBuild_m='NO'
1192 dnl              ;;
1193 dnl         *)   echo "I don't understand this option: --enable-user-way-m=$enableval"
1194 dnl              exit 1
1195 dnl              ;;
1196 dnl     esac])
1197 dnl 
1198 dnl AC_ARG_ENABLE(user-way-n,
1199 dnl    [--enable-user-way-n    build for \`user way n' (mostly for implementors)],
1200 dnl    [case "$enableval" in
1201 dnl         yes) GhcBuild_n='YES'
1202 dnl              ;;
1203 dnl         no)  GhcBuild_n='NO'
1204 dnl              ;;
1205 dnl         *)   echo "I don't understand this option: --enable-user-way-n=$enableval"
1206 dnl              exit 1
1207 dnl              ;;
1208 dnl     esac])
1209 dnl 
1210 dnl AC_ARG_ENABLE(user-way-o,
1211 dnl    [--enable-user-way-o    build for \`user way o' (mostly for implementors)],
1212 dnl    [case "$enableval" in
1213 dnl         yes) GhcBuild_o='YES'
1214 dnl              ;;
1215 dnl         no)  GhcBuild_o='NO'
1216 dnl              ;;
1217 dnl         *)   echo "I don't understand this option: --enable-user-way-o=$enableval"
1218 dnl              exit 1
1219 dnl              ;;
1220 dnl     esac])
1221 dnl 
1222 AC_SUBST(GhcBuild_normal)
1223 AC_SUBST(GhcBuild_p)
1224 AC_SUBST(GhcBuild_t)
1225 AC_SUBST(GhcBuild_u)
1226 AC_SUBST(GhcBuild_mc)
1227 AC_SUBST(GhcBuild_mr)
1228 AC_SUBST(GhcBuild_mt)
1229 AC_SUBST(GhcBuild_mp)
1230 AC_SUBST(GhcBuild_mg)
1231 AC_SUBST(GhcBuild_2s)
1232 AC_SUBST(GhcBuild_1s)
1233 AC_SUBST(GhcBuild_du)
1234 dnl AC_SUBST(GhcBuild_a)
1235 dnl AC_SUBST(GhcBuild_b)
1236 dnl AC_SUBST(GhcBuild_c)
1237 dnl AC_SUBST(GhcBuild_d)
1238 dnl AC_SUBST(GhcBuild_e)
1239 dnl AC_SUBST(GhcBuild_f)
1240 dnl AC_SUBST(GhcBuild_g)
1241 dnl AC_SUBST(GhcBuild_h)
1242 dnl AC_SUBST(GhcBuild_i)
1243 dnl AC_SUBST(GhcBuild_j)
1244 dnl AC_SUBST(GhcBuild_k)
1245 dnl AC_SUBST(GhcBuild_l)
1246 dnl AC_SUBST(GhcBuild_m)
1247 dnl AC_SUBST(GhcBuild_n)
1248 dnl AC_SUBST(GhcBuild_o)
1249
1250 #---------------------------------------------------------------
1251 #
1252 dnl ** which Haskell compiler to bootstrap GHC with?
1253 # Figure out what Haskell compiler(s) to use for booting
1254 #
1255 # first, the defaults...
1256 WithGhcHc='haskell-compiler-unspecified'
1257 WithGhcHcType='HC_UNSPECIFIED'
1258 GhcBuilderVersion='26'
1259
1260 AC_ARG_WITH(hc-for-ghc,
1261    [
1262 The Haskell compiler for bootstrapping GHC (if any); this option,
1263 if used, overrides --with-hc=<...>:
1264
1265     --with-hc-for-ghc=<Haskell compiler>
1266           ghc*     => Glasgow Haskell invoked by the name given
1267           C or c   => Don't use a Haskell compiler;
1268                       build from intermediate C (.hc) files.
1269    ],
1270    [case "$withval" in
1271         ghc* | glhc* )
1272                 WithGhcHc=$withval
1273                 ;;
1274         hbc* )  echo "HBC will not compile GHC 0.26 as is (sigh)"
1275                 exit 1
1276                 ;;
1277         c | C)  WithGhcHc='C'
1278                 WithGhcHcType='HC_USE_HC_FILES'
1279                 ;;
1280         *)      echo "I don't understand this option: --with-hc-for-ghc=$withval"
1281                 exit 1
1282                 ;;
1283     esac])
1284
1285 # make sure that what they said makes sense.... set WithGhcHcType
1286 case $WithGhcHc in
1287     haskell-compiler-unspecified ) # maybe they said something earlier...
1288             if test $WithHc = 'haskell-compiler-unspecified' ; then
1289                 echo "Neither --with-hc nor --with-hc-for-ghc was properly set"
1290                 exit 1
1291             fi
1292             if test $WithHcType = 'HC_GLASGOW_GHC' ; then
1293                 touch conftest.o
1294                 $WithHc -v -C conftest.o > conftest.out 2>&1
1295                 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1296                 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1297                 rm -rf conftest*
1298             fi
1299             ;;
1300     ghc* | glhc* )
1301             WithGhcHcType='HC_GLASGOW_GHC'
1302             AC_CHECK_PROG(have_ghc,$WithGhcHc,$ac_dir/$ac_word)
1303             if test -z "$have_ghc"; then
1304                 echo "Can't find Glasgow Haskell to compile with: $WithGhcHc"
1305                 exit 1
1306             else
1307                 touch conftest.o
1308                 $WithGhcHc -v -C conftest.o > conftest.out 2>&1
1309                 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1310                 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1311                 rm -rf conftest*
1312             fi
1313             ;;
1314     c | C)  WithGhcHcType='HC_USE_HC_FILES'
1315             ;;
1316 esac
1317 AC_SUBST(GhcBuilderVersion)
1318 AC_SUBST(WithGhcHc)
1319 AC_SUBST(WithGhcHcType)
1320
1321 dnl ** use portable (slow) C? -- preferably not
1322 GhcWithRegisterised='YES'
1323 AC_ARG_ENABLE(portable-C,
1324    [Other things for GHC:
1325
1326 --enable-portable-C       use portable C (slow), not \`registerised' (fast)],
1327    [case "$enableval" in
1328         yes) GhcWithRegisterised='NO'
1329              ;;
1330         no)  GhcWithRegisterised='YES'
1331              ;;
1332         *)   echo "I don't understand this option: --enable-portable-C=$enableval"
1333              exit 1
1334              ;;
1335     esac])
1336
1337 if test $GhcWithRegisterised = 'YES'; then
1338     case $HostPlatform in
1339     alpha-* | hppa1.1-* | i386-* | m68k-* | mips-* | sparc-* )
1340        ;;
1341     *)
1342        echo "Don't know non-portable C tricks for this platform: $HostPlatform"
1343        GhcWithRegisterised='NO'
1344        ;;
1345     esac
1346 fi
1347 AC_SUBST(GhcWithRegisterised)
1348
1349 if test $GhcWithRegisterised = 'NO'; then
1350     GhcBuild_u='YES'
1351     GhcBuild_normal='NO'
1352     GhcBuild_p='NO'
1353 fi
1354 # ToDo: make sure we can do concurrent for platform/circs...
1355 # ToDo: make sure we can do profiling for platform/circs...
1356 # ToDo: make sure we can do parallel for platform/circs...
1357 # ToDo: make sure we can do gransim for platform/circs...
1358
1359 dnl ** build GHC compiler proper (\`hsc') from .hc files?
1360 GhcWithHscBuiltViaC='NO'
1361 AC_ARG_ENABLE(hsc-built-via-C,
1362    [--enable-hsc-built-via-C  build compiler proper (hsc) from intermediate .hc
1363                           files (disabled by default)],
1364    [case "$enableval" in
1365         yes) GhcWithHscBuiltViaC='YES'
1366              ;;
1367         no)  GhcWithHscBuiltViaC='NO'
1368              ;;
1369         *)   echo "I don't understand this option: --enable-hsc-built-via-C=$enableval"
1370              exit 1
1371              ;;
1372     esac])
1373 case $WithGhcHc in
1374     haskell-compiler-unspecified ) # maybe they said something earlier...
1375             if test $WithHcType = 'HC_USE_HC_FILES' ; then
1376                 GhcWithHscBuiltViaC='YES'
1377             fi
1378             ;;
1379     c | C)  GhcWithHscBuiltViaC='YES'
1380             ;;
1381     *)      ;;
1382 esac
1383 AC_SUBST(GhcWithHscBuiltViaC)
1384
1385 dnl ** build \`hsc' with -O?
1386 GhcWithHscOptimised='YES'
1387 AC_ARG_ENABLE(hsc-optimised,
1388    [--disable-hsc-optimised   don't build compiler proper (hsc) with -O],
1389    [case "$enableval" in
1390         yes) GhcWithHscOptimised='YES'
1391              ;;
1392         no)  GhcWithHscOptimised='NO'
1393              ;;
1394         *)   echo "I don't understand this option: --enable-hsc-optimised=$enableval"
1395              exit 1
1396              ;;
1397     esac])
1398 AC_SUBST(GhcWithHscOptimised)
1399
1400 dnl ** build \`hsc' with -DDEBUG?
1401 GhcWithHscDebug='NO'
1402 AC_ARG_ENABLE(hsc-debug,
1403    [--enable-hsc-debug        build compiler proper (hsc) with -DDEBUG],
1404    [case "$enableval" in
1405         yes) GhcWithHscDebug='YES'
1406              ;;
1407         no)  GhcWithHscDebug='NO'
1408              ;;
1409         *)   echo "I don't understand this option: --enable-hsc-debug=$enableval"
1410              exit 1
1411              ;;
1412     esac])
1413 AC_SUBST(GhcWithHscDebug)
1414
1415 dnl ** omit native-code generator from \`hsc'?
1416 GhcWithNativeCodeGen='YES'
1417 AC_ARG_ENABLE(native-code-generator,
1418    [--enable-native-code-generator  build an n.c.g.
1419                           [enabled for supported platforms]],
1420    [case "$enableval" in
1421         yes) GhcWithNativeCodeGen='YES'
1422              ;;
1423         no)  GhcWithNativeCodeGen='NO'
1424              ;;
1425         *)   echo "I don't understand this option: --enable-native-code-generator=$enableval"
1426              exit 1
1427              ;;
1428     esac])
1429 if test $GhcWithNativeCodeGen = 'YES'; then
1430     case $TargetPlatform in
1431     sparc-sun-sunos4 | sparc-sun-solaris2 | alpha-dec-osf1 )
1432        ;;
1433     *)
1434        echo "Don't have a native-code generator for this platform: $TargetPlatform"
1435        GhcWithNativeCodeGen='NO'
1436        ;;
1437     esac
1438 fi
1439 AC_SUBST(GhcWithNativeCodeGen)
1440
1441 dnl ** include Marlow's deforester in \`hsc'?
1442 GhcWithDeforester='NO'
1443 AC_ARG_ENABLE(deforester,
1444    [--enable-deforester       build deforester into compiler (HACKERS ONLY)],
1445    [case "$enableval" in
1446         yes) GhcWithDeforester='YES'
1447              ;;
1448         no)  GhcWithDeforester='NO'
1449              ;;
1450         *)   echo "I don't understand this option: --enable-deforester=$enableval"
1451              exit 1
1452              ;;
1453     esac])
1454 AC_SUBST(GhcWithDeforester)
1455
1456 dnl ** include Readline library?
1457 GhcWithReadline='NO'
1458 AC_ARG_ENABLE(readline-library,
1459    [--enable-readline-library include (GNU) readline library in -syslib GHC],
1460    [case "$enableval" in
1461         yes) GhcWithReadline='YES'
1462              ;;
1463         no)  GhcWithReadline='NO'
1464              ;;
1465         *)   echo "I don't understand this option: --enable-readline-library=$enableval"
1466              exit 1
1467              ;;
1468     esac])
1469 AC_SUBST(GhcWithReadline)
1470
1471 dnl ** include Sockets library?
1472 GhcWithSockets='NO'
1473 AC_ARG_ENABLE(sockets-library,
1474    [--enable-sockets-library  include the network-interface (sockets) library in -syslib GHC],
1475    [case "$enableval" in
1476         yes) GhcWithSockets='YES'
1477              ;;
1478         no)  GhcWithSockets='NO'
1479              ;;
1480         *)   echo "I don't understand this option: --enable-sockets-library=$enableval"
1481              exit 1
1482              ;;
1483     esac])
1484 AC_SUBST(GhcWithSockets)
1485
1486 dnl ** build the interpreter?
1487 BuildGHCI='NO'
1488 AC_ARG_ENABLE(ghci,
1489    [--enable-ghci             build Glasgow Haskell interpreter (HACKERS ONLY)],
1490    [case "$enableval" in
1491         yes) BuildGHCI='YES'
1492              ;;
1493         no)  BuildGHCI='NO'
1494              ;;
1495         *)   echo "I don't understand this option: --enable-ghci=$enableval"
1496              exit 1
1497              ;;
1498     esac])
1499 AC_SUBST(BuildGHCI)
1500
1501 # here ends a very big if DoingGHC = 'ghc' ...
1502 fi
1503
1504 #
1505 # -------------------------------------------------------------------------
1506 dnl
1507 dnl * `Happy' CONFIGURATION STUFF
1508
1509 if test "xxx$DoingHappy" = 'xxxhappy' ; then
1510 # a very big "if"!
1511
1512 dnl ** which Haskell compiler to use on happy?
1513 WithHappyHc='haskell-compiler-unspecified'
1514 WithHappyHcType='HC_UNSPECIFIED'
1515
1516 AC_ARG_WITH(hc-for-happy,
1517    [
1518 *******************************************************************
1519 ** \`Happy' PARSER-GENERATOR OPTIONS:
1520
1521 The Haskell compiler to compile Happy; this option, if used, overrides
1522 --with-hc=<...>:
1523
1524     --with-hc-for-happy=<Haskell compiler>
1525           ghc*     => Glasgow Haskell invoked by the name given
1526           hbc*     => Chalmers HBC, invoked by the name given
1527           nhc*     => Niklas Rojemo's "nhc", invoked by the name given
1528           in-place => Use ghc/driver/ghc; i.e. you've built GHC
1529                       and you want to use it un-installed ("in-place").],
1530    [case "$withval" in
1531         ghc* | glhc* )
1532                 WithHappyHc=$withval
1533                 ;;
1534         hbc* )  WithHappyHc=$withval
1535                 ;;
1536         nhc* )  WithHappyHc=$withval
1537                 ;;
1538         in-place )
1539                 WithHappyHc='IN-PLACE'
1540                 ;;
1541         *)      echo "I don't understand this option: --with-hc-for-happy=$withval"
1542                 exit 1
1543                 ;;
1544     esac])
1545
1546 # make sure that what they said makes sense.... set WithHappyHcType
1547 case $WithHappyHc in
1548     haskell-compiler-unspecified ) # maybe they said something earlier...
1549             if test $WithHc = 'haskell-compiler-unspecified' ; then
1550                 echo "Neither --with-hc nor --with-hc-for-happy was properly set"
1551                 exit 1
1552             fi
1553             ;;
1554     ghc* | glhc* )
1555             WithHappyHcType='HC_GLASGOW_GHC'
1556             AC_CHECK_PROG(have_ghc,$WithHappyHc,$ac_dir/$ac_word)
1557             if test -z "$have_ghc"; then
1558                 echo "Can't find Glasgow Haskell to compile with: $WithHappyHc"
1559                 exit 1
1560             fi
1561             ;;
1562     hbc* )  # Look for the dastardly competition
1563             WithHappyHcType='HC_CHALMERS_HBC'
1564             AC_CHECK_PROG(have_hbc,$WithHappyHc,YES,NO)
1565             if test $have_hbc = 'NO' ; then
1566                 echo "Can't find Chalmers HBC to compile with: $WithHappyHc"
1567                 exit 1
1568             fi
1569             ;;
1570     nhc* )  # Look for Niklas Rojemo's "nhc"
1571             WithHappyHcType='HC_ROJEMO_NHC'
1572             AC_CHECK_PROG(have_nhc,$WithHappyHc,YES,NO)
1573             if test $have_nhc = 'NO' ; then
1574                 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHappyHc"
1575                 exit 1
1576             fi
1577             ;;
1578     IN-PLACE) WithHappyHcType='HC_GLASGOW_GHC'
1579             ;;
1580 esac
1581 AC_SUBST(WithHappyHc)
1582 AC_SUBST(WithHappyHcType)
1583
1584 # here ends a very big if DoingHappy = 'happy' ...
1585 fi
1586 #
1587 # -------------------------------------------------------------------------
1588 dnl
1589 dnl * `Haggis' CONFIGURATION STUFF
1590
1591 if test "xxx$DoingHaggis" = 'xxxhaggis' ; then
1592 # a very big "if"!
1593
1594 dnl ** which Haskell compiler to use on haggis?
1595 WithHaggisHc='haskell-compiler-unspecified'
1596 WithHaggisHcType='HC_UNSPECIFIED'
1597
1598 AC_ARG_WITH(hc-for-haggis,
1599    [
1600 *******************************************************************
1601 ** \`Haggis' HASKELL GUI TOOLKIT OPTIONS:
1602
1603 The Haskell compiler to compile the Haggis toolkit; this option, if
1604 used, overrides --with-hc=<...>:
1605
1606     --with-hc-for-haggis=<Haskell compiler>
1607           ghc*     => Glasgow Haskell invoked by the name given
1608                       and you want to use it un-installed ("in-place").],
1609    [case "$withval" in
1610         ghc* | glhc* )
1611                 WithHaggisHc=$withval
1612                 ;;
1613         in-place )
1614                 WithHaggisHc='IN-PLACE'
1615                 ;;
1616         *)      echo "I don't understand this option: --with-hc-for-haggis=$withval"
1617                 exit 1
1618                 ;;
1619     esac])
1620
1621 # make sure that what they said makes sense.... set WithHaggisHcType
1622 case $WithHaggisHc in
1623     haskell-compiler-unspecified ) # maybe they said something earlier...
1624             if test $WithHc = 'haskell-compiler-unspecified' ; then
1625                 echo "Neither --with-hc nor --with-hc-for-haggis was properly set"
1626                 exit 1
1627             fi
1628             ;;
1629     ghc* | glhc* )
1630             WithHaggisHcType='HC_GLASGOW_GHC'
1631             AC_CHECK_PROG(have_ghc,$WithHaggisHc,$ac_dir/$ac_word)
1632             if test -z "$have_ghc"; then
1633                 echo "Can't find Glasgow Haskell to compile with: $WithHaggisHc"
1634                 exit 1
1635             fi
1636             ;;
1637     IN-PLACE) WithHaggisHcType='HC_GLASGOW_GHC'
1638             ;;
1639 esac
1640 AC_SUBST(WithHaggisHc)
1641 AC_SUBST(WithHaggisHcType)
1642
1643 # here ends a very big if DoingHaggis = 'haggis' ...
1644 fi
1645 #
1646 # -------------------------------------------------------------------------
1647 dnl
1648 dnl * `NoFib' CONFIGURATION STUFF
1649
1650 if test "xxx$DoingNoFib" = 'xxxnofib' ; then
1651 # a very big "if"!
1652
1653 dnl ** which Haskell compiler to test with NoFib?
1654 WithNoFibHc='haskell-compiler-unspecified'
1655 WithNoFibHcType='HC_UNSPECIFIED'
1656
1657 AC_ARG_WITH(hc-for-nofib,
1658    [
1659 *******************************************************************
1660 ** NoFib HASKELL BENCHMARK SUITE OPTIONS:
1661
1662 The Haskell compiler to compile the NoFib programs; this option, if
1663 used, overrides --with-hc=<...>:
1664
1665     --with-hc-for-nofib=<Haskell compiler>
1666           ghc*     => Glasgow Haskell invoked by the name given
1667           hbc*     => Chalmers HBC, invoked by the name given
1668           nhc*     => Niklas Rojemo's "nhc", invoked by the name given
1669           in-place => Use ghc/driver/ghc; i.e. you've built GHC
1670                       and you want to use it un-installed ("in-place").
1671    ],
1672    [case "$withval" in
1673         ghc* | glhc* )
1674                 WithNoFibHc=$withval
1675                 ;;
1676         hbc* )  WithNoFibHc=$withval
1677                 ;;
1678         nhc* )  WithNoFibHc=$withval
1679                 ;;
1680         in-place )
1681                 WithNoFibHc='IN-PLACE'
1682                 ;;
1683         *)      echo "I don't understand this option: --with-hc-for-nofib=$withval"
1684                 exit 1
1685                 ;;
1686     esac])
1687
1688 # make sure that what they said makes sense.... set WithHappyHcType
1689 case $WithNoFibHc in
1690     haskell-compiler-unspecified ) # maybe they said something earlier...
1691             if test $WithHc = 'haskell-compiler-unspecified' ; then
1692                 echo "Neither --with-hc nor --with-hc-for-nofib was properly set"
1693                 exit 1
1694             fi
1695             ;;
1696     ghc* | glhc* )
1697             WithNoFibHcType='HC_GLASGOW_GHC'
1698             AC_CHECK_PROG(have_ghc,$WithNoFibHc,$ac_dir/$ac_word)
1699             if test -z "$have_ghc"; then
1700                 echo "Can't find Glasgow Haskell to compile with: $WithNoFibHc"
1701                 exit 1
1702             fi
1703             ;;
1704     hbc* )  # Look for the dastardly competition
1705             WithNoFibHcType='HC_CHALMERS_HBC'
1706             AC_CHECK_PROG(have_hbc,$WithNoFibHc,YES,NO)
1707             if test $have_hbc = 'NO' ; then
1708                 echo "Can't find Chalmers HBC to compile with: $WithNoFibHc"
1709                 exit 1
1710             fi
1711             ;;
1712     nhc* )  # Look for Niklas Rojemo's "nhc"
1713             WithNoFibHcType='HC_ROJEMO_NHC'
1714             AC_CHECK_PROG(have_nhc,$WithNoFibHc,YES,NO)
1715             if test $have_nhc = 'NO' ; then
1716                 echo "Can't find Niklas Rojemo's NHC to compile with: $WithNoFibHc"
1717                 exit 1
1718             fi
1719             ;;
1720     IN-PLACE) WithNoFibHcType='HC_GLASGOW_GHC'
1721             ;;
1722 esac
1723 AC_SUBST(WithNoFibHc)
1724 AC_SUBST(WithNoFibHcType)
1725
1726 dnl ** what mkworld \`setup' should be used?
1727 AC_ARG_WITH(setup,
1728    [
1729 What mkworld \`setup' should be used?
1730 Choices: ghc, hbc, nhc
1731 ],
1732    [case "$withval" in
1733         ghc )   MkWorldSetup='ghc'
1734                 ;;
1735         hbc )   MkWorldSetup='hbc'
1736                 ;;
1737         nhc )   MkWorldSetup='nhc'
1738                 ;;
1739         *)      echo "I don't understand this option: --with-hc-for-nofib=$withval"
1740                 exit 1
1741                 ;;
1742     esac])
1743
1744 if test $MkWorldSetup = 'std' ; then
1745     echo 'You must do --with-setup=... (one of: ghc, hbc, or nhc) for NoFib'
1746     exit 1
1747 fi
1748
1749 # ---------------------------------------
1750 # What sets of tests should be run.
1751 #
1752 IncludeRealNoFibTests='YES'     # defaults
1753 IncludeSpectralNoFibTests='YES'
1754 IncludeImaginaryNoFibTests='YES'
1755 IncludePENDINGNoFibTests='NO'
1756 IncludeUNUSEDNoFibTests='NO'
1757 IncludeGHC_ONLYNoFibTests='NO'
1758 IncludePRIVATENoFibTests='NO'
1759 IncludeParallelNoFibTests='NO'
1760
1761 dnl ** should *all* NoFib tests be run?
1762 # special catch-all variant
1763 AC_ARG_ENABLE(all-tests,
1764    [Possibly turn on *all* of the possible tests (a sane choice
1765 only if using GHC):
1766
1767 --enable-all-tests    do *all* tests],
1768    [case "$enableval" in
1769         yes) IncludePENDINGNoFibTests='YES'
1770              IncludeUNUSEDNoFibTests='YES'
1771              IncludeGHC_ONLYNoFibTests='YES'
1772              IncludePRIVATENoFibTests='YES'
1773              IncludeParallelNoFibTests='YES'
1774              ;;
1775         no) IncludePENDINGNoFibTests='NO'
1776              IncludeUNUSEDNoFibTests='NO'
1777              IncludeGHC_ONLYNoFibTests='NO'
1778              IncludePRIVATENoFibTests='NO'
1779              IncludeParallelNoFibTests='NO'
1780
1781              IncludeRealNoFibTests='NO'
1782              IncludeSpectralNoFibTests='NO'
1783              IncludeImaginaryNoFibTests='NO'
1784              ;;
1785         *)   echo "I don't understand this option: --enable-all-tests=$enableval"
1786              exit 1
1787              ;;
1788     esac])
1789
1790 dnl ** turn on/off individual categories of tests...
1791 # individual categories
1792 AC_ARG_ENABLE(imaginary-tests,
1793    [
1794 Enable/disable individual categories of tests:
1795
1796 --disable-imaginary-tests do *not* include imaginary tests],
1797    [case "$enableval" in
1798         yes) IncludeImaginaryNoFibTests='YES'
1799              ;;
1800         no)  IncludeImaginaryNoFibTests='NO'
1801              ;;
1802         *)   echo "I don't understand this option: --enable-imaginary-tests=$enableval"
1803              exit 1
1804              ;;
1805     esac])
1806
1807 AC_ARG_ENABLE(spectral-tests,
1808    [--disable-spectral-tests  do *not* include spectral tests],
1809    [case "$enableval" in
1810         yes) IncludeSpectralNoFibTests='YES'
1811              ;;
1812         no)  IncludeSpectralNoFibTests='NO'
1813              ;;
1814         *)   echo "I don't understand this option: --enable-spectral-tests=$enableval"
1815              exit 1
1816              ;;
1817     esac])
1818
1819 AC_ARG_ENABLE(real-tests,
1820    [--disable-real-tests      do *not* include real tests],
1821    [case "$enableval" in
1822         yes) IncludeRealNoFibTests='YES'
1823              ;;
1824         no)  IncludeRealNoFibTests='NO'
1825              ;;
1826         *)   echo "I don't understand this option: --enable-real-tests=$enableval"
1827              exit 1
1828              ;;
1829     esac])
1830
1831 AC_ARG_ENABLE(PENDING-tests,
1832    [--enable-PENDING-tests    include PENDING tests],
1833    [case "$enableval" in
1834         yes) IncludePENDINGNoFibTests='YES'
1835              ;;
1836         no)  IncludePENDINGNoFibTests='NO'
1837              ;;
1838         *)   echo "I don't understand this option: --enable-PENDING-tests=$enableval"
1839              exit 1
1840              ;;
1841     esac])
1842
1843 AC_ARG_ENABLE(UNUSED-tests,
1844    [--enable-UNUSED-tests     include UNUSED tests],
1845    [case "$enableval" in
1846         yes) IncludeUNUSEDNoFibTests='YES'
1847              ;;
1848         no)  IncludeUNUSEDNoFibTests='NO'
1849              ;;
1850         *)   echo "I don't understand this option: --enable-UNUSED-tests=$enableval"
1851              exit 1
1852              ;;
1853     esac])
1854
1855 AC_ARG_ENABLE(GHC-ONLY-tests,
1856    [--enable-GHC-ONLY-tests   include GHC_ONLY tests],
1857    [case "$enableval" in
1858         yes) IncludeGHC_ONLYNoFibTests='YES'
1859              ;;
1860         no)  IncludeGHC_ONLYNoFibTests='NO'
1861              ;;
1862         *)   echo "I don't understand this option: --enable-GHC-ONLY-tests=$enableval"
1863              exit 1
1864              ;;
1865     esac])
1866
1867 AC_ARG_ENABLE(PRIVATE-tests,
1868    [--enable-PRIVATE-tests    include PRIVATE tests],
1869    [case "$enableval" in
1870         yes) IncludePRIVATENoFibTests='YES'
1871              ;;
1872         no)  IncludePRIVATENoFibTests='NO'
1873              ;;
1874         *)   echo "I don't understand this option: --enable-PRIVATE-tests=$enableval"
1875              exit 1
1876              ;;
1877     esac])
1878
1879 AC_ARG_ENABLE(parallel-tests,
1880    [--enable-parallel-tests   include parallel tests
1881 ],
1882    [case "$enableval" in
1883         yes) IncludeParallelNoFibTests='YES'
1884              ;;
1885         no)  IncludeParallelNoFibTests='NO'
1886              ;;
1887         *)   echo "I don't understand this option: --enable-parallel-tests=$enableval"
1888              exit 1
1889              ;;
1890     esac])
1891
1892 AC_SUBST(IncludeRealNoFibTests)
1893 AC_SUBST(IncludeSpectralNoFibTests)
1894 AC_SUBST(IncludeImaginaryNoFibTests)
1895 AC_SUBST(IncludePENDINGNoFibTests)
1896 AC_SUBST(IncludeUNUSEDNoFibTests)
1897 AC_SUBST(IncludeGHC_ONLYNoFibTests)
1898 AC_SUBST(IncludeSpecialiseNoFibTests)
1899 AC_SUBST(IncludePRIVATENoFibTests)
1900 AC_SUBST(IncludeParallelNoFibTests)
1901
1902 # here ends a very big if DoingNoFib = 'nofib' ...
1903 fi
1904 #
1905 # -------------------------------------------------------------------------
1906 dnl
1907 dnl * extract non-header files with substitution (end)
1908 #
1909 AC_SUBST(MkWorldSetup)
1910
1911 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)
1912
1913 echo '************************************************'
1914 echo '*** NOW DO: sh < STARTUP'
1915 echo '************************************************'
1916 exit 0