* configure.in: Fixed up so that ucsim is only configured once.
[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 echo $ac_n "checking for GNU C library""... $ac_c" 1>&6
1319 echo "configure:1320: checking for GNU C library" >&5
1320 if eval "test \"`echo '$''{'gcc_cv_glibc'+set}'`\" = set"; then
1321   echo $ac_n "(cached) $ac_c" 1>&6
1322 else
1323   cat > conftest.$ac_ext <<EOF
1324 #line 1325 "configure"
1325 #include "confdefs.h"
1326 #include <features.h>
1327 int main() {
1328
1329 #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
1330 #error Not a GNU C library system
1331 #endif
1332 ; return 0; }
1333 EOF
1334 if { (eval echo configure:1335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1335   rm -rf conftest*
1336   gcc_cv_glibc=yes
1337 else
1338   echo "configure: failed program was:" >&5
1339   cat conftest.$ac_ext >&5
1340   rm -rf conftest*
1341   gcc_cv_glibc=no
1342 fi
1343 rm -f conftest*
1344 fi
1345
1346 echo "$ac_t""$gcc_cv_glibc" 1>&6
1347 if test $gcc_cv_glibc = yes; then
1348   cat >> confdefs.h <<\EOF
1349 #define _GNU_SOURCE 1
1350 EOF
1351
1352 fi
1353
1354 # Find some useful tools
1355 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
1356 echo "configure:1357: checking whether ln works" >&5
1357 if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then
1358   echo $ac_n "(cached) $ac_c" 1>&6
1359 else
1360   rm -f conftestdata_t
1361 echo >conftestdata_f
1362 if ln conftestdata_f conftestdata_t 2>/dev/null
1363 then
1364   gcc_cv_prog_LN="ln"
1365 else
1366   if ln -s conftestdata_f conftestdata_t 2>/dev/null
1367   then
1368     gcc_cv_prog_LN="ln -s"
1369   else
1370     gcc_cv_prog_LN=cp
1371   fi
1372 fi
1373 rm -f conftestdata_f conftestdata_t
1374
1375 fi
1376 LN="$gcc_cv_prog_LN"
1377 if test "$gcc_cv_prog_LN" = "ln"; then
1378   echo "$ac_t""yes" 1>&6
1379 else
1380   if test "$gcc_cv_prog_LN" = "ln -s"; then
1381     echo "$ac_t""no, using ln -s" 1>&6
1382   else
1383     echo "$ac_t""no, and neither does ln -s, so using cp" 1>&6
1384   fi
1385 fi
1386
1387 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1388 echo "configure:1389: checking whether ln -s works" >&5
1389 if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then
1390   echo $ac_n "(cached) $ac_c" 1>&6
1391 else
1392   rm -f conftestdata_t
1393 echo >conftestdata_f
1394 if ln -s conftestdata_f conftestdata_t 2>/dev/null
1395 then
1396   gcc_cv_prog_LN_S="ln -s"
1397 else
1398   if ln conftestdata_f conftestdata_t 2>/dev/null
1399   then
1400     gcc_cv_prog_LN_S=ln
1401   else
1402     gcc_cv_prog_LN_S=cp
1403   fi
1404 fi
1405 rm -f conftestdata_f conftestdata_t
1406
1407 fi
1408 LN_S="$gcc_cv_prog_LN_S"
1409 if test "$gcc_cv_prog_LN_S" = "ln -s"; then
1410   echo "$ac_t""yes" 1>&6
1411 else
1412   if test "$gcc_cv_prog_LN_S" = "ln"; then
1413     echo "$ac_t""no, using ln" 1>&6
1414   else
1415     echo "$ac_t""no, and neither does ln, so using cp" 1>&6
1416   fi
1417 fi
1418
1419 # Extract the first word of "ranlib", so it can be a program name with args.
1420 set dummy ranlib; ac_word=$2
1421 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1422 echo "configure:1423: checking for $ac_word" >&5
1423 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1424   echo $ac_n "(cached) $ac_c" 1>&6
1425 else
1426   if test -n "$RANLIB"; then
1427   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1428 else
1429   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1430   ac_dummy="$PATH"
1431   for ac_dir in $ac_dummy; do
1432     test -z "$ac_dir" && ac_dir=.
1433     if test -f $ac_dir/$ac_word; then
1434       ac_cv_prog_RANLIB="ranlib"
1435       break
1436     fi
1437   done
1438   IFS="$ac_save_ifs"
1439   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1440 fi
1441 fi
1442 RANLIB="$ac_cv_prog_RANLIB"
1443 if test -n "$RANLIB"; then
1444   echo "$ac_t""$RANLIB" 1>&6
1445 else
1446   echo "$ac_t""no" 1>&6
1447 fi
1448
1449 ac_aux_dir=
1450 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1451   if test -f $ac_dir/install-sh; then
1452     ac_aux_dir=$ac_dir
1453     ac_install_sh="$ac_aux_dir/install-sh -c"
1454     break
1455   elif test -f $ac_dir/install.sh; then
1456     ac_aux_dir=$ac_dir
1457     ac_install_sh="$ac_aux_dir/install.sh -c"
1458     break
1459   fi
1460 done
1461 if test -z "$ac_aux_dir"; then
1462   { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
1463 fi
1464 ac_config_guess=$ac_aux_dir/config.guess
1465 ac_config_sub=$ac_aux_dir/config.sub
1466 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
1467
1468 # Find a good install program.  We prefer a C program (faster),
1469 # so one script is as good as another.  But avoid the broken or
1470 # incompatible versions:
1471 # SysV /etc/install, /usr/sbin/install
1472 # SunOS /usr/etc/install
1473 # IRIX /sbin/install
1474 # AIX /bin/install
1475 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1476 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1477 # ./install, which can be erroneously created by make from ./install.sh.
1478 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1479 echo "configure:1480: checking for a BSD compatible install" >&5
1480 if test -z "$INSTALL"; then
1481 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1482   echo $ac_n "(cached) $ac_c" 1>&6
1483 else
1484     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1485   for ac_dir in $PATH; do
1486     # Account for people who put trailing slashes in PATH elements.
1487     case "$ac_dir/" in
1488     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1489     *)
1490       # OSF1 and SCO ODT 3.0 have their own names for install.
1491       for ac_prog in ginstall scoinst install; do
1492         if test -f $ac_dir/$ac_prog; then
1493           if test $ac_prog = install &&
1494             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1495             # AIX install.  It has an incompatible calling convention.
1496             # OSF/1 installbsd also uses dspmsg, but is usable.
1497             :
1498           else
1499             ac_cv_path_install="$ac_dir/$ac_prog -c"
1500             break 2
1501           fi
1502         fi
1503       done
1504       ;;
1505     esac
1506   done
1507   IFS="$ac_save_IFS"
1508
1509 fi
1510   if test "${ac_cv_path_install+set}" = set; then
1511     INSTALL="$ac_cv_path_install"
1512   else
1513     # As a last resort, use the slow shell script.  We don't cache a
1514     # path for INSTALL within a source directory, because that will
1515     # break other packages using the cache if that directory is
1516     # removed, or if the path is relative.
1517     INSTALL="$ac_install_sh"
1518   fi
1519 fi
1520 echo "$ac_t""$INSTALL" 1>&6
1521
1522 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1523 # It thinks the first close brace ends the variable substitution.
1524 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1525
1526 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1527
1528
1529 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1530 echo "configure:1531: checking for ANSI C header files" >&5
1531 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1532   echo $ac_n "(cached) $ac_c" 1>&6
1533 else
1534   cat > conftest.$ac_ext <<EOF
1535 #line 1536 "configure"
1536 #include "confdefs.h"
1537 #include <stdlib.h>
1538 #include <stdarg.h>
1539 #include <string.h>
1540 #include <float.h>
1541 EOF
1542 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1543 { (eval echo configure:1544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1544 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1545 if test -z "$ac_err"; then
1546   rm -rf conftest*
1547   ac_cv_header_stdc=yes
1548 else
1549   echo "$ac_err" >&5
1550   echo "configure: failed program was:" >&5
1551   cat conftest.$ac_ext >&5
1552   rm -rf conftest*
1553   ac_cv_header_stdc=no
1554 fi
1555 rm -f conftest*
1556
1557 if test $ac_cv_header_stdc = yes; then
1558   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1559 cat > conftest.$ac_ext <<EOF
1560 #line 1561 "configure"
1561 #include "confdefs.h"
1562 #include <string.h>
1563 EOF
1564 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1565   egrep "memchr" >/dev/null 2>&1; then
1566   :
1567 else
1568   rm -rf conftest*
1569   ac_cv_header_stdc=no
1570 fi
1571 rm -f conftest*
1572
1573 fi
1574
1575 if test $ac_cv_header_stdc = yes; then
1576   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1577 cat > conftest.$ac_ext <<EOF
1578 #line 1579 "configure"
1579 #include "confdefs.h"
1580 #include <stdlib.h>
1581 EOF
1582 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1583   egrep "free" >/dev/null 2>&1; then
1584   :
1585 else
1586   rm -rf conftest*
1587   ac_cv_header_stdc=no
1588 fi
1589 rm -f conftest*
1590
1591 fi
1592
1593 if test $ac_cv_header_stdc = yes; then
1594   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1595 if test "$cross_compiling" = yes; then
1596   :
1597 else
1598   cat > conftest.$ac_ext <<EOF
1599 #line 1600 "configure"
1600 #include "confdefs.h"
1601 #include <ctype.h>
1602 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1603 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1604 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1605 int main () { int i; for (i = 0; i < 256; i++)
1606 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1607 exit (0); }
1608
1609 EOF
1610 if { (eval echo configure:1611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1611 then
1612   :
1613 else
1614   echo "configure: failed program was:" >&5
1615   cat conftest.$ac_ext >&5
1616   rm -fr conftest*
1617   ac_cv_header_stdc=no
1618 fi
1619 rm -fr conftest*
1620 fi
1621
1622 fi
1623 fi
1624
1625 echo "$ac_t""$ac_cv_header_stdc" 1>&6
1626 if test $ac_cv_header_stdc = yes; then
1627   cat >> confdefs.h <<\EOF
1628 #define STDC_HEADERS 1
1629 EOF
1630
1631 fi
1632
1633 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1634 echo "configure:1635: checking whether time.h and sys/time.h may both be included" >&5
1635 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1636   echo $ac_n "(cached) $ac_c" 1>&6
1637 else
1638   cat > conftest.$ac_ext <<EOF
1639 #line 1640 "configure"
1640 #include "confdefs.h"
1641 #include <sys/types.h>
1642 #include <sys/time.h>
1643 #include <time.h>
1644 int main() {
1645 struct tm *tp;
1646 ; return 0; }
1647 EOF
1648 if { (eval echo configure:1649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1649   rm -rf conftest*
1650   ac_cv_header_time=yes
1651 else
1652   echo "configure: failed program was:" >&5
1653   cat conftest.$ac_ext >&5
1654   rm -rf conftest*
1655   ac_cv_header_time=no
1656 fi
1657 rm -f conftest*
1658 fi
1659
1660 echo "$ac_t""$ac_cv_header_time" 1>&6
1661 if test $ac_cv_header_time = yes; then
1662   cat >> confdefs.h <<\EOF
1663 #define TIME_WITH_SYS_TIME 1
1664 EOF
1665
1666 fi
1667
1668 echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
1669 echo "configure:1670: checking whether string.h and strings.h may both be included" >&5
1670 if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then
1671   echo $ac_n "(cached) $ac_c" 1>&6
1672 else
1673   cat > conftest.$ac_ext <<EOF
1674 #line 1675 "configure"
1675 #include "confdefs.h"
1676 #include <string.h>
1677 #include <strings.h>
1678 int main() {
1679
1680 ; return 0; }
1681 EOF
1682 if { (eval echo configure:1683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1683   rm -rf conftest*
1684   gcc_cv_header_string=yes
1685 else
1686   echo "configure: failed program was:" >&5
1687   cat conftest.$ac_ext >&5
1688   rm -rf conftest*
1689   gcc_cv_header_string=no
1690 fi
1691 rm -f conftest*
1692 fi
1693
1694 echo "$ac_t""$gcc_cv_header_string" 1>&6
1695 if test $gcc_cv_header_string = yes; then
1696   cat >> confdefs.h <<\EOF
1697 #define STRING_WITH_STRINGS 1
1698 EOF
1699
1700 fi
1701
1702 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1703 echo "configure:1704: checking for sys/wait.h that is POSIX.1 compatible" >&5
1704 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1705   echo $ac_n "(cached) $ac_c" 1>&6
1706 else
1707   cat > conftest.$ac_ext <<EOF
1708 #line 1709 "configure"
1709 #include "confdefs.h"
1710 #include <sys/types.h>
1711 #include <sys/wait.h>
1712 #ifndef WEXITSTATUS
1713 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1714 #endif
1715 #ifndef WIFEXITED
1716 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1717 #endif
1718 int main() {
1719 int s;
1720 wait (&s);
1721 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1722 ; return 0; }
1723 EOF
1724 if { (eval echo configure:1725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1725   rm -rf conftest*
1726   ac_cv_header_sys_wait_h=yes
1727 else
1728   echo "configure: failed program was:" >&5
1729   cat conftest.$ac_ext >&5
1730   rm -rf conftest*
1731   ac_cv_header_sys_wait_h=no
1732 fi
1733 rm -f conftest*
1734 fi
1735
1736 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1737 if test $ac_cv_header_sys_wait_h = yes; then
1738   cat >> confdefs.h <<\EOF
1739 #define HAVE_SYS_WAIT_H 1
1740 EOF
1741
1742 fi
1743
1744 for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \
1745                  fcntl.h unistd.h sys/file.h sys/time.h \
1746                  sys/resource.h sys/param.h sys/times.h sys/stat.h \
1747                  direct.h malloc.h langinfo.h
1748 do
1749 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1750 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1751 echo "configure:1752: checking for $ac_hdr" >&5
1752 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1753   echo $ac_n "(cached) $ac_c" 1>&6
1754 else
1755   cat > conftest.$ac_ext <<EOF
1756 #line 1757 "configure"
1757 #include "confdefs.h"
1758 #include <$ac_hdr>
1759 EOF
1760 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1761 { (eval echo configure:1762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1762 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1763 if test -z "$ac_err"; then
1764   rm -rf conftest*
1765   eval "ac_cv_header_$ac_safe=yes"
1766 else
1767   echo "$ac_err" >&5
1768   echo "configure: failed program was:" >&5
1769   cat conftest.$ac_ext >&5
1770   rm -rf conftest*
1771   eval "ac_cv_header_$ac_safe=no"
1772 fi
1773 rm -f conftest*
1774 fi
1775 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1776   echo "$ac_t""yes" 1>&6
1777     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1778   cat >> confdefs.h <<EOF
1779 #define $ac_tr_hdr 1
1780 EOF
1781  
1782 else
1783   echo "$ac_t""no" 1>&6
1784 fi
1785 done
1786
1787
1788 # Check for thread headers.
1789
1790 # These tests can't be done till we know if we have limits.h.
1791 echo $ac_n "checking for CHAR_BIT""... $ac_c" 1>&6
1792 echo "configure:1793: checking for CHAR_BIT" >&5
1793 if eval "test \"`echo '$''{'gcc_cv_decl_char_bit'+set}'`\" = set"; then
1794   echo $ac_n "(cached) $ac_c" 1>&6
1795 else
1796   cat > conftest.$ac_ext <<EOF
1797 #line 1798 "configure"
1798 #include "confdefs.h"
1799 #ifdef HAVE_LIMITS_H
1800 #include <limits.h>
1801 #endif
1802 #ifdef CHAR_BIT
1803 found
1804 #endif
1805 EOF
1806 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1807   egrep "found" >/dev/null 2>&1; then
1808   rm -rf conftest*
1809   gcc_cv_decl_char_bit=yes
1810 else
1811   rm -rf conftest*
1812   gcc_cv_decl_char_bit=no
1813 fi
1814 rm -f conftest*
1815
1816
1817 fi
1818
1819 echo "$ac_t""$gcc_cv_decl_char_bit" 1>&6
1820 if test $gcc_cv_decl_char_bit = no; then
1821   echo $ac_n "checking number of bits in a byte""... $ac_c" 1>&6
1822 echo "configure:1823: checking number of bits in a byte" >&5
1823 if eval "test \"`echo '$''{'gcc_cv_c_nbby'+set}'`\" = set"; then
1824   echo $ac_n "(cached) $ac_c" 1>&6
1825 else
1826   i=8
1827  gcc_cv_c_nbby=
1828  while test $i -lt 65; do
1829    cat > conftest.$ac_ext <<EOF
1830 #line 1831 "configure"
1831 #include "confdefs.h"
1832
1833 int main() {
1834 switch(0) {
1835   case (unsigned char)((unsigned long)1 << $i) == ((unsigned long)1 << $i):
1836   case (unsigned char)((unsigned long)1<<($i-1)) == ((unsigned long)1<<($i-1)):
1837   ; }
1838 ; return 0; }
1839 EOF
1840 if { (eval echo configure:1841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1841   rm -rf conftest*
1842   gcc_cv_c_nbby=$i; break
1843 else
1844   echo "configure: failed program was:" >&5
1845   cat conftest.$ac_ext >&5
1846 fi
1847 rm -f conftest*
1848    i=`expr $i + 1`
1849  done
1850  test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed
1851
1852 fi
1853
1854 echo "$ac_t""$gcc_cv_c_nbby" 1>&6
1855 if test $gcc_cv_c_nbby = failed; then
1856   { echo "configure: error: cannot determine number of bits in a byte" 1>&2; exit 1; }
1857 else
1858   cat >> confdefs.h <<EOF
1859 #define CHAR_BIT $gcc_cv_c_nbby
1860 EOF
1861
1862 fi
1863 fi
1864 echo $ac_n "checking byte ordering""... $ac_c" 1>&6
1865 echo "configure:1866: checking byte ordering" >&5
1866 if eval "test \"`echo '$''{'ac_cv_c_compile_endian'+set}'`\" = set"; then
1867   echo $ac_n "(cached) $ac_c" 1>&6
1868 else
1869   ac_cv_c_compile_endian=unknown
1870
1871 ac_ext=c
1872 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1873 ac_cpp='$CPP $CPPFLAGS'
1874 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1875 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1876 cross_compiling=$ac_cv_prog_cc_cross
1877
1878 cat > conftest.$ac_ext <<EOF
1879 #line 1880 "configure"
1880 #include "confdefs.h"
1881
1882 #ifdef HAVE_LIMITS_H
1883 # include <limits.h>
1884 #endif
1885 /* This structure must have no internal padding.  */
1886   struct {
1887     char prefix[sizeof "\nendian:" - 1];
1888     short word;
1889     char postfix[2];
1890  } tester = {
1891     "\nendian:",
1892 #if SIZEOF_SHORT == 4
1893     ('A' << (CHAR_BIT * 3)) | ('B' << (CHAR_BIT * 2)) |
1894 #endif
1895     ('A' << CHAR_BIT) | 'B',
1896     'X', '\n'
1897 };
1898 EOF
1899 if { (eval echo configure:1900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1900   od -c conftest.o |
1901     sed 's/^[0-7]*[     ]*/ /
1902           s/\*/./g
1903           s/ \\n/*/g
1904           s/ [0-9][0-9][0-9]/./g
1905           s/  \\[^ ]/./g' |
1906     tr -d '
1907  ' | tr -s '*' '
1908 ' | fold | sed '$a\
1909 ' > conftest.dmp
1910   if   grep 'endian:AB' conftest.dmp >/dev/null 2>&1; then
1911     ac_cv_c_compile_endian=big-endian
1912   elif grep 'endian:BA' conftest.dmp >/dev/null 2>&1; then
1913     ac_cv_c_compile_endian=little-endian
1914   fi
1915 fi
1916 rm -rf conftest*
1917 ac_ext=c
1918 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1919 ac_cpp='$CPP $CPPFLAGS'
1920 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1921 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1922 cross_compiling=$ac_cv_prog_cc_cross
1923
1924
1925 fi
1926
1927 echo "$ac_t""$ac_cv_c_compile_endian" 1>&6
1928 if test $ac_cv_c_compile_endian = unknown; then
1929   { echo "configure: error: *** unable to determine endianness" 1>&2; exit 1; }
1930 elif test $ac_cv_c_compile_endian = big-endian; then
1931   cat >> confdefs.h <<\EOF
1932 #define HOST_WORDS_BIG_ENDIAN 1
1933 EOF
1934
1935 fi
1936
1937
1938 # See if we have the mktemp command.
1939 # Extract the first word of "mktemp", so it can be a program name with args.
1940 set dummy mktemp; ac_word=$2
1941 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1942 echo "configure:1943: checking for $ac_word" >&5
1943 if eval "test \"`echo '$''{'ac_cv_prog_have_mktemp_command'+set}'`\" = set"; then
1944   echo $ac_n "(cached) $ac_c" 1>&6
1945 else
1946   if test -n "$have_mktemp_command"; then
1947   ac_cv_prog_have_mktemp_command="$have_mktemp_command" # Let the user override the test.
1948 else
1949   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1950   ac_dummy="$PATH"
1951   for ac_dir in $ac_dummy; do
1952     test -z "$ac_dir" && ac_dir=.
1953     if test -f $ac_dir/$ac_word; then
1954       ac_cv_prog_have_mktemp_command="yes"
1955       break
1956     fi
1957   done
1958   IFS="$ac_save_ifs"
1959   test -z "$ac_cv_prog_have_mktemp_command" && ac_cv_prog_have_mktemp_command="no"
1960 fi
1961 fi
1962 have_mktemp_command="$ac_cv_prog_have_mktemp_command"
1963 if test -n "$have_mktemp_command"; then
1964   echo "$ac_t""$have_mktemp_command" 1>&6
1965 else
1966   echo "$ac_t""no" 1>&6
1967 fi
1968
1969
1970 # Extract the first word of "strip", so it can be a program name with args.
1971 set dummy strip; ac_word=$2
1972 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1973 echo "configure:1974: checking for $ac_word" >&5
1974 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
1975   echo $ac_n "(cached) $ac_c" 1>&6
1976 else
1977   if test -n "$STRIP"; then
1978   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
1979 else
1980   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1981   ac_dummy="$PATH"
1982   for ac_dir in $ac_dummy; do
1983     test -z "$ac_dir" && ac_dir=.
1984     if test -f $ac_dir/$ac_word; then
1985       ac_cv_prog_STRIP="strip"
1986       break
1987     fi
1988   done
1989   IFS="$ac_save_ifs"
1990   test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
1991 fi
1992 fi
1993 STRIP="$ac_cv_prog_STRIP"
1994 if test -n "$STRIP"; then
1995   echo "$ac_t""$STRIP" 1>&6
1996 else
1997   echo "$ac_t""no" 1>&6
1998 fi
1999
2000
2001 # See if the stage1 system preprocessor understands the ANSI C
2002 # preprocessor stringification operator.  (Used by symcat.h.)
2003
2004
2005 echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
2006 echo "configure:2007: checking for preprocessor stringizing operator" >&5
2007 if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then
2008   echo $ac_n "(cached) $ac_c" 1>&6
2009 else
2010   cat > conftest.$ac_ext <<EOF
2011 #line 2012 "configure"
2012 #include "confdefs.h"
2013
2014 #define x(y) #y
2015
2016 char *s = x(teststring);
2017
2018 EOF
2019 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2020   egrep "#teststring" >/dev/null 2>&1; then
2021   rm -rf conftest*
2022   ac_cv_c_stringize=no
2023 else
2024   rm -rf conftest*
2025   ac_cv_c_stringize=yes
2026 fi
2027 rm -f conftest*
2028
2029 fi
2030
2031 if test "${ac_cv_c_stringize}" = yes
2032 then
2033         cat >> confdefs.h <<\EOF
2034 #define HAVE_STRINGIZE 1
2035 EOF
2036
2037 fi
2038 echo "$ac_t""${ac_cv_c_stringize}" 1>&6
2039
2040
2041 # Use <inttypes.h> only if it exists,
2042 # doesn't clash with <sys/types.h>, and declares intmax_t.
2043 echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6
2044 echo "configure:2045: checking for inttypes.h" >&5
2045 if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then
2046   echo $ac_n "(cached) $ac_c" 1>&6
2047 else
2048   cat > conftest.$ac_ext <<EOF
2049 #line 2050 "configure"
2050 #include "confdefs.h"
2051 #include <sys/types.h>
2052 #include <inttypes.h>
2053 int main() {
2054 intmax_t i = -1;
2055 ; return 0; }
2056 EOF
2057 if { (eval echo configure:2058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2058   rm -rf conftest*
2059   gcc_cv_header_inttypes_h=yes
2060 else
2061   echo "configure: failed program was:" >&5
2062   cat conftest.$ac_ext >&5
2063   rm -rf conftest*
2064   gcc_cv_header_inttypes_h=no
2065 fi
2066 rm -f conftest*
2067 fi
2068
2069 echo "$ac_t""$gcc_cv_header_inttypes_h" 1>&6
2070 if test $gcc_cv_header_inttypes_h = yes; then
2071   cat >> confdefs.h <<\EOF
2072 #define HAVE_INTTYPES_H 1
2073 EOF
2074
2075 fi
2076
2077
2078 for ac_func in times clock strchr strrchr lstat
2079 do
2080 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2081 echo "configure:2082: checking for $ac_func" >&5
2082 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2083   echo $ac_n "(cached) $ac_c" 1>&6
2084 else
2085   cat > conftest.$ac_ext <<EOF
2086 #line 2087 "configure"
2087 #include "confdefs.h"
2088 /* System header to define __stub macros and hopefully few prototypes,
2089     which can conflict with char $ac_func(); below.  */
2090 #include <assert.h>
2091 /* Override any gcc2 internal prototype to avoid an error.  */
2092 /* We use char because int might match the return type of a gcc2
2093     builtin and then its argument prototype would still apply.  */
2094 char $ac_func();
2095
2096 int main() {
2097
2098 /* The GNU C library defines this for functions which it implements
2099     to always fail with ENOSYS.  Some functions are actually named
2100     something starting with __ and the normal name is an alias.  */
2101 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2102 choke me
2103 #else
2104 $ac_func();
2105 #endif
2106
2107 ; return 0; }
2108 EOF
2109 if { (eval echo configure:2110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2110   rm -rf conftest*
2111   eval "ac_cv_func_$ac_func=yes"
2112 else
2113   echo "configure: failed program was:" >&5
2114   cat conftest.$ac_ext >&5
2115   rm -rf conftest*
2116   eval "ac_cv_func_$ac_func=no"
2117 fi
2118 rm -f conftest*
2119 fi
2120
2121 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2122   echo "$ac_t""yes" 1>&6
2123     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2124   cat >> confdefs.h <<EOF
2125 #define $ac_tr_func 1
2126 EOF
2127  
2128 else
2129   echo "$ac_t""no" 1>&6
2130 fi
2131 done
2132
2133
2134 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
2135 echo "configure:2136: checking for ssize_t" >&5
2136 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
2137   echo $ac_n "(cached) $ac_c" 1>&6
2138 else
2139   cat > conftest.$ac_ext <<EOF
2140 #line 2141 "configure"
2141 #include "confdefs.h"
2142 #include <sys/types.h>
2143 #if STDC_HEADERS
2144 #include <stdlib.h>
2145 #include <stddef.h>
2146 #endif
2147 EOF
2148 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2149   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
2150   rm -rf conftest*
2151   ac_cv_type_ssize_t=yes
2152 else
2153   rm -rf conftest*
2154   ac_cv_type_ssize_t=no
2155 fi
2156 rm -f conftest*
2157
2158 fi
2159 echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
2160 if test $ac_cv_type_ssize_t = no; then
2161   cat >> confdefs.h <<\EOF
2162 #define ssize_t int
2163 EOF
2164
2165 fi
2166
2167
2168 for ac_func in getpagesize
2169 do
2170 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2171 echo "configure:2172: checking for $ac_func" >&5
2172 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2173   echo $ac_n "(cached) $ac_c" 1>&6
2174 else
2175   cat > conftest.$ac_ext <<EOF
2176 #line 2177 "configure"
2177 #include "confdefs.h"
2178 /* System header to define __stub macros and hopefully few prototypes,
2179     which can conflict with char $ac_func(); below.  */
2180 #include <assert.h>
2181 /* Override any gcc2 internal prototype to avoid an error.  */
2182 /* We use char because int might match the return type of a gcc2
2183     builtin and then its argument prototype would still apply.  */
2184 char $ac_func();
2185
2186 int main() {
2187
2188 /* The GNU C library defines this for functions which it implements
2189     to always fail with ENOSYS.  Some functions are actually named
2190     something starting with __ and the normal name is an alias.  */
2191 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2192 choke me
2193 #else
2194 $ac_func();
2195 #endif
2196
2197 ; return 0; }
2198 EOF
2199 if { (eval echo configure:2200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2200   rm -rf conftest*
2201   eval "ac_cv_func_$ac_func=yes"
2202 else
2203   echo "configure: failed program was:" >&5
2204   cat conftest.$ac_ext >&5
2205   rm -rf conftest*
2206   eval "ac_cv_func_$ac_func=no"
2207 fi
2208 rm -f conftest*
2209 fi
2210
2211 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2212   echo "$ac_t""yes" 1>&6
2213     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2214   cat >> confdefs.h <<EOF
2215 #define $ac_tr_func 1
2216 EOF
2217  
2218 else
2219   echo "$ac_t""no" 1>&6
2220 fi
2221 done
2222
2223 # The test program for the next two tests is the same except for one
2224 # set of ifdefs.
2225 cat >ct-mmap.inc <<'EOF'
2226 #include <sys/types.h>
2227 #include <sys/mman.h>
2228 #include <fcntl.h>
2229 #include <signal.h>
2230 #include <setjmp.h>
2231 #include <stdio.h>
2232
2233 #if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
2234 # define MAP_ANONYMOUS MAP_ANON
2235 #endif
2236
2237 /* This mess was copied from the GNU getpagesize.h.  */
2238 #ifndef HAVE_GETPAGESIZE
2239 # ifdef HAVE_UNISTD_H
2240 #  include <unistd.h>
2241 # endif
2242
2243 /* Assume that all systems that can run configure have sys/param.h.  */
2244 # ifndef HAVE_SYS_PARAM_H
2245 #  define HAVE_SYS_PARAM_H 1
2246 # endif
2247
2248 # ifdef _SC_PAGESIZE
2249 #  define getpagesize() sysconf(_SC_PAGESIZE)
2250 # else /* no _SC_PAGESIZE */
2251 #  ifdef HAVE_SYS_PARAM_H
2252 #   include <sys/param.h>
2253 #   ifdef EXEC_PAGESIZE
2254 #    define getpagesize() EXEC_PAGESIZE
2255 #   else /* no EXEC_PAGESIZE */
2256 #    ifdef NBPG
2257 #     define getpagesize() NBPG * CLSIZE
2258 #     ifndef CLSIZE
2259 #      define CLSIZE 1
2260 #     endif /* no CLSIZE */
2261 #    else /* no NBPG */
2262 #     ifdef NBPC
2263 #      define getpagesize() NBPC
2264 #     else /* no NBPC */
2265 #      ifdef PAGESIZE
2266 #       define getpagesize() PAGESIZE
2267 #      endif /* PAGESIZE */
2268 #     endif /* no NBPC */
2269 #    endif /* no NBPG */
2270 #   endif /* no EXEC_PAGESIZE */
2271 #  else /* no HAVE_SYS_PARAM_H */
2272 #   define getpagesize() 8192   /* punt totally */
2273 #  endif /* no HAVE_SYS_PARAM_H */
2274 # endif /* no _SC_PAGESIZE */
2275
2276 #endif /* no HAVE_GETPAGESIZE */
2277
2278 #ifndef MAP_FAILED
2279 # define MAP_FAILED -1
2280 #endif
2281
2282 #undef perror_exit
2283 #define perror_exit(str, val) \
2284   do { perror(str); exit(val); } while (0)
2285
2286 /* Some versions of cygwin mmap require that munmap is called with the
2287    same parameters as mmap.  GCC expects that this is not the case.
2288    Test for various forms of this problem.  Warning - icky signal games.  */
2289
2290 static sigset_t unblock_sigsegv;
2291 static jmp_buf r;
2292 static size_t pg;
2293 static int devzero;
2294
2295 static char *
2296 anonmap (size)
2297      size_t size;
2298 {
2299 #ifdef USE_MAP_ANON
2300   return (char *) mmap (0, size, PROT_READ|PROT_WRITE,
2301                         MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
2302 #else
2303   return (char *) mmap (0, size, PROT_READ|PROT_WRITE,
2304                         MAP_PRIVATE, devzero, 0);
2305 #endif
2306 }
2307
2308 static void
2309 sigsegv (unused)
2310      int unused;
2311 {
2312   sigprocmask (SIG_UNBLOCK, &unblock_sigsegv, 0);
2313   longjmp (r, 1);
2314 }
2315
2316 /* Basic functionality test.  */
2317 void
2318 test_0 ()
2319 {
2320   char *x = anonmap (pg);
2321   if (x == (char *) MAP_FAILED)
2322     perror_exit("test 0 mmap", 2);
2323
2324   *(int *)x += 1;
2325
2326   if (munmap(x, pg) < 0)
2327     perror_exit("test 0 munmap", 3);
2328 }
2329
2330 /* 1. If we map a 2-page region and unmap its second page, the first page
2331    must remain.  */
2332 static void
2333 test_1 ()
2334 {
2335   char *x = anonmap (pg * 2);
2336   if (x == (char *)MAP_FAILED)
2337     perror_exit ("test 1 mmap", 4);
2338
2339   signal (SIGSEGV, sigsegv);
2340   if (setjmp (r))
2341     perror_exit ("test 1 fault", 5);
2342
2343   x[0] = 1;
2344   x[pg] = 1;
2345
2346   if (munmap (x + pg, pg) < 0)
2347     perror_exit ("test 1 munmap 1", 6);
2348   x[0] = 2;
2349
2350   if (setjmp (r) == 0)
2351     {
2352       x[pg] = 1;
2353       perror_exit ("test 1 no fault", 7);
2354     }
2355   if (munmap (x, pg) < 0)
2356     perror_exit ("test 1 munmap 2", 8);
2357 }
2358
2359 /* 2. If we map a 2-page region and unmap its first page, the second
2360    page must remain.  */
2361 static void
2362 test_2 ()
2363 {
2364   char *x = anonmap (pg * 2);
2365   if (x == (char *)MAP_FAILED)
2366     perror_exit ("test 2 mmap", 9);
2367
2368   signal (SIGSEGV, sigsegv);
2369   if (setjmp (r))
2370     perror_exit ("test 2 fault", 10);
2371
2372   x[0] = 1;
2373   x[pg] = 1;
2374
2375   if (munmap (x, pg) < 0)
2376     perror_exit ("test 2 munmap 1", 11);
2377
2378   x[pg] = 2;
2379
2380   if (setjmp (r) == 0)
2381     {
2382       x[0] = 1;
2383       perror_exit ("test 2 no fault", 12);
2384     }
2385
2386   if (munmap (x+pg, pg) < 0)
2387     perror_exit ("test 2 munmap 2", 13);
2388 }
2389
2390 /* 3. If we map two adjacent 1-page regions and unmap them both with
2391    one munmap, both must go away.
2392
2393    Getting two adjacent 1-page regions with two mmap calls is slightly
2394    tricky.  All OS's tested skip over already-allocated blocks; therefore
2395    we have been careful to unmap all allocated regions in previous tests.
2396    HP/UX allocates pages backward in memory.  No OS has yet been observed
2397    to be so perverse as to leave unmapped space between consecutive calls
2398    to mmap.  */
2399
2400 static void
2401 test_3 ()
2402 {
2403   char *x, *y, *z;
2404
2405   x = anonmap (pg);
2406   if (x == (char *)MAP_FAILED)
2407     perror_exit ("test 3 mmap 1", 14);
2408   y = anonmap (pg);
2409   if (y == (char *)MAP_FAILED)
2410     perror_exit ("test 3 mmap 2", 15);
2411
2412   if (y != x + pg)
2413     {
2414       if (y == x - pg)
2415         z = y, y = x, x = z;
2416       else
2417         {
2418           fprintf (stderr, "test 3 nonconsecutive pages - %lx, %lx\n",
2419                    (unsigned long)x, (unsigned long)y);
2420           exit (16);
2421         }
2422     }
2423
2424   signal (SIGSEGV, sigsegv);
2425   if (setjmp (r))
2426     perror_exit ("test 3 fault", 17);
2427
2428   x[0] = 1;
2429   y[0] = 1;
2430
2431   if (munmap (x, pg*2) < 0)
2432     perror_exit ("test 3 munmap", 18);
2433
2434   if (setjmp (r) == 0)
2435     {
2436       x[0] = 1;
2437       perror_exit ("test 3 no fault 1", 19);
2438     }
2439   
2440   signal (SIGSEGV, sigsegv);
2441   if (setjmp (r) == 0)
2442     {
2443       y[0] = 1;
2444       perror_exit ("test 3 no fault 2", 20);
2445     }
2446 }
2447
2448 int
2449 main ()
2450 {
2451   sigemptyset (&unblock_sigsegv);
2452   sigaddset (&unblock_sigsegv, SIGSEGV);
2453   pg = getpagesize ();
2454 #ifndef USE_MAP_ANON
2455   devzero = open ("/dev/zero", O_RDWR);
2456   if (devzero < 0)
2457     perror_exit ("open /dev/zero", 1);
2458 #endif
2459
2460   test_0();
2461   test_1();
2462   test_2();
2463   test_3();
2464
2465   exit(0);
2466 }
2467 EOF
2468
2469 echo $ac_n "checking for working mmap from /dev/zero""... $ac_c" 1>&6
2470 echo "configure:2471: checking for working mmap from /dev/zero" >&5
2471 if eval "test \"`echo '$''{'ac_cv_func_mmap_dev_zero'+set}'`\" = set"; then
2472   echo $ac_n "(cached) $ac_c" 1>&6
2473 else
2474   if test "$cross_compiling" = yes; then
2475   # If this is not cygwin, and /dev/zero is a character device, it's probably
2476  # safe to assume it works.
2477  case "$host_os" in
2478    cygwin* | win32 | pe | mingw* ) ac_cv_func_mmap_dev_zero=buggy ;;
2479    * ) if test -c /dev/zero
2480        then ac_cv_func_mmap_dev_zero=yes
2481        else ac_cv_func_mmap_dev_zero=no
2482        fi ;;
2483   esac
2484 else
2485   cat > conftest.$ac_ext <<EOF
2486 #line 2487 "configure"
2487 #include "confdefs.h"
2488 #include "ct-mmap.inc"
2489 EOF
2490 if { (eval echo configure:2491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2491 then
2492   ac_cv_func_mmap_dev_zero=yes
2493 else
2494   echo "configure: failed program was:" >&5
2495   cat conftest.$ac_ext >&5
2496   rm -fr conftest*
2497   if test $? -lt 4
2498  then ac_cv_func_mmap_dev_zero=no
2499  else ac_cv_func_mmap_dev_zero=buggy
2500  fi
2501 fi
2502 rm -fr conftest*
2503 fi
2504
2505
2506 fi
2507
2508 echo "$ac_t""$ac_cv_func_mmap_dev_zero" 1>&6
2509 if test $ac_cv_func_mmap_dev_zero = yes; then
2510   cat >> confdefs.h <<\EOF
2511 #define HAVE_MMAP_DEV_ZERO 1
2512 EOF
2513
2514 fi
2515
2516 echo $ac_n "checking for working mmap with MAP_ANON(YMOUS)""... $ac_c" 1>&6
2517 echo "configure:2518: checking for working mmap with MAP_ANON(YMOUS)" >&5
2518 if eval "test \"`echo '$''{'ac_cv_func_mmap_anon'+set}'`\" = set"; then
2519   echo $ac_n "(cached) $ac_c" 1>&6
2520 else
2521   if test "$cross_compiling" = yes; then
2522   # Unlike /dev/zero, it is not safe to assume MAP_ANON(YMOUS) works
2523  # just because it's there. Some SCO Un*xen define it but don't implement it.
2524  ac_cv_func_mmap_anon=no
2525 else
2526   cat > conftest.$ac_ext <<EOF
2527 #line 2528 "configure"
2528 #include "confdefs.h"
2529 #define USE_MAP_ANON
2530 #include "ct-mmap.inc"
2531 EOF
2532 if { (eval echo configure:2533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2533 then
2534   ac_cv_func_mmap_anon=yes
2535 else
2536   echo "configure: failed program was:" >&5
2537   cat conftest.$ac_ext >&5
2538   rm -fr conftest*
2539   if test $? -lt 4
2540  then ac_cv_func_mmap_anon=no
2541  else ac_cv_func_mmap_anon=buggy
2542  fi
2543 fi
2544 rm -fr conftest*
2545 fi
2546
2547
2548 fi
2549
2550 echo "$ac_t""$ac_cv_func_mmap_anon" 1>&6
2551 if test $ac_cv_func_mmap_anon = yes; then
2552   cat >> confdefs.h <<\EOF
2553 #define HAVE_MMAP_ANON 1
2554 EOF
2555
2556 fi
2557 rm -f ct-mmap.inc
2558
2559 echo $ac_n "checking for working mmap of a file""... $ac_c" 1>&6
2560 echo "configure:2561: checking for working mmap of a file" >&5
2561 if eval "test \"`echo '$''{'ac_cv_func_mmap_file'+set}'`\" = set"; then
2562   echo $ac_n "(cached) $ac_c" 1>&6
2563 else
2564   # Create a file one thousand bytes long.
2565 for i in 1 2 3 4 5 6 7 8 9 0
2566 do for j in 1 2 3 4 5 6 7 8 9 0
2567 do echo $i $j xxxxx
2568 done
2569 done > conftestdata$$
2570
2571 if test "$cross_compiling" = yes; then
2572   ac_cv_func_mmap_file=no
2573 else
2574   cat > conftest.$ac_ext <<EOF
2575 #line 2576 "configure"
2576 #include "confdefs.h"
2577
2578 /* Test by Zack Weinberg.  Modified from MMAP_ANYWHERE test by
2579    Richard Henderson and Alexandre Oliva.
2580    Check whether read-only mmap of a plain file works. */
2581 #include <sys/types.h>
2582 #include <sys/stat.h>
2583 #include <fcntl.h>
2584 #include <sys/mman.h>
2585
2586 int main()
2587 {
2588   char *x;
2589   int fd;
2590   struct stat st;
2591
2592   fd = open("conftestdata$$", O_RDONLY);
2593   if (fd < 0)
2594     exit(1);
2595
2596   if (fstat (fd, &st))
2597     exit(2);
2598
2599   x = (char*)mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
2600   if (x == (char *) -1)
2601     exit(3);
2602
2603   if (x[0] != '1' || x[1] != ' ' || x[2] != '1' || x[3] != ' ')
2604     exit(4);
2605
2606   if (munmap(x, st.st_size) < 0)
2607     exit(5);
2608
2609   exit(0);
2610 }
2611 EOF
2612 if { (eval echo configure:2613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2613 then
2614   ac_cv_func_mmap_file=yes
2615 else
2616   echo "configure: failed program was:" >&5
2617   cat conftest.$ac_ext >&5
2618   rm -fr conftest*
2619   ac_cv_func_mmap_file=no
2620 fi
2621 rm -fr conftest*
2622 fi
2623
2624 fi
2625
2626 echo "$ac_t""$ac_cv_func_mmap_file" 1>&6
2627 if test $ac_cv_func_mmap_file = yes; then
2628   cat >> confdefs.h <<\EOF
2629 #define HAVE_MMAP_FILE 1
2630 EOF
2631
2632 fi
2633
2634
2635 # We will need to find libiberty.h and ansidecl.h
2636 saved_CFLAGS="$CFLAGS"
2637 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
2638 for ac_func in getenv abort errno \
2639         malloc realloc calloc free getopt clock
2640 do
2641   ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2642 echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
2643 echo "configure:2644: checking whether $ac_func is declared" >&5
2644 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
2645   echo $ac_n "(cached) $ac_c" 1>&6
2646 else
2647   cat > conftest.$ac_ext <<EOF
2648 #line 2649 "configure"
2649 #include "confdefs.h"
2650 #undef $ac_tr_decl
2651 #define $ac_tr_decl 1
2652   
2653 #include "ansidecl.h"
2654 #include "system.h"
2655
2656 int main() {
2657 #ifndef $ac_func
2658 char *(*pfn) = (char *(*)) $ac_func ;
2659 #endif
2660 ; return 0; }
2661 EOF
2662 if { (eval echo configure:2663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2663   rm -rf conftest*
2664   eval "gcc_cv_have_decl_$ac_func=yes"
2665 else
2666   echo "configure: failed program was:" >&5
2667   cat conftest.$ac_ext >&5
2668   rm -rf conftest*
2669   eval "gcc_cv_have_decl_$ac_func=no"
2670 fi
2671 rm -f conftest*
2672 fi
2673
2674 if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
2675   echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
2676 #define $ac_tr_decl 1
2677 EOF
2678  
2679 else
2680   echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
2681 #define $ac_tr_decl 0
2682 EOF
2683  
2684 fi
2685
2686 done
2687 if test x = y ; then
2688   cat >> confdefs.h <<\EOF
2689 #define HAVE_DECL_GETENV 1
2690 EOF
2691  cat >> confdefs.h <<\EOF
2692 #define HAVE_DECL_ABORT 1
2693 EOF
2694  cat >> confdefs.h <<\EOF
2695 #define HAVE_DECL_ERRNO 1
2696 EOF
2697  \
2698         cat >> confdefs.h <<\EOF
2699 #define HAVE_DECL_MALLOC 1
2700 EOF
2701  cat >> confdefs.h <<\EOF
2702 #define HAVE_DECL_REALLOC 1
2703 EOF
2704  cat >> confdefs.h <<\EOF
2705 #define HAVE_DECL_CALLOC 1
2706 EOF
2707  cat >> confdefs.h <<\EOF
2708 #define HAVE_DECL_FREE 1
2709 EOF
2710  cat >> confdefs.h <<\EOF
2711 #define HAVE_DECL_GETOPT 1
2712 EOF
2713  cat >> confdefs.h <<\EOF
2714 #define HAVE_DECL_CLOCK 1
2715 EOF
2716 fi
2717
2718
2719 for ac_func in times
2720 do
2721   ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2722 echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
2723 echo "configure:2724: checking whether $ac_func is declared" >&5
2724 if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
2725   echo $ac_n "(cached) $ac_c" 1>&6
2726 else
2727   cat > conftest.$ac_ext <<EOF
2728 #line 2729 "configure"
2729 #include "confdefs.h"
2730 #undef $ac_tr_decl
2731 #define $ac_tr_decl 1
2732   
2733 #include "ansidecl.h"
2734 #include "system.h"
2735 #ifdef HAVE_SYS_TIMES_H
2736 #include <sys/times.h>
2737 #endif
2738
2739
2740 int main() {
2741 #ifndef $ac_func
2742 char *(*pfn) = (char *(*)) $ac_func ;
2743 #endif
2744 ; return 0; }
2745 EOF
2746 if { (eval echo configure:2747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2747   rm -rf conftest*
2748   eval "gcc_cv_have_decl_$ac_func=yes"
2749 else
2750   echo "configure: failed program was:" >&5
2751   cat conftest.$ac_ext >&5
2752   rm -rf conftest*
2753   eval "gcc_cv_have_decl_$ac_func=no"
2754 fi
2755 rm -f conftest*
2756 fi
2757
2758 if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
2759   echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
2760 #define $ac_tr_decl 1
2761 EOF
2762  
2763 else
2764   echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
2765 #define $ac_tr_decl 0
2766 EOF
2767  
2768 fi
2769
2770 done
2771 if test x = y ; then
2772   cat >> confdefs.h <<\EOF
2773 #define HAVE_DECL_TIMES 1
2774 EOF
2775 fi
2776
2777
2778 # More time-related stuff.
2779 echo $ac_n "checking for struct tms""... $ac_c" 1>&6
2780 echo "configure:2781: checking for struct tms" >&5
2781 if eval "test \"`echo '$''{'ac_cv_struct_tms'+set}'`\" = set"; then
2782   echo $ac_n "(cached) $ac_c" 1>&6
2783 else
2784   
2785 cat > conftest.$ac_ext <<EOF
2786 #line 2787 "configure"
2787 #include "confdefs.h"
2788
2789 #include "ansidecl.h"
2790 #include "system.h"
2791 #ifdef HAVE_SYS_TIMES_H
2792 #include <sys/times.h>
2793 #endif
2794
2795 int main() {
2796 struct tms tms;
2797 ; return 0; }
2798 EOF
2799 if { (eval echo configure:2800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2800   rm -rf conftest*
2801   ac_cv_struct_tms=yes
2802 else
2803   echo "configure: failed program was:" >&5
2804   cat conftest.$ac_ext >&5
2805   rm -rf conftest*
2806   ac_cv_struct_tms=no
2807 fi
2808 rm -f conftest*
2809 fi
2810
2811 echo "$ac_t""$ac_cv_struct_tms" 1>&6
2812 if test $ac_cv_struct_tms = yes; then
2813   cat >> confdefs.h <<\EOF
2814 #define HAVE_STRUCT_TMS 1
2815 EOF
2816
2817 fi
2818
2819 # use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
2820 # revisit after autoconf 2.50.
2821 echo $ac_n "checking for clock_t""... $ac_c" 1>&6
2822 echo "configure:2823: checking for clock_t" >&5
2823 if eval "test \"`echo '$''{'gcc_cv_type_clock_t'+set}'`\" = set"; then
2824   echo $ac_n "(cached) $ac_c" 1>&6
2825 else
2826   
2827 cat > conftest.$ac_ext <<EOF
2828 #line 2829 "configure"
2829 #include "confdefs.h"
2830
2831 #include "ansidecl.h"
2832 #include "system.h"
2833
2834 int main() {
2835 clock_t x;
2836 ; return 0; }
2837 EOF
2838 if { (eval echo configure:2839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2839   rm -rf conftest*
2840   gcc_cv_type_clock_t=yes
2841 else
2842   echo "configure: failed program was:" >&5
2843   cat conftest.$ac_ext >&5
2844   rm -rf conftest*
2845   gcc_cv_type_clock_t=no
2846 fi
2847 rm -f conftest*
2848 fi
2849
2850 echo "$ac_t""$gcc_cv_type_clock_t" 1>&6
2851 if test $gcc_cv_type_clock_t = yes; then
2852   cat >> confdefs.h <<\EOF
2853 #define HAVE_CLOCK_T 1
2854 EOF
2855
2856 fi
2857
2858 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
2859 CFLAGS="$saved_CFLAGS"
2860
2861 # mkdir takes a single argument on some systems. 
2862 echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
2863 echo "configure:2864: checking if mkdir takes one argument" >&5
2864 if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then
2865   echo $ac_n "(cached) $ac_c" 1>&6
2866 else
2867   cat > conftest.$ac_ext <<EOF
2868 #line 2869 "configure"
2869 #include "confdefs.h"
2870
2871 #include <sys/types.h>
2872 #ifdef HAVE_SYS_STAT_H
2873 # include <sys/stat.h>
2874 #endif
2875 #ifdef HAVE_UNISTD_H
2876 # include <unistd.h>
2877 #endif
2878 #ifdef HAVE_DIRECT_H
2879 # include <direct.h>
2880 #endif
2881 int main() {
2882 mkdir ("foo", 0);
2883 ; return 0; }
2884 EOF
2885 if { (eval echo configure:2886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2886   rm -rf conftest*
2887   gcc_cv_mkdir_takes_one_arg=no
2888 else
2889   echo "configure: failed program was:" >&5
2890   cat conftest.$ac_ext >&5
2891   rm -rf conftest*
2892   gcc_cv_mkdir_takes_one_arg=yes
2893 fi
2894 rm -f conftest*
2895 fi
2896
2897 echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6
2898 if test $gcc_cv_mkdir_takes_one_arg = yes ; then
2899   cat >> confdefs.h <<\EOF
2900 #define MKDIR_TAKES_ONE_ARG 1
2901 EOF
2902
2903 fi
2904
2905
2906 # File extensions
2907 manext='.1'
2908 objext='.o'
2909
2910
2911
2912 build_xm_file=
2913 build_xm_defines=
2914 build_install_headers_dir=install-headers-tar
2915 build_exeext=
2916 host_xm_file=
2917 host_xm_defines=
2918 host_xmake_file=
2919 host_truncate_target=
2920 host_exeext=
2921
2922 # Decode the host machine, then the target machine.
2923 # For the host machine, we save the xm_file variable as host_xm_file;
2924 # then we decode the target machine and forget everything else
2925 # that came from the host machine.
2926 #for machine in $build $host $target; do
2927 #       . ${srcdir}/config.gcc
2928 #done
2929
2930 extra_objs="${host_extra_objs} ${extra_objs}"
2931
2932 # Default the target-machine variables that were not explicitly set.
2933 if test x"$tm_file" = x
2934 then tm_file=$cpu_type/$cpu_type.h; fi
2935
2936 if test x"$extra_headers" = x
2937 then extra_headers=; fi
2938
2939 if test x$md_file = x
2940 then md_file=$cpu_type/$cpu_type.md; fi
2941
2942 if test x$out_file = x
2943 then out_file=$cpu_type/$cpu_type.c; fi
2944
2945 if test x"$tmake_file" = x
2946 then tmake_file=$cpu_type/t-$cpu_type
2947 fi
2948
2949 if test x"$dwarf2" = xyes
2950 then tm_file="$tm_file tm-dwarf2.h"
2951 fi
2952
2953 # Handle cpp installation.
2954 if test x$enable_cpp != xno
2955 then
2956   tmake_file="$tmake_file t-install-cpp"
2957 fi
2958
2959 # auto-host.h is the file containing items generated by autoconf and is
2960 # the first file included by config.h.
2961 # If host=build, it is correct to have hconfig include auto-host.h
2962 # as well.  If host!=build, we are in error and need to do more 
2963 # work to find out the build config parameters.
2964 if test x$host = x$build
2965 then
2966         build_auto=auto-host.h
2967 else
2968         # We create a subdir, then run autoconf in the subdir.
2969         # To prevent recursion we set host and build for the new
2970         # invocation of configure to the build for this invocation
2971         # of configure. 
2972         tempdir=build.$$
2973         rm -rf $tempdir
2974         mkdir $tempdir
2975         cd $tempdir
2976         case ${srcdir} in
2977         /* | A-Za-z:\\/* ) realsrcdir=${srcdir};;
2978         *) realsrcdir=../${srcdir};;
2979         esac
2980         CC=${CC_FOR_BUILD} ${realsrcdir}/configure \
2981                 --target=$target --host=$build --build=$build
2982
2983         # We just finished tests for the build machine, so rename
2984         # the file auto-build.h in the gcc directory.
2985         mv auto-host.h ../auto-build.h
2986         cd ..
2987         rm -rf $tempdir
2988         build_auto=auto-build.h
2989 fi
2990
2991 tm_file="${tm_file} defaults.h"
2992 host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}"
2993 build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}"
2994 xm_file="ansidecl.h ${xm_file} ${tm_file}"
2995
2996 # Truncate the target if necessary
2997 if test x$host_truncate_target != x; then
2998         target=`echo $target | sed -e 's/\(..............\).*/\1/'`
2999 fi
3000
3001 # Get the version trigger filename from the toplevel
3002 if test "${with_gcc_version_trigger+set}" = set; then
3003         gcc_version_trigger=$with_gcc_version_trigger
3004 else
3005         gcc_version_trigger=${srcdir}/version.c
3006 fi
3007 gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
3008 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
3009
3010 # Compile in configure arguments.
3011 if test -f configargs.h ; then
3012         # Being re-configured.
3013         gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
3014         gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
3015 else
3016         gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
3017 fi
3018 cat > configargs.h <<EOF
3019 /* Generated automatically. */
3020 static const char configuration_arguments[] = "$gcc_config_arguments";
3021 static const char thread_model[] = "$thread_file";
3022 EOF
3023
3024 # Internationalization
3025 PACKAGE=sdcc
3026 VERSION="$gcc_version"
3027 cat >> confdefs.h <<EOF
3028 #define PACKAGE "$PACKAGE"
3029 EOF
3030
3031 cat >> confdefs.h <<EOF
3032 #define VERSION "$VERSION"
3033 EOF
3034
3035
3036
3037
3038 ALL_LINGUAS="sv"
3039
3040 # Get an absolute path to the GCC top-level source directory
3041 holddir=`pwd`
3042 cd $srcdir
3043 topdir=`pwd`
3044 cd $holddir
3045
3046 out_object_file=`basename $out_file .c`.o
3047
3048 # Figure out what assembler we will be using.
3049 echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
3050 echo "configure:3051: checking what assembler to use" >&5
3051 gcc_cv_as=
3052 gcc_cv_gas_major_version=
3053 gcc_cv_gas_minor_version=
3054 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
3055 if test -x "$DEFAULT_ASSEMBLER"; then
3056         gcc_cv_as="$DEFAULT_ASSEMBLER"
3057 elif test -x "$AS"; then
3058         gcc_cv_as="$AS"
3059 elif test -x as$host_exeext; then
3060         # Build using assembler in the current directory.
3061         gcc_cv_as=./as$host_exeext
3062 elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then
3063         # Single tree build which includes gas.
3064         for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
3065         do
3066                 gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
3067                 if test x$gcc_cv_gas_version != x; then
3068                         break
3069                 fi
3070         done
3071         gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
3072         gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
3073 fi
3074
3075 if test "x$gcc_cv_as" = x -a x$host = x$target; then
3076         # Native build.
3077         # Search the same directories that the installed compiler will
3078         # search.  Else we may find the wrong assembler and lose.  If we
3079         # do not find a suitable assembler binary, then try the user's
3080         # path.
3081         #
3082         # Also note we have to check MD_EXEC_PREFIX before checking the
3083         # user's path.  Unfortunately, there is no good way to get at the
3084         # value of MD_EXEC_PREFIX here.  So we do a brute force search
3085         # through all the known MD_EXEC_PREFIX values.  Ugh.  This needs
3086         # to be fixed as part of the make/configure rewrite too.
3087
3088         if test "x$exec_prefix" = xNONE; then
3089                 if test "x$prefix" = xNONE; then
3090                         test_prefix=/usr/local
3091                 else
3092                         test_prefix=$prefix
3093                 fi
3094         else
3095                 test_prefix=$exec_prefix
3096         fi
3097
3098         # If the loop below does not find an assembler, then use whatever
3099         # one we can find in the users's path.
3100         # user's path.
3101         gcc_cv_as=as$host_exeext
3102
3103         test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \
3104                    $test_prefix/lib/gcc-lib/$target \
3105                    /usr/lib/gcc/$target/$gcc_version \
3106                    /usr/lib/gcc/$target \
3107                    $test_prefix/$target/bin/$target/$gcc_version \
3108                    $test_prefix/$target/bin \
3109                    /usr/libexec \
3110                    /usr/ccs/gcc \
3111                    /usr/ccs/bin \
3112                    /udk/usr/ccs/bin \
3113                    /bsd43/usr/lib/cmplrs/cc \
3114                    /usr/cross64/usr/bin \
3115                    /usr/lib/cmplrs/cc \
3116                    /sysv/usr/lib/cmplrs/cc \
3117                    /svr4/usr/lib/cmplrs/cc \
3118                    /usr/bin"
3119
3120         for dir in $test_dirs; do
3121                 if test -f $dir/as$host_exeext; then
3122                         gcc_cv_as=$dir/as$host_exeext
3123                         break;
3124                 fi
3125         done
3126 fi
3127 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
3128   echo "$ac_t"""newly built gas"" 1>&6
3129 else
3130   echo "$ac_t""$gcc_cv_as" 1>&6
3131 fi
3132
3133 # Figure out what nm we will be using.
3134 echo $ac_n "checking what nm to use""... $ac_c" 1>&6
3135 echo "configure:3136: checking what nm to use" >&5
3136 if test -x nm$host_exeext; then
3137         gcc_cv_nm=./nm$host_exeext
3138 elif test x$host = x$target; then
3139         # Native build.
3140         gcc_cv_nm=nm$host_exeext
3141 fi
3142 echo "$ac_t""$gcc_cv_nm" 1>&6
3143
3144
3145 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
3146 echo "configure:3147: checking whether to enable maintainer-specific portions of Makefiles" >&5
3147     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
3148 if test "${enable_maintainer_mode+set}" = set; then
3149   enableval="$enable_maintainer_mode"
3150   maintainer_mode=$enableval
3151 else
3152   maintainer_mode=no
3153 fi
3154
3155
3156 echo "$ac_t""$maintainer_mode" 1>&6
3157
3158 if test "$maintainer_mode" = "yes"; then
3159   MAINT=''
3160 else
3161   MAINT='#'
3162 fi
3163
3164 # These (without "all_") are set in each config-lang.in.
3165 # `language' must be a single word so is spelled singularly.
3166 all_stagestuff=
3167 all_outputs='Makefile'
3168 # List of language makefile fragments.
3169
3170 # Add the language fragments.
3171 # Languages are added via two mechanisms.  Some information must be
3172 # recorded in makefile variables, these are defined in config-lang.in.
3173 # We accumulate them and plug them into the main Makefile.
3174 # The other mechanism is a set of hooks for each of the main targets
3175 # like `clean', `install', etc.
3176
3177 language_fragments="Make-lang"
3178
3179 # Define variables host_canonical and build_canonical
3180 # because some Cygnus local changes in the Makefile depend on them.
3181 build_canonical=${build}
3182 host_canonical=${host}
3183 target_subdir=
3184 if test "${host}" != "${target}" ; then
3185     target_subdir=${target_alias}/
3186 fi
3187
3188
3189
3190         
3191 # Nothing to do for FLOAT_H, float_format already handled.
3192 objdir=`pwd`
3193
3194
3195 # Substitute configuration variables
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233 # Create the Makefile
3234 # and configure language subdirectories
3235 trap '' 1 2 15
3236 cat > confcache <<\EOF
3237 # This file is a shell script that caches the results of configure
3238 # tests run on this system so they can be shared between configure
3239 # scripts and configure runs.  It is not useful on other systems.
3240 # If it contains results you don't want to keep, you may remove or edit it.
3241 #
3242 # By default, configure uses ./config.cache as the cache file,
3243 # creating it if it does not exist already.  You can give configure
3244 # the --cache-file=FILE option to use a different cache file; that is
3245 # what configure does when it calls configure scripts in
3246 # subdirectories, so they share the cache.
3247 # Giving --cache-file=/dev/null disables caching, for debugging configure.
3248 # config.status only pays attention to the cache file if you give it the
3249 # --recheck option to rerun configure.
3250 #
3251 EOF
3252 # The following way of writing the cache mishandles newlines in values,
3253 # but we know of no workaround that is simple, portable, and efficient.
3254 # So, don't put newlines in cache variables' values.
3255 # Ultrix sh set writes to stderr and can't be redirected directly,
3256 # and sets the high bit in the cache file unless we assign to the vars.
3257 (set) 2>&1 |
3258   case `(ac_space=' '; set | grep ac_space) 2>&1` in
3259   *ac_space=\ *)
3260     # `set' does not quote correctly, so add quotes (double-quote substitution
3261     # turns \\\\ into \\, and sed turns \\ into \).
3262     sed -n \
3263       -e "s/'/'\\\\''/g" \
3264       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3265     ;;
3266   *)
3267     # `set' quotes correctly as required by POSIX, so do not add quotes.
3268     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3269     ;;
3270   esac >> confcache
3271 if cmp -s $cache_file confcache; then
3272   :
3273 else
3274   if test -w $cache_file; then
3275     echo "updating cache $cache_file"
3276     cat confcache > $cache_file
3277   else
3278     echo "not updating unwritable cache $cache_file"
3279   fi
3280 fi
3281 rm -f confcache
3282
3283 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3284
3285 test "x$prefix" = xNONE && prefix=$ac_default_prefix
3286 # Let make expand exec_prefix.
3287 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3288
3289 # Any assignment to VPATH causes Sun make to only execute
3290 # the first set of double-colon rules, so remove it if not needed.
3291 # If there is a colon in the path, we need to keep it.
3292 if test "x$srcdir" = x.; then
3293   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
3294 fi
3295
3296 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3297
3298 DEFS=-DHAVE_CONFIG_H
3299
3300 # Without the "./", some shells look in PATH for config.status.
3301 : ${CONFIG_STATUS=./config.status}
3302
3303 echo creating $CONFIG_STATUS
3304 rm -f $CONFIG_STATUS
3305 cat > $CONFIG_STATUS <<EOF
3306 #! /bin/sh
3307 # Generated automatically by configure.
3308 # Run this file to recreate the current configuration.
3309 # This directory was configured as follows,
3310 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3311 #
3312 # $0 $ac_configure_args
3313 #
3314 # Compiler output produced by configure, useful for debugging
3315 # configure, is in ./config.log if it exists.
3316
3317 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3318 for ac_option
3319 do
3320   case "\$ac_option" in
3321   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3322     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3323     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3324   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
3325     echo "$CONFIG_STATUS generated by autoconf version 2.13"
3326     exit 0 ;;
3327   -help | --help | --hel | --he | --h)
3328     echo "\$ac_cs_usage"; exit 0 ;;
3329   *) echo "\$ac_cs_usage"; exit 1 ;;
3330   esac
3331 done
3332
3333 ac_given_srcdir=$srcdir
3334
3335 trap 'rm -fr `echo "$all_outputs auto-host.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
3336 EOF
3337 cat >> $CONFIG_STATUS <<EOF
3338
3339 # Protect against being on the right side of a sed subst in config.status.
3340 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3341  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3342 $ac_vpsub
3343 $extrasub
3344 s%@SHELL@%$SHELL%g
3345 s%@CFLAGS@%$CFLAGS%g
3346 s%@CPPFLAGS@%$CPPFLAGS%g
3347 s%@CXXFLAGS@%$CXXFLAGS%g
3348 s%@FFLAGS@%$FFLAGS%g
3349 s%@DEFS@%$DEFS%g
3350 s%@LDFLAGS@%$LDFLAGS%g
3351 s%@LIBS@%$LIBS%g
3352 s%@exec_prefix@%$exec_prefix%g
3353 s%@prefix@%$prefix%g
3354 s%@program_transform_name@%$program_transform_name%g
3355 s%@bindir@%$bindir%g
3356 s%@sbindir@%$sbindir%g
3357 s%@libexecdir@%$libexecdir%g
3358 s%@datadir@%$datadir%g
3359 s%@sysconfdir@%$sysconfdir%g
3360 s%@sharedstatedir@%$sharedstatedir%g
3361 s%@localstatedir@%$localstatedir%g
3362 s%@libdir@%$libdir%g
3363 s%@includedir@%$includedir%g
3364 s%@oldincludedir@%$oldincludedir%g
3365 s%@infodir@%$infodir%g
3366 s%@mandir@%$mandir%g
3367 s%@CC@%$CC%g
3368 s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
3369 s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
3370 s%@CPP@%$CPP%g
3371 s%@warn_cflags@%$warn_cflags%g
3372 s%@SET_MAKE@%$SET_MAKE%g
3373 s%@LN@%$LN%g
3374 s%@LN_S@%$LN_S%g
3375 s%@RANLIB@%$RANLIB%g
3376 s%@INSTALL@%$INSTALL%g
3377 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
3378 s%@INSTALL_DATA@%$INSTALL_DATA%g
3379 s%@have_mktemp_command@%$have_mktemp_command%g
3380 s%@STRIP@%$STRIP%g
3381 s%@manext@%$manext%g
3382 s%@objext@%$objext%g
3383 s%@PACKAGE@%$PACKAGE%g
3384 s%@VERSION@%$VERSION%g
3385 s%@MAINT@%$MAINT%g
3386 s%@build_canonical@%$build_canonical%g
3387 s%@host_canonical@%$host_canonical%g
3388 s%@target_subdir@%$target_subdir%g
3389 s%@objdir@%$objdir%g
3390 s%@all_stagestuff@%$all_stagestuff%g
3391 s%@build_exeext@%$build_exeext%g
3392 s%@build_install_headers_dir@%$build_install_headers_dir%g
3393 s%@build_xm_file_list@%$build_xm_file_list%g
3394 s%@build_xm_file@%$build_xm_file%g
3395 s%@build_xm_defines@%$build_xm_defines%g
3396 s%@check_languages@%$check_languages%g
3397 s%@dep_host_xmake_file@%$dep_host_xmake_file%g
3398 s%@dep_tmake_file@%$dep_tmake_file%g
3399 s%@extra_c_flags@%$extra_c_flags%g
3400 s%@extra_headers_list@%$extra_headers_list%g
3401 s%@extra_objs@%$extra_objs%g
3402 s%@extra_parts@%$extra_parts%g
3403 s%@extra_passes@%$extra_passes%g
3404 s%@extra_programs@%$extra_programs%g
3405 s%@gcc_config_arguments@%$gcc_config_arguments%g
3406 s%@gcc_version@%$gcc_version%g
3407 s%@gcc_version_full@%$gcc_version_full%g
3408 s%@gcc_version_trigger@%$gcc_version_trigger%g
3409 s%@host_exeext@%$host_exeext%g
3410 s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
3411 s%@install@%$install%g
3412 s%@lang_tree_files@%$lang_tree_files%g
3413 s%@local_prefix@%$local_prefix%g
3414 s%@md_file@%$md_file%g
3415 s%@out_file@%$out_file%g
3416 s%@out_object_file@%$out_object_file%g
3417 s%@symbolic_link@%$symbolic_link%g
3418 s%@thread_file@%$thread_file%g
3419 s%@c_target_objs@%$c_target_objs%g
3420 /@target_overrides@/r $target_overrides
3421 s%@target_overrides@%%g
3422 /@host_overrides@/r $host_overrides
3423 s%@host_overrides@%%g
3424 s%@cross_defines@%$cross_defines%g
3425 /@cross_overrides@/r $cross_overrides
3426 s%@cross_overrides@%%g
3427 /@build_overrides@/r $build_overrides
3428 s%@build_overrides@%%g
3429
3430 CEOF
3431 EOF
3432
3433 cat >> $CONFIG_STATUS <<\EOF
3434
3435 # Split the substitutions into bite-sized pieces for seds with
3436 # small command number limits, like on Digital OSF/1 and HP-UX.
3437 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3438 ac_file=1 # Number of current file.
3439 ac_beg=1 # First line for current file.
3440 ac_end=$ac_max_sed_cmds # Line after last line for current file.
3441 ac_more_lines=:
3442 ac_sed_cmds=""
3443 while $ac_more_lines; do
3444   if test $ac_beg -gt 1; then
3445     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3446   else
3447     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3448   fi
3449   if test ! -s conftest.s$ac_file; then
3450     ac_more_lines=false
3451     rm -f conftest.s$ac_file
3452   else
3453     if test -z "$ac_sed_cmds"; then
3454       ac_sed_cmds="sed -f conftest.s$ac_file"
3455     else
3456       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3457     fi
3458     ac_file=`expr $ac_file + 1`
3459     ac_beg=$ac_end
3460     ac_end=`expr $ac_end + $ac_max_sed_cmds`
3461   fi
3462 done
3463 if test -z "$ac_sed_cmds"; then
3464   ac_sed_cmds=cat
3465 fi
3466 EOF
3467
3468 cat >> $CONFIG_STATUS <<EOF
3469
3470 CONFIG_FILES=\${CONFIG_FILES-"$all_outputs"}
3471 EOF
3472 cat >> $CONFIG_STATUS <<\EOF
3473 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3474   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3475   case "$ac_file" in
3476   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3477        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3478   *) ac_file_in="${ac_file}.in" ;;
3479   esac
3480
3481   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3482
3483   # Remove last slash and all that follows it.  Not all systems have dirname.
3484   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3485   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3486     # The file is in a subdirectory.
3487     test ! -d "$ac_dir" && mkdir "$ac_dir"
3488     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3489     # A "../" for each directory in $ac_dir_suffix.
3490     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3491   else
3492     ac_dir_suffix= ac_dots=
3493   fi
3494
3495   case "$ac_given_srcdir" in
3496   .)  srcdir=.
3497       if test -z "$ac_dots"; then top_srcdir=.
3498       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3499   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3500   *) # Relative path.
3501     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3502     top_srcdir="$ac_dots$ac_given_srcdir" ;;
3503   esac
3504
3505
3506   echo creating "$ac_file"
3507   rm -f "$ac_file"
3508   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3509   case "$ac_file" in
3510   *Makefile*) ac_comsub="1i\\
3511 # $configure_input" ;;
3512   *) ac_comsub= ;;
3513   esac
3514
3515   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3516   sed -e "$ac_comsub
3517 s%@configure_input@%$configure_input%g
3518 s%@srcdir@%$srcdir%g
3519 s%@top_srcdir@%$top_srcdir%g
3520 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3521 fi; done
3522 rm -f conftest.s*
3523
3524 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3525 # NAME is the cpp macro being defined and VALUE is the value it is being given.
3526 #
3527 # ac_d sets the value in "#define NAME VALUE" lines.
3528 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
3529 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
3530 ac_dC='\3'
3531 ac_dD='%g'
3532 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3533 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3534 ac_uB='\([      ]\)%\1#\2define\3'
3535 ac_uC=' '
3536 ac_uD='\4%g'
3537 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3538 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
3539 ac_eB='$%\1#\2define\3'
3540 ac_eC=' '
3541 ac_eD='%g'
3542
3543 if test "${CONFIG_HEADERS+set}" != set; then
3544 EOF
3545 cat >> $CONFIG_STATUS <<EOF
3546   CONFIG_HEADERS="auto-host.h:config.in"
3547 EOF
3548 cat >> $CONFIG_STATUS <<\EOF
3549 fi
3550 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3551   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3552   case "$ac_file" in
3553   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3554        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3555   *) ac_file_in="${ac_file}.in" ;;
3556   esac
3557
3558   echo creating $ac_file
3559
3560   rm -f conftest.frag conftest.in conftest.out
3561   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3562   cat $ac_file_inputs > conftest.in
3563
3564 EOF
3565
3566 # Transform confdefs.h into a sed script conftest.vals that substitutes
3567 # the proper values into config.h.in to produce config.h.  And first:
3568 # Protect against being on the right side of a sed subst in config.status.
3569 # Protect against being in an unquoted here document in config.status.
3570 rm -f conftest.vals
3571 cat > conftest.hdr <<\EOF
3572 s/[\\&%]/\\&/g
3573 s%[\\$`]%\\&%g
3574 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3575 s%ac_d%ac_u%gp
3576 s%ac_u%ac_e%gp
3577 EOF
3578 sed -n -f conftest.hdr confdefs.h > conftest.vals
3579 rm -f conftest.hdr
3580
3581 # This sed command replaces #undef with comments.  This is necessary, for
3582 # example, in the case of _POSIX_SOURCE, which is predefined and required
3583 # on some systems where configure will not decide to define it.
3584 cat >> conftest.vals <<\EOF
3585 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3586 EOF
3587
3588 # Break up conftest.vals because some shells have a limit on
3589 # the size of here documents, and old seds have small limits too.
3590
3591 rm -f conftest.tail
3592 while :
3593 do
3594   ac_lines=`grep -c . conftest.vals`
3595   # grep -c gives empty output for an empty file on some AIX systems.
3596   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3597   # Write a limited-size here document to conftest.frag.
3598   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3599   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3600   echo 'CEOF
3601   sed -f conftest.frag conftest.in > conftest.out
3602   rm -f conftest.in
3603   mv conftest.out conftest.in
3604 ' >> $CONFIG_STATUS
3605   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3606   rm -f conftest.vals
3607   mv conftest.tail conftest.vals
3608 done
3609 rm -f conftest.vals
3610
3611 cat >> $CONFIG_STATUS <<\EOF
3612   rm -f conftest.frag conftest.h
3613   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
3614   cat conftest.in >> conftest.h
3615   rm -f conftest.in
3616   if cmp -s $ac_file conftest.h 2>/dev/null; then
3617     echo "$ac_file is unchanged"
3618     rm -f conftest.h
3619   else
3620     # Remove last slash and all that follows it.  Not all systems have dirname.
3621       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3622       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3623       # The file is in a subdirectory.
3624       test ! -d "$ac_dir" && mkdir "$ac_dir"
3625     fi
3626     rm -f $ac_file
3627     mv conftest.h $ac_file
3628   fi
3629 fi; done
3630
3631 EOF
3632 cat >> $CONFIG_STATUS <<EOF
3633
3634 host='${host}'
3635 build='${build}'
3636 target='${target}'
3637 target_alias='${target_alias}'
3638 srcdir='${srcdir}'
3639 symbolic_link='${symbolic_link}'
3640 program_transform_set='${program_transform_set}'
3641 program_transform_name='${program_transform_name}'
3642 dep_host_xmake_file='${dep_host_xmake_file}'
3643 host_xmake_file='${host_xmake_file}'
3644 dep_tmake_file='${dep_tmake_file}'
3645 tmake_file='${tmake_file}'
3646 thread_file='${thread_file}'
3647 gcc_config_arguments='${gcc_config_arguments}'
3648 gcc_version='${gcc_version}'
3649 gcc_version_full='${gcc_version_full}'
3650 gcc_version_trigger='${gcc_version_trigger}'
3651 local_prefix='${local_prefix}'
3652 build_install_headers_dir='${build_install_headers_dir}'
3653 build_exeext='${build_exeext}'
3654 host_exeext='${host_exeext}'
3655 out_file='${out_file}'
3656 gdb_needs_out_file_path='${gdb_needs_out_file_path}'
3657 SET_MAKE='${SET_MAKE}'
3658 target_list='${target_list}'
3659 target_overrides='${target_overrides}'
3660 host_overrides='${host_overrides}'
3661 cross_defines='${cross_defines}'
3662 cross_overrides='${cross_overrides}'
3663 build_overrides='${build_overrides}'
3664 cpp_install_dir='${cpp_install_dir}'
3665
3666 EOF
3667 cat >> $CONFIG_STATUS <<\EOF
3668
3669 case x$CONFIG_HEADERS in
3670 xauto-host.h:config.in)
3671 echo > cstamp-h ;;
3672 esac
3673
3674 # Avoid having to add intl to our include paths.
3675 if test -f intl/libintl.h; then
3676   echo creating libintl.h
3677   echo '#include "intl/libintl.h"' >libintl.h
3678 fi
3679
3680 exit 0
3681 EOF
3682 chmod +x $CONFIG_STATUS
3683 rm -fr confdefs* $ac_clean_files
3684 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3685