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