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=powerpc-ibm-aix
391 TargetPlatform=powerpc-ibm-aix #hack
392 BuildPlatform=powerpc-ibm-aix #hack
393 HostPlatform_CPP='powerpc_ibm_aix'
394 HostArch_CPP='powerpc'
399 HostPlatform=sparc-sun-sunos4
400 TargetPlatform=sparc-sun-sunos4 #hack
401 BuildPlatform=sparc-sun-sunos4 #hack
402 HostPlatform_CPP='sparc_sun_sunos4'
408 HostPlatform=sparc-sun-solaris2
409 TargetPlatform=sparc-sun-solaris2 #hack
410 BuildPlatform=sparc-sun-solaris2 #hack
411 HostPlatform_CPP='sparc_sun_solaris2'
414 HostOS_CPP='solaris2'
417 echo "Unrecognised platform: $HostPlatform"
422 test -n "$verbose" && echo "Host platform set to $HostPlatform"
423 test -n "$verbose" -a x"$HostPlatform" != x"$TargetPlatform" \
424 && echo "Target platform set to $TargetPlatform"
425 test -n "$verbose" -a x"$BuildPlatform" != x"$HostPlatform" \
426 && echo "Build platform set to $BuildPlatform"
428 BuildPlatform_CPP=$HostPlatform_CPP
429 TargetPlatform_CPP=$HostPlatform_CPP
430 BuildArch_CPP=$HostArch_CPP
431 TargetArch_CPP=$HostArch_CPP
432 BuildOS_CPP=$HostOS_CPP
433 TargetOS_CPP=$HostOS_CPP
434 BuildVendor_CPP=$HostVendor_CPP
435 TargetVendor_CPP=$HostVendor_CPP
436 dnl Cannot afford all these AC_SUBSTs (because of braindead seds w/ 99 cmd limits
437 dnl AC_SUBST(BuildPlatform)
438 AC_SUBST(HostPlatform)
439 dnl AC_SUBST(TargetPlatform)
440 AC_SUBST(HostPlatform_CPP)
441 dnl AC_SUBST(BuildPlatform_CPP)
442 dnl AC_SUBST(TargetPlatform_CPP)
443 AC_SUBST(HostArch_CPP)
444 dnl AC_SUBST(BuildArch_CPP)
445 dnl AC_SUBST(TargetArch_CPP)
447 dnl AC_SUBST(BuildOS_CPP)
448 dnl AC_SUBST(TargetOS_CPP)
449 AC_SUBST(HostVendor_CPP)
450 dnl AC_SUBST(BuildVendor_CPP)
451 dnl AC_SUBST(TargetVendor_CPP)
453 # -------------------------------------------------------------------------
455 dnl * _GENERAL_ CONFIGURATION CHECKS
457 dnl ** are we at Glasgow?
459 if test -d /local/fp -a -d /users/fp/simonpj; then
460 echo "Brilliant! You must be a Glaswegian."
462 if test "x$prefix" = xNONE; then
464 echo "Assuming installation prefix of $prefix"
466 if test "x$exec_prefix" = xNONE; then
467 # Sigh: the defn of exec_prefix does not include the bin* bit...
469 exec_prefix=/local/fp
470 echo "Assuming binary installation prefix of $exec_prefix"
476 test -n "$verbose" && echo " setting AT_GLASGOW to $AT_GLASGOW"
484 dnl ** look for `perl', but watch out for version 4.035
486 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
487 if test -z "$PerlCmd"; then
488 echo "You must install perl before you can continue"
489 echo "Perhaps it is already installed, but not in your PATH?"
492 $PerlCmd -v >conftest.out 2>&1
493 if egrep "version 4" conftest.out >/dev/null 2>&1; then
494 if egrep "Patch level: 35" conftest.out >/dev/null 2>&1; then
496 ************************************************************************
497 Uh-oh...looks like you have Perl 4.035.
499 Perl version 4.035 has a bug to do with recursion that will bite if
500 you run the lit2texi script, when making Info files from
501 literate files of various sorts. Either use the current version
502 (4.036), an older version (e.g., perl 4.019) or apply the patch in
503 glafp-utils/perl-4.035-fixes to your 4.035 perl.
504 ************************************************************************
508 if egrep "version 5" conftest.out >/dev/null 2>&1; then
511 echo "I'm not sure if your version of perl will work,"
512 echo "but it's worth a shot, eh?"
518 dnl ** does #!.../perl work? (sometimes it's too long...)
519 echo "checking if \`#!$PerlCmd' works in shell scripts"
524 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
525 if test $? -ne 69; then
528 echo "It doesn't! Perhaps \`#!$PerlCmd' is too long (often 32 characters max)"
533 dnl ** check if perl library is properly installed
534 # (by seeing if a "do 'getopts.pl'" works...
535 if $PerlCmd -e 'do "getopts.pl" || exit(1); exit(0);' > /dev/null 2>&1 ; then
538 echo "I think your perl library is misinstalled."
539 echo "The following script did not work:"
540 echo ' do "getopts.pl" || exit(1); exit(0);'
545 dnl ** look for GCC and find out which version
546 # Figure out which C compiler to use. Gcc is preferred.
547 # If gcc, make sure it's at least 2.1
550 if test -z "$GCC"; then
551 echo "You would be better off with gcc"
552 echo "Perhaps it is already installed, but not in your PATH?"
555 gcc -v > conftest.out 2>&1
556 echo '/version (\d+)\.(\d+)/ && $1*10+$2 > 20 && print "YES";' > conftest.pl
557 HaveGcc=`eval $PerlCmd -n conftest.pl conftest.out`
558 if test -z "$HaveGcc"; then
559 echo "I'm not sure if your version of gcc will work,"
560 echo "but it's worth a shot, eh?"
568 dnl ** figure out how to do context diffs
569 # (NB: NeXTStep thinks diff'ing a file against itself is "trouble")
573 if diff -C 1 conftest1 conftest2 > /dev/null 2>&1 ; then
574 ContextDiffCmd='diff -C 1'
576 if diff -c1 conftest1 conftest2 > /dev/null 2>&1 ; then
577 ContextDiffCmd='diff -c1'
579 echo "Can't figure out how to do context diffs."
580 echo "Neither \`diff -C 1' nor \`diff -c1' works."
584 rm -f conftest1 conftest2
585 AC_SUBST(ContextDiffCmd)
587 dnl ** look for a decent parser generator (bison preferred)
590 AC_CHECK_PROG(YaccCmd, bison, bison -y)
591 if test -z "$YaccCmd"; then
592 echo "Can't find bison out there..."
593 AC_CHECK_PROG(WhatCmd, what, what, :)
594 AC_CHECK_PROG(YaccCmd, yacc, $ac_dir/$ac_word)
595 if test -z "$YaccCmd"; then
596 echo "But that's okay...I can't find yacc either."
599 $WhatCmd $YaccCmd > conftest.out
600 if egrep 'y1\.c 1\..*SMI' conftest.out >/dev/null 2>&1; then
601 echo "I don't trust your $YaccCmd; it looks like an old Sun yacc"
602 if test -x /usr/lang/yacc; then
603 echo "I'm going to use /usr/lang/yacc instead"
604 YaccCmd=/usr/lang/yacc
606 echo "I'm assuming the worst...no parser generator at all"
609 elif egrep 'y1\.c.*Revision: 4\.2\.6\.3.*DEC' conftest.out >/dev/null 2>&1; then
610 echo "I don't trust your $YaccCmd; it looks like a lame DEC yacc"
611 echo "I'm assuming the worst...no parser generator at all"
614 echo "But that's okay...as far as I know, your yacc will work."
620 #--------------------------------------------------------------
621 WithHc='haskell-compiler-unspecified'
622 WithHcType='HC_UNSPECIFIED'
626 *******************************************************************
627 ** GENERAL OPTIONS WHICH APPLY TO ALL TOOLS:
629 --with-hc=<Haskell compiler>
630 ghc* => Glasgow Haskell invoked by the name given
631 hbc* => Chalmers HBC, invoked by the name given
632 nhc* => Niklas Rojemo's "nhc", invoked by the name given
633 C or c => Don't use a Haskell compiler;
634 build from intermediate C (.hc) files.
635 in-place => Use ghc/driver/ghc; i.e. you've built GHC
636 and you want to use it un-installed ("in-place").
642 hbc* ) WithHc=$withval
644 nhc* ) WithHc=$withval
651 *) echo "I don't understand this option: --with-hc=$withval"
656 # make sure that what they said makes sense.... set WithHcType
658 haskell-compiler-unspecified ) # maybe they will say something later...
661 WithHcType='HC_GLASGOW_GHC'
662 AC_CHECK_PROG(have_ghc,$WithHc,$ac_dir/$ac_word)
663 if test -z "$have_ghc"; then
664 echo "Can't find Glasgow Haskell to compile with: $WithHc"
668 hbc* ) # Look for the dastardly competition
669 WithHcType='HC_CHALMERS_HBC'
670 AC_CHECK_PROG(have_hbc,$WithHc,YES,NO)
671 if test $have_hbc = 'NO' ; then
672 echo "Can't find Chalmers HBC to compile with: $WithHc"
676 nhc* ) # Look for Niklas Rojemo's "nhc"
677 WithHcType='HC_ROJEMO_NHC'
678 AC_CHECK_PROG(have_nhc,$WithHc,YES,NO)
679 if test $have_nhc = 'NO' ; then
680 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHc"
684 c | C) WithHcType='HC_USE_HC_FILES'
686 IN-PLACE) WithHcType='HC_GLASGOW_GHC'
692 dnl ** possibly choose a different tmpdir (default /tmp)
693 # let the user decide where the best tmpdir is
694 # /tmp is the default; /usr/tmp is sometimes a good choice.
695 # Very site-specific.
698 [--with-tmpdir=<temp directory> Use an alternative directory for
699 temporary files (presumably because /tmp is too small).],
703 dnl ** possibly set a max heap for Haskell compilations
704 # let the user specify a maximum heap to be used; the old
705 # "I have a 64MB machine, why not use a 32MB heap?" thing.
708 AC_ARG_WITH(max-heap,
710 --with-max-heap=<heap size, e.g., 32m> Do all Haskell compilations
711 with a heap of this size. (If you've got it, flaunt it.)],
712 [HcMaxHeapWasSet='YES'
713 HcMaxHeap="$withval"])
714 AC_SUBST(HcMaxHeapWasSet)
717 dnl ** figure out about mkdependHS
719 if test -f ./ghc/utils/mkdependHS/mkdependHS \
720 -o -f ./ghc/utils/mkdependHS/mkdependHS.prl ; then
721 MkDependHSCmd='TopDirPwd/ghc/utils/mkdependHS/mkdependHS'
723 AC_CHECK_PROG(have_mkdependHS,mkdependHS,YES,NO)
724 if test $have_mkdependHS = 'YES' ; then
725 MkDependHSCmd='mkdependHS'
728 AC_SUBST(MkDependHSCmd)
730 # -------------------------------------------------------------------------
732 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
735 if echo $CPP | egrep gcc >/dev/null 2>&1; then
737 gcc -v -E conftest.c >/dev/null 2>conftest.out
738 echo '/(\S+\/cpp)/ && print "$1";' > conftest.pl
739 GNUCPP="`eval $PerlCmd -n conftest.pl conftest.out`"
740 test -n "$verbose" && echo " setting GNUCPP to $GNUCPP"
741 RAWCPP="`eval $PerlCmd -n conftest.pl conftest.out` -traditional"
742 test -n "$verbose" && echo " setting RAWCPP to $RAWCPP"
745 # ToDo: what are GNUCPP and RAWCPP if the above if didn't fire? WDP 95/02
749 dnl ** figure out how to do a BSD-ish install
753 dnl ** figure out what arguments to feed to `ar'
755 AC_CHECK_PROG(ArCmd,ar,$ac_dir/$ac_word)
756 if test -z "$ArCmd"; then
757 echo "You don't seem to have ar...I have no idea how to make a library"
760 if $ArCmd clqs conftest.a >/dev/null 2>/dev/null; then
763 elif $ArCmd cqs conftest.a >/dev/null 2>/dev/null; then
766 elif $ArCmd clq conftest.a >/dev/null 2>/dev/null; then
769 elif $ArCmd cq conftest.a >/dev/null 2>/dev/null; then
773 echo "I can't figure out how to use your $ArCmd"
777 test -n "$ArCmd" && test -n "$verbose" && echo " setting ArCmd to $ArCmd"
780 dnl ** figure out if we need `ranlib'
782 if test -z "$NeedRanLib"; then
783 # we hackily override a few platforms on a case-by-case basis
784 case $HostPlatform in
791 test -n "$verbose" && echo " setting RANLIB to $RANLIB"
793 if test -n "$NeedRanLib"; then
798 dnl ** check for full ANSI header (.h) files
802 dnl ** check for specific header (.h) files that we are interested in
804 AC_CHECK_HEADERS(dirent.h fcntl.h grp.h malloc.h memory.h nlist.h pwd.h siginfo.h signal.h stdlib.h string.h sys/fault.h sys/file.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/vadvise.h sys/wait.h termios.h time.h types.h unistd.h utime.h vfork.h )
806 dnl ** check if it is safe to include both <time.h> and <sys/time.h>
810 dnl ** how do we get a timezone name?
814 dnl ** determine the type of signal()
818 dnl ** decide whether or not flex lexers need to be linked with -lfl
820 AC_CHECK_LIB(fl,yywrap,
821 FlexLibAvailable='YES',
822 FlexLibAvailable='NO')
823 AC_SUBST(FlexLibAvailable)
825 dnl ** Decide whether or not lex lexers need to be linked with -ll
826 # (Linux, for example, does not have "lex", only "flex")
828 AC_CHECK_LIB(l,yywrap,
829 LexLibAvailable='YES',
830 LexLibAvailable='NO')
831 AC_SUBST(LexLibAvailable)
833 dnl ** check for specific library functions that we are interested in
835 AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect setitimer stat sysconf timelocal times vadvise vfork)
837 dnl ** can we get alloca?
841 dnl ** determine whether or not const works
845 dnl ** check for leading underscores in symbol names
846 # We assume that they _aren't_ there if anything goes wrong.
848 echo checking for a leading underscore in symbol names
852 struct nlist xYzzY[] = {{"_xYzzY", 0},{0}};
860 if(nlist(argv[0], xYzzY) == 0 && xYzzY[0].n_value != 0)
864 }], LeadingUnderscore='YES', LeadingUnderscore='NO', LeadingUnderscore='YES')
865 test -n "$verbose" && echo " setting LeadingUnderscore to $LeadingUnderscore"
867 # -------------------------------------------------------------------------
869 dnl * `GHC' CONFIGURATION STUFF
871 if test "xxx$DoingGHC" = 'xxxghc' ; then
874 dnl ** which builds to build?
875 # builds: normal = sequential _ap_o ; _p = profiling (sequential);
876 # _t = ticky; _u = unregisterized
877 GhcBuild_normal='YES'
881 # _mc = concurrent; _mr = profiled concurrent; _mt = ticky concurrent
882 # _mp = parallel; _mg = gransim
888 # GC builds: _2s, _1s, _du (, _gn)
910 # More could be added here...
912 AC_ARG_ENABLE(normal-build,
914 *******************************************************************
915 ** \`GHC' (GLASGOW HASKELL COMPILER) OPTIONS:
917 Choose all the \`builds' of GHC that you want:
919 --disable-normal-build do *not* build GHC for normal sequential code],
920 [case "$enableval" in
921 yes) GhcBuild_normal='YES'
923 no) GhcBuild_normal='NO'
925 *) echo "I don't understand this option: --enable-normal-build=$enableval"
930 AC_ARG_ENABLE(profiling,
931 [--disable-profiling do *not* build profiling features],
932 [case "$enableval" in
933 yes) GhcBuild_p='YES'
937 *) echo "I don't understand this option: --enable-profiling=$enableval"
943 [--enable-ticky build for \`ticky-ticky' profiling (for implementors)],
944 [case "$enableval" in
945 yes) GhcBuild_t='YES'
949 *) echo "I don't understand this option: --enable-ticky=$enableval"
954 AC_ARG_ENABLE(concurrent,
955 [--enable-concurrent turn on \`concurrent Haskell' features],
956 [case "$enableval" in
957 yes) GhcBuild_mc='YES'
961 *) echo "I don't understand this option: --enable-concurrent=$enableval"
966 AC_ARG_ENABLE(profiled-concurrent,
967 [--enable-profiled-concurrent turn on profiling for \`concurrent Haskell'],
968 [case "$enableval" in
969 yes) GhcBuild_mr='YES'
973 *) echo "I don't understand this option: --enable-profiled-concurrent=$enableval"
978 AC_ARG_ENABLE(ticky-concurrent,
979 [--enable-ticky-concurrent turn on \`ticky-ticky' profiling for \`concurrent Haskell'],
980 [case "$enableval" in
981 yes) GhcBuild_mt='YES'
985 *) echo "I don't understand this option: --enable-ticky-concurrent=$enableval"
990 AC_ARG_ENABLE(parallel,
991 [--enable-parallel turn on \`parallel Haskell' features],
992 [case "$enableval" in
993 yes) GhcBuild_mp='YES';
997 *) echo "I don't understand this option: --enable-parallel=$enableval"
1002 AC_ARG_ENABLE(gransim,
1003 [--enable-gransim turn on GranSim parallel simulator],
1004 [case "$enableval" in
1005 yes) GhcBuild_mg='YES';
1007 no) GhcBuild_mg='NO'
1009 *) echo "I don't understand this option: --enable-gransim=$enableval"
1014 AC_ARG_ENABLE(gc-2s,
1015 [--enable-gc-2s a build with the 2-space copying garbage collector],
1016 [case "$enableval" in
1017 yes) GhcBuild_2s='YES'
1019 no) GhcBuild_2s='NO'
1021 *) echo "I don't understand this option: --enable-gc-2s=$enableval"
1026 AC_ARG_ENABLE(gc-1s,
1027 [--enable-gc-1s a build with the 1-space compacting garbage collector],
1028 [case "$enableval" in
1029 yes) GhcBuild_1s='YES'
1031 no) GhcBuild_1s='NO'
1033 *) echo "I don't understand this option: --enable-gc-1s=$enableval"
1038 AC_ARG_ENABLE(gc-du,
1039 [--enable-gc-du a build with \`dual-mode' (1s/2s) garbage collector],
1040 [case "$enableval" in
1041 yes) GhcBuild_du='YES'
1043 no) GhcBuild_du='NO'
1045 *) echo "I don't understand this option: --enable-gc-du=$enableval"
1050 dnl some seds only allow 99 commands, meaning no more
1051 dnl than 99 AC_SUBSTs. AARRGGHH!!
1052 dnl AC_ARG_ENABLE(user-way-a,
1053 dnl [--enable-user-way-a build for \`user way a' (mostly for implementors)],
1054 dnl [case "$enableval" in
1055 dnl yes) GhcBuild_a='YES'
1057 dnl no) GhcBuild_a='NO'
1059 dnl *) echo "I don't understand this option: --enable-user-way-a=$enableval"
1064 dnl AC_ARG_ENABLE(user-way-b,
1065 dnl [--enable-user-way-b build for \`user way b' (mostly for implementors)],
1066 dnl [case "$enableval" in
1067 dnl yes) GhcBuild_b='YES'
1069 dnl no) GhcBuild_b='NO'
1071 dnl *) echo "I don't understand this option: --enable-user-way-b=$enableval"
1076 dnl AC_ARG_ENABLE(user-way-c,
1077 dnl [--enable-user-way-c build for \`user way c' (mostly for implementors)],
1078 dnl [case "$enableval" in
1079 dnl yes) GhcBuild_c='YES'
1081 dnl no) GhcBuild_c='NO'
1083 dnl *) echo "I don't understand this option: --enable-user-way-c=$enableval"
1088 dnl AC_ARG_ENABLE(user-way-d,
1089 dnl [--enable-user-way-d build for \`user way d' (mostly for implementors)],
1090 dnl [case "$enableval" in
1091 dnl yes) GhcBuild_d='YES'
1093 dnl no) GhcBuild_d='NO'
1095 dnl *) echo "I don't understand this option: --enable-user-way-d=$enableval"
1100 dnl AC_ARG_ENABLE(user-way-e,
1101 dnl [--enable-user-way-e build for \`user way e' (mostly for implementors)],
1102 dnl [case "$enableval" in
1103 dnl yes) GhcBuild_e='YES'
1105 dnl no) GhcBuild_e='NO'
1107 dnl *) echo "I don't understand this option: --enable-user-way-e=$enableval"
1112 dnl AC_ARG_ENABLE(user-way-f,
1113 dnl [--enable-user-way-f build for \`user way f' (mostly for implementors)],
1114 dnl [case "$enableval" in
1115 dnl yes) GhcBuild_f='YES'
1117 dnl no) GhcBuild_f='NO'
1119 dnl *) echo "I don't understand this option: --enable-user-way-f=$enableval"
1124 dnl AC_ARG_ENABLE(user-way-g,
1125 dnl [--enable-user-way-g build for \`user way g' (mostly for implementors)],
1126 dnl [case "$enableval" in
1127 dnl yes) GhcBuild_g='YES'
1129 dnl no) GhcBuild_g='NO'
1131 dnl *) echo "I don't understand this option: --enable-user-way-g=$enableval"
1136 dnl AC_ARG_ENABLE(user-way-h,
1137 dnl [--enable-user-way-h build for \`user way h' (mostly for implementors)],
1138 dnl [case "$enableval" in
1139 dnl yes) GhcBuild_h='YES'
1141 dnl no) GhcBuild_h='NO'
1143 dnl *) echo "I don't understand this option: --enable-user-way-h=$enableval"
1148 dnl AC_ARG_ENABLE(user-way-i,
1149 dnl [--enable-user-way-i build for \`user way i' (mostly for implementors)],
1150 dnl [case "$enableval" in
1151 dnl yes) GhcBuild_i='YES'
1153 dnl no) GhcBuild_i='NO'
1155 dnl *) echo "I don't understand this option: --enable-user-way-i=$enableval"
1160 dnl AC_ARG_ENABLE(user-way-j,
1161 dnl [--enable-user-way-j build for \`user way j' (mostly for implementors)],
1162 dnl [case "$enableval" in
1163 dnl yes) GhcBuild_j='YES'
1165 dnl no) GhcBuild_j='NO'
1167 dnl *) echo "I don't understand this option: --enable-user-way-j=$enableval"
1172 dnl AC_ARG_ENABLE(user-way-k,
1173 dnl [--enable-user-way-k build for \`user way k' (mostly for implementors)],
1174 dnl [case "$enableval" in
1175 dnl yes) GhcBuild_k='YES'
1177 dnl no) GhcBuild_k='NO'
1179 dnl *) echo "I don't understand this option: --enable-user-way-k=$enableval"
1184 dnl AC_ARG_ENABLE(user-way-l,
1185 dnl [--enable-user-way-l build for \`user way l' (mostly for implementors)],
1186 dnl [case "$enableval" in
1187 dnl yes) GhcBuild_l='YES'
1189 dnl no) GhcBuild_l='NO'
1191 dnl *) echo "I don't understand this option: --enable-user-way-l=$enableval"
1196 dnl AC_ARG_ENABLE(user-way-m,
1197 dnl [--enable-user-way-m build for \`user way m' (mostly for implementors)],
1198 dnl [case "$enableval" in
1199 dnl yes) GhcBuild_m='YES'
1201 dnl no) GhcBuild_m='NO'
1203 dnl *) echo "I don't understand this option: --enable-user-way-m=$enableval"
1208 dnl AC_ARG_ENABLE(user-way-n,
1209 dnl [--enable-user-way-n build for \`user way n' (mostly for implementors)],
1210 dnl [case "$enableval" in
1211 dnl yes) GhcBuild_n='YES'
1213 dnl no) GhcBuild_n='NO'
1215 dnl *) echo "I don't understand this option: --enable-user-way-n=$enableval"
1220 dnl AC_ARG_ENABLE(user-way-o,
1221 dnl [--enable-user-way-o build for \`user way o' (mostly for implementors)],
1222 dnl [case "$enableval" in
1223 dnl yes) GhcBuild_o='YES'
1225 dnl no) GhcBuild_o='NO'
1227 dnl *) echo "I don't understand this option: --enable-user-way-o=$enableval"
1232 dnl AC_ARG_ENABLE(user-way-A,
1233 dnl [--enable-user-way-A build for \`user way A' (mostly for implementors)],
1234 dnl [case "$enableval" in
1235 dnl yes) GhcBuild_A='YES'
1237 dnl no) GhcBuild_A='NO'
1239 dnl *) echo "I don't understand this option: --enable-user-way-A=$enableval"
1244 dnl AC_ARG_ENABLE(user-way-B,
1245 dnl [--enable-user-way-B build for \`user way B' (mostly for implementors)],
1246 dnl [case "$enableval" in
1247 dnl yes) GhcBuild_B='YES'
1249 dnl no) GhcBuild_B='NO'
1251 dnl *) echo "I don't understand this option: --enable-user-way-B=$enableval"
1256 AC_SUBST(GhcBuild_normal)
1257 AC_SUBST(GhcBuild_p)
1258 AC_SUBST(GhcBuild_t)
1259 AC_SUBST(GhcBuild_u)
1260 AC_SUBST(GhcBuild_mc)
1261 AC_SUBST(GhcBuild_mr)
1262 AC_SUBST(GhcBuild_mt)
1263 AC_SUBST(GhcBuild_mp)
1264 AC_SUBST(GhcBuild_mg)
1265 AC_SUBST(GhcBuild_2s)
1266 AC_SUBST(GhcBuild_1s)
1267 AC_SUBST(GhcBuild_du)
1268 dnl AC_SUBST(GhcBuild_a)
1269 dnl AC_SUBST(GhcBuild_b)
1270 dnl AC_SUBST(GhcBuild_c)
1271 dnl AC_SUBST(GhcBuild_d)
1272 dnl AC_SUBST(GhcBuild_e)
1273 dnl AC_SUBST(GhcBuild_f)
1274 dnl AC_SUBST(GhcBuild_g)
1275 dnl AC_SUBST(GhcBuild_h)
1276 dnl AC_SUBST(GhcBuild_i)
1277 dnl AC_SUBST(GhcBuild_j)
1278 dnl AC_SUBST(GhcBuild_k)
1279 dnl AC_SUBST(GhcBuild_l)
1280 dnl AC_SUBST(GhcBuild_m)
1281 dnl AC_SUBST(GhcBuild_n)
1282 dnl AC_SUBST(GhcBuild_o)
1283 dnl AC_SUBST(GhcBuild_A)
1284 dnl AC_SUBST(GhcBuild_B)
1286 #---------------------------------------------------------------
1288 dnl ** which Haskell compiler to bootstrap GHC with?
1289 # Figure out what Haskell compiler(s) to use for booting
1291 # first, the defaults...
1292 WithGhcHc='haskell-compiler-unspecified'
1293 WithGhcHcType='HC_UNSPECIFIED'
1294 GhcBuilderVersion='26'
1296 AC_ARG_WITH(hc-for-ghc,
1298 The Haskell compiler for bootstrapping GHC (if any); this option,
1299 if used, overrides --with-hc=<...>:
1301 --with-hc-for-ghc=<Haskell compiler>
1302 ghc* => Glasgow Haskell invoked by the name given
1303 C or c => Don't use a Haskell compiler;
1304 build from intermediate C (.hc) files.
1310 hbc* ) echo "HBC will not compile GHC 0.26 as is (sigh)"
1313 c | C) WithGhcHc='C'
1314 WithGhcHcType='HC_USE_HC_FILES'
1316 *) echo "I don't understand this option: --with-hc-for-ghc=$withval"
1321 # make sure that what they said makes sense.... set WithGhcHcType
1323 haskell-compiler-unspecified ) # maybe they said something earlier...
1324 if test $WithHc = 'haskell-compiler-unspecified' ; then
1325 echo "Neither --with-hc nor --with-hc-for-ghc was properly set"
1328 if test $WithHcType = 'HC_GLASGOW_GHC' ; then
1330 $WithHc -v -C conftest.o > conftest.out 2>&1
1331 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1332 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1337 WithGhcHcType='HC_GLASGOW_GHC'
1338 AC_CHECK_PROG(have_ghc_ghc,$WithGhcHc,$ac_dir/$ac_word)
1339 if test -z "$have_ghc_ghc"; then
1340 echo "Can't find Glasgow Haskell to compile GHC with: $WithGhcHc"
1344 $WithGhcHc -v -C conftest.o > conftest.out 2>&1
1345 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1346 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1350 c | C) WithGhcHcType='HC_USE_HC_FILES'
1353 AC_SUBST(GhcBuilderVersion)
1355 AC_SUBST(WithGhcHcType)
1357 dnl ** use portable (slow) C? -- preferably not
1358 GhcWithRegisterised='YES'
1359 AC_ARG_ENABLE(portable-C,
1360 [Other things for GHC:
1362 --enable-portable-C use portable C (slow), not \`registerised' (fast)],
1363 [case "$enableval" in
1364 yes) GhcWithRegisterised='NO'
1366 no) GhcWithRegisterised='YES'
1368 *) echo "I don't understand this option: --enable-portable-C=$enableval"
1373 if test $GhcWithRegisterised = 'YES'; then
1374 case $HostPlatform in
1375 alpha-* | hppa1.1-* | i386-* | m68k-* | mips-* | powerpc-* | sparc-* )
1378 echo "Don't know non-portable C tricks for this platform: $HostPlatform"
1379 GhcWithRegisterised='NO'
1383 AC_SUBST(GhcWithRegisterised)
1385 if test $GhcWithRegisterised = 'NO'; then
1387 GhcBuild_normal='NO'
1390 # ToDo: make sure we can do concurrent for platform/circs...
1391 # ToDo: make sure we can do profiling for platform/circs...
1392 # ToDo: make sure we can do parallel for platform/circs...
1393 # ToDo: make sure we can do gransim for platform/circs...
1395 dnl ** build GHC compiler proper (\`hsc') from .hc files?
1396 GhcWithHscBuiltViaC='NO'
1397 AC_ARG_ENABLE(hsc-built-via-C,
1398 [--enable-hsc-built-via-C build compiler proper (hsc) from intermediate .hc
1399 files (disabled by default)],
1400 [case "$enableval" in
1401 yes) GhcWithHscBuiltViaC='YES'
1403 no) GhcWithHscBuiltViaC='NO'
1405 *) echo "I don't understand this option: --enable-hsc-built-via-C=$enableval"
1410 haskell-compiler-unspecified ) # maybe they said something earlier...
1411 if test $WithHcType = 'HC_USE_HC_FILES' ; then
1412 GhcWithHscBuiltViaC='YES'
1415 c | C) GhcWithHscBuiltViaC='YES'
1419 AC_SUBST(GhcWithHscBuiltViaC)
1421 dnl ** build \`hsc' with -O?
1422 GhcWithHscOptimised='YES'
1423 AC_ARG_ENABLE(hsc-optimised,
1424 [--disable-hsc-optimised don't build compiler proper (hsc) with -O],
1425 [case "$enableval" in
1426 yes) GhcWithHscOptimised='YES'
1428 no) GhcWithHscOptimised='NO'
1430 *) echo "I don't understand this option: --enable-hsc-optimised=$enableval"
1434 AC_SUBST(GhcWithHscOptimised)
1436 dnl ** build \`hsc' with -DDEBUG?
1437 GhcWithHscDebug='NO'
1438 AC_ARG_ENABLE(hsc-debug,
1439 [--enable-hsc-debug build compiler proper (hsc) with -DDEBUG],
1440 [case "$enableval" in
1441 yes) GhcWithHscDebug='YES'
1443 no) GhcWithHscDebug='NO'
1445 *) echo "I don't understand this option: --enable-hsc-debug=$enableval"
1449 AC_SUBST(GhcWithHscDebug)
1451 dnl ** omit native-code generator from \`hsc'?
1452 GhcWithNativeCodeGen='YES'
1453 AC_ARG_ENABLE(native-code-generator,
1454 [--enable-native-code-generator build an n.c.g.
1455 [enabled for supported platforms]],
1456 [case "$enableval" in
1457 yes) GhcWithNativeCodeGen='YES'
1459 no) GhcWithNativeCodeGen='NO'
1461 *) echo "I don't understand this option: --enable-native-code-generator=$enableval"
1465 if test $GhcWithNativeCodeGen = 'YES'; then
1466 case $TargetPlatform in
1467 i386-* | alpha-* | sparc-* )
1470 echo "Don't have a native-code generator for this platform: $TargetPlatform"
1471 GhcWithNativeCodeGen='NO'
1475 AC_SUBST(GhcWithNativeCodeGen)
1477 dnl ** include Marlow's deforester in \`hsc'?
1478 GhcWithDeforester='NO'
1479 AC_ARG_ENABLE(deforester,
1480 [--enable-deforester build deforester into compiler (HACKERS ONLY)],
1481 [case "$enableval" in
1482 yes) GhcWithDeforester='YES'
1484 no) GhcWithDeforester='NO'
1486 *) echo "I don't understand this option: --enable-deforester=$enableval"
1490 AC_SUBST(GhcWithDeforester)
1492 dnl ** include Readline library?
1493 GhcWithReadline='NO'
1494 AC_ARG_ENABLE(readline-library,
1495 [--enable-readline-library include (GNU) readline library in -syslib GHC],
1496 [case "$enableval" in
1497 yes) GhcWithReadline='YES'
1499 no) GhcWithReadline='NO'
1501 *) echo "I don't understand this option: --enable-readline-library=$enableval"
1505 AC_SUBST(GhcWithReadline)
1507 dnl ** include Sockets library?
1509 AC_ARG_ENABLE(sockets-library,
1510 [--enable-sockets-library include the network-interface (sockets) library in -syslib GHC],
1511 [case "$enableval" in
1512 yes) GhcWithSockets='YES'
1514 no) GhcWithSockets='NO'
1516 *) echo "I don't understand this option: --enable-sockets-library=$enableval"
1520 AC_SUBST(GhcWithSockets)
1522 dnl ** build the interpreter?
1525 [--enable-ghci build Glasgow Haskell interpreter (HACKERS ONLY)],
1526 [case "$enableval" in
1527 yes) BuildGHCI='YES'
1531 *) echo "I don't understand this option: --enable-ghci=$enableval"
1537 # here ends a very big if DoingGHC = 'ghc' ...
1541 # -------------------------------------------------------------------------
1543 dnl * `Happy' CONFIGURATION STUFF
1545 if test "xxx$DoingHappy" = 'xxxhappy' ; then
1548 dnl ** which Haskell compiler to use on happy?
1549 WithHappyHc='haskell-compiler-unspecified'
1550 WithHappyHcType='HC_UNSPECIFIED'
1552 AC_ARG_WITH(hc-for-happy,
1554 *******************************************************************
1555 ** \`Happy' PARSER-GENERATOR OPTIONS:
1557 The Haskell compiler to compile Happy; this option, if used, overrides
1560 --with-hc-for-happy=<Haskell compiler>
1561 ghc* => Glasgow Haskell invoked by the name given
1562 hbc* => Chalmers HBC, invoked by the name given
1563 nhc* => Niklas Rojemo's "nhc", invoked by the name given
1564 in-place => Use ghc/driver/ghc; i.e. you've built GHC
1565 and you want to use it un-installed ("in-place").],
1568 WithHappyHc=$withval
1570 hbc* ) WithHappyHc=$withval
1572 nhc* ) WithHappyHc=$withval
1575 WithHappyHc='IN-PLACE'
1577 *) echo "I don't understand this option: --with-hc-for-happy=$withval"
1582 # make sure that what they said makes sense.... set WithHappyHcType
1583 case $WithHappyHc in
1584 haskell-compiler-unspecified ) # maybe they said something earlier...
1585 if test $WithHc = 'haskell-compiler-unspecified' ; then
1586 echo "Neither --with-hc nor --with-hc-for-happy was properly set"
1591 WithHappyHcType='HC_GLASGOW_GHC'
1592 AC_CHECK_PROG(have_ghc_happy,$WithHappyHc,$ac_dir/$ac_word)
1593 if test -z "$have_ghc_happy"; then
1594 echo "Can't find Glasgow Haskell to compile Happy with: $WithHappyHc"
1598 hbc* ) # Look for the dastardly competition
1599 WithHappyHcType='HC_CHALMERS_HBC'
1600 AC_CHECK_PROG(have_hbc,$WithHappyHc,YES,NO)
1601 if test $have_hbc = 'NO' ; then
1602 echo "Can't find Chalmers HBC to compile with: $WithHappyHc"
1606 nhc* ) # Look for Niklas Rojemo's "nhc"
1607 WithHappyHcType='HC_ROJEMO_NHC'
1608 AC_CHECK_PROG(have_nhc,$WithHappyHc,YES,NO)
1609 if test $have_nhc = 'NO' ; then
1610 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHappyHc"
1614 IN-PLACE) WithHappyHcType='HC_GLASGOW_GHC'
1617 AC_SUBST(WithHappyHc)
1618 AC_SUBST(WithHappyHcType)
1620 # here ends a very big if DoingHappy = 'happy' ...
1623 # -------------------------------------------------------------------------
1625 dnl * `Haggis' CONFIGURATION STUFF
1627 if test "xxx$DoingHaggis" = 'xxxhaggis' ; then
1630 dnl ** which Haskell compiler to use on haggis?
1631 WithHaggisHc='haskell-compiler-unspecified'
1632 WithHaggisHcType='HC_UNSPECIFIED'
1634 AC_ARG_WITH(hc-for-haggis,
1636 *******************************************************************
1637 ** \`Haggis' HASKELL GUI TOOLKIT OPTIONS:
1639 The Haskell compiler to compile the Haggis toolkit; this option, if
1640 used, overrides --with-hc=<...>:
1642 --with-hc-for-haggis=<Haskell compiler>
1643 ghc* => Glasgow Haskell invoked by the name given
1644 and you want to use it un-installed ("in-place").],
1647 WithHaggisHc=$withval
1650 WithHaggisHc='IN-PLACE'
1652 *) echo "I don't understand this option: --with-hc-for-haggis=$withval"
1657 # make sure that what they said makes sense.... set WithHaggisHcType
1658 case $WithHaggisHc in
1659 haskell-compiler-unspecified ) # maybe they said something earlier...
1660 if test $WithHc = 'haskell-compiler-unspecified' ; then
1661 echo "Neither --with-hc nor --with-hc-for-haggis was properly set"
1666 WithHaggisHcType='HC_GLASGOW_GHC'
1667 AC_CHECK_PROG(have_ghc_haggis,$WithHaggisHc,$ac_dir/$ac_word)
1668 if test -z "$have_ghc_haggis"; then
1669 echo "Can't find Glasgow Haskell to compile Haggis with: $WithHaggisHc"
1673 IN-PLACE) WithHaggisHcType='HC_GLASGOW_GHC'
1676 AC_SUBST(WithHaggisHc)
1677 AC_SUBST(WithHaggisHcType)
1679 # here ends a very big if DoingHaggis = 'haggis' ...
1682 # -------------------------------------------------------------------------
1684 dnl * `Literate' CONFIGURATION STUFF
1686 if test "xxx$DoingLiterate" = 'xxxliterate' ; then
1690 AC_ARG_ENABLE(info-utils,
1692 *******************************************************************
1693 ** Literate programming system OPTIONS:
1695 --enable-info-utils build GNU info/makeinfo utilities],
1696 [case "$enableval" in
1697 yes) BuildInfoUtils='YES'
1699 no) BuildInfoUtils='NO'
1701 *) echo "I don't understand this option: --enable-info-utils=$enableval"
1705 AC_SUBST(BuildInfoUtils)
1707 # here ends a very big if DoingLiterate = 'literate' ...
1710 # -------------------------------------------------------------------------
1712 dnl * `NoFib' CONFIGURATION STUFF
1714 if test "xxx$DoingNoFib" = 'xxxnofib' ; then
1717 dnl ** which Haskell compiler to test with NoFib?
1718 WithNoFibHc='haskell-compiler-unspecified'
1719 WithNoFibHcType='HC_UNSPECIFIED'
1721 AC_ARG_WITH(hc-for-nofib,
1723 *******************************************************************
1724 ** NoFib HASKELL BENCHMARK SUITE OPTIONS:
1726 The Haskell compiler to compile the NoFib programs; this option, if
1727 used, overrides --with-hc=<...>:
1729 --with-hc-for-nofib=<Haskell compiler>
1730 ghc* => Glasgow Haskell invoked by the name given
1731 hbc* => Chalmers HBC, invoked by the name given
1732 nhc* => Niklas Rojemo's "nhc", invoked by the name given
1733 in-place => Use ghc/driver/ghc; i.e. you've built GHC
1734 and you want to use it un-installed ("in-place").
1738 WithNoFibHc=$withval
1740 hbc* ) WithNoFibHc=$withval
1742 nhc* ) WithNoFibHc=$withval
1745 WithNoFibHc='IN-PLACE'
1747 *) echo "I don't understand this option: --with-hc-for-nofib=$withval"
1752 # make sure that what they said makes sense.... set WithHappyHcType
1753 case $WithNoFibHc in
1754 haskell-compiler-unspecified ) # maybe they said something earlier...
1755 if test $WithHc = 'haskell-compiler-unspecified' ; then
1756 echo "Neither --with-hc nor --with-hc-for-nofib was properly set"
1761 WithNoFibHcType='HC_GLASGOW_GHC'
1762 AC_CHECK_PROG(have_ghc_nofib,$WithNoFibHc,$ac_dir/$ac_word)
1763 if test -z "$have_ghc_nofib"; then
1764 echo "Can't find Glasgow Haskell to compile NoFib with: $WithNoFibHc"
1768 hbc* ) # Look for the dastardly competition
1769 WithNoFibHcType='HC_CHALMERS_HBC'
1770 AC_CHECK_PROG(have_hbc,$WithNoFibHc,YES,NO)
1771 if test $have_hbc = 'NO' ; then
1772 echo "Can't find Chalmers HBC to compile NoFib with: $WithNoFibHc"
1776 nhc* ) # Look for Niklas Rojemo's "nhc"
1777 WithNoFibHcType='HC_ROJEMO_NHC'
1778 AC_CHECK_PROG(have_nhc,$WithNoFibHc,YES,NO)
1779 if test $have_nhc = 'NO' ; then
1780 echo "Can't find Niklas Rojemo's NHC to compile NoFib with: $WithNoFibHc"
1784 IN-PLACE) WithNoFibHcType='HC_GLASGOW_GHC'
1787 AC_SUBST(WithNoFibHc)
1788 AC_SUBST(WithNoFibHcType)
1790 dnl ** what mkworld \`setup' should be used?
1793 --with-setup=<setup> : What mkworld \`setup' should be used?
1794 Choices: ghc, hbc, nhc
1797 ghc ) MkWorldSetup='ghc'
1799 hbc ) MkWorldSetup='hbc'
1801 nhc ) MkWorldSetup='nhc'
1803 *) echo "I don't understand this option: --with-setup=$withval"
1808 if test $MkWorldSetup = 'std' ; then
1809 echo 'You must do --with-setup=... (one of: ghc, hbc, or nhc) for NoFib'
1813 # ---------------------------------------
1814 # What sets of tests should be run.
1816 IncludeRealNoFibTests='YES' # defaults
1817 IncludeSpectralNoFibTests='YES'
1818 IncludeImaginaryNoFibTests='YES'
1819 IncludePENDINGNoFibTests='NO'
1820 IncludeUNUSEDNoFibTests='NO'
1821 IncludeGHC_ONLYNoFibTests='NO'
1822 IncludePRIVATENoFibTests='NO'
1823 IncludeParallelNoFibTests='NO'
1825 dnl ** should *all* NoFib tests be run?
1826 # special catch-all variant
1827 AC_ARG_ENABLE(all-tests,
1828 [Possibly turn on *all* of the possible tests (a sane choice
1831 --enable-all-tests do *all* tests],
1832 [case "$enableval" in
1833 yes) IncludePENDINGNoFibTests='YES'
1834 IncludeUNUSEDNoFibTests='YES'
1835 IncludeGHC_ONLYNoFibTests='YES'
1836 IncludePRIVATENoFibTests='YES'
1837 IncludeParallelNoFibTests='YES'
1839 no) IncludePENDINGNoFibTests='NO'
1840 IncludeUNUSEDNoFibTests='NO'
1841 IncludeGHC_ONLYNoFibTests='NO'
1842 IncludePRIVATENoFibTests='NO'
1843 IncludeParallelNoFibTests='NO'
1845 IncludeRealNoFibTests='NO'
1846 IncludeSpectralNoFibTests='NO'
1847 IncludeImaginaryNoFibTests='NO'
1849 *) echo "I don't understand this option: --enable-all-tests=$enableval"
1854 dnl ** turn on/off individual categories of tests...
1855 # individual categories
1856 AC_ARG_ENABLE(imaginary-tests,
1858 Enable/disable individual categories of tests:
1860 --disable-imaginary-tests do *not* include imaginary tests],
1861 [case "$enableval" in
1862 yes) IncludeImaginaryNoFibTests='YES'
1864 no) IncludeImaginaryNoFibTests='NO'
1866 *) echo "I don't understand this option: --enable-imaginary-tests=$enableval"
1871 AC_ARG_ENABLE(spectral-tests,
1872 [--disable-spectral-tests do *not* include spectral tests],
1873 [case "$enableval" in
1874 yes) IncludeSpectralNoFibTests='YES'
1876 no) IncludeSpectralNoFibTests='NO'
1878 *) echo "I don't understand this option: --enable-spectral-tests=$enableval"
1883 AC_ARG_ENABLE(real-tests,
1884 [--disable-real-tests do *not* include real tests],
1885 [case "$enableval" in
1886 yes) IncludeRealNoFibTests='YES'
1888 no) IncludeRealNoFibTests='NO'
1890 *) echo "I don't understand this option: --enable-real-tests=$enableval"
1895 AC_ARG_ENABLE(PENDING-tests,
1896 [--enable-PENDING-tests include PENDING tests],
1897 [case "$enableval" in
1898 yes) IncludePENDINGNoFibTests='YES'
1900 no) IncludePENDINGNoFibTests='NO'
1902 *) echo "I don't understand this option: --enable-PENDING-tests=$enableval"
1907 AC_ARG_ENABLE(UNUSED-tests,
1908 [--enable-UNUSED-tests include UNUSED tests],
1909 [case "$enableval" in
1910 yes) IncludeUNUSEDNoFibTests='YES'
1912 no) IncludeUNUSEDNoFibTests='NO'
1914 *) echo "I don't understand this option: --enable-UNUSED-tests=$enableval"
1919 AC_ARG_ENABLE(GHC-ONLY-tests,
1920 [--enable-GHC-ONLY-tests include GHC_ONLY tests],
1921 [case "$enableval" in
1922 yes) IncludeGHC_ONLYNoFibTests='YES'
1924 no) IncludeGHC_ONLYNoFibTests='NO'
1926 *) echo "I don't understand this option: --enable-GHC-ONLY-tests=$enableval"
1931 AC_ARG_ENABLE(PRIVATE-tests,
1932 [--enable-PRIVATE-tests include PRIVATE tests],
1933 [case "$enableval" in
1934 yes) IncludePRIVATENoFibTests='YES'
1936 no) IncludePRIVATENoFibTests='NO'
1938 *) echo "I don't understand this option: --enable-PRIVATE-tests=$enableval"
1943 AC_ARG_ENABLE(parallel-tests,
1944 [--enable-parallel-tests include parallel tests
1946 [case "$enableval" in
1947 yes) IncludeParallelNoFibTests='YES'
1949 no) IncludeParallelNoFibTests='NO'
1951 *) echo "I don't understand this option: --enable-parallel-tests=$enableval"
1956 AC_SUBST(IncludeRealNoFibTests)
1957 AC_SUBST(IncludeSpectralNoFibTests)
1958 AC_SUBST(IncludeImaginaryNoFibTests)
1959 AC_SUBST(IncludePENDINGNoFibTests)
1960 AC_SUBST(IncludeUNUSEDNoFibTests)
1961 AC_SUBST(IncludeGHC_ONLYNoFibTests)
1962 AC_SUBST(IncludeSpecialiseNoFibTests)
1963 AC_SUBST(IncludePRIVATENoFibTests)
1964 AC_SUBST(IncludeParallelNoFibTests)
1966 # here ends a very big if DoingNoFib = 'nofib' ...
1969 # -------------------------------------------------------------------------
1971 dnl * extract non-header files with substitution (end)
1973 AC_SUBST(MkWorldSetup)
1975 AC_OUTPUT(Makefile STARTUP mkworld/site.jm mkworld/platform.h mkworld/config.h $ghc_mkworld_site_ghc_jm $ghc_includes_platform_h $nofib_mkworld_site_nofib_jm)
1977 echo '************************************************'
1978 echo '*** NOW DO: sh < STARTUP'
1979 echo '************************************************'