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)
21 # and literate/config.h ???
22 # ToDo !!!!!!!!!!!!!!!!
24 # No, we don't do `--srcdir'...
25 if test x"$srcdir" != 'x.' ; then
26 echo "This configuration does not support the \`--srcdir' option."
30 # -------------------------------------------------------------------------
31 dnl ** choose what blobs to build (ghc,hslibs,haggis,happy,nofib,????)
33 # set to the name for the dir if doing it, otherwise empty
40 # the following are not normally changed
41 DoingMkWorld='mkworld'
42 DoingGlaFpUtils='glafp-utils'
48 **********************************************************************
49 * Configuration options for the Glasgow functional-programming tools *
50 **********************************************************************
52 First, select *which* of the tools you want to build,
53 with --{enable,disable}-{ghc,hslibs,nofib,happy,haggis}.
54 (The default is: only GHC (Glasgow Haskell compiler).)
56 Second, you may set one of a few applies-in-all-cases options.
57 For example, --with-tmpdir=/usr/tmp.
59 Then you may set various options which are specifically for the
60 tools you choose in step 1. For GHC, perhaps --enable-concurrent.
61 For NoFib, perhaps --enable-all-tests. And so on.
63 The rest of this message lists all of the configure options. If the
64 option is enabled by default, the message says how to disable it. And
67 If you are confused, don't forget the installation documents that came
70 *******************************************************************
71 ** FOR SELECTING WHICH GLASGOW FP TOOLS TO BUILD:
73 --disable-ghc do *not* build GHC as part of Glasgow FP tools],
79 *) echo "I don't understand this option: --enable-ghc=$enableval"
83 if test "xxx$DoingGHC" = 'xxxghc' -a \( ! -d ghc \) ; then
85 echo 'Doing --disable-ghc, as there is no ghc directory'
87 ghc_mkworld_site_ghc_jm='ghc/mkworld/site-ghc.jm'
88 ghc_includes_platform_h='ghc/includes/platform.h'
89 # duznae work: ghc_includes_config_h='ghc/includes/config.h'
90 if test "xxx$DoingGHC" = 'xxx' ; then
91 ghc_mkworld_site_ghc_jm=''
92 ghc_includes_platform_h=''
93 # ghc_includes_config_h=''
97 [--enable-hslibs build suite of Haskell libraries],
99 yes) DoingHsLibs='hslibs'
103 *) echo "I don't understand this option: --enable-hslibs=$enableval"
107 if test "xxx$DoingHsLibs" = 'xxxhslibs' -a \( ! -d hslibs \) ; then
109 echo 'Doing --disable-hslibs, as there is no hslibs directory'
111 hslibs_mkworld_site_hslibs_jm='hslibs/mkworld/site-hslibs.jm'
112 if test "xxx$DoingHsLibs" = 'xxx' ; then
113 hslibs_mkworld_site_hslibs_jm=''
117 [--enable-nofib build NoFib suite as part of Glasgow FP tools],
118 [case "$enableval" in
119 yes) DoingNoFib='nofib'
123 *) echo "I don't understand this option: --enable-nofib=$enableval"
127 if test "xxx$DoingNoFib" = 'xxxnofib' -a \( ! -d nofib \) ; then
129 echo 'Doing --disable-nofib, as there is no nofib directory'
131 nofib_mkworld_site_nofib_jm='nofib/mkworld/site-nofib.jm'
132 if test "xxx$DoingNoFib" = 'xxx' ; then
133 nofib_mkworld_site_nofib_jm=''
137 [--enable-happy build Happy parser-generator as part of Glasgow FP tools],
138 [case "$enableval" in
139 yes) DoingHappy='happy'
143 *) echo "I don't understand this option: --enable-happy=$enableval"
147 if test "xxx$DoingHappy" = 'xxxhappy' -a \( ! -d happy \) ; then
149 echo 'Doing --disable-happy, as there is no happy directory'
152 AC_ARG_ENABLE(haggis,
153 [--enable-haggis build Haggis GUI toolkit as part of Glasgow FP tools],
154 [case "$enableval" in
155 yes) DoingHaggis='haggis'
159 *) echo "I don't understand this option: --enable-haggis=$enableval"
163 if test "xxx$DoingHaggis" = 'xxxhaggis' -a \( ! -d haggis \) ; then
165 echo 'Doing --disable-haggis, as there is no haggis directory'
168 AC_ARG_ENABLE(literate,
170 The following three are \`for hackers only':
171 --disable-literate do *not* build literate-programming stuff],
172 [case "$enableval" in
173 yes) DoingLiterate='literate'
177 *) echo "I don't understand this option: --enable-literate=$enableval"
181 if test "xxx$DoingLiterate" = 'xxxliterate' -a \( ! -d literate \) ; then
183 echo 'Doing --disable-literate, as there is no literate directory'
186 AC_ARG_ENABLE(mkworld,
187 [--disable-mkworld do *not* build \`mkworld' configuration stuff],
188 [case "$enableval" in
189 yes) DoingMkWorld='mkworld'
193 *) echo "I don't understand this option: --enable-mkworld=$enableval"
197 if test "xxx$DoingMkWorld" = 'xxxmkworld' -a \( ! -d mkworld \) ; then
199 echo 'Doing --disable-mkworld, as there is no mkworld directory'
202 AC_ARG_ENABLE(glafp-utils,
203 [--disable-glafp-utils do *not* build \`glafp utilities'],
204 [case "$enableval" in
205 yes) DoingGlaFpUtils='glafp-utils'
207 no) DoingGlaFpUtils=''
209 *) echo "I don't understand this option: --enable-glafp-utils=$enableval"
213 if test "xxx$DoingGlaFpUtils" = 'xxxglafp-utils' -a \( ! -d glafp-utils \) ; then
215 echo 'Doing --disable-glafp-utils, as there is no glafp-utils directory'
219 AC_SUBST(DoingHsLibs)
222 AC_SUBST(DoingHaggis)
223 AC_SUBST(DoingLiterate)
224 AC_SUBST(DoingMkWorld)
225 AC_SUBST(DoingGlaFpUtils)
227 # -------------------------------------------------------------------------
228 dnl ** choose host(/target/build) platform
229 # Guess host/target/build platform(s) if necessary.
230 # Partly stolen from GCC "configure".
232 if test "x$target" = xNONE ; then
233 if test "x$nonopt" != xNONE ; then
236 # This way of testing the result of a command substitution is
237 # defined by Posix.2 (section 3.9.1) as well as traditional shells.
238 if target=`$srcdir/config.guess` ; then
239 echo "Configuring for a ${target} host." 1>&2
241 echo 'Config.guess failed to determine the host type. You need \
242 to specify one.' 1>&2
243 if test -r config.status ; then
244 tail +2 config.status 1>&2
251 # "$host" defaults to "$target"
252 if test "x$host" = xNONE ; then
255 # "$build" defaults to "$host"
256 if test "x$build" = xNONE ; then
259 echo "This configuration does not support the \`--build' option."
263 dnl ** canonicalize platform names
264 # Canonicali[sz]e those babies
265 BuildPlatform=`/bin/sh $srcdir/config.sub $build` || exit 1
266 HostPlatform=`/bin/sh $srcdir/config.sub $host` || exit 1
267 TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1
269 if test x"$TargetPlatform" != x"$HostPlatform" ; then
270 echo "GHC configuration does not support differing host/target (i.e., cross-compiling)"
274 # The following will be more difficult when we *are* cross-compiling.
275 # Suitable names to slam in *_CPP are in platform.h.in.
276 # We also record the architecture, vendor, and operating system (OS)
278 case $HostPlatform in
279 alpha-dec-osf[[1234]]*)
280 HostPlatform=alpha-dec-osf1 # canonicalise for our purposes
281 TargetPlatform=alpha-dec-osf1 # this will work for now... (hack)
282 BuildPlatform=alpha-dec-osf1 #hack
283 HostPlatform_CPP='alpha_dec_osf1'
289 HostPlatform=hppa1.1-hp-hpux # canonicalise for our purposes (hack)
290 TargetPlatform=hppa1.1-hp-hpux
291 BuildPlatform=hppa1.1-hp-hpux
292 HostPlatform_CPP='hppa1_1_hp_hpux'
293 HostArch_CPP='hppa1_1'
297 i[[3456]]86-*-linuxaout*)
298 HostPlatform=i386-unknown-linuxaout # hack again
299 TargetPlatform=i386-unknown-linuxaout
300 BuildPlatform=i386-unknown-linuxaout
301 HostPlatform_CPP='i386_unknown_linuxaout'
303 HostVendor_CPP='unknown'
304 HostOS_CPP='linuxaout'
306 i[[3456]]86-*-linux*)
307 HostPlatform=i386-unknown-linux # hack again
308 TargetPlatform=i386-unknown-linux
309 BuildPlatform=i386-unknown-linux
310 HostPlatform_CPP='i386_unknown_linux'
312 HostVendor_CPP='unknown'
315 i[[3456]]86-*-freebsd*)
316 HostPlatform=i386-unknown-freebsd # hack again
317 TargetPlatform=i386-unknown-freebsd
318 BuildPlatform=i386-unknown-freebsd
319 HostPlatform_CPP='i386_unknown_freebsd'
321 HostVendor_CPP='unknown'
324 i[[3456]]86-*-netbsd*)
325 HostPlatform=i386-unknown-netbsd # hack again
326 TargetPlatform=i386-unknown-netbsd
327 BuildPlatform=i386-unknown-netbsd
328 HostPlatform_CPP='i386_unknown_netbsd'
330 HostVendor_CPP='unknown'
333 i[[3456]]86-*-solaris2*)
334 HostPlatform=i386-unknown-solaris2 # hack again
335 TargetPlatform=i386-unknown-solaris2
336 BuildPlatform=i386-unknown-solaris2
337 HostPlatform_CPP='i386_unknown_solaris2'
339 HostVendor_CPP='unknown'
340 HostOS_CPP='solaris2'
343 HostPlatform_CPP='m68k_next_nextstep2'
345 HostVendor_CPP='next'
346 HostOS_CPP='nextstep2'
349 HostPlatform_CPP='m68k_next_nextstep3'
351 HostVendor_CPP='next'
352 HostOS_CPP='nextstep3'
354 i[[3456]]86-next-nextstep3)
355 HostPlatform=i386-next-nextstep3 # hack again
356 TargetPlatform=i386-next-nextstep3
357 BuildPlatform=i386-next-nextstep3
358 HostPlatform_CPP='i386_next_nextstep3'
360 HostVendor_CPP='next'
361 HostOS_CPP='nextstep3'
364 HostPlatform=m68k-sun-sunos4
365 TargetPlatform=m68k-sun-sunos4 #hack
366 BuildPlatform=m68k-sun-sunos4 #hack
367 HostPlatform_CPP='m68k_sun_sunos4'
373 HostPlatform_CPP='mips_dec_ultrix'
374 HostArch_CPP='mipsel' # NB a little different
379 HostPlatform=mips-sgi-irix
380 TargetPlatform=mips-sgi-irix #hack
381 BuildPlatform=mips-sgi-irix #hack
382 HostPlatform_CPP='mips_sgi_irix'
383 HostArch_CPP='mipseb' # NB a little different
388 HostPlatform=powerpc-ibm-aix
389 TargetPlatform=powerpc-ibm-aix #hack
390 BuildPlatform=powerpc-ibm-aix #hack
391 HostPlatform_CPP='powerpc_ibm_aix'
392 HostArch_CPP='powerpc'
397 HostPlatform=sparc-sun-sunos4
398 TargetPlatform=sparc-sun-sunos4 #hack
399 BuildPlatform=sparc-sun-sunos4 #hack
400 HostPlatform_CPP='sparc_sun_sunos4'
406 HostPlatform=sparc-sun-solaris2
407 TargetPlatform=sparc-sun-solaris2 #hack
408 BuildPlatform=sparc-sun-solaris2 #hack
409 HostPlatform_CPP='sparc_sun_solaris2'
412 HostOS_CPP='solaris2'
415 echo "Unrecognised platform: $HostPlatform"
420 test -n "$verbose" && echo "Host platform set to $HostPlatform"
421 test -n "$verbose" -a x"$HostPlatform" != x"$TargetPlatform" \
422 && echo "Target platform set to $TargetPlatform"
423 test -n "$verbose" -a x"$BuildPlatform" != x"$HostPlatform" \
424 && echo "Build platform set to $BuildPlatform"
426 BuildPlatform_CPP=$HostPlatform_CPP
427 TargetPlatform_CPP=$HostPlatform_CPP
428 BuildArch_CPP=$HostArch_CPP
429 TargetArch_CPP=$HostArch_CPP
430 BuildOS_CPP=$HostOS_CPP
431 TargetOS_CPP=$HostOS_CPP
432 BuildVendor_CPP=$HostVendor_CPP
433 TargetVendor_CPP=$HostVendor_CPP
434 dnl Cannot afford all these AC_SUBSTs (because of braindead seds w/ 99 cmd limits
435 dnl AC_SUBST(BuildPlatform)
436 AC_SUBST(HostPlatform)
437 dnl AC_SUBST(TargetPlatform)
438 AC_SUBST(HostPlatform_CPP)
439 dnl AC_SUBST(BuildPlatform_CPP)
440 dnl AC_SUBST(TargetPlatform_CPP)
441 AC_SUBST(HostArch_CPP)
442 dnl AC_SUBST(BuildArch_CPP)
443 dnl AC_SUBST(TargetArch_CPP)
445 dnl AC_SUBST(BuildOS_CPP)
446 dnl AC_SUBST(TargetOS_CPP)
447 AC_SUBST(HostVendor_CPP)
448 dnl AC_SUBST(BuildVendor_CPP)
449 dnl AC_SUBST(TargetVendor_CPP)
451 # -------------------------------------------------------------------------
453 dnl * _GENERAL_ CONFIGURATION CHECKS
455 dnl ** are we at Glasgow?
457 if test -d /local/fp -a -d /users/fp/simonpj; then
458 echo "Brilliant! You must be a Glaswegian."
460 if test "x$prefix" = xNONE; then
462 echo "Assuming installation prefix of $prefix"
464 if test "x$exec_prefix" = xNONE; then
465 # Sigh: the defn of exec_prefix does not include the bin* bit...
467 exec_prefix=/local/fp
468 echo "Assuming binary installation prefix of $exec_prefix"
474 test -n "$verbose" && echo " setting AT_GLASGOW to $AT_GLASGOW"
482 dnl ** look for `perl', but watch out for version 4.035
484 AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
485 if test -z "$PerlCmd"; then
486 echo "You must install perl before you can continue"
487 echo "Perhaps it is already installed, but not in your PATH?"
490 $PerlCmd -v >conftest.out 2>&1
491 if egrep "version 4" conftest.out >/dev/null 2>&1; then
492 if egrep "Patch level: 35" conftest.out >/dev/null 2>&1; then
494 ************************************************************************
495 Uh-oh...looks like you have Perl 4.035.
497 Perl version 4.035 has a bug to do with recursion that will bite if
498 you run the lit2texi script, when making Info files from
499 literate files of various sorts. Either use the current version
500 (4.036), an older version (e.g., perl 4.019) or apply the patch in
501 glafp-utils/perl-4.035-fixes to your 4.035 perl.
502 ************************************************************************
506 if egrep "version 5" conftest.out >/dev/null 2>&1; then
509 echo "I'm not sure if your version of perl will work,"
510 echo "but it's worth a shot, eh?"
516 dnl ** does #!.../perl work? (sometimes it's too long...)
517 echo "checking if \`#!$PerlCmd' works in shell scripts"
522 (SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
523 if test $? -ne 69; then
526 echo "It doesn't! Perhaps \`#!$PerlCmd' is too long (often 32 characters max)"
531 dnl ** check if perl library is properly installed
532 # (by seeing if a "do 'getopts.pl'" works...
533 if $PerlCmd -e 'do "getopts.pl" || exit(1); exit(0);' > /dev/null 2>&1 ; then
536 echo "I think your perl library is misinstalled."
537 echo "The following script did not work:"
538 echo ' do "getopts.pl" || exit(1); exit(0);'
543 dnl ** look for GCC and find out which version
544 # Figure out which C compiler to use. Gcc is preferred.
545 # If gcc, make sure it's at least 2.1
548 if test -z "$GCC"; then
549 echo "You would be better off with gcc"
550 echo "Perhaps it is already installed, but not in your PATH?"
553 gcc -v > conftest.out 2>&1
554 echo '/version (\d+)\.(\d+)/ && $1*10+$2 > 20 && print "YES";' > conftest.pl
555 HaveGcc=`eval $PerlCmd -n conftest.pl conftest.out`
556 if test -z "$HaveGcc"; then
557 echo "I'm not sure if your version of gcc will work,"
558 echo "but it's worth a shot, eh?"
566 dnl ** figure out how to do context diffs
567 # (NB: NeXTStep thinks diff'ing a file against itself is "trouble")
571 if diff -C 1 conftest1 conftest2 > /dev/null 2>&1 ; then
572 ContextDiffCmd='diff -C 1'
574 if diff -c1 conftest1 conftest2 > /dev/null 2>&1 ; then
575 ContextDiffCmd='diff -c1'
577 echo "Can't figure out how to do context diffs."
578 echo "Neither \`diff -C 1' nor \`diff -c1' works."
582 rm -f conftest1 conftest2
583 AC_SUBST(ContextDiffCmd)
585 dnl ** look for a decent parser generator (bison preferred)
588 AC_CHECK_PROG(YaccCmd, bison, bison -y)
589 if test -z "$YaccCmd"; then
590 echo "Can't find bison out there..."
591 AC_CHECK_PROG(WhatCmd, what, what, :)
592 AC_CHECK_PROG(YaccCmd, yacc, $ac_dir/$ac_word)
593 if test -z "$YaccCmd"; then
594 echo "But that's okay...I can't find yacc either."
597 $WhatCmd $YaccCmd > conftest.out
598 if egrep 'y1\.c 1\..*SMI' conftest.out >/dev/null 2>&1; then
599 echo "I don't trust your $YaccCmd; it looks like an old Sun yacc"
600 if test -x /usr/lang/yacc; then
601 echo "I'm going to use /usr/lang/yacc instead"
602 YaccCmd=/usr/lang/yacc
604 echo "I'm assuming the worst...no parser generator at all"
607 elif egrep 'y1\.c.*Revision: 4\.2\.6\.3.*DEC' conftest.out >/dev/null 2>&1; then
608 echo "I don't trust your $YaccCmd; it looks like a lame DEC yacc"
609 echo "I'm assuming the worst...no parser generator at all"
612 echo "But that's okay...as far as I know, your yacc will work."
618 dnl ** Find lex command (lex or flex) and library (-ll or -lfl)
622 #--------------------------------------------------------------
623 WithHc='haskell-compiler-unspecified'
624 WithHcType='HC_UNSPECIFIED'
628 *******************************************************************
629 ** GENERAL OPTIONS WHICH APPLY TO ALL TOOLS:
631 --with-hc=<Haskell compiler>
632 ghc* => Glasgow Haskell invoked by the name given
633 hbc* => Chalmers HBC, invoked by the name given
634 nhc* => Niklas Rojemo's "nhc", invoked by the name given
635 C or c => Don't use a Haskell compiler;
636 build from intermediate C (.hc) files.
637 in-place => Use ghc/driver/ghc; i.e. you've built GHC
638 and you want to use it un-installed ("in-place").
644 hbc* ) WithHc=$withval
646 nhc* ) WithHc=$withval
653 *) echo "I don't understand this option: --with-hc=$withval"
658 # make sure that what they said makes sense.... set WithHcType
660 haskell-compiler-unspecified ) # maybe they will say something later...
663 WithHcType='HC_GLASGOW_GHC'
664 AC_CHECK_PROG(have_ghc,$WithHc,$ac_dir/$ac_word)
665 if test -z "$have_ghc"; then
666 echo "Can't find Glasgow Haskell to compile with: $WithHc"
670 hbc* ) # Look for the dastardly competition
671 WithHcType='HC_CHALMERS_HBC'
672 AC_CHECK_PROG(have_hbc,$WithHc,YES,NO)
673 if test $have_hbc = 'NO' ; then
674 echo "Can't find Chalmers HBC to compile with: $WithHc"
678 nhc* ) # Look for Niklas Rojemo's "nhc"
679 WithHcType='HC_ROJEMO_NHC'
680 AC_CHECK_PROG(have_nhc,$WithHc,YES,NO)
681 if test $have_nhc = 'NO' ; then
682 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHc"
686 c | C) WithHcType='HC_USE_HC_FILES'
688 IN-PLACE) WithHcType='HC_GLASGOW_GHC'
689 WithHc='$(TOP_PWD)/ghc/driver/ghc'
695 dnl ** Possibly use something else instead of 'gcc'.
698 [--with-gcc=<gcc command>
699 Use a different command instead of 'gcc' for the GNU C compiler.],
700 [HaveGcc=YES; WhatGccIsCalled="$withval"])
701 AC_SUBST(WhatGccIsCalled)
703 dnl ** Choose which make to use (default 'make')
707 --with-make=<make command>
708 Use an alternate command instead of 'make'. This is useful
709 when GNU make is required (for instance when the default make
710 supplied by the system won't work, as is the case on FreeBSD
712 [MakeCmd="$withval"])
715 dnl ** possibly choose a different tmpdir (default /tmp)
716 # let the user decide where the best tmpdir is
717 # /tmp is the default; /usr/tmp is sometimes a good choice.
718 # Very site-specific.
722 --with-tmpdir=<temp directory>
723 Use an alternative directory for temporary files (presumably
724 because /tmp is too small).],
728 dnl ** possibly set a max heap for Haskell compilations
729 # let the user specify a maximum heap to be used; the old
730 # "I have a 64MB machine, why not use a 32MB heap?" thing.
733 AC_ARG_WITH(max-heap,
735 --with-max-heap=<heap size, e.g., 32m>
736 Do all Haskell compilations with a heap of this size. (If
737 you've got it, flaunt it.)],
738 [HcMaxHeapWasSet='YES'
739 HcMaxHeap="$withval"])
740 AC_SUBST(HcMaxHeapWasSet)
743 dnl ** figure out about mkdependHS
744 MkDependHSCmd='mkdependHS'
745 if test -f ./ghc/utils/mkdependHS/mkdependHS \
746 -o -f ./ghc/utils/mkdependHS/mkdependHS.prl ; then
747 MkDependHSCmd='TopDirPwd/ghc/utils/mkdependHS/mkdependHS'
749 AC_ARG_WITH(mkdependHS,
750 [--with-mkdependHS=<mkdependHS command>
751 Use a different command instead of 'mkdependHS'.],
752 [MkDependHSCmd="$withval"])
753 dnl AC_CHECK_PROG(have_mkdependHS,$MkDependHSCmd,YES,NO)
754 dnl if test $have_mkdependHS = 'NO' ; then
755 dnl MkDependHSCmd=':'
757 AC_SUBST(MkDependHSCmd)
759 # -------------------------------------------------------------------------
761 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
764 if echo $CPP | egrep gcc >/dev/null 2>&1; then
766 gcc -v -E conftest.c >/dev/null 2>conftest.out
767 echo '/(\S+\/cpp)/ && print "$1";' > conftest.pl
768 # GNUCPP: used in jmake.c (GnuCppCmd) and in mkdependC
769 # (where we could do with the usual pre-#defines)
770 GNUCPP="`eval $PerlCmd -n conftest.pl conftest.out`"
771 test -n "$verbose" && echo " setting GNUCPP to $GNUCPP"
772 # RAWCPP: we do not want *any* pre-#defines...
773 # (e.g., hscpp, mkdependHS)
774 RAWCPP="`eval $PerlCmd -n conftest.pl conftest.out` -traditional"
775 test -n "$verbose" && echo " setting RAWCPP to $RAWCPP"
778 # ToDo: what are GNUCPP and RAWCPP if the above if didn't fire? WDP 95/02
782 dnl ** figure out how to do a BSD-ish install
786 dnl ** figure out what arguments to feed to `ar'
788 AC_CHECK_PROG(ArCmd,ar,$ac_dir/$ac_word)
789 if test -z "$ArCmd"; then
790 echo "You don't seem to have ar...I have no idea how to make a library"
793 if $ArCmd clqs conftest.a >/dev/null 2>/dev/null; then
796 elif $ArCmd cqs conftest.a >/dev/null 2>/dev/null; then
799 elif $ArCmd clq conftest.a >/dev/null 2>/dev/null; then
802 elif $ArCmd cq conftest.a >/dev/null 2>/dev/null; then
805 elif $ArCmd cq conftest.a 2>&1 | grep 'no archive members specified' >/dev/null 2>/dev/null; then
809 echo "I can't figure out how to use your $ArCmd"
813 test -n "$ArCmd" && test -n "$verbose" && echo " setting ArCmd to $ArCmd"
816 dnl ** figure out if we need `ranlib'
818 if test -z "$NeedRanLib"; then
819 # we hackily override a few platforms on a case-by-case basis
820 case $HostPlatform in
827 test -n "$verbose" && echo " setting RANLIB to $RANLIB"
829 if test -n "$NeedRanLib"; then
834 dnl ** check for full ANSI header (.h) files
838 dnl ** check for specific header (.h) files that we are interested in
840 AC_CHECK_HEADERS(dirent.h fcntl.h grp.h malloc.h memory.h nlist.h pwd.h siginfo.h signal.h stdlib.h string.h sys/fault.h sys/file.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/socket.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/vadvise.h sys/wait.h termios.h time.h types.h unistd.h utime.h vfork.h )
842 dnl ** check if it is safe to include both <time.h> and <sys/time.h>
846 dnl ** how do we get a timezone name?
850 dnl ** determine the type of signal()
854 dnl ** check for specific library functions that we are interested in
856 AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect setitimer stat sysconf timelocal times vadvise vfork)
858 dnl ** can we get alloca?
862 dnl ** determine whether or not const works
866 dnl ** check for leading underscores in symbol names
867 # We assume that they _aren't_ there if anything goes wrong.
869 echo checking for a leading underscore in symbol names
873 struct nlist xYzzY[] = {{"_xYzzY", 0},{0}};
881 if(nlist(argv[0], xYzzY) == 0 && xYzzY[0].n_value != 0)
885 }], LeadingUnderscore='YES', LeadingUnderscore='NO', LeadingUnderscore='YES')
886 test -n "$verbose" && echo " setting LeadingUnderscore to $LeadingUnderscore"
888 dnl -------------------------------------------------------
889 dnl ** which builds to build?
890 dnl ** (applies to anything w/ libraries (ghc, hslibs, ???)
891 dnl -------------------------------------------------------
892 # builds: normal = sequential _ap_o ; _p = profiling (sequential);
893 # _t = ticky; _u = unregisterized
898 # _mc = concurrent; _mr = profiled concurrent; _mt = ticky concurrent
899 # _mp = parallel; _mg = gransim
905 # GC builds: _2s, _1s, _du (, _gn)
927 # More could be added here...
929 AC_ARG_ENABLE(normal-build,
931 *******************************************************************
932 ** \`GHC' (GLASGOW HASKELL COMPILER) OPTIONS:
934 Choose all the \`builds' of GHC that you want:
936 --disable-normal-build do *not* build GHC for normal sequential code],
937 [case "$enableval" in
938 yes) Build_normal='YES'
940 no) Build_normal='NO'
942 *) echo "I don't understand this option: --enable-normal-build=$enableval"
947 AC_ARG_ENABLE(profiling,
948 [--disable-profiling do *not* build profiling features],
949 [case "$enableval" in
954 *) echo "I don't understand this option: --enable-profiling=$enableval"
960 [--enable-ticky build for \`ticky-ticky' profiling (for implementors)],
961 [case "$enableval" in
966 *) echo "I don't understand this option: --enable-ticky=$enableval"
971 AC_ARG_ENABLE(concurrent,
972 [--enable-concurrent turn on \`concurrent Haskell' features],
973 [case "$enableval" in
978 *) echo "I don't understand this option: --enable-concurrent=$enableval"
983 AC_ARG_ENABLE(profiled-concurrent,
984 [--enable-profiled-concurrent turn on profiling for \`concurrent Haskell'],
985 [case "$enableval" in
990 *) echo "I don't understand this option: --enable-profiled-concurrent=$enableval"
995 AC_ARG_ENABLE(ticky-concurrent,
996 [--enable-ticky-concurrent turn on \`ticky-ticky' profiling for \`concurrent Haskell'],
997 [case "$enableval" in
1002 *) echo "I don't understand this option: --enable-ticky-concurrent=$enableval"
1007 AC_ARG_ENABLE(parallel,
1008 [--enable-parallel turn on \`parallel Haskell' features],
1009 [case "$enableval" in
1010 yes) Build_mp='YES';
1014 *) echo "I don't understand this option: --enable-parallel=$enableval"
1019 AC_ARG_ENABLE(gransim,
1020 [--enable-gransim turn on GranSim parallel simulator],
1021 [case "$enableval" in
1022 yes) Build_mg='YES';
1026 *) echo "I don't understand this option: --enable-gransim=$enableval"
1031 AC_ARG_ENABLE(gc-2s,
1032 [--enable-gc-2s a build with the 2-space copying garbage collector],
1033 [case "$enableval" in
1038 *) echo "I don't understand this option: --enable-gc-2s=$enableval"
1043 AC_ARG_ENABLE(gc-1s,
1044 [--enable-gc-1s a build with the 1-space compacting garbage collector],
1045 [case "$enableval" in
1050 *) echo "I don't understand this option: --enable-gc-1s=$enableval"
1055 AC_ARG_ENABLE(gc-du,
1056 [--enable-gc-du a build with \`dual-mode' (1s/2s) garbage collector],
1057 [case "$enableval" in
1062 *) echo "I don't understand this option: --enable-gc-du=$enableval"
1067 AC_ARG_ENABLE(user-way-a,
1068 [--enable-user-way-a build for \`user way a' (mostly for implementors)],
1069 [case "$enableval" in
1074 *) echo "I don't understand this option: --enable-user-way-a=$enableval"
1079 AC_ARG_ENABLE(user-way-b,
1080 [--enable-user-way-b build for \`user way b' (mostly for implementors)],
1081 [case "$enableval" in
1086 *) echo "I don't understand this option: --enable-user-way-b=$enableval"
1091 AC_ARG_ENABLE(user-way-c,
1092 [--enable-user-way-c build for \`user way c' (mostly for implementors)],
1093 [case "$enableval" in
1098 *) echo "I don't understand this option: --enable-user-way-c=$enableval"
1103 AC_ARG_ENABLE(user-way-d,
1104 [--enable-user-way-d build for \`user way d' (mostly for implementors)],
1105 [case "$enableval" in
1110 *) echo "I don't understand this option: --enable-user-way-d=$enableval"
1115 AC_ARG_ENABLE(user-way-e,
1116 [--enable-user-way-e build for \`user way e' (mostly for implementors)],
1117 [case "$enableval" in
1122 *) echo "I don't understand this option: --enable-user-way-e=$enableval"
1127 AC_ARG_ENABLE(user-way-f,
1128 [--enable-user-way-f build for \`user way f' (mostly for implementors)],
1129 [case "$enableval" in
1134 *) echo "I don't understand this option: --enable-user-way-f=$enableval"
1139 AC_ARG_ENABLE(user-way-g,
1140 [--enable-user-way-g build for \`user way g' (mostly for implementors)],
1141 [case "$enableval" in
1146 *) echo "I don't understand this option: --enable-user-way-g=$enableval"
1151 AC_ARG_ENABLE(user-way-h,
1152 [--enable-user-way-h build for \`user way h' (mostly for implementors)],
1153 [case "$enableval" in
1158 *) echo "I don't understand this option: --enable-user-way-h=$enableval"
1163 AC_ARG_ENABLE(user-way-i,
1164 [--enable-user-way-i build for \`user way i' (mostly for implementors)],
1165 [case "$enableval" in
1170 *) echo "I don't understand this option: --enable-user-way-i=$enableval"
1175 AC_ARG_ENABLE(user-way-j,
1176 [--enable-user-way-j build for \`user way j' (mostly for implementors)],
1177 [case "$enableval" in
1182 *) echo "I don't understand this option: --enable-user-way-j=$enableval"
1187 AC_ARG_ENABLE(user-way-k,
1188 [--enable-user-way-k build for \`user way k' (mostly for implementors)],
1189 [case "$enableval" in
1194 *) echo "I don't understand this option: --enable-user-way-k=$enableval"
1199 AC_ARG_ENABLE(user-way-l,
1200 [--enable-user-way-l build for \`user way l' (mostly for implementors)],
1201 [case "$enableval" in
1206 *) echo "I don't understand this option: --enable-user-way-l=$enableval"
1211 AC_ARG_ENABLE(user-way-m,
1212 [--enable-user-way-m build for \`user way m' (mostly for implementors)],
1213 [case "$enableval" in
1218 *) echo "I don't understand this option: --enable-user-way-m=$enableval"
1223 AC_ARG_ENABLE(user-way-n,
1224 [--enable-user-way-n build for \`user way n' (mostly for implementors)],
1225 [case "$enableval" in
1230 *) echo "I don't understand this option: --enable-user-way-n=$enableval"
1235 AC_ARG_ENABLE(user-way-o,
1236 [--enable-user-way-o build for \`user way o' (mostly for implementors)],
1237 [case "$enableval" in
1242 *) echo "I don't understand this option: --enable-user-way-o=$enableval"
1247 AC_ARG_ENABLE(user-way-A,
1248 [--enable-user-way-A build for \`user way A' (mostly for implementors)],
1249 [case "$enableval" in
1254 *) echo "I don't understand this option: --enable-user-way-A=$enableval"
1259 AC_ARG_ENABLE(user-way-B,
1260 [--enable-user-way-B build for \`user way B' (mostly for implementors)],
1261 [case "$enableval" in
1266 *) echo "I don't understand this option: --enable-user-way-B=$enableval"
1271 dnl We do not use AC_SUBST to communicate the Build_* info,
1272 dnl as some seds (notably OSF) only allow 99 commands (!!!).
1273 dnl We will do the equivalent by a HACK further down.
1275 # -------------------------------------------------------------------------
1277 dnl * `GHC' CONFIGURATION STUFF
1279 if test "xxx$DoingGHC" = 'xxxghc' ; then
1282 #---------------------------------------------------------------
1284 dnl ** which Haskell compiler to bootstrap GHC with?
1285 # Figure out what Haskell compiler(s) to use for booting
1287 # first, the defaults...
1288 WithGhcHc='haskell-compiler-unspecified'
1289 WithGhcHcType='HC_UNSPECIFIED'
1290 GhcBuilderVersion='28'
1292 AC_ARG_WITH(hc-for-ghc,
1294 The Haskell compiler for bootstrapping GHC (if any); this option,
1295 if used, overrides --with-hc=<...>:
1297 --with-hc-for-ghc=<Haskell compiler>
1298 ghc* => Glasgow Haskell invoked by the name given
1299 C or c => Don't use a Haskell compiler;
1300 build from intermediate C (.hc) files.
1306 hbc* ) echo "HBC will not compile GHC 0.26 as is (sigh)"
1309 c | C) WithGhcHc='C'
1310 WithGhcHcType='HC_USE_HC_FILES'
1312 *) echo "I don't understand this option: --with-hc-for-ghc=$withval"
1317 # make sure that what they said makes sense.... set WithGhcHcType
1319 haskell-compiler-unspecified ) # maybe they said something earlier...
1320 if test $WithHc = 'haskell-compiler-unspecified' ; then
1321 echo "Neither --with-hc nor --with-hc-for-ghc was properly set"
1324 if test $WithHcType = 'HC_GLASGOW_GHC' ; then
1326 $WithHc -v -C conftest.o > conftest.out 2>&1
1327 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1328 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1333 WithGhcHcType='HC_GLASGOW_GHC'
1334 AC_CHECK_PROG(have_ghc_ghc,$WithGhcHc,$ac_dir/$ac_word)
1335 if test -z "$have_ghc_ghc"; then
1336 echo "Can't find Glasgow Haskell to compile GHC with: $WithGhcHc"
1340 $WithGhcHc -v -C conftest.o > conftest.out 2>&1
1341 echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
1342 GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
1346 c | C) WithGhcHcType='HC_USE_HC_FILES'
1349 AC_SUBST(GhcBuilderVersion)
1351 AC_SUBST(WithGhcHcType)
1353 dnl ** use portable (slow) C? -- preferably not
1354 GhcWithRegisterised='YES'
1355 AC_ARG_ENABLE(portable-C,
1356 [Other things for GHC:
1358 --enable-portable-C use portable C (slow), not \`registerised' (fast)],
1359 [case "$enableval" in
1360 yes) GhcWithRegisterised='NO'
1362 no) GhcWithRegisterised='YES'
1364 *) echo "I don't understand this option: --enable-portable-C=$enableval"
1369 if test $GhcWithRegisterised = 'YES'; then
1370 case $HostPlatform in
1371 alpha-* | hppa1.1-* | i386-* | m68k-* | mips-* | powerpc-* | sparc-* )
1374 echo "Don't know non-portable C tricks for this platform: $HostPlatform"
1375 GhcWithRegisterised='NO'
1379 AC_SUBST(GhcWithRegisterised)
1381 if test $GhcWithRegisterised = 'NO'; then
1386 # ToDo: make sure we can do concurrent for platform/circs...
1387 # ToDo: make sure we can do profiling for platform/circs...
1388 # ToDo: make sure we can do parallel for platform/circs...
1389 # ToDo: make sure we can do gransim for platform/circs...
1391 dnl ** build GHC compiler proper (\`hsc') from .hc files?
1392 GhcWithHscBuiltViaC='NO'
1393 AC_ARG_ENABLE(hsc-built-via-C,
1394 [--enable-hsc-built-via-C build compiler proper (hsc) from intermediate .hc
1395 files (disabled by default)],
1396 [case "$enableval" in
1397 yes) GhcWithHscBuiltViaC='YES'
1399 no) GhcWithHscBuiltViaC='NO'
1401 *) echo "I don't understand this option: --enable-hsc-built-via-C=$enableval"
1406 haskell-compiler-unspecified ) # maybe they said something earlier...
1407 if test $WithHcType = 'HC_USE_HC_FILES' ; then
1408 GhcWithHscBuiltViaC='YES'
1411 c | C) GhcWithHscBuiltViaC='YES'
1415 AC_SUBST(GhcWithHscBuiltViaC)
1417 dnl ** build \`hsc' with -O?
1418 GhcWithHscOptimised='YES'
1419 AC_ARG_ENABLE(hsc-optimised,
1420 [--disable-hsc-optimised don't build compiler proper (hsc) with -O],
1421 [case "$enableval" in
1422 yes) GhcWithHscOptimised='YES'
1424 no) GhcWithHscOptimised='NO'
1426 *) echo "I don't understand this option: --enable-hsc-optimised=$enableval"
1430 AC_SUBST(GhcWithHscOptimised)
1432 dnl ** build \`hsc' with -DDEBUG?
1433 GhcWithHscDebug='NO'
1434 AC_ARG_ENABLE(hsc-debug,
1435 [--enable-hsc-debug build compiler proper (hsc) with -DDEBUG],
1436 [case "$enableval" in
1437 yes) GhcWithHscDebug='YES'
1439 no) GhcWithHscDebug='NO'
1441 *) echo "I don't understand this option: --enable-hsc-debug=$enableval"
1445 AC_SUBST(GhcWithHscDebug)
1447 dnl ** omit native-code generator from \`hsc'?
1448 GhcWithNativeCodeGen='YES'
1449 AC_ARG_ENABLE(native-code-generator,
1450 [--enable-native-code-generator build an n.c.g.
1451 [enabled for supported platforms]],
1452 [case "$enableval" in
1453 yes) GhcWithNativeCodeGen='YES'
1455 no) GhcWithNativeCodeGen='NO'
1457 *) echo "I don't understand this option: --enable-native-code-generator=$enableval"
1461 if test $GhcWithNativeCodeGen = 'YES'; then
1462 case $TargetPlatform in
1463 i386-* | alpha-* | sparc-* )
1466 echo "Don't have a native-code generator for this platform: $TargetPlatform"
1467 GhcWithNativeCodeGen='NO'
1471 AC_SUBST(GhcWithNativeCodeGen)
1473 dnl ** include Marlow's deforester in \`hsc'?
1474 GhcWithDeforester='NO'
1475 AC_ARG_ENABLE(deforester,
1476 [--enable-deforester build deforester into compiler (HACKERS ONLY)],
1477 [case "$enableval" in
1478 yes) GhcWithDeforester='YES'
1480 no) GhcWithDeforester='NO'
1482 *) echo "I don't understand this option: --enable-deforester=$enableval"
1486 AC_SUBST(GhcWithDeforester)
1488 dnl ** include Readline library?
1489 GhcWithReadline='NO'
1490 AC_ARG_ENABLE(readline-library,
1491 [--enable-readline-library include (GNU) readline library in -syslib GHC],
1492 [case "$enableval" in
1493 yes) GhcWithReadline='YES'
1495 no) GhcWithReadline='NO'
1497 *) echo "I don't understand this option: --enable-readline-library=$enableval"
1501 AC_SUBST(GhcWithReadline)
1503 dnl ** include Sockets library?
1505 AC_ARG_ENABLE(sockets-library,
1506 [--enable-sockets-library include the network-interface (sockets) library in -syslib GHC],
1507 [case "$enableval" in
1508 yes) GhcWithSockets='YES'
1510 no) GhcWithSockets='NO'
1512 *) echo "I don't understand this option: --enable-sockets-library=$enableval"
1516 AC_SUBST(GhcWithSockets)
1518 # Here, by HACK means, we dump all the Build_ info
1519 # into a file. See comment above.
1520 rm -f ghc/mkworld/buildinfo.jm
1521 echo creating ghc/mkworld/buildinfo.jm
1522 cat > ghc/mkworld/buildinfo.jm <<EOF
1523 XCOMM ** DO NOT EDIT! **
1524 XCOMM This file is obliterated every time 'configure' is run!
1527 for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
1528 eval "yy=\$Build_$xx"
1529 echo "#ifndef Build_$xx" >> ghc/mkworld/buildinfo.jm
1530 echo "#define Build_$xx $yy" >> ghc/mkworld/buildinfo.jm
1531 echo "#endif" >> ghc/mkworld/buildinfo.jm
1534 # here ends a very big if DoingGHC = 'ghc' ...
1537 # -------------------------------------------------------------------------
1539 dnl * `HsLibs' CONFIGURATION STUFF
1541 if test "xxx$DoingHsLibs" = 'xxxhslibs' ; then
1544 dnl ** which Haskell compiler to use on hslibs?
1545 WithHsLibsHc='haskell-compiler-unspecified'
1546 WithHsLibsHcType='HC_UNSPECIFIED'
1548 AC_ARG_WITH(hc-for-hslibs,
1550 *******************************************************************
1551 ** \`HsLibs' HASKELL LIBRARIES OPTIONS:
1553 The Haskell compiler to compile the Haskell Libraries suite; this
1554 option, if used, overrides --with-hc=<...>:
1556 --with-hc-for-hslibs=<Haskell compiler>
1557 ghc* => Glasgow Haskell invoked by the name given
1558 and you want to use it un-installed ("in-place").],
1561 WithHsLibsHc=$withval
1564 WithHsLibsHc='IN-PLACE'
1566 *) echo "I don't understand this option: --with-hc-for-hslibs=$withval"
1571 # make sure that what they said makes sense.... set WithHsLibsHcType
1572 case $WithHsLibsHc in
1573 haskell-compiler-unspecified ) # maybe they said something earlier...
1574 if test $WithHc = 'haskell-compiler-unspecified' ; then
1575 echo "Neither --with-hc nor --with-hc-for-hslibs was properly set"
1580 WithHsLibsHcType='HC_GLASGOW_GHC'
1581 AC_CHECK_PROG(have_ghc_hslibs,$WithHsLibsHc,$ac_dir/$ac_word)
1582 if test -z "$have_ghc_hslibs"; then
1583 echo "Can't find Glasgow Haskell to compile HsLibs with: $WithHsLibsHc"
1587 IN-PLACE) WithHsLibsHcType='HC_GLASGOW_GHC'
1588 WithHsLibsHc='$(TOP_PWD)/ghc/driver/ghc'
1591 AC_SUBST(WithHsLibsHc)
1592 AC_SUBST(WithHsLibsHcType)
1594 # Here, by HACK means, we dump all the Build_ info
1595 # into a file. See comment above.
1596 rm -f hslibs/mkworld/buildinfo.jm
1597 echo creating hslibs/mkworld/buildinfo.jm
1598 cat > hslibs/mkworld/buildinfo.jm <<EOF
1599 XCOMM ** DO NOT EDIT! **
1600 XCOMM This file is obliterated every time 'configure' is run!
1603 for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
1604 eval "yy=\$Build_$xx"
1605 echo "#ifndef Build_$xx" >> hslibs/mkworld/buildinfo.jm
1606 echo "#define Build_$xx $yy" >> hslibs/mkworld/buildinfo.jm
1607 echo "#endif" >> hslibs/mkworld/buildinfo.jm
1610 # here ends a very big if DoingHsLibs = 'hslibs' ...
1613 # -------------------------------------------------------------------------
1615 dnl * `Happy' CONFIGURATION STUFF
1617 if test "xxx$DoingHappy" = 'xxxhappy' ; then
1620 dnl ** which Haskell compiler to use on happy?
1621 WithHappyHc='haskell-compiler-unspecified'
1622 WithHappyHcType='HC_UNSPECIFIED'
1624 AC_ARG_WITH(hc-for-happy,
1626 *******************************************************************
1627 ** \`Happy' PARSER-GENERATOR OPTIONS:
1629 The Haskell compiler to compile Happy; this option, if used, overrides
1632 --with-hc-for-happy=<Haskell compiler>
1633 ghc* => Glasgow Haskell invoked by the name given
1634 hbc* => Chalmers HBC, invoked by the name given
1635 nhc* => Niklas Rojemo's "nhc", invoked by the name given
1636 in-place => Use ghc/driver/ghc; i.e. you've built GHC
1637 and you want to use it un-installed ("in-place").],
1640 WithHappyHc=$withval
1642 hbc* ) WithHappyHc=$withval
1644 nhc* ) WithHappyHc=$withval
1647 WithHappyHc='IN-PLACE'
1649 *) echo "I don't understand this option: --with-hc-for-happy=$withval"
1654 # make sure that what they said makes sense.... set WithHappyHcType
1655 case $WithHappyHc in
1656 haskell-compiler-unspecified ) # maybe they said something earlier...
1657 if test $WithHc = 'haskell-compiler-unspecified' ; then
1658 echo "Neither --with-hc nor --with-hc-for-happy was properly set"
1663 WithHappyHcType='HC_GLASGOW_GHC'
1664 AC_CHECK_PROG(have_ghc_happy,$WithHappyHc,$ac_dir/$ac_word)
1665 if test -z "$have_ghc_happy"; then
1666 echo "Can't find Glasgow Haskell to compile Happy with: $WithHappyHc"
1670 hbc* ) # Look for the dastardly competition
1671 WithHappyHcType='HC_CHALMERS_HBC'
1672 AC_CHECK_PROG(have_hbc,$WithHappyHc,YES,NO)
1673 if test $have_hbc = 'NO' ; then
1674 echo "Can't find Chalmers HBC to compile with: $WithHappyHc"
1678 nhc* ) # Look for Niklas Rojemo's "nhc"
1679 WithHappyHcType='HC_ROJEMO_NHC'
1680 AC_CHECK_PROG(have_nhc,$WithHappyHc,YES,NO)
1681 if test $have_nhc = 'NO' ; then
1682 echo "Can't find Niklas Rojemo's NHC to compile with: $WithHappyHc"
1686 IN-PLACE) WithHappyHcType='HC_GLASGOW_GHC'
1687 WithHappyHc='$(TOP_PWD)/ghc/driver/ghc'
1690 AC_SUBST(WithHappyHc)
1691 AC_SUBST(WithHappyHcType)
1693 # here ends a very big if DoingHappy = 'happy' ...
1696 # -------------------------------------------------------------------------
1698 dnl * `Haggis' CONFIGURATION STUFF
1700 if test "xxx$DoingHaggis" = 'xxxhaggis' ; then
1703 dnl ** which Haskell compiler to use on haggis?
1704 WithHaggisHc='haskell-compiler-unspecified'
1705 WithHaggisHcType='HC_UNSPECIFIED'
1707 AC_ARG_WITH(hc-for-haggis,
1709 *******************************************************************
1710 ** \`Haggis' HASKELL GUI TOOLKIT OPTIONS:
1712 The Haskell compiler to compile the Haggis toolkit; this option, if
1713 used, overrides --with-hc=<...>:
1715 --with-hc-for-haggis=<Haskell compiler>
1716 ghc* => Glasgow Haskell invoked by the name given
1717 and you want to use it un-installed ("in-place").],
1720 WithHaggisHc=$withval
1723 WithHaggicHs='IN-PLACE'
1725 *) echo "I don't understand this option: --with-hc-for-haggis=$withval"
1730 # make sure that what they said makes sense.... set WithHaggisHcType
1731 case $WithHaggisHc in
1732 haskell-compiler-unspecified ) # maybe they said something earlier...
1733 if test $WithHc = 'haskell-compiler-unspecified' ; then
1734 echo "Neither --with-hc nor --with-hc-for-haggis was properly set"
1739 WithHaggisHcType='HC_GLASGOW_GHC'
1740 AC_CHECK_PROG(have_ghc_haggis,$WithHaggisHc,$ac_dir/$ac_word)
1741 if test -z "$have_ghc_haggis"; then
1742 echo "Can't find Glasgow Haskell to compile Haggis with: $WithHaggisHc"
1746 IN-PLACE) WithHaggisHcType='HC_GLASGOW_GHC'
1747 WithHaggisHc='$(TOP_PWD)/ghc/driver/ghc'
1750 AC_SUBST(WithHaggisHc)
1751 AC_SUBST(WithHaggisHcType)
1753 # builds stuff?? ToDo
1755 # here ends a very big if DoingHaggis = 'haggis' ...
1758 # -------------------------------------------------------------------------
1760 dnl * `Literate' CONFIGURATION STUFF
1762 dnl if test "xxx$DoingLiterate" = 'xxxliterate' ; then
1763 dnl # a very big "if"!
1765 dnl # here ends a very big if DoingLiterate = 'literate' ...
1768 # -------------------------------------------------------------------------
1770 dnl * `NoFib' CONFIGURATION STUFF
1772 if test "xxx$DoingNoFib" = 'xxxnofib' ; then
1775 dnl ** which Haskell compiler to test with NoFib?
1776 WithNoFibHc='haskell-compiler-unspecified'
1777 WithNoFibHcType='HC_UNSPECIFIED'
1779 AC_ARG_WITH(hc-for-nofib,
1781 *******************************************************************
1782 ** NoFib HASKELL BENCHMARK SUITE OPTIONS:
1784 The Haskell compiler to compile the NoFib programs; this option, if
1785 used, overrides --with-hc=<...>:
1787 --with-hc-for-nofib=<Haskell compiler>
1788 ghc* => Glasgow Haskell invoked by the name given
1789 hbc* => Chalmers HBC, invoked by the name given
1790 nhc* => Niklas Rojemo's "nhc", invoked by the name given
1791 in-place => Use ghc/driver/ghc; i.e. you've built GHC
1792 and you want to use it un-installed ("in-place").
1796 WithNoFibHc=$withval
1798 hbc* ) WithNoFibHc=$withval
1800 nhc* ) WithNoFibHc=$withval
1803 WithNoFibHc='IN-PLACE'
1805 *) echo "I don't understand this option: --with-hc-for-nofib=$withval"
1810 # make sure that what they said makes sense.... set WithHappyHcType
1811 case $WithNoFibHc in
1812 haskell-compiler-unspecified ) # maybe they said something earlier...
1813 if test $WithHc = 'haskell-compiler-unspecified' ; then
1814 echo "Neither --with-hc nor --with-hc-for-nofib was properly set"
1819 WithNoFibHcType='HC_GLASGOW_GHC'
1820 AC_CHECK_PROG(have_ghc_nofib,$WithNoFibHc,$ac_dir/$ac_word)
1821 if test -z "$have_ghc_nofib"; then
1822 echo "Can't find Glasgow Haskell to compile NoFib with: $WithNoFibHc"
1826 hbc* ) # Look for the dastardly competition
1827 WithNoFibHcType='HC_CHALMERS_HBC'
1828 AC_CHECK_PROG(have_hbc,$WithNoFibHc,YES,NO)
1829 if test $have_hbc = 'NO' ; then
1830 echo "Can't find Chalmers HBC to compile NoFib with: $WithNoFibHc"
1834 nhc* ) # Look for Niklas Rojemo's "nhc"
1835 WithNoFibHcType='HC_ROJEMO_NHC'
1836 AC_CHECK_PROG(have_nhc,$WithNoFibHc,YES,NO)
1837 if test $have_nhc = 'NO' ; then
1838 echo "Can't find Niklas Rojemo's NHC to compile NoFib with: $WithNoFibHc"
1842 IN-PLACE) WithNoFibHcType='HC_GLASGOW_GHC'
1843 WithNoFibHc='$(TOP_PWD)/ghc/driver/ghc'
1846 AC_SUBST(WithNoFibHc)
1847 AC_SUBST(WithNoFibHcType)
1849 dnl ** what mkworld \`setup' should be used?
1852 --with-setup=<setup> : What mkworld \`setup' should be used?
1853 Choices: ghc, hbc, nhc
1856 ghc ) MkWorldSetup='ghc'
1858 hbc ) MkWorldSetup='hbc'
1860 nhc ) MkWorldSetup='nhc'
1862 *) echo "I don't understand this option: --with-setup=$withval"
1867 if test $MkWorldSetup = 'std' ; then
1868 echo 'You must do --with-setup=... (one of: ghc, hbc, or nhc) for NoFib'
1872 # ---------------------------------------
1873 # What sets of tests should be run.
1875 IncludeRealNoFibTests='YES' # defaults
1876 IncludeSpectralNoFibTests='YES'
1877 IncludeImaginaryNoFibTests='YES'
1878 IncludeSpecialiseNoFibTests='NO'
1879 IncludeGHC_ONLYNoFibTests='NO'
1880 IncludePRIVATENoFibTests='NO'
1881 IncludeParallelNoFibTests='NO'
1883 dnl ** should *all* NoFib tests be run?
1884 # special catch-all variant
1885 AC_ARG_ENABLE(all-tests,
1886 [Possibly turn on *all* of the possible tests (a sane choice
1889 --enable-all-tests do *all* tests],
1890 [case "$enableval" in
1891 yes) IncludeGHC_ONLYNoFibTests='YES'
1892 IncludeSpecialiseNoFibTests='YES'
1893 IncludePRIVATENoFibTests='YES'
1894 IncludeParallelNoFibTests='YES'
1896 no) IncludeGHC_ONLYNoFibTests='NO'
1897 IncludeSpecialiseNoFibTests='NO'
1898 IncludePRIVATENoFibTests='NO'
1899 IncludeParallelNoFibTests='NO'
1901 IncludeRealNoFibTests='NO'
1902 IncludeSpectralNoFibTests='NO'
1903 IncludeImaginaryNoFibTests='NO'
1905 *) echo "I don't understand this option: --enable-all-tests=$enableval"
1910 dnl ** turn on/off individual categories of tests...
1911 # individual categories
1912 AC_ARG_ENABLE(imaginary-tests,
1914 Enable/disable individual categories of tests:
1916 --disable-imaginary-tests do *not* include imaginary tests],
1917 [case "$enableval" in
1918 yes) IncludeImaginaryNoFibTests='YES'
1920 no) IncludeImaginaryNoFibTests='NO'
1922 *) echo "I don't understand this option: --enable-imaginary-tests=$enableval"
1927 AC_ARG_ENABLE(spectral-tests,
1928 [--disable-spectral-tests do *not* include spectral tests],
1929 [case "$enableval" in
1930 yes) IncludeSpectralNoFibTests='YES'
1932 no) IncludeSpectralNoFibTests='NO'
1934 *) echo "I don't understand this option: --enable-spectral-tests=$enableval"
1939 AC_ARG_ENABLE(real-tests,
1940 [--disable-real-tests do *not* include real tests],
1941 [case "$enableval" in
1942 yes) IncludeRealNoFibTests='YES'
1944 no) IncludeRealNoFibTests='NO'
1946 *) echo "I don't understand this option: --enable-real-tests=$enableval"
1951 AC_ARG_ENABLE(GHC-ONLY-tests,
1952 [--enable-GHC-ONLY-tests include GHC_ONLY tests],
1953 [case "$enableval" in
1954 yes) IncludeGHC_ONLYNoFibTests='YES'
1956 no) IncludeGHC_ONLYNoFibTests='NO'
1958 *) echo "I don't understand this option: --enable-GHC-ONLY-tests=$enableval"
1963 AC_ARG_ENABLE(specialise-tests,
1964 [--enable-specialise-tests include specialisation tests],
1965 [case "$enableval" in
1966 yes) IncludeSpecialiseNoFibTests='YES'
1968 no) IncludeSpecialiseNoFibTests='NO'
1970 *) echo "I don't understand this option: --enable-specialise-tests=$enableval"
1975 AC_ARG_ENABLE(PRIVATE-tests,
1976 [--enable-PRIVATE-tests include PRIVATE tests],
1977 [case "$enableval" in
1978 yes) IncludePRIVATENoFibTests='YES'
1980 no) IncludePRIVATENoFibTests='NO'
1982 *) echo "I don't understand this option: --enable-PRIVATE-tests=$enableval"
1987 AC_ARG_ENABLE(parallel-tests,
1988 [--enable-parallel-tests include parallel tests
1990 [case "$enableval" in
1991 yes) IncludeParallelNoFibTests='YES'
1993 no) IncludeParallelNoFibTests='NO'
1995 *) echo "I don't understand this option: --enable-parallel-tests=$enableval"
2000 dnl not AC_SUBSTd because of 99-command seds (sigh)
2001 dnl (See what follows instead)
2002 dnl AC_SUBST(IncludeRealNoFibTests)
2003 dnl AC_SUBST(IncludeSpectralNoFibTests)
2004 dnl AC_SUBST(IncludeImaginaryNoFibTests)
2005 dnl AC_SUBST(IncludeGHC_ONLYNoFibTests)
2006 dnl AC_SUBST(IncludeSpecialiseNoFibTests)
2007 dnl AC_SUBST(IncludePRIVATENoFibTests)
2008 dnl AC_SUBST(IncludeParallelNoFibTests)
2010 # Here, by HACK means, we dump all the Include*NoFibTests info
2011 # into a file. See comment above.
2012 rm -f nofib/mkworld/buildinfo.jm
2013 echo creating nofib/mkworld/buildinfo.jm
2014 cat > nofib/mkworld/buildinfo.jm <<EOF
2015 XCOMM ** DO NOT EDIT! **
2016 XCOMM This file is obliterated every time 'configure' is run!
2019 for xx in Real Spectral Imaginary GHC_ONLY Specialise PRIVATE Parallel ; do
2020 eval "yy=\$Include${xx}NoFibTests"
2021 echo "#ifndef Include${xx}NoFibTests" >> nofib/mkworld/buildinfo.jm
2022 echo "#define Include${xx}NoFibTests $yy" >> nofib/mkworld/buildinfo.jm
2023 echo "#endif" >> nofib/mkworld/buildinfo.jm
2026 # Here, by HACK means, we add all the Build_ info
2027 # into a file. See comment above.
2029 for xx in normal p t u mc mr mt mp mg 2s 1s du a b c d e f g h i j k l m n o A B ; do
2030 eval "yy=\$Build_$xx"
2031 echo "#ifndef Build_$xx" >> nofib/mkworld/buildinfo.jm
2032 echo "#define Build_$xx $yy" >> nofib/mkworld/buildinfo.jm
2033 echo "#endif" >> nofib/mkworld/buildinfo.jm
2036 # here ends a very big if DoingNoFib = 'nofib' ...
2039 # -------------------------------------------------------------------------
2041 dnl * extract non-header files with substitution (end)
2043 AC_SUBST(MkWorldSetup)
2045 AC_OUTPUT(Makefile STARTUP mkworld/site.jm mkworld/platform.h mkworld/config.h $ghc_mkworld_site_ghc_jm $ghc_includes_platform_h $hslibs_mkworld_site_hslibs_jm $nofib_mkworld_site_nofib_jm)
2047 echo '************************************************'
2048 echo '*** NOW DO: sh < STARTUP'
2049 echo '************************************************'