1 dnl == autoconf source for the Glasgow FP tools ==
2 dnl (grep for '^dnl' to see the outline of this file)
4 dnl * INITIAL SETUP, CHOICE OF PLATFORM(S)
7 # (c) The AQUA Project, Glasgow University, 1994-1995
9 # Configure script for the Glasgow functional programming tools
10 # (created automagically by autoconf...do not edit by hand)
12 # Do "./configure --help" to see what flags are available.
13 # (Better yet, read the documentation!)
15 # -------------------------------------------------------------------------
18 # Prepare to generate the following header files
20 AC_CONFIG_HEADER(ghc/includes/config.h literate/config.h)
21 # ToDo !!!!!!!!!!!!!!!!
23 # No, we don't do `--srcdir'...
24 if test x"$srcdir" != 'x.' ; then
25 echo "This configuration does not support the \`--srcdir' option."
29 # -------------------------------------------------------------------------
30 dnl ** choose what blobs to build (ghc,haggis,happy,nofib,????)
32 # set to the name for the dir if doing it, otherwise empty
37 # the following are not normally changed
38 DoingLiterate='literate'
39 DoingMkWorld='mkworld'
40 DoingGlaFpUtils='glafp-utils'
46 **********************************************************************
47 * Configuration options for the Glasgow functional-programming tools *
48 **********************************************************************
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).)
54 Second, you may set one of a few applies-in-all-cases options.
55 For example, --with-tmpdir=/usr/tmp.
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.
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
65 If you are confused, don't forget the installation documents that came
68 *******************************************************************
69 ** FOR SELECTING WHICH GLASGOW FP TOOLS TO BUILD:
71 --disable-ghc do *not* build GHC as part of Glasgow FP tools],
77 *) echo "I don't understand this option: --enable-ghc=$enableval"
81 if test "xxx$DoingGHC" = 'xxxghc' -a \( ! -d ghc \) ; then
83 echo 'Doing --disable-ghc, as there is no ghc directory'
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=''
95 [--enable-nofib build NoFib suite as part of Glasgow FP tools],
97 yes) DoingNoFib='nofib'
101 *) echo "I don't understand this option: --enable-nofib=$enableval"
105 if test "xxx$DoingNoFib" = 'xxxnofib' -a \( ! -d nofib \) ; then
107 echo 'Doing --disable-nofib, as there is no nofib directory'
109 nofib_mkworld_site_nofib_jm='nofib/mkworld/site-nofib.jm'
110 if test "xxx$DoingNoFib" = 'xxx' ; then
111 nofib_mkworld_site_nofib_jm=''
115 [--enable-happy build Happy parser-generator as part of Glasgow FP tools],
116 [case "$enableval" in
117 yes) DoingHappy='happy'
121 *) echo "I don't understand this option: --enable-happy=$enableval"
125 if test "xxx$DoingHappy" = 'xxxhappy' -a \( ! -d happy \) ; then
127 echo 'Doing --disable-happy, as there is no happy directory'
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'
137 *) echo "I don't understand this option: --enable-haggis=$enableval"
141 if test "xxx$DoingHaggis" = 'xxxhaggis' -a \( ! -d haggis \) ; then
143 echo 'Doing --disable-haggis, as there is no haggis directory'
146 AC_ARG_ENABLE(literate,
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'
155 *) echo "I don't understand this option: --enable-literate=$enableval"
159 if test "xxx$DoingLiterate" = 'xxxliterate' -a \( ! -d literate \) ; then
161 echo 'Doing --disable-literate, as there is no literate directory'
164 AC_ARG_ENABLE(mkworld,
165 [--disable-mkworld do *not* build \`mkworld' configuration stuff],
166 [case "$enableval" in
167 yes) DoingMkWorld='mkworld'
171 *) echo "I don't understand this option: --enable-mkworld=$enableval"
175 if test "xxx$DoingMkWorld" = 'xxxmkworld' -a \( ! -d mkworld \) ; then
177 echo 'Doing --disable-mkworld, as there is no mkworld directory'
180 AC_ARG_ENABLE(glafp-utils,
181 [--disable-glafp-utils do *not* build \`glafp utilities'],
182 [case "$enableval" in
183 yes) DoingGlaFpUtils='glafp-utils'
185 no) DoingGlaFpUtils=''
187 *) echo "I don't understand this option: --enable-glafp-utils=$enableval"
191 if test "xxx$DoingGlaFpUtils" = 'xxxglafp-utils' -a \( ! -d glafp-utils \) ; then
193 echo 'Doing --disable-glafp-utils, as there is no glafp-utils directory'
199 AC_SUBST(DoingHaggis)
200 AC_SUBST(DoingLiterate)
201 AC_SUBST(DoingMkWorld)
202 AC_SUBST(DoingGlaFpUtils)
204 # -------------------------------------------------------------------------
205 dnl ** choose host(/target/build) platform
206 # Guess host/target/build platform(s) if necessary.
207 # Partly stolen from GCC "configure".
209 if test "x$target" = xNONE ; then
210 if test "x$nonopt" != xNONE; then
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
218 echo 'Config.guess failed to determine the host type. You need \
219 to specify one.' 1>&2
220 if [ -r config.status ]
222 tail +2 config.status 1>&2
229 # "$host" defaults to "$target"
230 if test "x$host" = xNONE ; then
233 # "$build" defaults to "$host"
234 if test "x$build" = xNONE ; then
237 echo "This configuration does not support the \`--build' option."
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
247 if test x"$TargetPlatform" != x"$HostPlatform" ; then
248 echo "GHC configuration does not support differing host/target (i.e., cross-compiling)"
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)
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'
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'
276 HostPlatform=i386-unknown-linuxaout # hack again
277 TargetPlatform=i386-unknown-linuxaout
278 BuildPlatform=i386-unknown-linuxaout
279 HostPlatform_CPP='i386_unknown_linuxaout'
281 HostVendor_CPP='unknown'
282 HostOS_CPP='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'
290 HostVendor_CPP='unknown'
291 HostOS_CPP='linuxaout'
294 HostPlatform=i386-unknown-linux # hack again
295 TargetPlatform=i386-unknown-linux
296 BuildPlatform=i386-unknown-linux
297 HostPlatform_CPP='i386_unknown_linux'
299 HostVendor_CPP='unknown'
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'
308 HostVendor_CPP='unknown'
312 HostPlatform_CPP='i386_unknown_freebsd'
314 HostVendor_CPP='unknown'
318 HostPlatform_CPP='i386_unknown_freebsd'
320 HostVendor_CPP='unknown'
324 HostPlatform_CPP='i386_unknown_netbsd'
326 HostVendor_CPP='unknown'
330 HostPlatform_CPP='i386_unknown_netbsd'
332 HostVendor_CPP='unknown'
336 HostPlatform=i386-unknown-solaris2 # hack again
337 TargetPlatform=i386-unknown-solaris2
338 BuildPlatform=i386-unknown-solaris2
339 HostPlatform_CPP='i386_unknown_solaris2'
341 HostVendor_CPP='unknown'
342 HostOS_CPP='solaris2'
345 HostPlatform_CPP='m68k_next_nextstep2'
347 HostVendor_CPP='next'
348 HostOS_CPP='nextstep2'
351 HostPlatform_CPP='m68k_next_nextstep3'
353 HostVendor_CPP='next'
354 HostOS_CPP='nextstep3'
357 HostPlatform=i386-next-nextstep3 # hack again
358 TargetPlatform=i386-next-nextstep3
359 BuildPlatform=i386-next-nextstep3
360 HostPlatform_CPP='i386_next_nextstep3'
362 HostVendor_CPP='next'
363 HostOS_CPP='nextstep3'
366 HostPlatform=m68k-sun-sunos4
367 TargetPlatform=m68k-sun-sunos4 #hack
368 BuildPlatform=m68k-sun-sunos4 #hack
369 HostPlatform_CPP='m68k_sun_sunos4'
375 HostPlatform_CPP='mips_dec_ultrix'
376 HostArch_CPP='mipsel' # NB a little different
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
390 HostPlatform_CPP='rs6000_ibm_aix'
391 HostArch_CPP='rs6000'
396 HostPlatform=sparc-sun-sunos4
397 TargetPlatform=sparc-sun-sunos4 #hack
398 BuildPlatform=sparc-sun-sunos4 #hack
399 HostPlatform_CPP='sparc_sun_sunos4'
405 HostPlatform=sparc-sun-solaris2
406 TargetPlatform=sparc-sun-solaris2 #hack
407 BuildPlatform=sparc-sun-solaris2 #hack
408 HostPlatform_CPP='sparc_sun_solaris2'
411 HostOS_CPP='solaris2'
414 echo "Unrecognised platform: $HostPlatform"
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"
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)
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)
450 # -------------------------------------------------------------------------
452 dnl * _GENERAL_ CONFIGURATION CHECKS
454 dnl ** are we at Glasgow?
456 if test -d /local/fp -a -d /users/fp/simonpj; then
457 echo "Brilliant! You must be a Glaswegian."
459 if test "x$prefix" = xNONE; then
461 echo "Assuming installation prefix of $prefix"
463 if test "x$exec_prefix" = xNONE; then
464 # Sigh: the defn of exec_prefix does not include the bin* bit...
466 exec_prefix=/local/fp
467 echo "Assuming binary installation prefix of $exec_prefix"
473 test -n "$verbose" && echo " setting AT_GLASGOW to $AT_GLASGOW"
481 dnl ** look for `perl', but watch out for version 4.035
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?"
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
493 ************************************************************************
494 Uh-oh...looks like you have Perl 4.035.
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 ************************************************************************
505 echo "I'm not sure if your version of perl will work,"
506 echo "but it's worth a shot, eh?"
511 dnl ** does #!.../perl work? (sometimes it's too long...)
512 echo "checking if \`#!$PerlCmd' works in shell scripts"
517 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
518 if test $? -ne 69; then
521 echo "It doesn't! Perhaps \`#!$PerlCmd' is too long (often 32 characters max)"
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
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);'
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
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?"
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?"
561 dnl ** figure out how to do context diffs
562 # (NB: NeXTStep thinks diff'ing a file against itself is "trouble")
566 if diff -C 1 conftest1 conftest2 > /dev/null 2>&1 ; then
567 ContextDiffCmd='diff -C 1'
569 if diff -c1 conftest1 conftest2 > /dev/null 2>&1 ; then
570 ContextDiffCmd='diff -c1'
572 echo "Can't figure out how to do context diffs."
573 echo "Neither \`diff -C 1' nor \`diff -c1' works."
577 rm -f conftest1 conftest2
578 AC_SUBST(ContextDiffCmd)
580 dnl ** look for a decent parser generator (bison preferred)
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."
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
599 echo "I'm assuming the worst...no parser generator at all"
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"
607 echo "But that's okay...as far as I know, your yacc will work."
613 #--------------------------------------------------------------
614 WithHc='haskell-compiler-unspecified'
615 WithHcType='HC_UNSPECIFIED'
619 *******************************************************************
620 ** GENERAL OPTIONS WHICH APPLY TO ALL TOOLS:
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").
635 hbc* ) WithHc=$withval
637 nhc* ) WithHc=$withval
644 *) echo "I don't understand this option: --with-hc=$withval"
649 # make sure that what they said makes sense.... set WithHcType
651 haskell-compiler-unspecified ) # maybe they will say something later...
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"
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"
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"
677 c | C) WithHcType='HC_USE_HC_FILES'
679 IN-PLACE) WithHcType='HC_GLASGOW_GHC'
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.
691 [--with-tmpdir=<temp directory> Use an alternative directory for
692 temporary files (presumably because /tmp is too small).],
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.
701 AC_ARG_WITH(max-heap,
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)
710 dnl ** figure out about mkdependHS
712 if test -f ./ghc/utils/mkdependHS/mkdependHS \
713 -o -f ./ghc/utils/mkdependHS/mkdependHS.prl ; then
714 MkDependHSCmd='TopDirPwd/ghc/utils/mkdependHS/mkdependHS'
716 AC_CHECK_PROG(have_mkdependHS,mkdependHS,YES,NO)
717 if test $have_mkdependHS = 'YES' ; then
718 MkDependHSCmd='mkdependHS'
721 AC_SUBST(MkDependHSCmd)
723 # -------------------------------------------------------------------------
725 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
728 if echo $CPP | egrep gcc >/dev/null 2>&1; then
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"
738 # ToDo: what are GNUCPP and RAWCPP if the above if didn't fire? WDP 95/02
742 dnl ** figure out how to do a BSD-ish install
746 dnl ** figure out what arguments to feed to `ar'
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"
753 if $ArCmd clqs conftest.a >/dev/null 2>/dev/null; then
756 elif $ArCmd cqs conftest.a >/dev/null 2>/dev/null; then
759 elif $ArCmd clq conftest.a >/dev/null 2>/dev/null; then
762 elif $ArCmd cq conftest.a >/dev/null 2>/dev/null; then
766 echo "I can't figure out how to use your $ArCmd"
770 test -n "$ArCmd" && test -n "$verbose" && echo " setting ArCmd to $ArCmd"
773 dnl ** figure out if we need `ranlib'
775 if test -z "$NeedRanLib"; then
776 # we hackily override a few platforms on a case-by-case basis
777 case $HostPlatform in
784 test -n "$verbose" && echo " setting RANLIB to $RANLIB"
786 if test -n "$NeedRanLib"; then
791 dnl ** check for full ANSI header (.h) files
795 dnl ** check for specific header (.h) files that we are interested in
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 )
799 dnl ** check if it is safe to include both <time.h> and <sys/time.h>
803 dnl ** how do we get a timezone name?
807 dnl ** determine the type of signal()
811 dnl ** decide whether or not flex lexers need to be linked with -lfl
813 AC_CHECK_LIB(fl,yywrap,
814 FlexLibAvailable='YES',
815 FlexLibAvailable='NO')
816 AC_SUBST(FlexLibAvailable)
818 dnl ** Decide whether or not lex lexers need to be linked with -ll
819 # (Linux, for example, does not have "lex", only "flex")
821 AC_CHECK_LIB(l,yywrap,
822 LexLibAvailable='YES',
823 LexLibAvailable='NO')
824 AC_SUBST(LexLibAvailable)
826 dnl ** check for specific library functions that we are interested in
828 AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect setitimer stat sysconf timelocal times vadvise vfork)
830 dnl ** can we get alloca?
834 dnl ** determine whether or not const works
838 dnl ** check for leading underscores in symbol names
839 # We assume that they _aren't_ there if anything goes wrong.
841 echo checking for a leading underscore in symbol names
845 struct nlist xYzzY[] = {{"_xYzzY", 0},{0}};
853 if(nlist(argv[0], xYzzY) == 0 && xYzzY[0].n_value != 0)
857 }], LeadingUnderscore='YES', LeadingUnderscore='NO', LeadingUnderscore='YES')
858 test -n "$verbose" && echo " setting LeadingUnderscore to $LeadingUnderscore"
860 # -------------------------------------------------------------------------
862 dnl * `GHC' CONFIGURATION STUFF
864 if test "xxx$DoingGHC" = 'xxxghc' ; then
867 dnl ** which builds to build?
868 # builds: normal = sequential _ap_o ; _p = profiling (sequential);
869 # _t = ticky; _u = unregisterized
870 GhcBuild_normal='YES'
874 # _mc = concurrent; _mr = profiled concurrent; _mt = ticky concurrent
875 # _mp = parallel; _mg = gransim
881 # GC builds: _2s, _1s, _du (, _gn)
902 AC_ARG_ENABLE(normal-build,
904 *******************************************************************
905 ** \`GHC' (GLASGOW HASKELL COMPILER) OPTIONS:
907 Choose all the \`builds' of GHC that you want:
909 --disable-normal-build do *not* build GHC for normal sequential code],
910 [case "$enableval" in
911 yes) GhcBuild_normal='YES'
913 no) GhcBuild_normal='NO'
915 *) echo "I don't understand this option: --enable-normal-build=$enableval"
920 AC_ARG_ENABLE(profiling,
921 [--disable-profiling do *not* build profiling features],
922 [case "$enableval" in
923 yes) GhcBuild_p='YES'
927 *) echo "I don't understand this option: --enable-profiling=$enableval"
933 [--enable-ticky build for \`ticky-ticky' profiling (for implementors)],
934 [case "$enableval" in
935 yes) GhcBuild_t='YES'
939 *) echo "I don't understand this option: --enable-ticky=$enableval"
944 AC_ARG_ENABLE(concurrent,
945 [--enable-concurrent turn on \`concurrent Haskell' features],
946 [case "$enableval" in
947 yes) GhcBuild_mc='YES'
951 *) echo "I don't understand this option: --enable-concurrent=$enableval"
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'
963 *) echo "I don't understand this option: --enable-profiled-concurrent=$enableval"
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'
975 *) echo "I don't understand this option: --enable-ticky-concurrent=$enableval"
980 AC_ARG_ENABLE(parallel,
981 [--enable-parallel turn on \`parallel Haskell' features],
982 [case "$enableval" in
983 yes) GhcBuild_mp='YES';
987 *) echo "I don't understand this option: --enable-parallel=$enableval"
992 AC_ARG_ENABLE(gransim,
993 [--enable-gransim turn on GranSim parallel simulator],
994 [case "$enableval" in
995 yes) GhcBuild_mg='YES';
999 *) echo "I don't understand this option: --enable-gransim=$enableval"
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'
1009 no) GhcBuild_2s='NO'
1011 *) echo "I don't understand this option: --enable-gc-2s=$enableval"
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'
1021 no) GhcBuild_1s='NO'
1023 *) echo "I don't understand this option: --enable-gc-1s=$enableval"
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'
1033 no) GhcBuild_du='NO'
1035 *) echo "I don't understand this option: --enable-gc-du=$enableval"
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'
1047 dnl no) GhcBuild_a='NO'
1049 dnl *) echo "I don't understand this option: --enable-user-way-a=$enableval"
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'
1059 dnl no) GhcBuild_b='NO'
1061 dnl *) echo "I don't understand this option: --enable-user-way-b=$enableval"
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'
1071 dnl no) GhcBuild_c='NO'
1073 dnl *) echo "I don't understand this option: --enable-user-way-c=$enableval"
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'
1083 dnl no) GhcBuild_d='NO'
1085 dnl *) echo "I don't understand this option: --enable-user-way-d=$enableval"
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'
1095 dnl no) GhcBuild_e='NO'
1097 dnl *) echo "I don't understand this option: --enable-user-way-e=$enableval"
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'
1107 dnl no) GhcBuild_f='NO'
1109 dnl *) echo "I don't understand this option: --enable-user-way-f=$enableval"
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'
1119 dnl no) GhcBuild_g='NO'
1121 dnl *) echo "I don't understand this option: --enable-user-way-g=$enableval"
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'
1131 dnl no) GhcBuild_h='NO'
1133 dnl *) echo "I don't understand this option: --enable-user-way-h=$enableval"
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'
1143 dnl no) GhcBuild_i='NO'
1145 dnl *) echo "I don't understand this option: --enable-user-way-i=$enableval"
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'
1155 dnl no) GhcBuild_j='NO'
1157 dnl *) echo "I don't understand this option: --enable-user-way-j=$enableval"
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'
1167 dnl no) GhcBuild_k='NO'
1169 dnl *) echo "I don't understand this option: --enable-user-way-k=$enableval"
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'
1179 dnl no) GhcBuild_l='NO'
1181 dnl *) echo "I don't understand this option: --enable-user-way-l=$enableval"
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'
1191 dnl no) GhcBuild_m='NO'
1193 dnl *) echo "I don't understand this option: --enable-user-way-m=$enableval"
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'
1203 dnl no) GhcBuild_n='NO'
1205 dnl *) echo "I don't understand this option: --enable-user-way-n=$enableval"
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'
1215 dnl no) GhcBuild_o='NO'
1217 dnl *) echo "I don't understand this option: --enable-user-way-o=$enableval"
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)
1250 #---------------------------------------------------------------
1252 dnl ** which Haskell compiler to bootstrap GHC with?
1253 # Figure out what Haskell compiler(s) to use for booting
1255 # first, the defaults...
1256 WithGhcHc='haskell-compiler-unspecified'
1257 WithGhcHcType='HC_UNSPECIFIED'
1258 GhcBuilderVersion='26'
1260 AC_ARG_WITH(hc-for-ghc,
1262 The Haskell compiler for bootstrapping GHC (if any); this option,
1263 if used, overrides --with-hc=<...>:
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.
1274 hbc* ) echo "HBC will not compile GHC 0.26 as is (sigh)"
1277 c | C) WithGhcHc='C'
1278 WithGhcHcType='HC_USE_HC_FILES'
1280 *) echo "I don't understand this option: --with-hc-for-ghc=$withval"
1285 # make sure that what they said makes sense.... set WithGhcHcType
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"
1292 if test $WithHcType = 'HC_GLASGOW_GHC' ; then
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`
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"
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`
1314 c | C) WithGhcHcType='HC_USE_HC_FILES'
1317 AC_SUBST(GhcBuilderVersion)
1319 AC_SUBST(WithGhcHcType)
1321 dnl ** use portable (slow) C? -- preferably not
1322 GhcWithRegisterised='YES'
1323 AC_ARG_ENABLE(portable-C,
1324 [Other things for GHC:
1326 --enable-portable-C use portable C (slow), not \`registerised' (fast)],
1327 [case "$enableval" in
1328 yes) GhcWithRegisterised='NO'
1330 no) GhcWithRegisterised='YES'
1332 *) echo "I don't understand this option: --enable-portable-C=$enableval"
1337 if test $GhcWithRegisterised = 'YES'; then
1338 case $HostPlatform in
1339 alpha-* | hppa1.1-* | i386-* | m68k-* | mips-* | sparc-* )
1342 echo "Don't know non-portable C tricks for this platform: $HostPlatform"
1343 GhcWithRegisterised='NO'
1347 AC_SUBST(GhcWithRegisterised)
1349 if test $GhcWithRegisterised = 'NO'; then
1351 GhcBuild_normal='NO'
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...
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'
1367 no) GhcWithHscBuiltViaC='NO'
1369 *) echo "I don't understand this option: --enable-hsc-built-via-C=$enableval"
1374 haskell-compiler-unspecified ) # maybe they said something earlier...
1375 if test $WithHcType = 'HC_USE_HC_FILES' ; then
1376 GhcWithHscBuiltViaC='YES'
1379 c | C) GhcWithHscBuiltViaC='YES'
1383 AC_SUBST(GhcWithHscBuiltViaC)
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'
1392 no) GhcWithHscOptimised='NO'
1394 *) echo "I don't understand this option: --enable-hsc-optimised=$enableval"
1398 AC_SUBST(GhcWithHscOptimised)
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'
1407 no) GhcWithHscDebug='NO'
1409 *) echo "I don't understand this option: --enable-hsc-debug=$enableval"
1413 AC_SUBST(GhcWithHscDebug)
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'
1423 no) GhcWithNativeCodeGen='NO'
1425 *) echo "I don't understand this option: --enable-native-code-generator=$enableval"
1429 if test $GhcWithNativeCodeGen = 'YES'; then
1430 case $TargetPlatform in
1431 sparc-sun-sunos4 | sparc-sun-solaris2 | alpha-dec-osf1 )
1434 echo "Don't have a native-code generator for this platform: $TargetPlatform"
1435 GhcWithNativeCodeGen='NO'
1439 AC_SUBST(GhcWithNativeCodeGen)
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'
1448 no) GhcWithDeforester='NO'
1450 *) echo "I don't understand this option: --enable-deforester=$enableval"
1454 AC_SUBST(GhcWithDeforester)
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'
1463 no) GhcWithReadline='NO'
1465 *) echo "I don't understand this option: --enable-readline-library=$enableval"
1469 AC_SUBST(GhcWithReadline)
1471 dnl ** include Sockets library?
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'
1478 no) GhcWithSockets='NO'
1480 *) echo "I don't understand this option: --enable-sockets-library=$enableval"
1484 AC_SUBST(GhcWithSockets)
1486 dnl ** build the interpreter?
1489 [--enable-ghci build Glasgow Haskell interpreter (HACKERS ONLY)],
1490 [case "$enableval" in
1491 yes) BuildGHCI='YES'
1495 *) echo "I don't understand this option: --enable-ghci=$enableval"
1501 # here ends a very big if DoingGHC = 'ghc' ...
1505 # -------------------------------------------------------------------------
1507 dnl * `Happy' CONFIGURATION STUFF
1509 if test "xxx$DoingHappy" = 'xxxhappy' ; then
1512 dnl ** which Haskell compiler to use on happy?
1513 WithHappyHc='haskell-compiler-unspecified'
1514 WithHappyHcType='HC_UNSPECIFIED'
1516 AC_ARG_WITH(hc-for-happy,
1518 *******************************************************************
1519 ** \`Happy' PARSER-GENERATOR OPTIONS:
1521 The Haskell compiler to compile Happy; this option, if used, overrides
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").],
1532 WithHappyHc=$withval
1534 hbc* ) WithHappyHc=$withval
1536 nhc* ) WithHappyHc=$withval
1539 WithHappyHc='IN-PLACE'
1541 *) echo "I don't understand this option: --with-hc-for-happy=$withval"
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"
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"
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"
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"
1578 IN-PLACE) WithHappyHcType='HC_GLASGOW_GHC'
1581 AC_SUBST(WithHappyHc)
1582 AC_SUBST(WithHappyHcType)
1584 # here ends a very big if DoingHappy = 'happy' ...
1587 # -------------------------------------------------------------------------
1589 dnl * `Haggis' CONFIGURATION STUFF
1591 if test "xxx$DoingHaggis" = 'xxxhaggis' ; then
1594 dnl ** which Haskell compiler to use on haggis?
1595 WithHaggisHc='haskell-compiler-unspecified'
1596 WithHaggisHcType='HC_UNSPECIFIED'
1598 AC_ARG_WITH(hc-for-haggis,
1600 *******************************************************************
1601 ** \`Haggis' HASKELL GUI TOOLKIT OPTIONS:
1603 The Haskell compiler to compile the Haggis toolkit; this option, if
1604 used, overrides --with-hc=<...>:
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").],
1611 WithHaggisHc=$withval
1614 WithHaggisHc='IN-PLACE'
1616 *) echo "I don't understand this option: --with-hc-for-haggis=$withval"
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"
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"
1637 IN-PLACE) WithHaggisHcType='HC_GLASGOW_GHC'
1640 AC_SUBST(WithHaggisHc)
1641 AC_SUBST(WithHaggisHcType)
1643 # here ends a very big if DoingHaggis = 'haggis' ...
1646 # -------------------------------------------------------------------------
1648 dnl * `NoFib' CONFIGURATION STUFF
1650 if test "xxx$DoingNoFib" = 'xxxnofib' ; then
1653 dnl ** which Haskell compiler to test with NoFib?
1654 WithNoFibHc='haskell-compiler-unspecified'
1655 WithNoFibHcType='HC_UNSPECIFIED'
1657 AC_ARG_WITH(hc-for-nofib,
1659 *******************************************************************
1660 ** NoFib HASKELL BENCHMARK SUITE OPTIONS:
1662 The Haskell compiler to compile the NoFib programs; this option, if
1663 used, overrides --with-hc=<...>:
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").
1674 WithNoFibHc=$withval
1676 hbc* ) WithNoFibHc=$withval
1678 nhc* ) WithNoFibHc=$withval
1681 WithNoFibHc='IN-PLACE'
1683 *) echo "I don't understand this option: --with-hc-for-nofib=$withval"
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"
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"
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"
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"
1720 IN-PLACE) WithNoFibHcType='HC_GLASGOW_GHC'
1723 AC_SUBST(WithNoFibHc)
1724 AC_SUBST(WithNoFibHcType)
1726 dnl ** what mkworld \`setup' should be used?
1729 What mkworld \`setup' should be used?
1730 Choices: ghc, hbc, nhc
1733 ghc ) MkWorldSetup='ghc'
1735 hbc ) MkWorldSetup='hbc'
1737 nhc ) MkWorldSetup='nhc'
1739 *) echo "I don't understand this option: --with-hc-for-nofib=$withval"
1744 if test $MkWorldSetup = 'std' ; then
1745 echo 'You must do --with-setup=... (one of: ghc, hbc, or nhc) for NoFib'
1749 # ---------------------------------------
1750 # What sets of tests should be run.
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'
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
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'
1775 no) IncludePENDINGNoFibTests='NO'
1776 IncludeUNUSEDNoFibTests='NO'
1777 IncludeGHC_ONLYNoFibTests='NO'
1778 IncludePRIVATENoFibTests='NO'
1779 IncludeParallelNoFibTests='NO'
1781 IncludeRealNoFibTests='NO'
1782 IncludeSpectralNoFibTests='NO'
1783 IncludeImaginaryNoFibTests='NO'
1785 *) echo "I don't understand this option: --enable-all-tests=$enableval"
1790 dnl ** turn on/off individual categories of tests...
1791 # individual categories
1792 AC_ARG_ENABLE(imaginary-tests,
1794 Enable/disable individual categories of tests:
1796 --disable-imaginary-tests do *not* include imaginary tests],
1797 [case "$enableval" in
1798 yes) IncludeImaginaryNoFibTests='YES'
1800 no) IncludeImaginaryNoFibTests='NO'
1802 *) echo "I don't understand this option: --enable-imaginary-tests=$enableval"
1807 AC_ARG_ENABLE(spectral-tests,
1808 [--disable-spectral-tests do *not* include spectral tests],
1809 [case "$enableval" in
1810 yes) IncludeSpectralNoFibTests='YES'
1812 no) IncludeSpectralNoFibTests='NO'
1814 *) echo "I don't understand this option: --enable-spectral-tests=$enableval"
1819 AC_ARG_ENABLE(real-tests,
1820 [--disable-real-tests do *not* include real tests],
1821 [case "$enableval" in
1822 yes) IncludeRealNoFibTests='YES'
1824 no) IncludeRealNoFibTests='NO'
1826 *) echo "I don't understand this option: --enable-real-tests=$enableval"
1831 AC_ARG_ENABLE(PENDING-tests,
1832 [--enable-PENDING-tests include PENDING tests],
1833 [case "$enableval" in
1834 yes) IncludePENDINGNoFibTests='YES'
1836 no) IncludePENDINGNoFibTests='NO'
1838 *) echo "I don't understand this option: --enable-PENDING-tests=$enableval"
1843 AC_ARG_ENABLE(UNUSED-tests,
1844 [--enable-UNUSED-tests include UNUSED tests],
1845 [case "$enableval" in
1846 yes) IncludeUNUSEDNoFibTests='YES'
1848 no) IncludeUNUSEDNoFibTests='NO'
1850 *) echo "I don't understand this option: --enable-UNUSED-tests=$enableval"
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'
1860 no) IncludeGHC_ONLYNoFibTests='NO'
1862 *) echo "I don't understand this option: --enable-GHC-ONLY-tests=$enableval"
1867 AC_ARG_ENABLE(PRIVATE-tests,
1868 [--enable-PRIVATE-tests include PRIVATE tests],
1869 [case "$enableval" in
1870 yes) IncludePRIVATENoFibTests='YES'
1872 no) IncludePRIVATENoFibTests='NO'
1874 *) echo "I don't understand this option: --enable-PRIVATE-tests=$enableval"
1879 AC_ARG_ENABLE(parallel-tests,
1880 [--enable-parallel-tests include parallel tests
1882 [case "$enableval" in
1883 yes) IncludeParallelNoFibTests='YES'
1885 no) IncludeParallelNoFibTests='NO'
1887 *) echo "I don't understand this option: --enable-parallel-tests=$enableval"
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)
1902 # here ends a very big if DoingNoFib = 'nofib' ...
1905 # -------------------------------------------------------------------------
1907 dnl * extract non-header files with substitution (end)
1909 AC_SUBST(MkWorldSetup)
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)
1913 echo '************************************************'
1914 echo '*** NOW DO: sh < STARTUP'
1915 echo '************************************************'