f3833c1a851c940475cf1b32e9c823e88b37052f
[fw/sdcc] / support / cpp2 / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_help="$ac_help
15   --with-gnu-ld           arrange to work with GNU ld."
16 ac_help="$ac_help
17   --with-ld               arrange to use the specified ld (full pathname)"
18 ac_help="$ac_help
19   --with-gnu-as           arrange to work with GNU as"
20 ac_help="$ac_help
21   --with-as               arrange to use the specified as (full pathname)"
22 ac_help="$ac_help
23   --with-stabs            arrange to use stabs instead of host debug format"
24 ac_help="$ac_help
25   --with-elf              arrange to use ELF instead of host debug format"
26 ac_help="$ac_help
27   --with-local-prefix=DIR specifies directory to put local include"
28 ac_help="$ac_help
29   --enable-c-mbchar       enable multibyte characters for C and C++"
30 ac_help="$ac_help
31   --enable-maintainer-mode
32                           enable make rules and dependencies not useful
33                           (and sometimes confusing) to the casual installer"
34
35 # Initialize some variables set by options.
36 # The variables have the same names as the options, with
37 # dashes changed to underlines.
38 build=NONE
39 cache_file=./config.cache
40 exec_prefix=NONE
41 host=NONE
42 no_create=
43 nonopt=NONE
44 no_recursion=
45 prefix=NONE
46 program_prefix=NONE
47 program_suffix=NONE
48 program_transform_name=s,x,x,
49 silent=
50 site=
51 srcdir=
52 target=NONE
53 verbose=
54 x_includes=NONE
55 x_libraries=NONE
56 bindir='${exec_prefix}/bin'
57 sbindir='${exec_prefix}/sbin'
58 libexecdir='${exec_prefix}/libexec'
59 datadir='${prefix}/share'
60 sysconfdir='${prefix}/etc'
61 sharedstatedir='${prefix}/com'
62 localstatedir='${prefix}/var'
63 libdir='${exec_prefix}/lib'
64 includedir='${prefix}/include'
65 oldincludedir='/usr/include'
66 infodir='${prefix}/info'
67 mandir='${prefix}/man'
68
69 # Initialize some other variables.
70 subdirs=
71 MFLAGS= MAKEFLAGS=
72 SHELL=${CONFIG_SHELL-/bin/sh}
73 # Maximum number of lines to put in a shell here document.
74 ac_max_here_lines=12
75
76 ac_prev=
77 for ac_option
78 do
79
80   # If the previous option needs an argument, assign it.
81   if test -n "$ac_prev"; then
82     eval "$ac_prev=\$ac_option"
83     ac_prev=
84     continue
85   fi
86
87   case "$ac_option" in
88   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
89   *) ac_optarg= ;;
90   esac
91
92   # Accept the important Cygnus configure options, so we can diagnose typos.
93
94   case "$ac_option" in
95
96   -bindir | --bindir | --bindi | --bind | --bin | --bi)
97     ac_prev=bindir ;;
98   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
99     bindir="$ac_optarg" ;;
100
101   -build | --build | --buil | --bui | --bu)
102     ac_prev=build ;;
103   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
104     build="$ac_optarg" ;;
105
106   -cache-file | --cache-file | --cache-fil | --cache-fi \
107   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
108     ac_prev=cache_file ;;
109   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
110   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
111     cache_file="$ac_optarg" ;;
112
113   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
114     ac_prev=datadir ;;
115   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
116   | --da=*)
117     datadir="$ac_optarg" ;;
118
119   -disable-* | --disable-*)
120     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
121     # Reject names that are not valid shell variable names.
122     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
123       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
124     fi
125     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
126     eval "enable_${ac_feature}=no" ;;
127
128   -enable-* | --enable-*)
129     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
130     # Reject names that are not valid shell variable names.
131     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
132       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
133     fi
134     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
135     case "$ac_option" in
136       *=*) ;;
137       *) ac_optarg=yes ;;
138     esac
139     eval "enable_${ac_feature}='$ac_optarg'" ;;
140
141   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
142   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
143   | --exec | --exe | --ex)
144     ac_prev=exec_prefix ;;
145   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
146   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
147   | --exec=* | --exe=* | --ex=*)
148     exec_prefix="$ac_optarg" ;;
149
150   -gas | --gas | --ga | --g)
151     # Obsolete; use --with-gas.
152     with_gas=yes ;;
153
154   -help | --help | --hel | --he)
155     # Omit some internal or obsolete options to make the list less imposing.
156     # This message is too long to be a string in the A/UX 3.1 sh.
157     cat << EOF
158 Usage: configure [options] [host]
159 Options: [defaults in brackets after descriptions]
160 Configuration:
161   --cache-file=FILE       cache test results in FILE
162   --help                  print this message
163   --no-create             do not create output files
164   --quiet, --silent       do not print \`checking...' messages
165   --version               print the version of autoconf that created configure
166 Directory and file names:
167   --prefix=PREFIX         install architecture-independent files in PREFIX
168                           [$ac_default_prefix]
169   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
170                           [same as prefix]
171   --bindir=DIR            user executables in DIR [EPREFIX/bin]
172   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
173   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
174   --datadir=DIR           read-only architecture-independent data in DIR
175                           [PREFIX/share]
176   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
177   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
178                           [PREFIX/com]
179   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
180   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
181   --includedir=DIR        C header files in DIR [PREFIX/include]
182   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
183   --infodir=DIR           info documentation in DIR [PREFIX/info]
184   --mandir=DIR            man documentation in DIR [PREFIX/man]
185   --srcdir=DIR            find the sources in DIR [configure dir or ..]
186   --program-prefix=PREFIX prepend PREFIX to installed program names
187   --program-suffix=SUFFIX append SUFFIX to installed program names
188   --program-transform-name=PROGRAM
189                           run sed PROGRAM on installed program names
190 EOF
191     cat << EOF
192 Host type:
193   --build=BUILD           configure for building on BUILD [BUILD=HOST]
194   --host=HOST             configure for HOST [guessed]
195   --target=TARGET         configure for TARGET [TARGET=HOST]
196 Features and packages:
197   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
198   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
199   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
200   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
201   --x-includes=DIR        X include files are in DIR
202   --x-libraries=DIR       X library files are in DIR
203 EOF
204     if test -n "$ac_help"; then
205       echo "--enable and --with options recognized:$ac_help"
206     fi
207     exit 0 ;;
208
209   -host | --host | --hos | --ho)
210     ac_prev=host ;;
211   -host=* | --host=* | --hos=* | --ho=*)
212     host="$ac_optarg" ;;
213
214   -includedir | --includedir | --includedi | --included | --include \
215   | --includ | --inclu | --incl | --inc)
216     ac_prev=includedir ;;
217   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
218   | --includ=* | --inclu=* | --incl=* | --inc=*)
219     includedir="$ac_optarg" ;;
220
221   -infodir | --infodir | --infodi | --infod | --info | --inf)
222     ac_prev=infodir ;;
223   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
224     infodir="$ac_optarg" ;;
225
226   -libdir | --libdir | --libdi | --libd)
227     ac_prev=libdir ;;
228   -libdir=* | --libdir=* | --libdi=* | --libd=*)
229     libdir="$ac_optarg" ;;
230
231   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
232   | --libexe | --libex | --libe)
233     ac_prev=libexecdir ;;
234   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
235   | --libexe=* | --libex=* | --libe=*)
236     libexecdir="$ac_optarg" ;;
237
238   -localstatedir | --localstatedir | --localstatedi | --localstated \
239   | --localstate | --localstat | --localsta | --localst \
240   | --locals | --local | --loca | --loc | --lo)
241     ac_prev=localstatedir ;;
242   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
243   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
244   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
245     localstatedir="$ac_optarg" ;;
246
247   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
248     ac_prev=mandir ;;
249   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
250     mandir="$ac_optarg" ;;
251
252   -nfp | --nfp | --nf)
253     # Obsolete; use --without-fp.
254     with_fp=no ;;
255
256   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
257   | --no-cr | --no-c)
258     no_create=yes ;;
259
260   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
261   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
262     no_recursion=yes ;;
263
264   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
265   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
266   | --oldin | --oldi | --old | --ol | --o)
267     ac_prev=oldincludedir ;;
268   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
269   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
270   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
271     oldincludedir="$ac_optarg" ;;
272
273   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
274     ac_prev=prefix ;;
275   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
276     prefix="$ac_optarg" ;;
277
278   -program-prefix | --program-prefix | --program-prefi | --program-pref \
279   | --program-pre | --program-pr | --program-p)
280     ac_prev=program_prefix ;;
281   -program-prefix=* | --program-prefix=* | --program-prefi=* \
282   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
283     program_prefix="$ac_optarg" ;;
284
285   -program-suffix | --program-suffix | --program-suffi | --program-suff \
286   | --program-suf | --program-su | --program-s)
287     ac_prev=program_suffix ;;
288   -program-suffix=* | --program-suffix=* | --program-suffi=* \
289   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
290     program_suffix="$ac_optarg" ;;
291
292   -program-transform-name | --program-transform-name \
293   | --program-transform-nam | --program-transform-na \
294   | --program-transform-n | --program-transform- \
295   | --program-transform | --program-transfor \
296   | --program-transfo | --program-transf \
297   | --program-trans | --program-tran \
298   | --progr-tra | --program-tr | --program-t)
299     ac_prev=program_transform_name ;;
300   -program-transform-name=* | --program-transform-name=* \
301   | --program-transform-nam=* | --program-transform-na=* \
302   | --program-transform-n=* | --program-transform-=* \
303   | --program-transform=* | --program-transfor=* \
304   | --program-transfo=* | --program-transf=* \
305   | --program-trans=* | --program-tran=* \
306   | --progr-tra=* | --program-tr=* | --program-t=*)
307     program_transform_name="$ac_optarg" ;;
308
309   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
310   | -silent | --silent | --silen | --sile | --sil)
311     silent=yes ;;
312
313   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
314     ac_prev=sbindir ;;
315   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
316   | --sbi=* | --sb=*)
317     sbindir="$ac_optarg" ;;
318
319   -sharedstatedir | --sharedstatedir | --sharedstatedi \
320   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
321   | --sharedst | --shareds | --shared | --share | --shar \
322   | --sha | --sh)
323     ac_prev=sharedstatedir ;;
324   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
325   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
326   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
327   | --sha=* | --sh=*)
328     sharedstatedir="$ac_optarg" ;;
329
330   -site | --site | --sit)
331     ac_prev=site ;;
332   -site=* | --site=* | --sit=*)
333     site="$ac_optarg" ;;
334
335   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
336     ac_prev=srcdir ;;
337   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
338     srcdir="$ac_optarg" ;;
339
340   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
341   | --syscon | --sysco | --sysc | --sys | --sy)
342     ac_prev=sysconfdir ;;
343   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
344   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
345     sysconfdir="$ac_optarg" ;;
346
347   -target | --target | --targe | --targ | --tar | --ta | --t)
348     ac_prev=target ;;
349   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
350     target="$ac_optarg" ;;
351
352   -v | -verbose | --verbose | --verbos | --verbo | --verb)
353     verbose=yes ;;
354
355   -version | --version | --versio | --versi | --vers)
356     echo "configure generated by autoconf version 2.13"
357     exit 0 ;;
358
359   -with-* | --with-*)
360     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
361     # Reject names that are not valid shell variable names.
362     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
363       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
364     fi
365     ac_package=`echo $ac_package| sed 's/-/_/g'`
366     case "$ac_option" in
367       *=*) ;;
368       *) ac_optarg=yes ;;
369     esac
370     eval "with_${ac_package}='$ac_optarg'" ;;
371
372   -without-* | --without-*)
373     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
374     # Reject names that are not valid shell variable names.
375     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
376       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
377     fi
378     ac_package=`echo $ac_package| sed 's/-/_/g'`
379     eval "with_${ac_package}=no" ;;
380
381   --x)
382     # Obsolete; use --with-x.
383     with_x=yes ;;
384
385   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
386   | --x-incl | --x-inc | --x-in | --x-i)
387     ac_prev=x_includes ;;
388   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
389   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
390     x_includes="$ac_optarg" ;;
391
392   -x-libraries | --x-libraries | --x-librarie | --x-librari \
393   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
394     ac_prev=x_libraries ;;
395   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
396   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
397     x_libraries="$ac_optarg" ;;
398
399   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
400     ;;
401
402   *)
403     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
404       echo "configure: warning: $ac_option: invalid host type" 1>&2
405     fi
406     if test "x$nonopt" != xNONE; then
407       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
408     fi
409     nonopt="$ac_option"
410     ;;
411
412   esac
413 done
414
415 if test -n "$ac_prev"; then
416   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
417 fi
418
419 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
420
421 # File descriptor usage:
422 # 0 standard input
423 # 1 file creation
424 # 2 errors and warnings
425 # 3 some systems may open it to /dev/tty
426 # 4 used on the Kubota Titan
427 # 6 checking for... messages and results
428 # 5 compiler messages saved in config.log
429 if test "$silent" = yes; then
430   exec 6>/dev/null
431 else
432   exec 6>&1
433 fi
434 exec 5>./config.log
435
436 echo "\
437 This file contains any messages produced by compilers while
438 running configure, to aid debugging if configure makes a mistake.
439 " 1>&5
440
441 # Strip out --no-create and --no-recursion so they do not pile up.
442 # Also quote any args containing shell metacharacters.
443 ac_configure_args=
444 for ac_arg
445 do
446   case "$ac_arg" in
447   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
448   | --no-cr | --no-c) ;;
449   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
450   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
451   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
452   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
453   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
454   esac
455 done
456
457 # NLS nuisances.
458 # Only set these to C if already set.  These must not be set unconditionally
459 # because not all systems understand e.g. LANG=C (notably SCO).
460 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
461 # Non-C LC_CTYPE values break the ctype check.
462 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
463 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
464 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
465 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
466
467 # confdefs.h avoids OS command line length limits that DEFS can exceed.
468 rm -rf conftest* confdefs.h
469 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
470 echo > confdefs.h
471
472 # A filename unique to this package, relative to the directory that
473 # configure is in, which we can look for to find out if srcdir is correct.
474 ac_unique_file=cppmain.c
475
476 # Find the source files, if location was not specified.
477 if test -z "$srcdir"; then
478   ac_srcdir_defaulted=yes
479   # Try the directory containing this script, then its parent.
480   ac_prog=$0
481   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
482   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
483   srcdir=$ac_confdir
484   if test ! -r $srcdir/$ac_unique_file; then
485     srcdir=..
486   fi
487 else
488   ac_srcdir_defaulted=no
489 fi
490 if test ! -r $srcdir/$ac_unique_file; then
491   if test "$ac_srcdir_defaulted" = yes; then
492     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
493   else
494     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
495   fi
496 fi
497 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
498
499 # Prefer explicitly selected file to automatically selected ones.
500 if test -z "$CONFIG_SITE"; then
501   if test "x$prefix" != xNONE; then
502     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
503   else
504     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
505   fi
506 fi
507 for ac_site_file in $CONFIG_SITE; do
508   if test -r "$ac_site_file"; then
509     echo "loading site script $ac_site_file"
510     . "$ac_site_file"
511   fi
512 done
513
514 if test -r "$cache_file"; then
515   echo "loading cache $cache_file"
516   . $cache_file
517 else
518   echo "creating cache $cache_file"
519   > $cache_file
520 fi
521
522 ac_ext=c
523 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
524 ac_cpp='$CPP $CPPFLAGS'
525 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
526 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
527 cross_compiling=$ac_cv_prog_cc_cross
528
529 ac_exeext=
530 ac_objext=o
531 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
532   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
533   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
534     ac_n= ac_c='
535 ' ac_t='        '
536   else
537     ac_n=-n ac_c= ac_t=
538   fi
539 else
540   ac_n= ac_c='\c' ac_t=
541 fi
542
543
544
545
546 remove=rm
547 hard_link=ln
548 symbolic_link='ln -s'
549 copy=cp
550
551 # Check for additional parameters
552
553 # With GNU ld
554 # Check whether --with-gnu-ld or --without-gnu-ld was given.
555 if test "${with_gnu_ld+set}" = set; then
556   withval="$with_gnu_ld"
557   gnu_ld_flag="$with_gnu_ld"
558 else
559   gnu_ld_flag=no
560 fi
561
562
563 # With pre-defined ld
564 # Check whether --with-ld or --without-ld was given.
565 if test "${with_ld+set}" = set; then
566   withval="$with_ld"
567   DEFAULT_LINKER="$with_ld"
568 fi
569
570 if test x"${DEFAULT_LINKER+set}" = x"set"; then
571   if test ! -x "$DEFAULT_LINKER"; then
572     echo "configure: warning: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" 1>&2
573   elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
574     gnu_ld_flag=yes
575   fi
576   cat >> confdefs.h <<EOF
577 #define DEFAULT_LINKER "$DEFAULT_LINKER"
578 EOF
579
580 fi
581
582 # With GNU as
583 # Check whether --with-gnu-as or --without-gnu-as was given.
584 if test "${with_gnu_as+set}" = set; then
585   withval="$with_gnu_as"
586   gas_flag="$with_gnu_as"
587 else
588   gas_flag=no
589 fi
590
591
592 # Check whether --with-as or --without-as was given.
593 if test "${with_as+set}" = set; then
594   withval="$with_as"
595   DEFAULT_ASSEMBLER="$with_as"
596 fi
597
598 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
599   if test ! -x "$DEFAULT_ASSEMBLER"; then
600     echo "configure: warning: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" 1>&2
601   elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
602     gas_flag=yes
603   fi
604   cat >> confdefs.h <<EOF
605 #define DEFAULT_ASSEMBLER "$DEFAULT_ASSEMBLER"
606 EOF
607
608 fi
609
610 # With stabs
611 # Check whether --with-stabs or --without-stabs was given.
612 if test "${with_stabs+set}" = set; then
613   withval="$with_stabs"
614   stabs="$with_stabs"
615 else
616   stabs=no
617 fi
618
619
620 # With ELF
621 # Check whether --with-elf or --without-elf was given.
622 if test "${with_elf+set}" = set; then
623   withval="$with_elf"
624   elf="$with_elf"
625 else
626   elf=no
627 fi
628
629
630 # Specify the local prefix
631 local_prefix=
632 # Check whether --with-local-prefix or --without-local-prefix was given.
633 if test "${with_local_prefix+set}" = set; then
634   withval="$with_local_prefix"
635   case "${withval}" in
636 yes)    { echo "configure: error: bad value ${withval} given for local include directory prefix" 1>&2; exit 1; } ;;
637 no)     ;;
638 *)      local_prefix=$with_local_prefix ;;
639 esac
640 fi
641
642
643 # Default local prefix if it is empty
644 if test x$local_prefix = x; then
645         local_prefix=/usr/local
646 fi
647
648 if test "$program_transform_name" = s,x,x,; then
649   program_transform_name=
650 else
651   # Double any \ or $.  echo might interpret backslashes.
652   cat <<\EOF_SED > conftestsed
653 s,\\,\\\\,g; s,\$,$$,g
654 EOF_SED
655   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
656   rm -f conftestsed
657 fi
658 test "$program_prefix" != NONE &&
659   program_transform_name="s,^,${program_prefix},; $program_transform_name"
660 # Use a double $ so make ignores it.
661 test "$program_suffix" != NONE &&
662   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
663
664 # sed with no file args requires a program.
665 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
666
667
668 # Enable Multibyte Characters for C/C++
669 # Check whether --enable-c-mbchar or --disable-c-mbchar was given.
670 if test "${enable_c_mbchar+set}" = set; then
671   enableval="$enable_c_mbchar"
672   if test x$enable_c_mbchar != xno; then
673   cat >> confdefs.h <<\EOF
674 #define MULTIBYTE_CHARS 1
675 EOF
676
677 fi
678 fi
679
680   
681 # Find the native compiler
682 # Extract the first word of "gcc", so it can be a program name with args.
683 set dummy gcc; ac_word=$2
684 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
685 echo "configure:686: checking for $ac_word" >&5
686 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
687   echo $ac_n "(cached) $ac_c" 1>&6
688 else
689   if test -n "$CC"; then
690   ac_cv_prog_CC="$CC" # Let the user override the test.
691 else
692   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
693   ac_dummy="$PATH"
694   for ac_dir in $ac_dummy; do
695     test -z "$ac_dir" && ac_dir=.
696     if test -f $ac_dir/$ac_word; then
697       ac_cv_prog_CC="gcc"
698       break
699     fi
700   done
701   IFS="$ac_save_ifs"
702 fi
703 fi
704 CC="$ac_cv_prog_CC"
705 if test -n "$CC"; then
706   echo "$ac_t""$CC" 1>&6
707 else
708   echo "$ac_t""no" 1>&6
709 fi
710
711 if test -z "$CC"; then
712   # Extract the first word of "cc", so it can be a program name with args.
713 set dummy cc; ac_word=$2
714 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
715 echo "configure:716: checking for $ac_word" >&5
716 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
717   echo $ac_n "(cached) $ac_c" 1>&6
718 else
719   if test -n "$CC"; then
720   ac_cv_prog_CC="$CC" # Let the user override the test.
721 else
722   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
723   ac_prog_rejected=no
724   ac_dummy="$PATH"
725   for ac_dir in $ac_dummy; do
726     test -z "$ac_dir" && ac_dir=.
727     if test -f $ac_dir/$ac_word; then
728       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
729         ac_prog_rejected=yes
730         continue
731       fi
732       ac_cv_prog_CC="cc"
733       break
734     fi
735   done
736   IFS="$ac_save_ifs"
737 if test $ac_prog_rejected = yes; then
738   # We found a bogon in the path, so make sure we never use it.
739   set dummy $ac_cv_prog_CC
740   shift
741   if test $# -gt 0; then
742     # We chose a different compiler from the bogus one.
743     # However, it has the same basename, so the bogon will be chosen
744     # first if we set CC to just the basename; use the full file name.
745     shift
746     set dummy "$ac_dir/$ac_word" "$@"
747     shift
748     ac_cv_prog_CC="$@"
749   fi
750 fi
751 fi
752 fi
753 CC="$ac_cv_prog_CC"
754 if test -n "$CC"; then
755   echo "$ac_t""$CC" 1>&6
756 else
757   echo "$ac_t""no" 1>&6
758 fi
759
760   if test -z "$CC"; then
761     case "`uname -s`" in
762     *win32* | *WIN32*)
763       # Extract the first word of "cl", so it can be a program name with args.
764 set dummy cl; ac_word=$2
765 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
766 echo "configure:767: checking for $ac_word" >&5
767 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
768   echo $ac_n "(cached) $ac_c" 1>&6
769 else
770   if test -n "$CC"; then
771   ac_cv_prog_CC="$CC" # Let the user override the test.
772 else
773   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
774   ac_dummy="$PATH"
775   for ac_dir in $ac_dummy; do
776     test -z "$ac_dir" && ac_dir=.
777     if test -f $ac_dir/$ac_word; then
778       ac_cv_prog_CC="cl"
779       break
780     fi
781   done
782   IFS="$ac_save_ifs"
783 fi
784 fi
785 CC="$ac_cv_prog_CC"
786 if test -n "$CC"; then
787   echo "$ac_t""$CC" 1>&6
788 else
789   echo "$ac_t""no" 1>&6
790 fi
791  ;;
792     esac
793   fi
794   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
795 fi
796
797 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
798 echo "configure:799: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
799
800 ac_ext=c
801 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
802 ac_cpp='$CPP $CPPFLAGS'
803 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
804 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
805 cross_compiling=$ac_cv_prog_cc_cross
806
807 cat > conftest.$ac_ext << EOF
808
809 #line 810 "configure"
810 #include "confdefs.h"
811
812 main(){return(0);}
813 EOF
814 if { (eval echo configure:815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
815   ac_cv_prog_cc_works=yes
816   # If we can't run a trivial program, we are probably using a cross compiler.
817   if (./conftest; exit) 2>/dev/null; then
818     ac_cv_prog_cc_cross=no
819   else
820     ac_cv_prog_cc_cross=yes
821   fi
822 else
823   echo "configure: failed program was:" >&5
824   cat conftest.$ac_ext >&5
825   ac_cv_prog_cc_works=no
826 fi
827 rm -fr conftest*
828 ac_ext=c
829 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
830 ac_cpp='$CPP $CPPFLAGS'
831 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
832 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
833 cross_compiling=$ac_cv_prog_cc_cross
834
835 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
836 if test $ac_cv_prog_cc_works = no; then
837   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
838 fi
839 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
840 echo "configure:841: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
841 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
842 cross_compiling=$ac_cv_prog_cc_cross
843
844 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
845 echo "configure:846: checking whether we are using GNU C" >&5
846 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
847   echo $ac_n "(cached) $ac_c" 1>&6
848 else
849   cat > conftest.c <<EOF
850 #ifdef __GNUC__
851   yes;
852 #endif
853 EOF
854 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
855   ac_cv_prog_gcc=yes
856 else
857   ac_cv_prog_gcc=no
858 fi
859 fi
860
861 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
862
863 if test $ac_cv_prog_gcc = yes; then
864   GCC=yes
865 else
866   GCC=
867 fi
868
869 ac_test_CFLAGS="${CFLAGS+set}"
870 ac_save_CFLAGS="$CFLAGS"
871 CFLAGS=
872 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
873 echo "configure:874: checking whether ${CC-cc} accepts -g" >&5
874 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
875   echo $ac_n "(cached) $ac_c" 1>&6
876 else
877   echo 'void f(){}' > conftest.c
878 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
879   ac_cv_prog_cc_g=yes
880 else
881   ac_cv_prog_cc_g=no
882 fi
883 rm -f conftest*
884
885 fi
886
887 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
888 if test "$ac_test_CFLAGS" = set; then
889   CFLAGS="$ac_save_CFLAGS"
890 elif test $ac_cv_prog_cc_g = yes; then
891   if test "$GCC" = yes; then
892     CFLAGS="-g -O2"
893   else
894     CFLAGS="-g"
895   fi
896 else
897   if test "$GCC" = yes; then
898     CFLAGS="-O2"
899   else
900     CFLAGS=
901   fi
902 fi
903
904 if test "x$CC" != xcc; then
905   echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
906 echo "configure:907: checking whether $CC and cc understand -c and -o together" >&5
907 else
908   echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
909 echo "configure:910: checking whether cc understands -c and -o together" >&5
910 fi
911 set dummy $CC; ac_cc="`echo $2 |
912                        sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
913 if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
914   echo $ac_n "(cached) $ac_c" 1>&6
915 else
916   echo 'foo(){}' > conftest.c
917 # Make sure it works both with $CC and with simple cc.
918 # We do the test twice because some compilers refuse to overwrite an
919 # existing .o file with -o, though they will create one.
920 ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
921 if { (eval echo configure:922: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
922    test -f conftest.o && { (eval echo configure:923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
923 then
924   eval ac_cv_prog_cc_${ac_cc}_c_o=yes
925   if test "x$CC" != xcc; then
926     # Test first that cc exists at all.
927     if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
928       ac_try='cc -c conftest.c -o conftest.o 1>&5'
929       if { (eval echo configure:930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
930          test -f conftest.o && { (eval echo configure:931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
931       then
932         # cc works too.
933         :
934       else
935         # cc exists but doesn't like -o.
936         eval ac_cv_prog_cc_${ac_cc}_c_o=no
937       fi
938     fi
939   fi
940 else
941   eval ac_cv_prog_cc_${ac_cc}_c_o=no
942 fi
943 rm -f conftest*
944
945 fi
946 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
947   echo "$ac_t""yes" 1>&6
948 else
949   echo "$ac_t""no" 1>&6
950   cat >> confdefs.h <<\EOF
951 #define NO_MINUS_C_MINUS_O 1
952 EOF
953
954 fi
955
956 # autoconf is lame and doesn't give us any substitution variable for this.
957 if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
958   NO_MINUS_C_MINUS_O=yes
959 else
960   OUTPUT_OPTION='-o $@'
961 fi
962
963
964
965 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
966 echo "configure:967: checking how to run the C preprocessor" >&5
967 # On Suns, sometimes $CPP names a directory.
968 if test -n "$CPP" && test -d "$CPP"; then
969   CPP=
970 fi
971 if test -z "$CPP"; then
972 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
973   echo $ac_n "(cached) $ac_c" 1>&6
974 else
975     # This must be in double quotes, not single quotes, because CPP may get
976   # substituted into the Makefile and "${CC-cc}" will confuse make.
977   CPP="${CC-cc} -E"
978   # On the NeXT, cc -E runs the code through the compiler's parser,
979   # not just through cpp.
980   cat > conftest.$ac_ext <<EOF
981 #line 982 "configure"
982 #include "confdefs.h"
983 #include <assert.h>
984 Syntax Error
985 EOF
986 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
987 { (eval echo configure:988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
988 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
989 if test -z "$ac_err"; then
990   :
991 else
992   echo "$ac_err" >&5
993   echo "configure: failed program was:" >&5
994   cat conftest.$ac_ext >&5
995   rm -rf conftest*
996   CPP="${CC-cc} -E -traditional-cpp"
997   cat > conftest.$ac_ext <<EOF
998 #line 999 "configure"
999 #include "confdefs.h"
1000 #include <assert.h>
1001 Syntax Error
1002 EOF
1003 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1004 { (eval echo configure:1005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1005 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1006 if test -z "$ac_err"; then
1007   :
1008 else
1009   echo "$ac_err" >&5
1010   echo "configure: failed program was:" >&5
1011   cat conftest.$ac_ext >&5
1012   rm -rf conftest*
1013   CPP="${CC-cc} -nologo -E"
1014   cat > conftest.$ac_ext <<EOF
1015 #line 1016 "configure"
1016 #include "confdefs.h"
1017 #include <assert.h>
1018 Syntax Error
1019 EOF
1020 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1021 { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1022 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1023 if test -z "$ac_err"; then
1024   :
1025 else
1026   echo "$ac_err" >&5
1027   echo "configure: failed program was:" >&5
1028   cat conftest.$ac_ext >&5
1029   rm -rf conftest*
1030   CPP=/lib/cpp
1031 fi
1032 rm -f conftest*
1033 fi
1034 rm -f conftest*
1035 fi
1036 rm -f conftest*
1037   ac_cv_prog_CPP="$CPP"
1038 fi
1039   CPP="$ac_cv_prog_CPP"
1040 else
1041   ac_cv_prog_CPP="$CPP"
1042 fi
1043 echo "$ac_t""$CPP" 1>&6
1044
1045 echo $ac_n "checking for inline""... $ac_c" 1>&6
1046 echo "configure:1047: checking for inline" >&5
1047 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1048   echo $ac_n "(cached) $ac_c" 1>&6
1049 else
1050   ac_cv_c_inline=no
1051 for ac_kw in inline __inline__ __inline; do
1052   cat > conftest.$ac_ext <<EOF
1053 #line 1054 "configure"
1054 #include "confdefs.h"
1055
1056 int main() {
1057 } $ac_kw foo() {
1058 ; return 0; }
1059 EOF
1060 if { (eval echo configure:1061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1061   rm -rf conftest*
1062   ac_cv_c_inline=$ac_kw; break
1063 else
1064   echo "configure: failed program was:" >&5
1065   cat conftest.$ac_ext >&5
1066 fi
1067 rm -f conftest*
1068 done
1069
1070 fi
1071
1072 echo "$ac_t""$ac_cv_c_inline" 1>&6
1073 case "$ac_cv_c_inline" in
1074   inline | yes) ;;
1075   no) cat >> confdefs.h <<\EOF
1076 #define inline 
1077 EOF
1078  ;;
1079   *)  cat >> confdefs.h <<EOF
1080 #define inline $ac_cv_c_inline
1081 EOF
1082  ;;
1083 esac
1084
1085
1086 # sizeof(char) is 1 by definition.
1087 echo $ac_n "checking size of short""... $ac_c" 1>&6
1088 echo "configure:1089: checking size of short" >&5
1089 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
1090   echo $ac_n "(cached) $ac_c" 1>&6
1091 else
1092   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
1093   cat > conftest.$ac_ext <<EOF
1094 #line 1095 "configure"
1095 #include "confdefs.h"
1096 #include "confdefs.h"
1097 #include <sys/types.h>
1098
1099
1100 int main() {
1101 switch (0) case 0: case (sizeof (short) == $ac_size):;
1102 ; return 0; }
1103 EOF
1104 if { (eval echo configure:1105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1105   rm -rf conftest*
1106   ac_cv_sizeof_short=$ac_size
1107 else
1108   echo "configure: failed program was:" >&5
1109   cat conftest.$ac_ext >&5
1110 fi
1111 rm -f conftest*
1112   if test x$ac_cv_sizeof_short != x ; then break; fi
1113 done
1114
1115 fi
1116
1117 if test x$ac_cv_sizeof_short = x ; then
1118   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; }
1119 fi
1120 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
1121 cat >> confdefs.h <<EOF
1122 #define SIZEOF_SHORT $ac_cv_sizeof_short
1123 EOF
1124
1125
1126 echo $ac_n "checking size of int""... $ac_c" 1>&6
1127 echo "configure:1128: checking size of int" >&5
1128 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
1129   echo $ac_n "(cached) $ac_c" 1>&6
1130 else
1131   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
1132   cat > conftest.$ac_ext <<EOF
1133 #line 1134 "configure"
1134 #include "confdefs.h"
1135 #include "confdefs.h"
1136 #include <sys/types.h>
1137
1138
1139 int main() {
1140 switch (0) case 0: case (sizeof (int) == $ac_size):;
1141 ; return 0; }
1142 EOF
1143 if { (eval echo configure:1144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1144   rm -rf conftest*
1145   ac_cv_sizeof_int=$ac_size
1146 else
1147   echo "configure: failed program was:" >&5
1148   cat conftest.$ac_ext >&5
1149 fi
1150 rm -f conftest*
1151   if test x$ac_cv_sizeof_int != x ; then break; fi
1152 done
1153
1154 fi
1155
1156 if test x$ac_cv_sizeof_int = x ; then
1157   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; }
1158 fi
1159 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
1160 cat >> confdefs.h <<EOF
1161 #define SIZEOF_INT $ac_cv_sizeof_int
1162 EOF
1163
1164
1165 echo $ac_n "checking size of long""... $ac_c" 1>&6
1166 echo "configure:1167: checking size of long" >&5
1167 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
1168   echo $ac_n "(cached) $ac_c" 1>&6
1169 else
1170   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence.
1171   cat > conftest.$ac_ext <<EOF
1172 #line 1173 "configure"
1173 #include "confdefs.h"
1174 #include "confdefs.h"
1175 #include <sys/types.h>
1176
1177
1178 int main() {
1179 switch (0) case 0: case (sizeof (long) == $ac_size):;
1180 ; return 0; }
1181 EOF
1182 if { (eval echo configure:1183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1183   rm -rf conftest*
1184   ac_cv_sizeof_long=$ac_size
1185 else
1186   echo "configure: failed program was:" >&5
1187   cat conftest.$ac_ext >&5
1188 fi
1189 rm -f conftest*
1190   if test x$ac_cv_sizeof_long != x ; then break; fi
1191 done
1192
1193 fi
1194
1195 if test x$ac_cv_sizeof_long = x ; then
1196   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; }
1197 fi
1198 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
1199 cat >> confdefs.h <<EOF
1200 #define SIZEOF_LONG $ac_cv_sizeof_long
1201 EOF
1202
1203
1204
1205 echo $ac_n "checking execution character set""... $ac_c" 1>&6
1206 echo "configure:1207: checking execution character set" >&5
1207 if eval "test \"`echo '$''{'ac_cv_c_charset'+set}'`\" = set"; then
1208   echo $ac_n "(cached) $ac_c" 1>&6
1209 else
1210   cat > conftest.$ac_ext <<EOF
1211 #line 1212 "configure"
1212 #include "confdefs.h"
1213 #if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
1214    && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
1215 ASCII
1216 #endif
1217 EOF
1218 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1219   egrep "ASCII" >/dev/null 2>&1; then
1220   rm -rf conftest*
1221   ac_cv_c_charset=ASCII
1222 fi
1223 rm -f conftest*
1224
1225   if test x${ac_cv_c_charset+set} != xset; then
1226     cat > conftest.$ac_ext <<EOF
1227 #line 1228 "configure"
1228 #include "confdefs.h"
1229 #if '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \
1230    && 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A
1231 EBCDIC
1232 #endif
1233 EOF
1234 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1235   egrep "EBCDIC" >/dev/null 2>&1; then
1236   rm -rf conftest*
1237   ac_cv_c_charset=EBCDIC
1238 fi
1239 rm -f conftest*
1240
1241   fi
1242   if test x${ac_cv_c_charset+set} != xset; then
1243     ac_cv_c_charset=unknown
1244   fi
1245 fi
1246
1247 echo "$ac_t""$ac_cv_c_charset" 1>&6
1248 if test $ac_cv_c_charset = unknown; then
1249   { echo "configure: error: *** Cannot determine host character set." 1>&2; exit 1; }
1250 elif test $ac_cv_c_charset = EBCDIC; then
1251   cat >> confdefs.h <<\EOF
1252 #define HOST_EBCDIC 1
1253 EOF
1254
1255 fi
1256
1257 # If the native compiler is GCC, we can enable warnings even in stage1.  
1258 # That's useful for people building cross-compilers, or just running a
1259 # quick `make'.
1260 warn_cflags=
1261 if test "x$GCC" = "xyes"; then
1262   warn_cflags='$(GCC_WARN_CFLAGS)'
1263 fi
1264
1265
1266 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1267 echo "configure:1268: checking whether ${MAKE-make} sets \${MAKE}" >&5
1268 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1269 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1270   echo $ac_n "(cached) $ac_c" 1>&6
1271 else
1272   cat > conftestmake <<\EOF
1273 all:
1274         @echo 'ac_maketemp="${MAKE}"'
1275 EOF
1276 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1277 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1278 if test -n "$ac_maketemp"; then
1279   eval ac_cv_prog_make_${ac_make}_set=yes
1280 else
1281   eval ac_cv_prog_make_${ac_make}_set=no
1282 fi
1283 rm -f conftestmake
1284 fi
1285 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1286   echo "$ac_t""yes" 1>&6
1287   SET_MAKE=
1288 else
1289   echo "$ac_t""no" 1>&6
1290   SET_MAKE="MAKE=${MAKE-make}"
1291 fi
1292
1293
1294 echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6
1295 echo "configure:1296: checking whether a default assembler was specified" >&5
1296 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
1297     if test x"$gas_flag" = x"no"; then
1298         echo "$ac_t""yes ($DEFAULT_ASSEMBLER)" 1>&6
1299     else
1300         echo "$ac_t""yes ($DEFAULT_ASSEMBLER - GNU as)" 1>&6
1301     fi
1302 else
1303     echo "$ac_t""no" 1>&6
1304 fi
1305
1306 echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6
1307 echo "configure:1308: checking whether a default linker was specified" >&5
1308 if test x"${DEFAULT_LINKER+set}" = x"set"; then
1309     if test x"$gnu_ld_flag" = x"no"; then
1310         echo "$ac_t""yes ($DEFAULT_LINKER)" 1>&6
1311     else
1312         echo "$ac_t""yes ($DEFAULT_LINKER - GNU ld)" 1>&6
1313     fi
1314 else
1315     echo "$ac_t""no" 1>&6
1316 fi
1317
1318 # Find some useful tools
1319 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
1320 echo "configure:1321: checking whether ln works" >&5
1321 if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then
1322   echo $ac_n "(cached) $ac_c" 1>&6
1323 else
1324   rm -f conftestdata_t
1325 echo >conftestdata_f
1326 if ln conftestdata_f conftestdata_t 2>/dev/null
1327 then
1328   gcc_cv_prog_LN="ln"
1329 else
1330   if ln -s conftestdata_f conftestdata_t 2>/dev/null
1331   then
1332     gcc_cv_prog_LN="ln -s"
1333   else
1334     gcc_cv_prog_LN=cp
1335   fi
1336 fi
1337 rm -f conftestdata_f conftestdata_t
1338
1339 fi
1340 LN="$gcc_cv_prog_LN"
1341 if test "$gcc_cv_prog_LN" = "ln"; then
1342   echo "$ac_t""yes" 1>&6
1343 else
1344   if test "$gcc_cv_prog_LN" = "ln -s"; then
1345     echo "$ac_t""no, using ln -s" 1>&6
1346   else
1347     echo "$ac_t""no, and neither does ln -s, so using cp" 1>&6
1348   fi
1349 fi
1350
1351 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1352 echo "configure:1353: checking whether ln -s works" >&5
1353 if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then
1354   echo $ac_n "(cached) $ac_c" 1>&6
1355 else
1356   rm -f conftestdata_t
1357 echo >conftestdata_f
1358 if ln -s conftestdata_f conftestdata_t 2>/dev/null
1359 then
1360   gcc_cv_prog_LN_S="ln -s"
1361 else
1362   if ln conftestdata_f conftestdata_t 2>/dev/null
1363   then
1364     gcc_cv_prog_LN_S=ln
1365   else
1366     gcc_cv_prog_LN_S=cp
1367   fi
1368 fi
1369 rm -f conftestdata_f conftestdata_t
1370
1371 fi
1372 LN_S="$gcc_cv_prog_LN_S"
1373 if test "$gcc_cv_prog_LN_S" = "ln -s"; then
1374   echo "$ac_t""yes" 1>&6
1375 else
1376   if test "$gcc_cv_prog_LN_S" = "ln"; then
1377     echo "$ac_t""no, using ln" 1>&6
1378   else
1379     echo "$ac_t""no, and neither does ln, so using cp" 1>&6
1380   fi
1381 fi
1382
1383 # Extract the first word of "ranlib", so it can be a program name with args.
1384 set dummy ranlib; ac_word=$2
1385 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1386 echo "configure:1387: checking for $ac_word" >&5
1387 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1388   echo $ac_n "(cached) $ac_c" 1>&6
1389 else
1390   if test -n "$RANLIB"; then
1391   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1392 else
1393   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1394   ac_dummy="$PATH"
1395   for ac_dir in $ac_dummy; do
1396     test -z "$ac_dir" && ac_dir=.
1397     if test -f $ac_dir/$ac_word; then
1398       ac_cv_prog_RANLIB="ranlib"
1399       break
1400     fi
1401   done
1402   IFS="$ac_save_ifs"
1403   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1404 fi
1405 fi
1406 RANLIB="$ac_cv_prog_RANLIB"
1407 if test -n "$RANLIB"; then
1408   echo "$ac_t""$RANLIB" 1>&6
1409 else
1410   echo "$ac_t""no" 1>&6
1411 fi
1412
1413 ac_aux_dir=
1414 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1415   if test -f $ac_dir/install-sh; then
1416     ac_aux_dir=$ac_dir
1417     ac_install_sh="$ac_aux_dir/install-sh -c"
1418     break
1419   elif test -f $ac_dir/install.sh; then
1420     ac_aux_dir=$ac_dir
1421     ac_install_sh="$ac_aux_dir/install.sh -c"
1422     break
1423   fi
1424 done
1425 if test -z "$ac_aux_dir"; then
1426   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
1427 fi
1428 ac_config_guess=$ac_aux_dir/config.guess
1429 ac_config_sub=$ac_aux_dir/config.sub
1430 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
1431
1432 # Find a good install program.  We prefer a C program (faster),
1433 # so one script is as good as another.  But avoid the broken or
1434 # incompatible versions:
1435 # SysV /etc/install, /usr/sbin/install
1436 # SunOS /usr/etc/install
1437 # IRIX /sbin/install
1438 # AIX /bin/install
1439 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1440 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1441 # ./install, which can be erroneously created by make from ./install.sh.
1442 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1443 echo "configure:1444: checking for a BSD compatible install" >&5
1444 if test -z "$INSTALL"; then
1445 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1446   echo $ac_n "(cached) $ac_c" 1>&6
1447 else
1448     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1449   for ac_dir in $PATH; do
1450     # Account for people who put trailing slashes in PATH elements.
1451     case "$ac_dir/" in
1452     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1453     *)
1454       # OSF1 and SCO ODT 3.0 have their own names for install.
1455       for ac_prog in ginstall scoinst install; do
1456         if test -f $ac_dir/$ac_prog; then
1457           if test $ac_prog = install &&
1458             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1459             # AIX install.  It has an incompatible calling convention.
1460             # OSF/1 installbsd also uses dspmsg, but is usable.
1461             :
1462           else
1463             ac_cv_path_install="$ac_dir/$ac_prog -c"
1464             break 2
1465           fi
1466         fi
1467       done
1468       ;;
1469     esac
1470   done
1471   IFS="$ac_save_IFS"
1472
1473 fi
1474   if test "${ac_cv_path_install+set}" = set; then
1475     INSTALL="$ac_cv_path_install"
1476   else
1477     # As a last resort, use the slow shell script.  We don't cache a
1478     # path for INSTALL within a source directory, because that will
1479     # break other packages using the cache if that directory is
1480     # removed, or if the path is relative.
1481     INSTALL="$ac_install_sh"
1482   fi
1483 fi
1484 echo "$ac_t""$INSTALL" 1>&6
1485
1486 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1487 # It thinks the first close brace ends the variable substitution.
1488 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1489
1490 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1491
1492
1493 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1494 echo "configure:1495: checking for ANSI C header files" >&5
1495 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1496   echo $ac_n "(cached) $ac_c" 1>&6
1497 else
1498   cat > conftest.$ac_ext <<EOF
1499 #line 1500 "configure"
1500 #include "confdefs.h"
1501 #include <stdlib.h>
1502 #include <stdarg.h>
1503 #include <string.h>
1504 #include <float.h>
1505 EOF
1506 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1507 { (eval echo configure:1508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1508 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1509 if test -z "$ac_err"; then
1510   rm -rf conftest*
1511   ac_cv_header_stdc=yes
1512 else
1513   echo "$ac_err" >&5
1514   echo "configure: failed program was:" >&5
1515   cat conftest.$ac_ext >&5
1516   rm -rf conftest*
1517   ac_cv_header_stdc=no
1518 fi
1519 rm -f conftest*
1520
1521 if test $ac_cv_header_stdc = yes; then
1522   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1523 cat > conftest.$ac_ext <<EOF
1524 #line 1525 "configure"
1525 #include "confdefs.h"
1526 #include <string.h>
1527 EOF
1528 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1529   egrep "memchr" >/dev/null 2>&1; then
1530   :
1531 else
1532   rm -rf conftest*
1533   ac_cv_header_stdc=no
1534 fi
1535 rm -f conftest*
1536
1537 fi
1538
1539 if test $ac_cv_header_stdc = yes; then
1540   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1541 cat > conftest.$ac_ext <<EOF
1542 #line 1543 "configure"
1543 #include "confdefs.h"
1544 #include <stdlib.h>
1545 EOF
1546 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1547   egrep "free" >/dev/null 2>&1; then
1548   :
1549 else
1550   rm -rf conftest*
1551   ac_cv_header_stdc=no
1552 fi
1553 rm -f conftest*
1554
1555 fi
1556
1557 if test $ac_cv_header_stdc = yes; then
1558   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1559 if test "$cross_compiling" = yes; then
1560   :
1561 else
1562   cat > conftest.$ac_ext <<EOF
1563 #line 1564 "configure"
1564 #include "confdefs.h"
1565 #include <ctype.h>
1566 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1567 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1568 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1569 int main () { int i; for (i = 0; i < 256; i++)
1570 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1571 exit (0); }
1572
1573 EOF
1574 if { (eval echo configure:1575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1575 then
1576   :
1577 else
1578   echo "configure: failed program was:" >&5
1579   cat conftest.$ac_ext >&5
1580   rm -fr conftest*
1581   ac_cv_header_stdc=no
1582 fi
1583 rm -fr conftest*
1584 fi
1585
1586 fi
1587 fi
1588
1589 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1590 if test $ac_cv_header_stdc = yes; then
1591   cat >> confdefs.h <<\EOF
1592 #define STDC_HEADERS 1
1593 EOF
1594
1595 fi
1596
1597 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1598 echo "configure:1599: checking whether time.h and sys/time.h may both be included" >&5
1599 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1600   echo $ac_n "(cached) $ac_c" 1>&6
1601 else
1602   cat > conftest.$ac_ext <<EOF
1603 #line 1604 "configure"
1604 #include "confdefs.h"
1605 #include <sys/types.h>
1606 #include <sys/time.h>
1607 #include <time.h>
1608 int main() {
1609 struct tm *tp;
1610 ; return 0; }
1611 EOF
1612 if { (eval echo configure:1613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1613   rm -rf conftest*
1614   ac_cv_header_time=yes
1615 else
1616   echo "configure: failed program was:" >&5
1617   cat conftest.$ac_ext >&5
1618   rm -rf conftest*
1619   ac_cv_header_time=no
1620 fi
1621 rm -f conftest*
1622 fi
1623
1624 echo "$ac_t""$ac_cv_header_time" 1>&6
1625 if test $ac_cv_header_time = yes; then
1626   cat >> confdefs.h <<\EOF
1627 #define TIME_WITH_SYS_TIME 1
1628 EOF
1629
1630 fi
1631
1632 echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
1633 echo "configure:1634: checking whether string.h and strings.h may both be included" >&5
1634 if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then
1635   echo $ac_n "(cached) $ac_c" 1>&6
1636 else
1637   cat > conftest.$ac_ext <<EOF
1638 #line 1639 "configure"
1639 #include "confdefs.h"
1640 #include <string.h>
1641 #include <strings.h>
1642 int main() {
1643
1644 ; return 0; }
1645 EOF
1646 if { (eval echo configure:1647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1647   rm -rf conftest*
1648   gcc_cv_header_string=yes
1649 else
1650   echo "configure: failed program was:" >&5
1651   cat conftest.$ac_ext >&5
1652   rm -rf conftest*
1653   gcc_cv_header_string=no
1654 fi
1655 rm -f conftest*
1656 fi
1657
1658 echo "$ac_t""$gcc_cv_header_string" 1>&6
1659 if test $gcc_cv_header_string = yes; then
1660   cat >> confdefs.h <<\EOF
1661 #define STRING_WITH_STRINGS 1
1662 EOF
1663
1664 fi
1665
1666 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1667 echo "configure:1668: checking for sys/wait.h that is POSIX.1 compatible" >&5
1668 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1669   echo $ac_n "(cached) $ac_c" 1>&6
1670 else
1671   cat > conftest.$ac_ext <<EOF
1672 #line 1673 "configure"
1673 #include "confdefs.h"
1674 #include <sys/types.h>
1675 #include <sys/wait.h>
1676 #ifndef WEXITSTATUS
1677 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1678 #endif
1679 #ifndef WIFEXITED
1680 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1681 #endif
1682 int main() {
1683 int s;
1684 wait (&s);
1685 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1686 ; return 0; }
1687 EOF
1688 if { (eval echo configure:1689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1689   rm -rf conftest*
1690   ac_cv_header_sys_wait_h=yes
1691 else
1692   echo "configure: failed program was:" >&5
1693   cat conftest.$ac_ext >&5
1694   rm -rf conftest*
1695   ac_cv_header_sys_wait_h=no
1696 fi
1697 rm -f conftest*
1698 fi
1699
1700 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1701 if test $ac_cv_header_sys_wait_h = yes; then
1702   cat >> confdefs.h <<\EOF
1703 #define HAVE_SYS_WAIT_H 1
1704 EOF
1705
1706 fi
1707
1708 for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \
1709                  fcntl.h unistd.h sys/file.h sys/time.h \
1710                  sys/param.h sys/stat.h \
1711                  direct.h malloc.h
1712 do
1713 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1714 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1715 echo "configure:1716: checking for $ac_hdr" >&5
1716 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1717   echo $ac_n "(cached) $ac_c" 1>&6
1718 else
1719   cat > conftest.$ac_ext <<EOF
1720 #line 1721 "configure"
1721 #include "confdefs.h"
1722 #include <$ac_hdr>
1723 EOF
1724 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1725 { (eval echo configure:1726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1726 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1727 if test -z "$ac_err"; then
1728   rm -rf conftest*
1729   eval "ac_cv_header_$ac_safe=yes"
1730 else
1731   echo "$ac_err" >&5
1732   echo "configure: failed program was:" >&5
1733   cat conftest.$ac_ext >&5
1734   rm -rf conftest*
1735   eval "ac_cv_header_$ac_safe=no"
1736 fi
1737 rm -f conftest*
1738 fi
1739 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1740   echo "$ac_t""yes" 1>&6
1741     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1742   cat >> confdefs.h <<EOF
1743 #define $ac_tr_hdr 1
1744 EOF
1745  
1746 else
1747   echo "$ac_t""no" 1>&6
1748 fi
1749 done
1750
1751
1752 # Check for thread headers.
1753
1754 # These tests can't be done till we know if we have limits.h.
1755 echo $ac_n "checking for CHAR_BIT""... $ac_c" 1>&6
1756 echo "configure:1757: checking for CHAR_BIT" >&5
1757 if eval "test \"`echo '$''{'gcc_cv_decl_char_bit'+set}'`\" = set"; then
1758   echo $ac_n "(cached) $ac_c" 1>&6
1759 else
1760   cat > conftest.$ac_ext <<EOF
1761 #line 1762 "configure"
1762 #include "confdefs.h"
1763 #ifdef HAVE_LIMITS_H
1764 #include <limits.h>
1765 #endif
1766 #ifdef CHAR_BIT
1767 found
1768 #endif
1769 EOF
1770 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1771   egrep "found" >/dev/null 2>&1; then
1772   rm -rf conftest*
1773   gcc_cv_decl_char_bit=yes
1774 else
1775   rm -rf conftest*
1776   gcc_cv_decl_char_bit=no
1777 fi
1778 rm -f conftest*
1779
1780
1781 fi
1782
1783 echo "$ac_t""$gcc_cv_decl_char_bit" 1>&6
1784 if test $gcc_cv_decl_char_bit = no; then
1785   echo $ac_n "checking number of bits in a byte""... $ac_c" 1>&6
1786 echo "configure:1787: checking number of bits in a byte" >&5
1787 if eval "test \"`echo '$''{'gcc_cv_c_nbby'+set}'`\" = set"; then
1788   echo $ac_n "(cached) $ac_c" 1>&6
1789 else
1790   i=8
1791  gcc_cv_c_nbby=
1792  while test $i -lt 65; do
1793    cat > conftest.$ac_ext <<EOF
1794 #line 1795 "configure"
1795 #include "confdefs.h"
1796
1797 int main() {
1798 switch(0) {
1799   case (unsigned char)((unsigned long)1 << $i) == ((unsigned long)1 << $i):
1800   case (unsigned char)((unsigned long)1<<($i-1)) == ((unsigned long)1<<($i-1)):
1801   ; }
1802 ; return 0; }
1803 EOF
1804 if { (eval echo configure:1805: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1805   rm -rf conftest*
1806   gcc_cv_c_nbby=$i; break
1807 else
1808   echo "configure: failed program was:" >&5
1809   cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest*
1812    i=`expr $i + 1`
1813  done
1814  test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed
1815
1816 fi
1817
1818 echo "$ac_t""$gcc_cv_c_nbby" 1>&6
1819 if test $gcc_cv_c_nbby = failed; then
1820   { echo "configure: error: cannot determine number of bits in a byte" 1>&2; exit 1; }
1821 else
1822   cat >> confdefs.h <<EOF
1823 #define CHAR_BIT $gcc_cv_c_nbby
1824 EOF
1825
1826 fi
1827 fi
1828 echo $ac_n "checking byte ordering""... $ac_c" 1>&6
1829 echo "configure:1830: checking byte ordering" >&5
1830 if eval "test \"`echo '$''{'ac_cv_c_compile_endian'+set}'`\" = set"; then
1831   echo $ac_n "(cached) $ac_c" 1>&6
1832 else
1833   ac_cv_c_compile_endian=unknown
1834
1835 ac_ext=c
1836 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1837 ac_cpp='$CPP $CPPFLAGS'
1838 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1839 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1840 cross_compiling=$ac_cv_prog_cc_cross
1841
1842 cat > conftest.$ac_ext <<EOF
1843 #line 1844 "configure"
1844 #include "confdefs.h"
1845
1846 #ifdef HAVE_LIMITS_H
1847 # include <limits.h>
1848 #endif
1849 /* This structure must have no internal padding.  */
1850   struct {
1851     char prefix[sizeof "\nendian:" - 1];
1852     short word;
1853     char postfix[2];
1854  } tester = {
1855     "\nendian:",
1856 #if SIZEOF_SHORT == 4
1857     ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) |
1858 #endif
1859     ('A' << CHAR_BIT) | 'B',
1860     'X', '\n'
1861 };
1862 EOF
1863 if { (eval echo configure:1864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1864   od -c conftest.o |
1865     sed 's/^[0-7]*[     ]*/ /
1866           s/\*/./g
1867           s/ \\n/*/g
1868           s/ [0-9][0-9][0-9]/./g
1869           s/  \\[^ ]/./g' |
1870     tr -d '
1871  ' | tr -s '*' '
1872 ' | fold | sed '$a\
1873 ' > conftest.dmp
1874   if   grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then
1875     ac_cv_c_compile_endian=big-endian
1876   elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then
1877     ac_cv_c_compile_endian=little-endian
1878   fi
1879 fi
1880 rm -rf conftest*
1881 ac_ext=c
1882 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1883 ac_cpp='$CPP $CPPFLAGS'
1884 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1885 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1886 cross_compiling=$ac_cv_prog_cc_cross
1887
1888
1889 fi
1890
1891 echo "$ac_t""$ac_cv_c_compile_endian" 1>&6
1892 if test $ac_cv_c_compile_endian = unknown; then
1893   { echo "configure: error: *** unable to determine endianness" 1>&2; exit 1; }
1894 elif test $ac_cv_c_compile_endian = big-endian; then
1895   cat >> confdefs.h <<\EOF
1896 #define HOST_WORDS_BIG_ENDIAN 1
1897 EOF
1898
1899 fi
1900
1901
1902 # See if we have the mktemp command.
1903 # Extract the first word of "mktemp", so it can be a program name with args.
1904 set dummy mktemp; ac_word=$2
1905 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1906 echo "configure:1907: checking for $ac_word" >&5
1907 if eval "test \"`echo '$''{'ac_cv_prog_have_mktemp_command'+set}'`\" = set"; then
1908   echo $ac_n "(cached) $ac_c" 1>&6
1909 else
1910   if test -n "$have_mktemp_command"; then
1911   ac_cv_prog_have_mktemp_command="$have_mktemp_command" # Let the user override the test.
1912 else
1913   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1914   ac_dummy="$PATH"
1915   for ac_dir in $ac_dummy; do
1916     test -z "$ac_dir" && ac_dir=.
1917     if test -f $ac_dir/$ac_word; then
1918       ac_cv_prog_have_mktemp_command="yes"
1919       break
1920     fi
1921   done
1922   IFS="$ac_save_ifs"
1923   test -z "$ac_cv_prog_have_mktemp_command" && ac_cv_prog_have_mktemp_command="no"
1924 fi
1925 fi
1926 have_mktemp_command="$ac_cv_prog_have_mktemp_command"
1927 if test -n "$have_mktemp_command"; then
1928   echo "$ac_t""$have_mktemp_command" 1>&6
1929 else
1930   echo "$ac_t""no" 1>&6
1931 fi
1932
1933
1934 # Extract the first word of "strip", so it can be a program name with args.
1935 set dummy strip; ac_word=$2
1936 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1937 echo "configure:1938: checking for $ac_word" >&5
1938 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
1939   echo $ac_n "(cached) $ac_c" 1>&6
1940 else
1941   if test -n "$STRIP"; then
1942   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
1943 else
1944   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1945   ac_dummy="$PATH"
1946   for ac_dir in $ac_dummy; do
1947     test -z "$ac_dir" && ac_dir=.
1948     if test -f $ac_dir/$ac_word; then
1949       ac_cv_prog_STRIP="strip"
1950       break
1951     fi
1952   done
1953   IFS="$ac_save_ifs"
1954   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
1955 fi
1956 fi
1957 STRIP="$ac_cv_prog_STRIP"
1958 if test -n "$STRIP"; then
1959   echo "$ac_t""$STRIP" 1>&6
1960 else
1961   echo "$ac_t""no" 1>&6
1962 fi
1963
1964
1965 # See if the stage1 system preprocessor understands the ANSI C
1966 # preprocessor stringification operator.  (Used by symcat.h.)
1967
1968
1969 echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
1970 echo "configure:1971: checking for preprocessor stringizing operator" >&5
1971 if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then
1972   echo $ac_n "(cached) $ac_c" 1>&6
1973 else
1974   cat > conftest.$ac_ext <<EOF
1975 #line 1976 "configure"
1976 #include "confdefs.h"
1977
1978 #define x(y) #y
1979
1980 char *s = x(teststring);
1981
1982 EOF
1983 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1984   egrep "#teststring" >/dev/null 2>&1; then
1985   rm -rf conftest*
1986   ac_cv_c_stringize=no
1987 else
1988   rm -rf conftest*
1989   ac_cv_c_stringize=yes
1990 fi
1991 rm -f conftest*
1992
1993 fi
1994
1995 if test "${ac_cv_c_stringize}" = yes
1996 then
1997         cat >> confdefs.h <<\EOF
1998 #define HAVE_STRINGIZE 1
1999 EOF
2000
2001 fi
2002 echo "$ac_t""${ac_cv_c_stringize}" 1>&6
2003
2004
2005
2006 for ac_func in clock strchr strrchr lstat
2007 do
2008 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2009 echo "configure:2010: checking for $ac_func" >&5
2010 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2011   echo $ac_n "(cached) $ac_c" 1>&6
2012 else
2013   cat > conftest.$ac_ext <<EOF
2014 #line 2015 "configure"
2015 #include "confdefs.h"
2016 /* System header to define __stub macros and hopefully few prototypes,
2017     which can conflict with char $ac_func(); below.  */
2018 #include <assert.h>
2019 /* Override any gcc2 internal prototype to avoid an error.  */
2020 /* We use char because int might match the return type of a gcc2
2021     builtin and then its argument prototype would still apply.  */
2022 char $ac_func();
2023
2024 int main() {
2025
2026 /* The GNU C library defines this for functions which it implements
2027     to always fail with ENOSYS.  Some functions are actually named
2028     something starting with __ and the normal name is an alias.  */
2029 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2030 choke me
2031 #else
2032 $ac_func();
2033 #endif
2034
2035 ; return 0; }
2036 EOF
2037 if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2038   rm -rf conftest*
2039   eval "ac_cv_func_$ac_func=yes"
2040 else
2041   echo "configure: failed program was:" >&5
2042   cat conftest.$ac_ext >&5
2043   rm -rf conftest*
2044   eval "ac_cv_func_$ac_func=no"
2045 fi
2046 rm -f conftest*
2047 fi
2048
2049 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2050   echo "$ac_t""yes" 1>&6
2051     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2052   cat >> confdefs.h <<EOF
2053 #define $ac_tr_func 1
2054 EOF
2055  
2056 else
2057   echo "$ac_t""no" 1>&6
2058 fi
2059 done
2060
2061
2062 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
2063 echo "configure:2064: checking for ssize_t" >&5
2064 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
2065   echo $ac_n "(cached) $ac_c" 1>&6
2066 else
2067   cat > conftest.$ac_ext <<EOF
2068 #line 2069 "configure"
2069 #include "confdefs.h"
2070 #include <sys/types.h>
2071 #if STDC_HEADERS
2072 #include <stdlib.h>
2073 #include <stddef.h>
2074 #endif
2075 EOF
2076 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2077   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
2078   rm -rf conftest*
2079   ac_cv_type_ssize_t=yes
2080 else
2081   rm -rf conftest*
2082   ac_cv_type_ssize_t=no
2083 fi
2084 rm -f conftest*
2085
2086 fi
2087 echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
2088 if test $ac_cv_type_ssize_t = no; then
2089   cat >> confdefs.h <<\EOF
2090 #define ssize_t int
2091 EOF
2092
2093 fi
2094
2095
2096 for ac_func in getpagesize
2097 do
2098 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2099 echo "configure:2100: checking for $ac_func" >&5
2100 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2101   echo $ac_n "(cached) $ac_c" 1>&6
2102 else
2103   cat > conftest.$ac_ext <<EOF
2104 #line 2105 "configure"
2105 #include "confdefs.h"
2106 /* System header to define __stub macros and hopefully few prototypes,
2107     which can conflict with char $ac_func(); below.  */
2108 #include <assert.h>
2109 /* Override any gcc2 internal prototype to avoid an error.  */
2110 /* We use char because int might match the return type of a gcc2
2111     builtin and then its argument prototype would still apply.  */
2112 char $ac_func();
2113
2114 int main() {
2115
2116 /* The GNU C library defines this for functions which it implements
2117     to always fail with ENOSYS.  Some functions are actually named
2118     something starting with __ and the normal name is an alias.  */
2119 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2120 choke me
2121 #else
2122 $ac_func();
2123 #endif
2124
2125 ; return 0; }
2126 EOF
2127 if { (eval echo configure:2128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2128   rm -rf conftest*
2129   eval "ac_cv_func_$ac_func=yes"
2130 else
2131   echo "configure: failed program was:" >&5
2132   cat conftest.$ac_ext >&5
2133   rm -rf conftest*
2134   eval "ac_cv_func_$ac_func=no"
2135 fi
2136 rm -f conftest*
2137 fi
2138
2139 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2140   echo "$ac_t""yes" 1>&6
2141     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2142   cat >> confdefs.h <<EOF
2143 #define $ac_tr_func 1
2144 EOF
2145  
2146 else
2147   echo "$ac_t""no" 1>&6
2148 fi
2149 done
2150
2151 # The test program for the next two tests is the same except for one
2152 # set of ifdefs.
2153 cat >ct-mmap.inc <<'EOF'
2154 #include <sys/types.h>
2155 #include <sys/mman.h>
2156 #include <fcntl.h>
2157 #include <signal.h>
2158 #include <setjmp.h>
2159 #include <stdio.h>
2160
2161 #if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
2162 # define MAP_ANONYMOUS MAP_ANON
2163 #endif
2164
2165 /* This mess was copied from the GNU getpagesize.h.  */
2166 #ifndef HAVE_GETPAGESIZE
2167 # ifdef HAVE_UNISTD_H
2168 #  include <unistd.h>
2169 # endif
2170
2171 /* Assume that all systems that can run configure have sys/param.h.  */
2172 # ifndef HAVE_SYS_PARAM_H
2173 #  define HAVE_SYS_PARAM_H 1
2174 # endif
2175
2176 # ifdef _SC_PAGESIZE
2177 #  define getpagesize() sysconf(_SC_PAGESIZE)
2178 # else /* no _SC_PAGESIZE */
2179 #  ifdef HAVE_SYS_PARAM_H
2180 #   include <sys/param.h>
2181 #   ifdef EXEC_PAGESIZE
2182 #    define getpagesize() EXEC_PAGESIZE
2183 #   else /* no EXEC_PAGESIZE */
2184 #    ifdef NBPG
2185 #     define getpagesize() NBPG * CLSIZE
2186 #     ifndef CLSIZE
2187 #      define CLSIZE 1
2188 #     endif /* no CLSIZE */
2189 #    else /* no NBPG */
2190 #     ifdef NBPC
2191 #      define getpagesize() NBPC
2192 #     else /* no NBPC */
2193 #      ifdef PAGESIZE
2194 #       define getpagesize() PAGESIZE
2195 #      endif /* PAGESIZE */
2196 #     endif /* no NBPC */
2197 #    endif /* no NBPG */
2198 #   endif /* no EXEC_PAGESIZE */
2199 #  else /* no HAVE_SYS_PARAM_H */
2200 #   define getpagesize() 8192   /* punt totally */
2201 #  endif /* no HAVE_SYS_PARAM_H */
2202 # endif /* no _SC_PAGESIZE */
2203
2204 #endif /* no HAVE_GETPAGESIZE */
2205
2206 #ifndef MAP_FAILED
2207 # define MAP_FAILED -1
2208 #endif
2209
2210 #undef perror_exit
2211 #define perror_exit(str, val) \
2212   do { perror(str); exit(val); } while (0)
2213
2214 /* Some versions of cygwin mmap require that munmap is called with the
2215    same parameters as mmap.  GCC expects that this is not the case.
2216    Test for various forms of this problem.  Warning - icky signal games.  */
2217
2218 static sigset_t unblock_sigsegv;
2219 static jmp_buf r;
2220 static size_t pg;
2221 static int devzero;
2222
2223 static char *
2224 anonmap (size)
2225      size_t size;
2226 {
2227 #ifdef USE_MAP_ANON
2228   return (char *) mmap (0, size, PROT_READ|PROT_WRITE,
2229                         MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
2230 #else
2231   return (char *) mmap (0, size, PROT_READ|PROT_WRITE,
2232                         MAP_PRIVATE, devzero, 0);
2233 #endif
2234 }
2235
2236 static void
2237 sigsegv (unused)
2238      int unused;
2239 {
2240   sigprocmask (SIG_UNBLOCK, &unblock_sigsegv, 0);
2241   longjmp (r, 1);
2242 }
2243
2244 /* Basic functionality test.  */
2245 void
2246 test_0 ()
2247 {
2248   char *x = anonmap (pg);
2249   if (x == (char *) MAP_FAILED)
2250     perror_exit("test 0 mmap", 2);
2251
2252   *(int *)x += 1;
2253
2254   if (munmap(x, pg) < 0)
2255     perror_exit("test 0 munmap", 3);
2256 }
2257
2258 /* 1. If we map a 2-page region and unmap its second page, the first page
2259    must remain.  */
2260 static void
2261 test_1 ()
2262 {
2263   char *x = anonmap (pg * 2);
2264   if (x == (char *)MAP_FAILED)
2265     perror_exit ("test 1 mmap", 4);
2266
2267   signal (SIGSEGV, sigsegv);
2268   if (setjmp (r))
2269     perror_exit ("test 1 fault", 5);
2270
2271   x[0] = 1;
2272   x[pg] = 1;
2273
2274   if (munmap (x + pg, pg) < 0)
2275     perror_exit ("test 1 munmap 1", 6);
2276   x[0] = 2;
2277
2278   if (setjmp (r) == 0)
2279     {
2280       x[pg] = 1;
2281       perror_exit ("test 1 no fault", 7);
2282     }
2283   if (munmap (x, pg) < 0)
2284     perror_exit ("test 1 munmap 2", 8);
2285 }
2286
2287 /* 2. If we map a 2-page region and unmap its first page, the second
2288    page must remain.  */
2289 static void
2290 test_2 ()
2291 {
2292   char *x = anonmap (pg * 2);
2293   if (x == (char *)MAP_FAILED)
2294     perror_exit ("test 2 mmap", 9);
2295
2296   signal (SIGSEGV, sigsegv);
2297   if (setjmp (r))
2298     perror_exit ("test 2 fault", 10);
2299
2300   x[0] = 1;
2301   x[pg] = 1;
2302
2303   if (munmap (x, pg) < 0)
2304     perror_exit ("test 2 munmap 1", 11);
2305
2306   x[pg] = 2;
2307
2308   if (setjmp (r) == 0)
2309     {
2310       x[0] = 1;
2311       perror_exit ("test 2 no fault", 12);
2312     }
2313
2314   if (munmap (x+pg, pg) < 0)
2315     perror_exit ("test 2 munmap 2", 13);
2316 }
2317
2318 /* 3. If we map two adjacent 1-page regions and unmap them both with
2319    one munmap, both must go away.
2320
2321    Getting two adjacent 1-page regions with two mmap calls is slightly
2322    tricky.  All OS's tested skip over already-allocated blocks; therefore
2323    we have been careful to unmap all allocated regions in previous tests.
2324    HP/UX allocates pages backward in memory.  No OS has yet been observed
2325    to be so perverse as to leave unmapped space between consecutive calls
2326    to mmap.  */
2327
2328 static void
2329 test_3 ()
2330 {
2331   char *x, *y, *z;
2332
2333   x = anonmap (pg);
2334   if (x == (char *)MAP_FAILED)
2335     perror_exit ("test 3 mmap 1", 14);
2336   y = anonmap (pg);
2337   if (y == (char *)MAP_FAILED)
2338     perror_exit ("test 3 mmap 2", 15);
2339
2340   if (y != x + pg)
2341     {
2342       if (y == x - pg)
2343         z = y, y = x, x = z;
2344       else
2345         {
2346           fprintf (stderr, "test 3 nonconsecutive pages - %lx, %lx\n",
2347                    (unsigned long)x, (unsigned long)y);
2348           exit (16);
2349         }
2350     }
2351
2352   signal (SIGSEGV, sigsegv);
2353   if (setjmp (r))
2354     perror_exit ("test 3 fault", 17);
2355
2356   x[0] = 1;
2357   y[0] = 1;
2358
2359   if (munmap (x, pg*2) < 0)
2360     perror_exit ("test 3 munmap", 18);
2361
2362   if (setjmp (r) == 0)
2363     {
2364       x[0] = 1;
2365       perror_exit ("test 3 no fault 1", 19);
2366     }
2367   
2368   signal (SIGSEGV, sigsegv);
2369   if (setjmp (r) == 0)
2370     {
2371       y[0] = 1;
2372       perror_exit ("test 3 no fault 2", 20);
2373     }
2374 }
2375
2376 int
2377 main ()
2378 {
2379   sigemptyset (&unblock_sigsegv);
2380   sigaddset (&unblock_sigsegv, SIGSEGV);
2381   pg = getpagesize ();
2382 #ifndef USE_MAP_ANON
2383   devzero = open ("/dev/zero", O_RDWR);
2384   if (devzero < 0)
2385     perror_exit ("open /dev/zero", 1);
2386 #endif
2387
2388   test_0();
2389   test_1();
2390   test_2();
2391   test_3();
2392
2393   exit(0);
2394 }
2395 EOF
2396
2397 echo $ac_n "checking for working mmap from /dev/zero""... $ac_c" 1>&6
2398 echo "configure:2399: checking for working mmap from /dev/zero" >&5
2399 if eval "test \"`echo '$''{'ac_cv_func_mmap_dev_zero'+set}'`\" = set"; then
2400   echo $ac_n "(cached) $ac_c" 1>&6
2401 else
2402   if test "$cross_compiling" = yes; then
2403   # If this is not cygwin, and /dev/zero is a character device, it's probably
2404  # safe to assume it works.
2405  case "$host_os" in
2406    cygwin* | win32 | pe | mingw* ) ac_cv_func_mmap_dev_zero=buggy ;;
2407    * ) if test -c /dev/zero
2408        then ac_cv_func_mmap_dev_zero=yes
2409        else ac_cv_func_mmap_dev_zero=no
2410        fi ;;
2411   esac
2412 else
2413   cat > conftest.$ac_ext <<EOF
2414 #line 2415 "configure"
2415 #include "confdefs.h"
2416 #include "ct-mmap.inc"
2417 EOF
2418 if { (eval echo configure:2419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2419 then
2420   ac_cv_func_mmap_dev_zero=yes
2421 else
2422   echo "configure: failed program was:" >&5
2423   cat conftest.$ac_ext >&5
2424   rm -fr conftest*
2425   if test $? -lt 4
2426  then ac_cv_func_mmap_dev_zero=no
2427  else ac_cv_func_mmap_dev_zero=buggy
2428  fi
2429 fi
2430 rm -fr conftest*
2431 fi
2432
2433
2434 fi
2435
2436 echo "$ac_t""$ac_cv_func_mmap_dev_zero" 1>&6
2437 if test $ac_cv_func_mmap_dev_zero = yes; then
2438   cat >> confdefs.h <<\EOF
2439 #define HAVE_MMAP_DEV_ZERO 1
2440 EOF
2441
2442 fi
2443
2444 echo $ac_n "checking for working mmap with MAP_ANON(YMOUS)""... $ac_c" 1>&6
2445 echo "configure:2446: checking for working mmap with MAP_ANON(YMOUS)" >&5
2446 if eval "test \"`echo '$''{'ac_cv_func_mmap_anon'+set}'`\" = set"; then
2447   echo $ac_n "(cached) $ac_c" 1>&6
2448 else
2449   if test "$cross_compiling" = yes; then
2450   # Unlike /dev/zero, it is not safe to assume MAP_ANON(YMOUS) works
2451  # just because it's there. Some SCO Un*xen define it but don't implement it.
2452  ac_cv_func_mmap_anon=no
2453 else
2454   cat > conftest.$ac_ext <<EOF
2455 #line 2456 "configure"
2456 #include "confdefs.h"
2457 #define USE_MAP_ANON
2458 #include "ct-mmap.inc"
2459 EOF
2460 if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2461 then
2462   ac_cv_func_mmap_anon=yes
2463 else
2464   echo "configure: failed program was:" >&5
2465   cat conftest.$ac_ext >&5
2466   rm -fr conftest*
2467   if test $? -lt 4
2468  then ac_cv_func_mmap_anon=no
2469  else ac_cv_func_mmap_anon=buggy
2470  fi
2471 fi
2472 rm -fr conftest*
2473 fi
2474
2475
2476 fi
2477
2478 echo "$ac_t""$ac_cv_func_mmap_anon" 1>&6
2479 if test $ac_cv_func_mmap_anon = yes; then
2480   cat >> confdefs.h <<\EOF
2481 #define HAVE_MMAP_ANON 1
2482 EOF
2483
2484 fi
2485 rm -f ct-mmap.inc
2486
2487 echo $ac_n "checking for working mmap of a file""... $ac_c" 1>&6
2488 echo "configure:2489: checking for working mmap of a file" >&5
2489 if eval "test \"`echo '$''{'ac_cv_func_mmap_file'+set}'`\" = set"; then
2490   echo $ac_n "(cached) $ac_c" 1>&6
2491 else
2492   # Create a file one thousand bytes long.
2493 for i in 1 2 3 4 5 6 7 8 9 0
2494 do for j in 1 2 3 4 5 6 7 8 9 0
2495 do echo $i $j xxxxx
2496 done
2497 done > conftestdata$$
2498
2499 if test "$cross_compiling" = yes; then
2500   ac_cv_func_mmap_file=no
2501 else
2502   cat > conftest.$ac_ext <<EOF
2503 #line 2504 "configure"
2504 #include "confdefs.h"
2505
2506 /* Test by Zack Weinberg.  Modified from MMAP_ANYWHERE test by
2507    Richard Henderson and Alexandre Oliva.
2508    Check whether read-only mmap of a plain file works. */
2509 #include <sys/types.h>
2510 #include <sys/stat.h>
2511 #include <fcntl.h>
2512 #include <sys/mman.h>
2513
2514 int main()
2515 {
2516   char *x;
2517   int fd;
2518   struct stat st;
2519
2520   fd = open("conftestdata$$", O_RDONLY);
2521   if (fd < 0)
2522     exit(1);
2523
2524   if (fstat (fd, &st))
2525     exit(2);
2526
2527   x = (char*)mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
2528   if (x == (char *) -1)
2529     exit(3);
2530
2531   if (x[0] != '1' || x[1] != ' ' || x[2] != '1' || x[3] != ' ')
2532     exit(4);
2533
2534   if (munmap(x, st.st_size) < 0)
2535     exit(5);
2536
2537   exit(0);
2538 }
2539 EOF
2540 if { (eval echo configure:2541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2541 then
2542   ac_cv_func_mmap_file=yes
2543 else
2544   echo "configure: failed program was:" >&5
2545   cat conftest.$ac_ext >&5
2546   rm -fr conftest*
2547   ac_cv_func_mmap_file=no
2548 fi
2549 rm -fr conftest*
2550 fi
2551
2552 fi
2553
2554 echo "$ac_t""$ac_cv_func_mmap_file" 1>&6
2555 if test $ac_cv_func_mmap_file = yes; then
2556   cat >> confdefs.h <<\EOF
2557 #define HAVE_MMAP_FILE 1
2558 EOF
2559
2560 fi
2561
2562
2563 # We will need to find libiberty.h and ansidecl.h
2564 saved_CFLAGS="$CFLAGS"
2565 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
2566 for ac_func in getenv abort errno \
2567         malloc realloc calloc free clock
2568 do
2569   ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2570 echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
2571 echo "configure:2572: checking whether $ac_func is declared" >&5
2572 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
2573   echo $ac_n "(cached) $ac_c" 1>&6
2574 else
2575   cat > conftest.$ac_ext <<EOF
2576 #line 2577 "configure"
2577 #include "confdefs.h"
2578 #undef $ac_tr_decl
2579 #define $ac_tr_decl 1
2580   
2581 #include "ansidecl.h"
2582 #include "system.h"
2583
2584 int main() {
2585 #ifndef $ac_func
2586 char *(*pfn) = (char *(*)) $ac_func ;
2587 #endif
2588 ; return 0; }
2589 EOF
2590 if { (eval echo configure:2591: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2591   rm -rf conftest*
2592   eval "gcc_cv_have_decl_$ac_func=yes"
2593 else
2594   echo "configure: failed program was:" >&5
2595   cat conftest.$ac_ext >&5
2596   rm -rf conftest*
2597   eval "gcc_cv_have_decl_$ac_func=no"
2598 fi
2599 rm -f conftest*
2600 fi
2601
2602 if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
2603   echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
2604 #define $ac_tr_decl 1
2605 EOF
2606  
2607 else
2608   echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
2609 #define $ac_tr_decl 0
2610 EOF
2611  
2612 fi
2613
2614 done
2615 if test x = y ; then
2616   cat >> confdefs.h <<\EOF
2617 #define HAVE_DECL_GETENV 1
2618 EOF
2619  cat >> confdefs.h <<\EOF
2620 #define HAVE_DECL_ABORT 1
2621 EOF
2622  cat >> confdefs.h <<\EOF
2623 #define HAVE_DECL_ERRNO 1
2624 EOF
2625  \
2626         cat >> confdefs.h <<\EOF
2627 #define HAVE_DECL_MALLOC 1
2628 EOF
2629  cat >> confdefs.h <<\EOF
2630 #define HAVE_DECL_REALLOC 1
2631 EOF
2632  cat >> confdefs.h <<\EOF
2633 #define HAVE_DECL_CALLOC 1
2634 EOF
2635  cat >> confdefs.h <<\EOF
2636 #define HAVE_DECL_FREE 1
2637 EOF
2638  cat >> confdefs.h <<\EOF
2639 #define HAVE_DECL_CLOCK 1
2640 EOF
2641 fi
2642
2643
2644 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
2645 CFLAGS="$saved_CFLAGS"
2646
2647 # mkdir takes a single argument on some systems. 
2648 echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
2649 echo "configure:2650: checking if mkdir takes one argument" >&5
2650 if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then
2651   echo $ac_n "(cached) $ac_c" 1>&6
2652 else
2653   cat > conftest.$ac_ext <<EOF
2654 #line 2655 "configure"
2655 #include "confdefs.h"
2656
2657 #include <sys/types.h>
2658 #ifdef HAVE_SYS_STAT_H
2659 # include <sys/stat.h>
2660 #endif
2661 #ifdef HAVE_UNISTD_H
2662 # include <unistd.h>
2663 #endif
2664 #ifdef HAVE_DIRECT_H
2665 # include <direct.h>
2666 #endif
2667 int main() {
2668 mkdir ("foo", 0);
2669 ; return 0; }
2670 EOF
2671 if { (eval echo configure:2672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2672   rm -rf conftest*
2673   gcc_cv_mkdir_takes_one_arg=no
2674 else
2675   echo "configure: failed program was:" >&5
2676   cat conftest.$ac_ext >&5
2677   rm -rf conftest*
2678   gcc_cv_mkdir_takes_one_arg=yes
2679 fi
2680 rm -f conftest*
2681 fi
2682
2683 echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6
2684 if test $gcc_cv_mkdir_takes_one_arg = yes ; then
2685   cat >> confdefs.h <<\EOF
2686 #define MKDIR_TAKES_ONE_ARG 1
2687 EOF
2688
2689 fi
2690
2691
2692 # File extensions
2693 manext='.1'
2694 objext='.o'
2695
2696
2697
2698 build_xm_file=
2699 build_xm_defines=
2700 build_install_headers_dir=install-headers-tar
2701 build_exeext=
2702 host_xm_file=
2703 host_xm_defines=
2704 host_xmake_file=
2705 host_truncate_target=
2706 host_exeext=
2707
2708 # Decode the host machine, then the target machine.
2709 # For the host machine, we save the xm_file variable as host_xm_file;
2710 # then we decode the target machine and forget everything else
2711 # that came from the host machine.
2712 #for machine in $build $host $target; do
2713 #       . ${srcdir}/config.gcc
2714 #done
2715
2716 extra_objs="${host_extra_objs} ${extra_objs}"
2717
2718 # Default the target-machine variables that were not explicitly set.
2719 if test x"$tm_file" = x
2720 then tm_file=$cpu_type/$cpu_type.h; fi
2721
2722 if test x"$extra_headers" = x
2723 then extra_headers=; fi
2724
2725 if test x$md_file = x
2726 then md_file=$cpu_type/$cpu_type.md; fi
2727
2728 if test x$out_file = x
2729 then out_file=$cpu_type/$cpu_type.c; fi
2730
2731 if test x"$tmake_file" = x
2732 then tmake_file=$cpu_type/t-$cpu_type
2733 fi
2734
2735 if test x"$dwarf2" = xyes
2736 then tm_file="$tm_file tm-dwarf2.h"
2737 fi
2738
2739 # Handle cpp installation.
2740 if test x$enable_cpp != xno
2741 then
2742   tmake_file="$tmake_file t-install-cpp"
2743 fi
2744
2745 # auto-host.h is the file containing items generated by autoconf and is
2746 # the first file included by config.h.
2747 # If host=build, it is correct to have hconfig include auto-host.h
2748 # as well.  If host!=build, we are in error and need to do more 
2749 # work to find out the build config parameters.
2750 if test x$host = x$build
2751 then
2752         build_auto=auto-host.h
2753 else
2754         # We create a subdir, then run autoconf in the subdir.
2755         # To prevent recursion we set host and build for the new
2756         # invocation of configure to the build for this invocation
2757         # of configure. 
2758         tempdir=build.$$
2759         rm -rf $tempdir
2760         mkdir $tempdir
2761         cd $tempdir
2762         case ${srcdir} in
2763         /* | A-Za-z:\\/* ) realsrcdir=${srcdir};;
2764         *) realsrcdir=../${srcdir};;
2765         esac
2766         CC=${CC_FOR_BUILD} ${realsrcdir}/configure \
2767                 --target=$target --host=$build --build=$build
2768
2769         # We just finished tests for the build machine, so rename
2770         # the file auto-build.h in the gcc directory.
2771         mv auto-host.h ../auto-build.h
2772         cd ..
2773         rm -rf $tempdir
2774         build_auto=auto-build.h
2775 fi
2776
2777 tm_file="${tm_file} defaults.h"
2778 host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}"
2779 build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}"
2780 xm_file="ansidecl.h ${xm_file} ${tm_file}"
2781
2782 # Truncate the target if necessary
2783 if test x$host_truncate_target != x; then
2784         target=`echo $target | sed -e 's/\(..............\).*/\1/'`
2785 fi
2786
2787 # Get the version trigger filename from the toplevel
2788 if test "${with_gcc_version_trigger+set}" = set; then
2789         gcc_version_trigger=$with_gcc_version_trigger
2790 else
2791         gcc_version_trigger=${srcdir}/version.c
2792 fi
2793 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
2794 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
2795
2796 # Compile in configure arguments.
2797 if test -f configargs.h ; then
2798         # Being re-configured.
2799         gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
2800         gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
2801 else
2802         gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
2803 fi
2804 cat > configargs.h <<EOF
2805 /* Generated automatically. */
2806 static const char configuration_arguments[] = "$gcc_config_arguments";
2807 static const char thread_model[] = "$thread_file";
2808 EOF
2809
2810 # Internationalization
2811 PACKAGE=sdcc
2812 VERSION="$gcc_version"
2813 cat >> confdefs.h <<EOF
2814 #define PACKAGE "$PACKAGE"
2815 EOF
2816
2817 cat >> confdefs.h <<EOF
2818 #define VERSION "$VERSION"
2819 EOF
2820
2821
2822
2823
2824 ALL_LINGUAS="sv"
2825
2826 # Get an absolute path to the GCC top-level source directory
2827 holddir=`pwd`
2828 cd $srcdir
2829 topdir=`pwd`
2830 cd $holddir
2831
2832 out_object_file=`basename $out_file .c`.o
2833
2834 # Figure out what assembler we will be using.
2835 echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
2836 echo "configure:2837: checking what assembler to use" >&5
2837 gcc_cv_as=
2838 gcc_cv_gas_major_version=
2839 gcc_cv_gas_minor_version=
2840 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
2841 if test -x "$DEFAULT_ASSEMBLER"; then
2842         gcc_cv_as="$DEFAULT_ASSEMBLER"
2843 elif test -x "$AS"; then
2844         gcc_cv_as="$AS"
2845 elif test -x as$host_exeext; then
2846         # Build using assembler in the current directory.
2847         gcc_cv_as=./as$host_exeext
2848 elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then
2849         # Single tree build which includes gas.
2850         for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
2851         do
2852                 gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
2853                 if test x$gcc_cv_gas_version != x; then
2854                         break
2855                 fi
2856         done
2857         gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
2858         gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
2859 fi
2860
2861 if test "x$gcc_cv_as" = x -a x$host = x$target; then
2862         # Native build.
2863         # Search the same directories that the installed compiler will
2864         # search.  Else we may find the wrong assembler and lose.  If we
2865         # do not find a suitable assembler binary, then try the user's
2866         # path.
2867         #
2868         # Also note we have to check MD_EXEC_PREFIX before checking the
2869         # user's path.  Unfortunately, there is no good way to get at the
2870         # value of MD_EXEC_PREFIX here.  So we do a brute force search
2871         # through all the known MD_EXEC_PREFIX values.  Ugh.  This needs
2872         # to be fixed as part of the make/configure rewrite too.
2873
2874         if test "x$exec_prefix" = xNONE; then
2875                 if test "x$prefix" = xNONE; then
2876                         test_prefix=/usr/local
2877                 else
2878                         test_prefix=$prefix
2879                 fi
2880         else
2881                 test_prefix=$exec_prefix
2882         fi
2883
2884         # If the loop below does not find an assembler, then use whatever
2885         # one we can find in the users's path.
2886         # user's path.
2887         gcc_cv_as=as$host_exeext
2888
2889         test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \
2890                    $test_prefix/lib/gcc-lib/$target \
2891                    /usr/lib/gcc/$target/$gcc_version \
2892                    /usr/lib/gcc/$target \
2893                    $test_prefix/$target/bin/$target/$gcc_version \
2894                    $test_prefix/$target/bin \
2895                    /usr/libexec \
2896                    /usr/ccs/gcc \
2897                    /usr/ccs/bin \
2898                    /udk/usr/ccs/bin \
2899                    /bsd43/usr/lib/cmplrs/cc \
2900                    /usr/cross64/usr/bin \
2901                    /usr/lib/cmplrs/cc \
2902                    /sysv/usr/lib/cmplrs/cc \
2903                    /svr4/usr/lib/cmplrs/cc \
2904                    /usr/bin"
2905
2906         for dir in $test_dirs; do
2907                 if test -f $dir/as$host_exeext; then
2908                         gcc_cv_as=$dir/as$host_exeext
2909                         break;
2910                 fi
2911         done
2912 fi
2913 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
2914   echo "$ac_t"""newly built gas"" 1>&6
2915 else
2916   echo "$ac_t""$gcc_cv_as" 1>&6
2917 fi
2918
2919 # Figure out what nm we will be using.
2920 echo $ac_n "checking what nm to use""... $ac_c" 1>&6
2921 echo "configure:2922: checking what nm to use" >&5
2922 if test -x nm$host_exeext; then
2923         gcc_cv_nm=./nm$host_exeext
2924 elif test x$host = x$target; then
2925         # Native build.
2926         gcc_cv_nm=nm$host_exeext
2927 fi
2928 echo "$ac_t""$gcc_cv_nm" 1>&6
2929
2930
2931 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
2932 echo "configure:2933: checking whether to enable maintainer-specific portions of Makefiles" >&5
2933     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
2934 if test "${enable_maintainer_mode+set}" = set; then
2935   enableval="$enable_maintainer_mode"
2936   maintainer_mode=$enableval
2937 else
2938   maintainer_mode=no
2939 fi
2940
2941
2942 echo "$ac_t""$maintainer_mode" 1>&6
2943
2944 if test "$maintainer_mode" = "yes"; then
2945   MAINT=''
2946 else
2947   MAINT='#'
2948 fi
2949
2950 # These (without "all_") are set in each config-lang.in.
2951 # `language' must be a single word so is spelled singularly.
2952 all_stagestuff=
2953 all_outputs='Makefile'
2954 # List of language makefile fragments.
2955
2956 # Add the language fragments.
2957 # Languages are added via two mechanisms.  Some information must be
2958 # recorded in makefile variables, these are defined in config-lang.in.
2959 # We accumulate them and plug them into the main Makefile.
2960 # The other mechanism is a set of hooks for each of the main targets
2961 # like `clean', `install', etc.
2962
2963 language_fragments="Make-lang"
2964
2965 # Define variables host_canonical and build_canonical
2966 # because some Cygnus local changes in the Makefile depend on them.
2967 build_canonical=${build}
2968 host_canonical=${host}
2969 target_subdir=
2970 if test "${host}" != "${target}" ; then
2971     target_subdir=${target_alias}/
2972 fi
2973
2974
2975
2976         
2977 # Nothing to do for FLOAT_H, float_format already handled.
2978 objdir=`pwd`
2979
2980
2981 # Substitute configuration variables
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013 #AC_SUBST_FILE(target_overrides)
3014 #AC_SUBST_FILE(host_overrides)
3015 #AC_SUBST(cross_defines)
3016 #AC_SUBST_FILE(cross_overrides)
3017 #AC_SUBST_FILE(build_overrides)
3018
3019 # Create the Makefile
3020 # and configure language subdirectories
3021 trap '' 1 2 15
3022 cat > confcache <<\EOF
3023 # This file is a shell script that caches the results of configure
3024 # tests run on this system so they can be shared between configure
3025 # scripts and configure runs.  It is not useful on other systems.
3026 # If it contains results you don't want to keep, you may remove or edit it.
3027 #
3028 # By default, configure uses ./config.cache as the cache file,
3029 # creating it if it does not exist already.  You can give configure
3030 # the --cache-file=FILE option to use a different cache file; that is
3031 # what configure does when it calls configure scripts in
3032 # subdirectories, so they share the cache.
3033 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3034 # config.status only pays attention to the cache file if you give it the
3035 # --recheck option to rerun configure.
3036 #
3037 EOF
3038 # The following way of writing the cache mishandles newlines in values,
3039 # but we know of no workaround that is simple, portable, and efficient.
3040 # So, don't put newlines in cache variables' values.
3041 # Ultrix sh set writes to stderr and can't be redirected directly,
3042 # and sets the high bit in the cache file unless we assign to the vars.
3043 (set) 2>&1 |
3044   case `(ac_space=' '; set | grep ac_space) 2>&1` in
3045   *ac_space=\ *)
3046     # `set' does not quote correctly, so add quotes (double-quote substitution
3047     # turns \\\\ into \\, and sed turns \\ into \).
3048     sed -n \
3049       -e "s/'/'\\\\''/g" \
3050       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3051     ;;
3052   *)
3053     # `set' quotes correctly as required by POSIX, so do not add quotes.
3054     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3055     ;;
3056   esac >> confcache
3057 if cmp -s $cache_file confcache; then
3058   :
3059 else
3060   if test -w $cache_file; then
3061     echo "updating cache $cache_file"
3062     cat confcache > $cache_file
3063   else
3064     echo "not updating unwritable cache $cache_file"
3065   fi
3066 fi
3067 rm -f confcache
3068
3069 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3070
3071 test "x$prefix" = xNONE && prefix=$ac_default_prefix
3072 # Let make expand exec_prefix.
3073 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3074
3075 # Any assignment to VPATH causes Sun make to only execute
3076 # the first set of double-colon rules, so remove it if not needed.
3077 # If there is a colon in the path, we need to keep it.
3078 if test "x$srcdir" = x.; then
3079   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
3080 fi
3081
3082 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3083
3084 DEFS=-DHAVE_CONFIG_H
3085
3086 # Without the "./", some shells look in PATH for config.status.
3087 : ${CONFIG_STATUS=./config.status}
3088
3089 echo creating $CONFIG_STATUS
3090 rm -f $CONFIG_STATUS
3091 cat > $CONFIG_STATUS <<EOF
3092 #! /bin/sh
3093 # Generated automatically by configure.
3094 # Run this file to recreate the current configuration.
3095 # This directory was configured as follows,
3096 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3097 #
3098 # $0 $ac_configure_args
3099 #
3100 # Compiler output produced by configure, useful for debugging
3101 # configure, is in ./config.log if it exists.
3102
3103 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3104 for ac_option
3105 do
3106   case "\$ac_option" in
3107   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3108     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3109     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3110   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3111     echo "$CONFIG_STATUS generated by autoconf version 2.13"
3112     exit 0 ;;
3113   -help | --help | --hel | --he | --h)
3114     echo "\$ac_cs_usage"; exit 0 ;;
3115   *) echo "\$ac_cs_usage"; exit 1 ;;
3116   esac
3117 done
3118
3119 ac_given_srcdir=$srcdir
3120
3121 trap 'rm -fr `echo "$all_outputs auto-host.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
3122 EOF
3123 cat >> $CONFIG_STATUS <<EOF
3124
3125 # Protect against being on the right side of a sed subst in config.status.
3126 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3127  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3128 $ac_vpsub
3129 $extrasub
3130 s%@SHELL@%$SHELL%g
3131 s%@CFLAGS@%$CFLAGS%g
3132 s%@CPPFLAGS@%$CPPFLAGS%g
3133 s%@CXXFLAGS@%$CXXFLAGS%g
3134 s%@FFLAGS@%$FFLAGS%g
3135 s%@DEFS@%$DEFS%g
3136 s%@LDFLAGS@%$LDFLAGS%g
3137 s%@LIBS@%$LIBS%g
3138 s%@exec_prefix@%$exec_prefix%g
3139 s%@prefix@%$prefix%g
3140 s%@program_transform_name@%$program_transform_name%g
3141 s%@bindir@%$bindir%g
3142 s%@sbindir@%$sbindir%g
3143 s%@libexecdir@%$libexecdir%g
3144 s%@datadir@%$datadir%g
3145 s%@sysconfdir@%$sysconfdir%g
3146 s%@sharedstatedir@%$sharedstatedir%g
3147 s%@localstatedir@%$localstatedir%g
3148 s%@libdir@%$libdir%g
3149 s%@includedir@%$includedir%g
3150 s%@oldincludedir@%$oldincludedir%g
3151 s%@infodir@%$infodir%g
3152 s%@mandir@%$mandir%g
3153 s%@CC@%$CC%g
3154 s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
3155 s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
3156 s%@CPP@%$CPP%g
3157 s%@warn_cflags@%$warn_cflags%g
3158 s%@SET_MAKE@%$SET_MAKE%g
3159 s%@LN@%$LN%g
3160 s%@LN_S@%$LN_S%g
3161 s%@RANLIB@%$RANLIB%g
3162 s%@INSTALL@%$INSTALL%g
3163 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3164 s%@INSTALL_DATA@%$INSTALL_DATA%g
3165 s%@have_mktemp_command@%$have_mktemp_command%g
3166 s%@STRIP@%$STRIP%g
3167 s%@manext@%$manext%g
3168 s%@objext@%$objext%g
3169 s%@PACKAGE@%$PACKAGE%g
3170 s%@VERSION@%$VERSION%g
3171 s%@MAINT@%$MAINT%g
3172 s%@build_canonical@%$build_canonical%g
3173 s%@host_canonical@%$host_canonical%g
3174 s%@target_subdir@%$target_subdir%g
3175 s%@objdir@%$objdir%g
3176 s%@all_stagestuff@%$all_stagestuff%g
3177 s%@build_exeext@%$build_exeext%g
3178 s%@build_install_headers_dir@%$build_install_headers_dir%g
3179 s%@build_xm_file_list@%$build_xm_file_list%g
3180 s%@build_xm_file@%$build_xm_file%g
3181 s%@build_xm_defines@%$build_xm_defines%g
3182 s%@check_languages@%$check_languages%g
3183 s%@dep_host_xmake_file@%$dep_host_xmake_file%g
3184 s%@dep_tmake_file@%$dep_tmake_file%g
3185 s%@extra_c_flags@%$extra_c_flags%g
3186 s%@extra_headers_list@%$extra_headers_list%g
3187 s%@extra_objs@%$extra_objs%g
3188 s%@extra_parts@%$extra_parts%g
3189 s%@extra_passes@%$extra_passes%g
3190 s%@extra_programs@%$extra_programs%g
3191 s%@gcc_config_arguments@%$gcc_config_arguments%g
3192 s%@gcc_version@%$gcc_version%g
3193 s%@gcc_version_full@%$gcc_version_full%g
3194 s%@gcc_version_trigger@%$gcc_version_trigger%g
3195 s%@host_exeext@%$host_exeext%g
3196 s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
3197 s%@install@%$install%g
3198 s%@lang_tree_files@%$lang_tree_files%g
3199 s%@local_prefix@%$local_prefix%g
3200 s%@md_file@%$md_file%g
3201 s%@out_file@%$out_file%g
3202 s%@out_object_file@%$out_object_file%g
3203 s%@symbolic_link@%$symbolic_link%g
3204 s%@thread_file@%$thread_file%g
3205 s%@c_target_objs@%$c_target_objs%g
3206
3207 CEOF
3208 EOF
3209
3210 cat >> $CONFIG_STATUS <<\EOF
3211
3212 # Split the substitutions into bite-sized pieces for seds with
3213 # small command number limits, like on Digital OSF/1 and HP-UX.
3214 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3215 ac_file=1 # Number of current file.
3216 ac_beg=1 # First line for current file.
3217 ac_end=$ac_max_sed_cmds # Line after last line for current file.
3218 ac_more_lines=:
3219 ac_sed_cmds=""
3220 while $ac_more_lines; do
3221   if test $ac_beg -gt 1; then
3222     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3223   else
3224     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3225   fi
3226   if test ! -s conftest.s$ac_file; then
3227     ac_more_lines=false
3228     rm -f conftest.s$ac_file
3229   else
3230     if test -z "$ac_sed_cmds"; then
3231       ac_sed_cmds="sed -f conftest.s$ac_file"
3232     else
3233       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3234     fi
3235     ac_file=`expr $ac_file + 1`
3236     ac_beg=$ac_end
3237     ac_end=`expr $ac_end + $ac_max_sed_cmds`
3238   fi
3239 done
3240 if test -z "$ac_sed_cmds"; then
3241   ac_sed_cmds=cat
3242 fi
3243 EOF
3244
3245 cat >> $CONFIG_STATUS <<EOF
3246
3247 CONFIG_FILES=\${CONFIG_FILES-"$all_outputs"}
3248 EOF
3249 cat >> $CONFIG_STATUS <<\EOF
3250 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3251   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3252   case "$ac_file" in
3253   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3254        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3255   *) ac_file_in="${ac_file}.in" ;;
3256   esac
3257
3258   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3259
3260   # Remove last slash and all that follows it.  Not all systems have dirname.
3261   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3262   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3263     # The file is in a subdirectory.
3264     test ! -d "$ac_dir" && mkdir "$ac_dir"
3265     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3266     # A "../" for each directory in $ac_dir_suffix.
3267     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3268   else
3269     ac_dir_suffix= ac_dots=
3270   fi
3271
3272   case "$ac_given_srcdir" in
3273   .)  srcdir=.
3274       if test -z "$ac_dots"; then top_srcdir=.
3275       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3276   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3277   *) # Relative path.
3278     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3279     top_srcdir="$ac_dots$ac_given_srcdir" ;;
3280   esac
3281
3282
3283   echo creating "$ac_file"
3284   rm -f "$ac_file"
3285   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3286   case "$ac_file" in
3287   *Makefile*) ac_comsub="1i\\
3288 # $configure_input" ;;
3289   *) ac_comsub= ;;
3290   esac
3291
3292   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3293   sed -e "$ac_comsub
3294 s%@configure_input@%$configure_input%g
3295 s%@srcdir@%$srcdir%g
3296 s%@top_srcdir@%$top_srcdir%g
3297 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3298 fi; done
3299 rm -f conftest.s*
3300
3301 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3302 # NAME is the cpp macro being defined and VALUE is the value it is being given.
3303 #
3304 # ac_d sets the value in "#define NAME VALUE" lines.
3305 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
3306 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
3307 ac_dC='\3'
3308 ac_dD='%g'
3309 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3310 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3311 ac_uB='\([      ]\)%\1#\2define\3'
3312 ac_uC=' '
3313 ac_uD='\4%g'
3314 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3315 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3316 ac_eB='$%\1#\2define\3'
3317 ac_eC=' '
3318 ac_eD='%g'
3319
3320 if test "${CONFIG_HEADERS+set}" != set; then
3321 EOF
3322 cat >> $CONFIG_STATUS <<EOF
3323   CONFIG_HEADERS="auto-host.h:config.in"
3324 EOF
3325 cat >> $CONFIG_STATUS <<\EOF
3326 fi
3327 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3328   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3329   case "$ac_file" in
3330   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3331        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3332   *) ac_file_in="${ac_file}.in" ;;
3333   esac
3334
3335   echo creating $ac_file
3336
3337   rm -f conftest.frag conftest.in conftest.out
3338   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3339   cat $ac_file_inputs > conftest.in
3340
3341 EOF
3342
3343 # Transform confdefs.h into a sed script conftest.vals that substitutes
3344 # the proper values into config.h.in to produce config.h.  And first:
3345 # Protect against being on the right side of a sed subst in config.status.
3346 # Protect against being in an unquoted here document in config.status.
3347 rm -f conftest.vals
3348 cat > conftest.hdr <<\EOF
3349 s/[\\&%]/\\&/g
3350 s%[\\$`]%\\&%g
3351 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3352 s%ac_d%ac_u%gp
3353 s%ac_u%ac_e%gp
3354 EOF
3355 sed -n -f conftest.hdr confdefs.h > conftest.vals
3356 rm -f conftest.hdr
3357
3358 # This sed command replaces #undef with comments.  This is necessary, for
3359 # example, in the case of _POSIX_SOURCE, which is predefined and required
3360 # on some systems where configure will not decide to define it.
3361 cat >> conftest.vals <<\EOF
3362 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3363 EOF
3364
3365 # Break up conftest.vals because some shells have a limit on
3366 # the size of here documents, and old seds have small limits too.
3367
3368 rm -f conftest.tail
3369 while :
3370 do
3371   ac_lines=`grep -c . conftest.vals`
3372   # grep -c gives empty output for an empty file on some AIX systems.
3373   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3374   # Write a limited-size here document to conftest.frag.
3375   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3376   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3377   echo 'CEOF
3378   sed -f conftest.frag conftest.in > conftest.out
3379   rm -f conftest.in
3380   mv conftest.out conftest.in
3381 ' >> $CONFIG_STATUS
3382   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3383   rm -f conftest.vals
3384   mv conftest.tail conftest.vals
3385 done
3386 rm -f conftest.vals
3387
3388 cat >> $CONFIG_STATUS <<\EOF
3389   rm -f conftest.frag conftest.h
3390   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
3391   cat conftest.in >> conftest.h
3392   rm -f conftest.in
3393   if cmp -s $ac_file conftest.h 2>/dev/null; then
3394     echo "$ac_file is unchanged"
3395     rm -f conftest.h
3396   else
3397     # Remove last slash and all that follows it.  Not all systems have dirname.
3398       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3399       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3400       # The file is in a subdirectory.
3401       test ! -d "$ac_dir" && mkdir "$ac_dir"
3402     fi
3403     rm -f $ac_file
3404     mv conftest.h $ac_file
3405   fi
3406 fi; done
3407
3408 EOF
3409 cat >> $CONFIG_STATUS <<EOF
3410
3411 host='${host}'
3412 build='${build}'
3413 target='${target}'
3414 target_alias='${target_alias}'
3415 srcdir='${srcdir}'
3416 symbolic_link='${symbolic_link}'
3417 program_transform_set='${program_transform_set}'
3418 program_transform_name='${program_transform_name}'
3419 dep_host_xmake_file='${dep_host_xmake_file}'
3420 host_xmake_file='${host_xmake_file}'
3421 dep_tmake_file='${dep_tmake_file}'
3422 tmake_file='${tmake_file}'
3423 thread_file='${thread_file}'
3424 gcc_config_arguments='${gcc_config_arguments}'
3425 gcc_version='${gcc_version}'
3426 gcc_version_full='${gcc_version_full}'
3427 gcc_version_trigger='${gcc_version_trigger}'
3428 local_prefix='${local_prefix}'
3429 build_install_headers_dir='${build_install_headers_dir}'
3430 build_exeext='${build_exeext}'
3431 host_exeext='${host_exeext}'
3432 out_file='${out_file}'
3433 gdb_needs_out_file_path='${gdb_needs_out_file_path}'
3434 SET_MAKE='${SET_MAKE}'
3435 target_list='${target_list}'
3436 target_overrides='${target_overrides}'
3437 host_overrides='${host_overrides}'
3438 cross_defines='${cross_defines}'
3439 cross_overrides='${cross_overrides}'
3440 build_overrides='${build_overrides}'
3441 cpp_install_dir='${cpp_install_dir}'
3442
3443 EOF
3444 cat >> $CONFIG_STATUS <<\EOF
3445
3446 case x$CONFIG_HEADERS in
3447 xauto-host.h:config.in)
3448 echo > cstamp-h ;;
3449 esac
3450
3451 # Avoid having to add intl to our include paths.
3452 if test -f intl/libintl.h; then
3453   echo creating libintl.h
3454   echo '#include "intl/libintl.h"' >libintl.h
3455 fi
3456
3457 exit 0
3458 EOF
3459 chmod +x $CONFIG_STATUS
3460 rm -fr confdefs* $ac_clean_files
3461 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3462