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-1997
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 # First off, a distrib sanity check..
16 AC_INIT(mk/config.mk.in)
18 # -------------------------------------------------------------------------
19 # Prepare to generate the following header files
22 AC_CONFIG_HEADER(mk/config.h)
24 # No, we don't do `--srcdir'...
25 if test x"$srcdir" != 'x.' ; then
26 echo "This configuration does not support the \`--srcdir' option.."
31 # Remove some automounter nonsense (Glasgow specific gruff)
34 hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|' | sed 's|^/grasp_tmp|/local/grasp_tmp|'`
37 echo "*** The top of your build tree is: $hardtop"
40 ####--------------------------------------------------------------------
41 dnl ** choose host(/target/build) platform
43 # Guess host/target/build platform(s) if necessary.
47 # "$host" defaults to "$target"
48 if test "x$host" = xNONE ; then
51 # "$build" defaults to "$host"
52 #if test "x$build" = xNONE ; then
55 # echo "This configuration does not support the \`--build' option."
59 dnl ** canonicalize platform names
60 # Canonicali[sz]e those babies
61 BuildPlatform=`/bin/sh $srcdir/config.sub $build` || exit 1
62 HostPlatform=`/bin/sh $srcdir/config.sub $host` || exit 1
63 TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1
65 if test x"$TargetPlatform" != x"$HostPlatform" ; then
66 echo "GHC configuration does not support differing host/target (i.e., cross-compiling)"
72 # The following will be more difficult when we *are* cross-compiling.
73 # Suitable names to slam in *_CPP are in platform.h.in.
74 # We also record the architecture, vendor, and operating system (OS)
78 HostPlatform=alpha-dec-osf1 # canonicalise for our purposes
79 TargetPlatform=alpha-dec-osf1 # this will work for now... (hack)
80 BuildPlatform=alpha-dec-osf1 # hack
81 HostPlatform_CPP='alpha_dec_osf1'
87 HostPlatform=alpha-dec-osf3 # canonicalise for our purposes
88 TargetPlatform=alpha-dec-osf3 # this will work for now... (hack)
89 BuildPlatform=alpha-dec-osf3 # hack
90 HostPlatform_CPP='alpha_dec_osf3'
96 HostPlatform=hppa1.1-hp-hpux # canonicalise for our purposes (hack)
97 TargetPlatform=hppa1.1-hp-hpux
98 BuildPlatform=hppa1.1-hp-hpux
99 HostPlatform_CPP='hppa1_1_hp_hpux'
100 HostArch_CPP='hppa1_1'
104 i[[3456]]86-*-linuxaout*)
105 HostPlatform=i386-unknown-linuxaout # hack again
106 TargetPlatform=i386-unknown-linuxaout
107 BuildPlatform=i386-unknown-linuxaout
108 HostPlatform_CPP='i386_unknown_linuxaout'
110 HostVendor_CPP='unknown'
111 HostOS_CPP='linuxaout'
113 i[[3456]]86-*-linux*)
114 HostPlatform=i386-unknown-linux # hack again
115 TargetPlatform=i386-unknown-linux
116 BuildPlatform=i386-unknown-linux
117 HostPlatform_CPP='i386_unknown_linux'
119 HostVendor_CPP='unknown'
122 i[[3456]]86-*-freebsd*)
123 HostPlatform=i386-unknown-freebsd # hack again
124 TargetPlatform=i386-unknown-freebsd
125 BuildPlatform=i386-unknown-freebsd
126 HostPlatform_CPP='i386_unknown_freebsd'
128 HostVendor_CPP='unknown'
131 i[[3456]]86-*-netbsd*)
132 HostPlatform=i386-unknown-netbsd # hack again
133 TargetPlatform=i386-unknown-netbsd
134 BuildPlatform=i386-unknown-netbsd
135 HostPlatform_CPP='i386_unknown_netbsd'
137 HostVendor_CPP='unknown'
140 i[[3456]]86-*-solaris2*)
141 HostPlatform=i386-unknown-solaris2 # hack again
142 TargetPlatform=i386-unknown-solaris2
143 BuildPlatform=i386-unknown-solaris2
144 HostPlatform_CPP='i386_unknown_solaris2'
146 HostVendor_CPP='unknown'
147 HostOS_CPP='solaris2'
149 i[[3456]]86-*-cygwin32*)
150 HostPlatform=i386-unknown-cygwin32 # hack again
151 TargetPlatform=i386-unknown-cygwin32
152 BuildPlatform=i386-unknown-cygwin32
153 HostPlatform_CPP='i386_unknown_cygwin32'
155 HostVendor_CPP='unknown'
156 HostOS_CPP='cygwin32'
160 HostPlatform_CPP='m68k_next_nextstep2'
162 HostVendor_CPP='next'
163 HostOS_CPP='nextstep2'
166 HostPlatform_CPP='m68k_next_nextstep3'
168 HostVendor_CPP='next'
169 HostOS_CPP='nextstep3'
171 i[[3456]]86-next-nextstep3)
172 HostPlatform=i386-next-nextstep3 # hack again
173 TargetPlatform=i386-next-nextstep3
174 BuildPlatform=i386-next-nextstep3
175 HostPlatform_CPP='i386_next_nextstep3'
177 HostVendor_CPP='next'
178 HostOS_CPP='nextstep3'
181 HostPlatform=m68k-sun-sunos4
182 TargetPlatform=m68k-sun-sunos4 #hack
183 BuildPlatform=m68k-sun-sunos4 #hack
184 HostPlatform_CPP='m68k_sun_sunos4'
190 HostPlatform_CPP='mips_dec_ultrix'
191 HostArch_CPP='mipsel' # NB a little different
196 HostPlatform=mips-sgi-irix
197 TargetPlatform=mips-sgi-irix #hack
198 BuildPlatform=mips-sgi-irix #hack
199 HostPlatform_CPP='mips_sgi_irix'
200 HostArch_CPP='mipseb' # NB a little different
205 HostPlatform=rs6000-ibm-aix
206 TargetPlatform=rs6000-ibm-aix #hack
207 BuildPlatform=rs6000-ibm-aix #hack
208 HostPlatform_CPP='rs6000_ibm_aix'
209 HostArch_CPP='rs6000'
214 HostPlatform=powerpc-ibm-aix
215 TargetPlatform=powerpc-ibm-aix #hack
216 BuildPlatform=powerpc-ibm-aix #hack
217 HostPlatform_CPP='powerpc_ibm_aix'
218 HostArch_CPP='powerpc'
223 HostPlatform=sparc-sun-sunos4
224 TargetPlatform=sparc-sun-sunos4 #hack
225 BuildPlatform=sparc-sun-sunos4 #hack
226 HostPlatform_CPP='sparc_sun_sunos4'
232 HostPlatform=sparc-sun-solaris2
233 TargetPlatform=sparc-sun-solaris2 #hack
234 BuildPlatform=sparc-sun-solaris2 #hack
235 HostPlatform_CPP='sparc_sun_solaris2'
238 HostOS_CPP='solaris2'
241 echo "Unrecognised platform: $HostPlatform"
245 echo "Canonicalised to: $HostPlatform"
246 test x"$HostPlatform" != x"$TargetPlatform" && echo "Target platform set to $TargetPlatform"
247 test x"$BuildPlatform" != x"$HostPlatform" && echo "Build platform set to $BuildPlatform"
249 BuildPlatform_CPP=$HostPlatform_CPP
250 TargetPlatform_CPP=$HostPlatform_CPP
251 BuildArch_CPP=$HostArch_CPP
252 TargetArch_CPP=$HostArch_CPP
253 BuildOS_CPP=$HostOS_CPP
255 TargetOS_CPP=$HostOS_CPP
256 BuildVendor_CPP=$HostVendor_CPP
257 TargetVendor_CPP=$HostVendor_CPP
259 dnl Cannot afford all these SUBSTs (because of braindead seds w/ 99 cmd limits)
260 dnl AC_SUBST(BuildPlatform)
262 AC_SUBST(HostPlatform)
263 AC_SUBST(TargetPlatform)
264 AC_SUBST(HostPlatform_CPP)
265 dnl AC_SUBST(BuildPlatform_CPP)
266 dnl AC_SUBST(TargetPlatform_CPP)
268 AC_SUBST(HostArch_CPP)
269 dnl AC_SUBST(BuildArch_CPP)
270 dnl AC_SUBST(TargetArch_CPP)
273 AC_SUBST(HostOS_Full)
274 dnl AC_SUBST(BuildOS_CPP)
275 dnl AC_SUBST(TargetOS_CPP)
277 AC_SUBST(HostVendor_CPP)
278 dnl AC_SUBST(BuildVendor_CPP)
279 dnl AC_SUBST(TargetVendor_CPP)
283 # -------------------------------------------------------------------------
285 dnl * _GENERAL_ CONFIGURATION CHECKS
293 dnl ** look for `perl', but watch out for version 4.035
295 AC_PATH_PROG(PerlCmd,perl)
296 if test -z "$PerlCmd"; then
297 echo "You must install perl before you can continue"
298 echo "Perhaps it is already installed, but not in your PATH?"
301 AC_CHECK_PERL_VERSION
305 dnl ** does #!.../perl work? (sometimes it's too long...)
309 # Remove: we work around the problem in the single place
310 # where we rely on something (getopts) from the libraries.
312 #dnl ** check if perl library is properly installed
314 # (by seeing if a "do 'getopts.pl'" works...
315 #if $PerlCmd -e 'do "getopts.pl" || exit(1); exit(0);' > /dev/null 2>&1 ; then
318 # echo "I think your perl library is misinstalled:"
319 # echo "The following script did not work:"
320 # echo ' do "getopts.pl" || exit(1); exit(0);'
321 # echo 'But, anyway, we will continue in our quest..'
326 dnl ** look for GCC and find out which version
327 # Figure out which C compiler to use. Gcc is preferred.
328 # If gcc, make sure it's at least 2.1
334 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
340 dnl ** figure out how to do context diffs
345 dnl ** look for a decent parser generator (bison preferred)
347 # (AC_PROG_YACCY is AC_PROG_YACC, but with some extra testing
348 # on the suitability of the 'yacc' returned.)
352 dnl ** Find lex command (lex or flex) and library (-ll or -lfl)
357 dnl ** figure out how to do a BSD-ish install
361 dnl ** how to invoke `ar' and `ranlib'
363 AC_PROG_AR_AND_RANLIB
367 dnl ** Check to see whether ln -s works
372 dnl ** Find the path to sed **
374 AC_PATH_PROG(SedCmd,sed)
377 dnl ** check for time command **
378 AC_PATH_PROG(TimeCmd,time)
381 dnl ** check for tar **
383 # if GNU tar is named gtar, look for it first.
385 AC_PATH_PROGS(TarCmd,gtar tar,tar)
388 dnl ** check for gzip/compress **
389 AC_PATH_PROGS(CompressCmd,gzip compress,gzip)
391 compress_nm=`basename $CompressCmd`
392 if test x"$compress_nm" = xgzip; then
393 CompressCmd="$CompressCmd -d"
398 AC_SUBST(CompressCmd)
399 AC_SUBST(CompressSuffix)
402 dnl ** check for installed happy binary + version
406 if test x"$HappyCmd" != x; then
407 if expr $HappyVersion \< "1.3" >/dev/null; then
408 echo " Happy Version 1.3 or later is required to compile GHC."
409 echo " Using the Happy sources in the tree.";
416 dnl ** check for installed lx binary
418 AC_PATH_PROG(LxCmd,lx)
421 dnl ** check for installed green-card binary
423 AC_PATH_PROG(GreencardCmd,green-card)
425 #### program checking section ends here ####
427 ####--------------------------------------------------
428 #### checking the state of the local header files and syscalls ####
431 dnl ** check for full ANSI header (.h) files
436 dnl ** check for specific header (.h) files that we are interested in
438 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 readline/readline.h )
441 dnl ** check if it is safe to include both <time.h> and <sys/time.h>
445 dnl ** how do we get a timezone name, and UTC offset ?
450 dnl what's the type of timezone?
454 dnl do we have altzone?
458 dnl ** check for specific library functions that we are interested in
460 AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect setitimer stat sysconf timelocal times vadvise vfork)
465 dnl ** can we get alloca?
467 dnl ** determine whether or not const works
469 dnl ** determine the type of signal()
473 dnl ** check for leading underscores in symbol names
477 AC_OUTPUT(mk/config.mk, echo timestamp > mk/stamp-h )
480 echo '************************************************'
481 echo '*** NOW DO: gmake boot followed by gmake all'
482 echo '*** (where gmake == GNU make)'
483 echo '************************************************'