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