[project @ 1999-01-26 09:59:18 by sof]
[ghc-hetmet.git] / configure.in
1 dnl == autoconf source for the Glasgow FP tools ==
2 dnl (run "grep '^dnl \*' configure.in | sed -e 's/dnl / /g; s/\*\*/   +/g;'"
3 dnl  (or some such) to see the outline of this file)
4 dnl
5 #
6 # (c) The AQUA Project, Glasgow University, 1994-1998
7 #
8 # Configure script template for the Glasgow functional programming tools
9 #
10 # Process with 'autoconf' to get a working configure script.
11 #
12 # For the generated configure script, do "./configure --help" to
13 # see what flags are available. (Better yet, read the documentation!)
14 #
15
16 # First off, a distrib sanity check..
17 AC_INIT(mk/config.mk.in)
18
19 # -------------------------------------------------------------------------
20 # Prepare to generate the following header files
21 #
22 #
23 AC_CONFIG_HEADER(mk/config.h)
24
25 # No, semi-sadly, we don't do `--srcdir'...
26 if test x"$srcdir" != 'x.' ; then
27     echo "This configuration does not support the \`--srcdir' option.."
28     exit 1
29 fi
30
31 #
32 # Remove common automounter nonsense + convert from UNC to DOS style paths
33 # (UNC awareness isn't quite there yet for cygwin32-beta18 and consituent tools.)
34 #
35 hardtop=`pwd`
36 hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|' | sed 's|^/grasp_tmp|/local/grasp_tmp|' | sed 's|^//\(.\)/|\1:/|' `
37
38 echo ''
39 echo "*** The top of your build tree is: $hardtop"
40 AC_SUBST(hardtop)
41
42 dnl--------------------------------------------------------------------
43 dnl * Choose host(/target/build) platform
44 dnl--------------------------------------------------------------------
45
46 dnl Guess host/target/build platform(s) if necessary.
47 AC_CANONICAL_SYSTEM
48
49 # "$host" defaults to "$target"
50 if test "x$host" = xNONE ; then
51     host=$target
52 fi
53
54 dnl ** canonicalize platform names
55 BuildPlatform=`/bin/sh $srcdir/config.sub $build` || exit 1
56 HostPlatform=`/bin/sh $srcdir/config.sub $host` || exit 1
57 TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1
58
59 if test x"$TargetPlatform" != x"$HostPlatform" ; then
60     echo "GHC configuration does not support differing host/target (i.e., cross-compiling)"
61     exit 1
62 fi
63
64 exeext=''
65 #
66 # The following will be more difficult when we *are* cross-compiling.
67 # Suitable names to slam in *_CPP are in platform.h.in.
68 # We also record the architecture, vendor, and operating system (OS)
69 # separately.
70 case $HostPlatform in
71 alpha-dec-osf[[12]]*)
72         HostPlatform=alpha-dec-osf1   # canonicalise for our purposes
73         TargetPlatform=alpha-dec-osf1 # this will work for now... (hack)
74         BuildPlatform=alpha-dec-osf1  # hack
75         HostPlatform_CPP='alpha_dec_osf1'
76         HostArch_CPP='alpha'
77         HostVendor_CPP='dec'
78         HostOS_CPP='osf1'
79         ;;
80 alpha-dec-osf[[34]]*)
81         HostPlatform=alpha-dec-osf3   # canonicalise for our purposes
82         TargetPlatform=alpha-dec-osf3 # this will work for now... (hack)
83         BuildPlatform=alpha-dec-osf3  # hack
84         HostPlatform_CPP='alpha_dec_osf3'
85         HostArch_CPP='alpha'
86         HostVendor_CPP='dec'
87         HostOS_CPP='osf3'
88         ;;
89 hppa1.1-hp-hpux*)
90         HostPlatform=hppa1.1-hp-hpux  # canonicalise for our purposes (hack)
91         TargetPlatform=hppa1.1-hp-hpux
92         BuildPlatform=hppa1.1-hp-hpux
93         HostPlatform_CPP='hppa1_1_hp_hpux'
94         HostArch_CPP='hppa1_1'
95         HostVendor_CPP='hp'
96         HostOS_CPP='hpux'
97         ;;
98 i[[3456]]86-*-linuxaout*)
99         HostPlatform=i386-unknown-linuxaout   # hack again
100         TargetPlatform=i386-unknown-linuxaout
101         BuildPlatform=i386-unknown-linuxaout
102         HostPlatform_CPP='i386_unknown_linuxaout'
103         HostArch_CPP='i386'
104         HostVendor_CPP='unknown'
105         HostOS_CPP='linuxaout'
106         ;;
107 i[[3456]]86-*-linux*)
108         HostPlatform=i386-unknown-linux # hack again
109         TargetPlatform=i386-unknown-linux
110         BuildPlatform=i386-unknown-linux
111         HostPlatform_CPP='i386_unknown_linux'
112         HostArch_CPP='i386'
113         HostVendor_CPP='unknown'
114         HostOS_CPP='linux'
115         ;;
116 i[[3456]]86-*-freebsd3*) # FreeBSD 3.0+ uses ELF
117         HostPlatform=i386-unknown-freebsd3 # hack again
118         TargetPlatform=i386-unknown-freebsd3
119         BuildPlatform=i386-unknown-freebsd3
120         HostPlatform_CPP='i386_unknown_freebsd3'
121         HostArch_CPP='i386'
122         HostVendor_CPP='unknown'
123         HostOS_CPP='freebsd3'
124         ;;
125 i[[3456]]86-*-freebsd2*) # Older FreeBSDs are a.out
126         HostPlatform=i386-unknown-freebsd2 # hack again
127         TargetPlatform=i386-unknown-freebsd2
128         BuildPlatform=i386-unknown-freebsd2
129         HostPlatform_CPP='i386_unknown_freebsd2'
130         HostArch_CPP='i386'
131         HostVendor_CPP='unknown'
132         HostOS_CPP='freebsd2'
133         ;;
134 i[[3456]]86-*-netbsd*)
135         HostPlatform=i386-unknown-netbsd # hack again
136         TargetPlatform=i386-unknown-netbsd
137         BuildPlatform=i386-unknown-netbsd
138         HostPlatform_CPP='i386_unknown_netbsd'
139         HostArch_CPP='i386'
140         HostVendor_CPP='unknown'
141         HostOS_CPP='netbsd'
142         ;;
143 i[[3456]]86-*-solaris2*)
144         HostPlatform=i386-unknown-solaris2 # hack again
145         TargetPlatform=i386-unknown-solaris2
146         BuildPlatform=i386-unknown-solaris2
147         HostPlatform_CPP='i386_unknown_solaris2'
148         HostArch_CPP='i386'
149         HostVendor_CPP='unknown'
150         HostOS_CPP='solaris2'
151         ;;
152 i[[3456]]86-*-cygwin32*)
153         HostPlatform=i386-unknown-cygwin32 # hack again
154         TargetPlatform=i386-unknown-cygwin32
155         BuildPlatform=i386-unknown-cygwin32
156         HostPlatform_CPP='i386_unknown_cygwin32'
157         HostArch_CPP='i386'
158         HostVendor_CPP='unknown'
159         HostOS_CPP='cygwin32'
160         exeext='.exe'
161         ;;
162 i[[3456]]86-*-mingw32*)
163         HostPlatform=i386-unknown-mingw32 # hack again
164         TargetPlatform=i386-unknown-mingw32
165         BuildPlatform=i386-unknown-mingw32
166         HostPlatform_CPP='i386_unknown_mingw32'
167         HostArch_CPP='i386'
168         HostVendor_CPP='unknown'
169         HostOS_CPP='mingw32'
170         exeext='.exe'
171         ;;
172 m68k-next-nextstep2)
173         HostPlatform_CPP='m68k_next_nextstep2'
174         HostArch_CPP='m68k'
175         HostVendor_CPP='next'
176         HostOS_CPP='nextstep2'
177         ;;
178 m68k-next-nextstep3)
179         HostPlatform_CPP='m68k_next_nextstep3'
180         HostArch_CPP='m68k'
181         HostVendor_CPP='next'
182         HostOS_CPP='nextstep3'
183         ;;
184 i[[3456]]86-next-nextstep3)
185         HostPlatform=i386-next-nextstep3 # hack again
186         TargetPlatform=i386-next-nextstep3
187         BuildPlatform=i386-next-nextstep3
188         HostPlatform_CPP='i386_next_nextstep3'
189         HostArch_CPP='i386'
190         HostVendor_CPP='next'
191         HostOS_CPP='nextstep3'
192         ;;
193 m68k-sun-sunos4*)
194         HostPlatform=m68k-sun-sunos4
195         TargetPlatform=m68k-sun-sunos4 #hack
196         BuildPlatform=m68k-sun-sunos4 #hack
197         HostPlatform_CPP='m68k_sun_sunos4'
198         HostArch_CPP='m68k'
199         HostVendor_CPP='sun'
200         HostOS_CPP='sunos4'
201         ;;
202 mips-dec-ultrix*)
203         HostPlatform_CPP='mips_dec_ultrix'
204         HostArch_CPP='mipsel'   # NB a little different
205         HostVendor_CPP='dec'
206         HostOS_CPP='ultrix'
207         ;;
208 mips-sgi-irix*)
209         HostPlatform=mips-sgi-irix
210         TargetPlatform=mips-sgi-irix #hack
211         BuildPlatform=mips-sgi-irix #hack
212         HostPlatform_CPP='mips_sgi_irix'
213         HostArch_CPP='mipseb'   # NB a little different
214         HostVendor_CPP='sgi'
215         HostOS_CPP='irix'
216         ;;
217 rs6000-ibm-aix*)
218         HostPlatform=rs6000-ibm-aix
219         TargetPlatform=rs6000-ibm-aix #hack
220         BuildPlatform=rs6000-ibm-aix #hack
221         HostPlatform_CPP='rs6000_ibm_aix'
222         HostArch_CPP='rs6000'
223         HostVendor_CPP='ibm'
224         HostOS_CPP='aix'
225         ;;
226 powerpc-ibm-aix*)
227         HostPlatform=powerpc-ibm-aix
228         TargetPlatform=powerpc-ibm-aix #hack
229         BuildPlatform=powerpc-ibm-aix #hack
230         HostPlatform_CPP='powerpc_ibm_aix'
231         HostArch_CPP='powerpc'
232         HostVendor_CPP='ibm'
233         HostOS_CPP='aix'
234         ;;
235 sparc-sun-sunos4*)
236         HostPlatform=sparc-sun-sunos4
237         TargetPlatform=sparc-sun-sunos4 #hack
238         BuildPlatform=sparc-sun-sunos4 #hack
239         HostPlatform_CPP='sparc_sun_sunos4'
240         HostArch_CPP='sparc'
241         HostVendor_CPP='sun'
242         HostOS_CPP='sunos4'
243         ;;
244 sparc-sun-solaris2*)
245         HostPlatform=sparc-sun-solaris2
246         TargetPlatform=sparc-sun-solaris2 #hack
247         BuildPlatform=sparc-sun-solaris2 #hack
248         HostPlatform_CPP='sparc_sun_solaris2'
249         HostArch_CPP='sparc'
250         HostVendor_CPP='sun'
251         HostOS_CPP='solaris2'
252         ;;
253 *)
254         echo "Unrecognised platform: $HostPlatform"
255         exit 1
256         ;;
257 esac
258 echo "Canonicalised to: $HostPlatform"
259 test  x"$HostPlatform" != x"$TargetPlatform" && echo "Target platform set to $TargetPlatform"
260 test  x"$BuildPlatform" != x"$HostPlatform"  && echo "Build platform set to $BuildPlatform"
261
262 BuildPlatform_CPP=$HostPlatform_CPP
263 TargetPlatform_CPP=$HostPlatform_CPP
264 BuildArch_CPP=$HostArch_CPP
265 TargetArch_CPP=$HostArch_CPP
266 BuildOS_CPP=$HostOS_CPP
267 HostOS_Full=$host_os
268 TargetOS_CPP=$HostOS_CPP
269 BuildVendor_CPP=$HostVendor_CPP
270 TargetVendor_CPP=$HostVendor_CPP
271
272 dnl Cannot afford all these SUBSTs (because of braindead seds w/ 99 cmd limits)
273 dnl AC_SUBST(BuildPlatform)
274
275 AC_SUBST(HostPlatform)
276 AC_SUBST(TargetPlatform)
277 AC_SUBST(HostPlatform_CPP)
278 dnl AC_SUBST(BuildPlatform_CPP)
279 dnl AC_SUBST(TargetPlatform_CPP)
280
281 AC_SUBST(HostArch_CPP)
282 dnl AC_SUBST(BuildArch_CPP)
283 dnl AC_SUBST(TargetArch_CPP)
284
285 AC_SUBST(HostOS_CPP)
286 AC_SUBST(HostOS_Full)
287 dnl AC_SUBST(BuildOS_CPP)
288 dnl AC_SUBST(TargetOS_CPP)
289
290 AC_SUBST(HostVendor_CPP)
291 dnl AC_SUBST(BuildVendor_CPP)
292 dnl AC_SUBST(TargetVendor_CPP)
293
294 AC_SUBST(exeext)
295
296 dnl --------------------------------------------------------------
297 dnl * Project specific configuration options
298 dnl --------------------------------------------------------------
299 dnl What follows is a bunch of options that can either be configured
300 dnl through command line options to the configure script or by
301 dnl supplying defns in the build tree's mk/build.mk. Having the option to
302 dnl use either is considered a Feature.
303
304 dnl ** What command to use to compile compiler sources ?
305 dnl --------------------------------------------------------------
306 AC_ARG_WITH(ghc-hc,
307 [  --with-ghc-hc=<haskell compiler>
308         Use a command different from 'ghc-2.10' to compile up the GHC compiler sources.
309          (no claims currently made that this will work with a compiler other than a
310           recent version of GHC, but you could always try...)
311 ],
312 [WithGhcHc="$withval"],
313 [WithGhcHc="ghc"]
314 )
315 AC_SUBST(WithGhcHc)
316
317 dnl ** Which gcc to use?
318 dnl --------------------------------------------------------------
319 AC_ARG_WITH(gcc,
320 [  --with-gcc=<gcc command>
321         Use a different command instead of 'gcc' for the GNU C compiler.
322 ],
323 [WhatGccIsCalled="$withval"],
324 [WhatGccIsCalled="gcc"]
325 )
326 AC_SUBST(WhatGccIsCalled)
327
328 dnl ** Booting from .hc files?
329 dnl --------------------------------------------------------------
330 AC_ARG_ENABLE(hc-boot,
331 [  --enable-hc-boot
332         Boot the Glasgow Haskell Compiler from intermediate .hc files.
333         (This option is mostly of interest to porters.)
334 ],
335 [BootingFromHc=YES],
336 [BootingFromHc=NO]
337 )
338 AC_SUBST(BootingFromHc)
339
340
341 dnl --------------------------------------------------------------
342 dnl End of configure script option section
343 dnl --------------------------------------------------------------
344
345
346 dnl --------------------------------------------------------------
347 dnl * General configuration checks
348 dnl --------------------------------------------------------------
349
350 dnl ** does #! work?
351 AC_SYS_INTERPRETER()
352
353 dnl ** look for `perl', but watch out for version 4.035
354 AC_PATH_PROG(PerlCmd,perl)
355 if test -z "$PerlCmd"; then
356    echo "You must install perl before you can continue"
357    echo "Perhaps it is already installed, but not in your PATH?"
358    exit 1
359 else
360 FPTOOLS_CHECK_PERL_VERSION
361 fi
362
363 dnl ** does #! path/to/perl work? (sometimes it's too long...)
364 FPTOOLS_SHEBANG_PERL
365
366
367 dnl ** look for GCC and find out which version
368 dnl     Figure out which C compiler to use.  Gcc is preferred.
369 dnl     If gcc, make sure it's at least 2.1
370 dnl
371 AC_PROG_CC
372 FPTOOLS_HAVE_GCC
373
374 dnl ** figure out how to invoke cpp directly (gcc -E is no good)
375 AC_PROG_CPP
376 FPTOOLS_PROG_GNUCPP
377
378 dnl ** figure out how to do context diffs
379 FPTOOLS_PROG_DIFF
380
381
382 dnl ** look for a decent parser generator (bison preferred)
383 dnl (FPTOOLS_PROG_YACCY is AC_PROG_YACC, but with some extra testing 
384 dnl  on the suitability of the 'yacc' returned.)
385 FPTOOLS_PROG_YACCY
386
387 dnl ** Find lex command (lex or flex) and library (-ll or -lfl)
388 dnl     ( not that we care about the latter, see mk/config.mk.in )
389 AC_PROG_LEX
390
391
392 dnl ** figure out how to do a BSD-ish install
393 AC_PROG_INSTALL
394
395 dnl If you can run configure, you certainly have /bin/sh
396 AC_DEFINE(HAVE_BIN_SH)
397
398 dnl ** how to invoke `ar' and `ranlib'
399 FPTOOLS_PROG_AR_AND_RANLIB
400
401
402 dnl ** Check to see whether ln -s works
403 AC_PROG_LN_S
404
405
406 dnl ** Find the path to sed
407 AC_PATH_PROG(SedCmd,sed)
408
409
410 dnl ** check for time command
411 AC_PATH_PROG(TimeCmd,time)
412
413
414 dnl ** check for tar
415 dnl   if GNU tar is named gtar, look for it first.
416 AC_PATH_PROGS(TarCmd,gtar tar,tar)
417
418 dnl ** check for gzip/compress
419 AC_PATH_PROGS(CompressCmd,gzip compress,gzip)
420
421 compress_nm=`basename $CompressCmd`
422 if test x"$compress_nm" = xgzip; then
423   CompressCmd="$CompressCmd -d"
424   CompressSuffix="gz"
425 else
426   CompressSuffix="Z"
427 fi
428 AC_SUBST(CompressCmd)
429 AC_SUBST(CompressSuffix)
430
431 dnl ** check for installed happy binary + version
432 dnl    (don't do it if we're booting from .hc files though.)
433 if (test "$BootingFromHc" = "NO"); then
434 FPTOOLS_HAPPY
435 fi;
436
437 dnl --------------------------------------------------
438 dnl ### program checking section ends here ###
439 dnl --------------------------------------------------
440
441 dnl --------------------------------------------------
442 dnl * Platform header file and syscall feature tests
443 dnl ### checking the state of the local header files and syscalls ###
444
445 dnl ** check for full ANSI header (.h) files
446 AC_HEADER_STDC
447
448 dnl ** check for specific header (.h) files that we are interested in
449 AC_CHECK_HEADERS(Files.h assert.h console.h ctype.h dirent.h errno.h fcntl.h float.h ftw.h grp.h ieee754.h malloc.h memory.h nlist.h pascal.h pwd.h sgtty.h siginfo.h signal.h stat.h stdlib.h stdarg.h string.h sys/fault.h sys/file.h sys/ioctl.h sys/limits.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/socket.h netinet/tcp.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 termio.h termios.h time.h types.h unistd.h utime.h values.h vfork.h readline/readline.h bfd.h)
450
451 dnl ** check for DOS include files
452 AC_CHECK_HEADERS(dos.h conio.h io.h std.h) 
453
454 dnl ** check for Windows include files
455 AC_CHECK_HEADERS(windows.h)
456
457 dnl ** check if it is safe to include both <time.h> and <sys/time.h>
458 AC_HEADER_TIME
459
460 dnl dynamic loading include files
461 AC_CHECK_HEADERS(dlfcn.h dl.h) 
462
463 dnl ** check for farcalloc (in bcc)
464 AC_CHECK_HEADER(alloc.h,AC_CHECK_FUNCS(farcalloc))
465
466 dnl ** check for valloc (in sunos, solaris, mips, amiga, next, minix, ultrix)
467 AC_CHECK_HEADER(malloc.h,AC_CHECK_FUNCS(valloc))
468
469 dnl ** how do we get a timezone name, and UTC offset ?
470 AC_STRUCT_TIMEZONE
471
472 dnl ** what's the type of timezone?
473 FPTOOLS_TYPE_TIMEZONE
474
475 dnl ** do we have altzone?
476 FPTOOLS_ALTZONE
477
478 dnl ** does struct stat contain st_blksize?
479 AC_STRUCT_ST_BLKSIZE
480
481 dnl ** what are the sizes of various types
482 dnl    (these must come before GHC_CHECK_ALIGNMENT)
483 AC_CHECK_SIZEOF(unsigned int,4)
484 AC_CHECK_SIZEOF(float,       4)
485 AC_CHECK_SIZEOF(double,      8)
486 AC_CHECK_SIZEOF(long,        4)
487 AC_CHECK_SIZEOF(void *,      4)
488
489 dnl ** what are alignment constraints on various types
490 FPTOOLS_CHECK_ALIGNMENT(unsigned int) dnl redundant but harmless
491 FPTOOLS_CHECK_ALIGNMENT(long)
492 FPTOOLS_CHECK_ALIGNMENT(float)
493 FPTOOLS_CHECK_ALIGNMENT(double)
494
495 dnl ** do we have long longs?
496 FPTOOLS_C_LONG_LONG
497
498 dnl ** can we open files in binary mode?
499 FPTOOLS_O_BINARY
500
501 dnl ** check for GetModuleFileName and WinExec (windows only)
502 dnl Old: AC_CHECK_FUNCS(WinExec GetModuleFileName)       dnl Windows
503 dnl Doesn't work because the linker can't see the functions if
504 dnl you omit the #include <windows.h>.  (I've no idea why not...)
505
506 FPTOOLS_TRY_LINK_NOWARN(,[
507 #if HAVE_WINDOWS_H
508 #include <windows.h>
509 #endif
510 main() { 
511   WinExec("",0);
512   exit(0);
513 }
514 ],
515 [have_winexec=1],
516 [have_winexec=0])
517 if test "$have_winexec" = "1"; then
518 AC_DEFINE(HAVE_WINEXEC)
519 fi
520
521 FPTOOLS_TRY_LINK_NOWARN(,[
522 #if HAVE_WINDOWS_H
523 #include <windows.h>
524 #endif
525 main() { 
526   char* dir;
527   GetModuleFileName((HMODULE)0,dir,0);
528   exit(0);
529 }
530 ],
531 [have_getmodulefilename=1],
532 [have_getmodulefilename=0])
533 if test "$have_getmodulefilename" = "1"; then
534 AC_DEFINE(HAVE_GETMODULEFILENAME)
535 fi
536
537 dnl ** check return type of signal handlers
538 dnl Foo: assumes we can use prototypes.
539 dnl On BCC, signal handlers have type "int(void)", elsewhere its "void(int)".
540 dnl AC_CACHE_CHECK([type of signal handlers], ac_cv_type_signal_handler,
541 dnl [AC_TRY_COMPILE([#include <sys/types.h>
542 dnl #include <signal.h>
543 dnl #ifdef signal
544 dnl #undef signal
545 dnl #endif
546 dnl void (*signal (int, void (*)(int)))(int);
547 dnl ],
548 dnl [int i;], 
549 dnl ac_cv_type_signal_handler=void_int,
550 dnl ac_cv_type_signal_handler=int_void)])
551 dnl if test "$ac_cv_type_signal_handler" = void_int; then
552 dnl AC_DEFINE(VOID_INT_SIGNALS)
553 dnl fi
554
555 dnl On BCC, signal handlers have type "int(void)", elsewhere its "void(int)".
556 AC_TYPE_SIGNAL
557 if test "$ac_cv_type_signal" = void; then
558 AC_DEFINE(VOID_INT_SIGNALS)
559 fi
560
561 dnl ** check for more functions
562 AC_CHECK_FUNCS(strcasecmp _stricmp stricmp strcmpi)
563 AC_CHECK_FUNCS(strcmp)
564 AC_CHECK_FUNCS(realpath _fullpath)  
565 AC_CHECK_FUNCS(PBHSetVolSync macsystem)  
566 AC_CHECK_FUNCS(fgetpos fsetpos fseek ftell)
567 AC_CHECK_FUNCS(vsnprintf _vsnprintf)
568 AC_CHECK_FUNCS(snprintf  _snprintf )  
569 AC_CHECK_FUNCS(popen     _popen )  
570 AC_CHECK_FUNCS(pclose    _pclose )  
571
572
573 dnl ** check for specific library functions that we are interested in
574 AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect readlink setitimer stat symlink sysconf timelocal times vadvise vfork)
575
576 dnl ** check whether this machine has gmp2 installed
577 AC_CHECK_LIB(gmp,  mpz_fdiv_qr, HaveLibGmp=YES; LibGmp=gmp,
578   AC_CHECK_LIB(gmp2, mpz_fdiv_qr,  HaveLibGmp=YES; LibGmp=gmp2,
579     HaveLibGmp=No; LibGmp=not-installed))
580 AC_SUBST(HaveLibGmp)
581 AC_SUBST(LibGmp)
582
583 dnl ** check whether this machine has BFD and liberty installed (used for debugging)
584 dnl    the order of these tests matters: bfd needs liberty
585 AC_CHECK_LIB(iberty, xmalloc)
586 AC_CHECK_LIB(bfd,    bfd_init)
587
588 dnl ################################################################
589 dnl Check for libraries
590 dnl ################################################################
591
592 FPTOOLS_CHECK_LIB_NOWARN(dl, dlopen)
593 FPTOOLS_CHECK_LIB_NOWARN(dld, shl_load)
594 FPTOOLS_CHECK_LIB_NOWARN(m, atan)
595
596 dnl --------------------------------------------------
597 dnl * Miscellaneous feature tests
598 dnl --------------------------------------------------
599
600 dnl ** can we get alloca?
601 AC_FUNC_ALLOCA
602
603 dnl ** determine whether or not const works
604 AC_C_CONST
605
606 dnl ** determine whether ANSI-function prototypes work?
607 AC_C_PROTOTYPES          
608
609 dnl ** are we big endian?
610 AC_C_BIGENDIAN
611 # Allay users' general fear of warnings of any kind.
612 errprint((fptools configure script wizard sez: "don't worry, the above warning is harmless (to us.)")
613 )
614
615 dnl ** determine the return type of signal()
616 AC_TYPE_SIGNAL
617
618 dnl ** check for leading underscores in symbol names
619 FPTOOLS_UNDERSCORE
620
621 dnl ** how is the end of text section signalled?
622 FPTOOLS_END_TEXT_SECTION
623
624 dnl ** how is the end of data section signalled?
625 FPTOOLS_END_DATA_SECTION
626
627 dnl ** code before data?
628 FPTOOLS_CODE_BEFORE_DATA
629
630 AC_OUTPUT(mk/config.mk, echo timestamp > mk/stamp-h )
631
632 echo ''
633 echo '************************************************'
634 echo '*** NOW DO: gmake boot followed by gmake all'
635 echo '***         (where gmake == GNU make)'
636 echo '************************************************'
637 exit 0