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