]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/configure
cppfiles.c (INCLUDE_LEN_FUDGE, ENOMEM): Delete.
[thirdparty/gcc.git] / gcc / configure
CommitLineData
005537df 1#! /bin/sh
861bb6c1
JL
2
3# Guess values for system-dependent variables and create Makefiles.
b27d2bd5 4# Generated automatically using autoconf version 2.13
861bb6c1
JL
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:
11ac_help=
12ac_default_prefix=/usr/local
13# Any additions from configure.in:
14ac_help="$ac_help
15 --with-gnu-ld arrange to work with GNU ld."
ab339d62
AO
16ac_help="$ac_help
17 --with-ld arrange to use the specified ld (full pathname)."
861bb6c1
JL
18ac_help="$ac_help
19 --with-gnu-as arrange to work with GNU as."
ab339d62
AO
20ac_help="$ac_help
21 --with-as arrange to use the specified as (full pathname)."
861bb6c1
JL
22ac_help="$ac_help
23 --with-stabs arrange to use stabs instead of host debug format."
24ac_help="$ac_help
25 --with-elf arrange to use ELF instead of host debug format."
26ac_help="$ac_help
27 --with-local-prefix=DIR specifies directory to put local include."
28ac_help="$ac_help
29 --with-gxx-include-dir=DIR
30 specifies directory to put g++ header files."
39d6f2e8
MM
31ac_help="$ac_help
32 --enable-multilib enable library support for multiple ABIs"
a494747c 33ac_help="$ac_help
f4524c9e
ZW
34 --enable-checking[=LIST]
35 enable expensive run-time checks. With LIST,
36 enable only specific categories of checks.
37 Categories are: misc,tree,rtl,gc,gcac; default
59f406b7 38 is misc,tree,gc"
3ecc3258
ZW
39ac_help="$ac_help
40 --disable-cpp don't provide a user-visible C preprocessor."
41ac_help="$ac_help
42 --with-cpp-install-dir=DIR
43 install the user visible C preprocessor in DIR
44 (relative to PREFIX) as well as PREFIX/bin."
c5c76735
JL
45ac_help="$ac_help
46 --enable-c-mbchar Enable multibyte characters for C and C++."
861bb6c1
JL
47ac_help="$ac_help
48 --enable-threads enable thread usage for target GCC.
49 --enable-threads=LIB use LIB thread package for target GCC."
d8bb17c8
OP
50ac_help="$ac_help
51 --enable-objc-gc enable the use of Boehm's garbage collector with
52 the GNU Objective-C runtime."
90e6a802 53ac_help="$ac_help
756ee602 54 --with-dwarf2 force the default debug format to be DWARF2."
50503ac8
RH
55ac_help="$ac_help
56 --disable-shared don't provide a shared libgcc."
ab87f8c8 57ac_help="$ac_help
dc6746e7 58 --enable-nls use Native Language Support (default)"
ab87f8c8
JL
59ac_help="$ac_help
60 --disable-nls do not use Native Language Support"
61ac_help="$ac_help
62 --with-included-gettext use the GNU gettext library included here"
63ac_help="$ac_help
64 --with-catgets use catgets functions if available"
f4ab28e3
MK
65ac_help="$ac_help
66 --disable-win32-registry
67 Disable lookup of installation paths in the
68 Registry on Windows hosts.
69 --enable-win32-registry Enable registry lookup (default).
70 --enable-win32-registry=KEY
71 Use KEY instead of GCC version as the last portion
72 of the registry key."
81bf3d9e
RH
73ac_help="$ac_help
74 --with-gc={simple,page} Choose the garbage collection mechanism to use
75 with the compiler."
3c809ba4
AG
76ac_help="$ac_help
77 --with-system-zlib use installed libz"
dc6746e7
PT
78ac_help="$ac_help
79 --enable-maintainer-mode enable make rules and dependencies not useful
80 (and sometimes confusing) to the casual installer"
2bbea3a6
RH
81ac_help="$ac_help
82 --enable-version-specific-runtime-libs Specify that runtime libraries shou
83ld be installed in a compiler-specific directory "
5b15f277
RH
84ac_help="$ac_help
85 --with-slibdir=DIR shared libraries in DIR [LIBDIR]"
861bb6c1
JL
86
87# Initialize some variables set by options.
88# The variables have the same names as the options, with
89# dashes changed to underlines.
90build=NONE
91cache_file=./config.cache
92exec_prefix=NONE
93host=NONE
94no_create=
95nonopt=NONE
96no_recursion=
97prefix=NONE
98program_prefix=NONE
99program_suffix=NONE
100program_transform_name=s,x,x,
101silent=
102site=
1bf17cc4 103sitefile=
861bb6c1
JL
104srcdir=
105target=NONE
106verbose=
107x_includes=NONE
108x_libraries=NONE
109bindir='${exec_prefix}/bin'
110sbindir='${exec_prefix}/sbin'
111libexecdir='${exec_prefix}/libexec'
112datadir='${prefix}/share'
113sysconfdir='${prefix}/etc'
114sharedstatedir='${prefix}/com'
115localstatedir='${prefix}/var'
116libdir='${exec_prefix}/lib'
117includedir='${prefix}/include'
118oldincludedir='/usr/include'
119infodir='${prefix}/info'
120mandir='${prefix}/man'
121
122# Initialize some other variables.
123subdirs=
124MFLAGS= MAKEFLAGS=
6f144c9c 125SHELL=${CONFIG_SHELL-/bin/sh}
861bb6c1
JL
126# Maximum number of lines to put in a shell here document.
127ac_max_here_lines=12
128
129ac_prev=
130for ac_option
131do
132
133 # If the previous option needs an argument, assign it.
134 if test -n "$ac_prev"; then
135 eval "$ac_prev=\$ac_option"
136 ac_prev=
137 continue
138 fi
139
140 case "$ac_option" in
141 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
142 *) ac_optarg= ;;
143 esac
144
145 # Accept the important Cygnus configure options, so we can diagnose typos.
146
147 case "$ac_option" in
148
149 -bindir | --bindir | --bindi | --bind | --bin | --bi)
150 ac_prev=bindir ;;
151 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
152 bindir="$ac_optarg" ;;
153
154 -build | --build | --buil | --bui | --bu)
155 ac_prev=build ;;
156 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
157 build="$ac_optarg" ;;
158
159 -cache-file | --cache-file | --cache-fil | --cache-fi \
160 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
161 ac_prev=cache_file ;;
162 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
163 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
164 cache_file="$ac_optarg" ;;
165
166 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
167 ac_prev=datadir ;;
168 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
169 | --da=*)
170 datadir="$ac_optarg" ;;
171
172 -disable-* | --disable-*)
173 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
174 # Reject names that are not valid shell variable names.
175 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
176 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
177 fi
178 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
179 eval "enable_${ac_feature}=no" ;;
180
181 -enable-* | --enable-*)
182 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
183 # Reject names that are not valid shell variable names.
184 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
185 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
186 fi
187 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
188 case "$ac_option" in
189 *=*) ;;
190 *) ac_optarg=yes ;;
191 esac
192 eval "enable_${ac_feature}='$ac_optarg'" ;;
193
194 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
195 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
196 | --exec | --exe | --ex)
197 ac_prev=exec_prefix ;;
198 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
199 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
200 | --exec=* | --exe=* | --ex=*)
201 exec_prefix="$ac_optarg" ;;
202
203 -gas | --gas | --ga | --g)
204 # Obsolete; use --with-gas.
205 with_gas=yes ;;
206
207 -help | --help | --hel | --he)
208 # Omit some internal or obsolete options to make the list less imposing.
209 # This message is too long to be a string in the A/UX 3.1 sh.
210 cat << EOF
211Usage: configure [options] [host]
212Options: [defaults in brackets after descriptions]
213Configuration:
214 --cache-file=FILE cache test results in FILE
215 --help print this message
216 --no-create do not create output files
217 --quiet, --silent do not print \`checking...' messages
1bf17cc4 218 --site-file=FILE use FILE as the site file
861bb6c1
JL
219 --version print the version of autoconf that created configure
220Directory and file names:
221 --prefix=PREFIX install architecture-independent files in PREFIX
222 [$ac_default_prefix]
223 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
224 [same as prefix]
225 --bindir=DIR user executables in DIR [EPREFIX/bin]
226 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
227 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
228 --datadir=DIR read-only architecture-independent data in DIR
229 [PREFIX/share]
230 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
231 --sharedstatedir=DIR modifiable architecture-independent data in DIR
232 [PREFIX/com]
233 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
234 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
235 --includedir=DIR C header files in DIR [PREFIX/include]
236 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
237 --infodir=DIR info documentation in DIR [PREFIX/info]
238 --mandir=DIR man documentation in DIR [PREFIX/man]
239 --srcdir=DIR find the sources in DIR [configure dir or ..]
240 --program-prefix=PREFIX prepend PREFIX to installed program names
241 --program-suffix=SUFFIX append SUFFIX to installed program names
242 --program-transform-name=PROGRAM
243 run sed PROGRAM on installed program names
244EOF
245 cat << EOF
246Host type:
247 --build=BUILD configure for building on BUILD [BUILD=HOST]
248 --host=HOST configure for HOST [guessed]
249 --target=TARGET configure for TARGET [TARGET=HOST]
250Features and packages:
251 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
252 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
253 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
254 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
255 --x-includes=DIR X include files are in DIR
256 --x-libraries=DIR X library files are in DIR
257EOF
258 if test -n "$ac_help"; then
259 echo "--enable and --with options recognized:$ac_help"
260 fi
261 exit 0 ;;
262
263 -host | --host | --hos | --ho)
264 ac_prev=host ;;
265 -host=* | --host=* | --hos=* | --ho=*)
266 host="$ac_optarg" ;;
267
268 -includedir | --includedir | --includedi | --included | --include \
269 | --includ | --inclu | --incl | --inc)
270 ac_prev=includedir ;;
271 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
272 | --includ=* | --inclu=* | --incl=* | --inc=*)
273 includedir="$ac_optarg" ;;
274
275 -infodir | --infodir | --infodi | --infod | --info | --inf)
276 ac_prev=infodir ;;
277 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
278 infodir="$ac_optarg" ;;
279
280 -libdir | --libdir | --libdi | --libd)
281 ac_prev=libdir ;;
282 -libdir=* | --libdir=* | --libdi=* | --libd=*)
283 libdir="$ac_optarg" ;;
284
285 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
286 | --libexe | --libex | --libe)
287 ac_prev=libexecdir ;;
288 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
289 | --libexe=* | --libex=* | --libe=*)
290 libexecdir="$ac_optarg" ;;
291
292 -localstatedir | --localstatedir | --localstatedi | --localstated \
293 | --localstate | --localstat | --localsta | --localst \
294 | --locals | --local | --loca | --loc | --lo)
295 ac_prev=localstatedir ;;
296 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
297 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
298 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
299 localstatedir="$ac_optarg" ;;
300
301 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
302 ac_prev=mandir ;;
303 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
304 mandir="$ac_optarg" ;;
305
306 -nfp | --nfp | --nf)
307 # Obsolete; use --without-fp.
308 with_fp=no ;;
309
310 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
311 | --no-cr | --no-c)
312 no_create=yes ;;
313
314 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
315 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
316 no_recursion=yes ;;
317
318 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
319 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
320 | --oldin | --oldi | --old | --ol | --o)
321 ac_prev=oldincludedir ;;
322 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
323 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
324 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
325 oldincludedir="$ac_optarg" ;;
326
327 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
328 ac_prev=prefix ;;
329 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
330 prefix="$ac_optarg" ;;
331
332 -program-prefix | --program-prefix | --program-prefi | --program-pref \
333 | --program-pre | --program-pr | --program-p)
334 ac_prev=program_prefix ;;
335 -program-prefix=* | --program-prefix=* | --program-prefi=* \
336 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
337 program_prefix="$ac_optarg" ;;
338
339 -program-suffix | --program-suffix | --program-suffi | --program-suff \
340 | --program-suf | --program-su | --program-s)
341 ac_prev=program_suffix ;;
342 -program-suffix=* | --program-suffix=* | --program-suffi=* \
343 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
344 program_suffix="$ac_optarg" ;;
345
346 -program-transform-name | --program-transform-name \
347 | --program-transform-nam | --program-transform-na \
348 | --program-transform-n | --program-transform- \
349 | --program-transform | --program-transfor \
350 | --program-transfo | --program-transf \
351 | --program-trans | --program-tran \
352 | --progr-tra | --program-tr | --program-t)
353 ac_prev=program_transform_name ;;
354 -program-transform-name=* | --program-transform-name=* \
355 | --program-transform-nam=* | --program-transform-na=* \
356 | --program-transform-n=* | --program-transform-=* \
357 | --program-transform=* | --program-transfor=* \
358 | --program-transfo=* | --program-transf=* \
359 | --program-trans=* | --program-tran=* \
360 | --progr-tra=* | --program-tr=* | --program-t=*)
361 program_transform_name="$ac_optarg" ;;
362
363 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
364 | -silent | --silent | --silen | --sile | --sil)
365 silent=yes ;;
366
367 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
368 ac_prev=sbindir ;;
369 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
370 | --sbi=* | --sb=*)
371 sbindir="$ac_optarg" ;;
372
373 -sharedstatedir | --sharedstatedir | --sharedstatedi \
374 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
375 | --sharedst | --shareds | --shared | --share | --shar \
376 | --sha | --sh)
377 ac_prev=sharedstatedir ;;
378 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
379 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
380 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
381 | --sha=* | --sh=*)
382 sharedstatedir="$ac_optarg" ;;
383
384 -site | --site | --sit)
385 ac_prev=site ;;
386 -site=* | --site=* | --sit=*)
387 site="$ac_optarg" ;;
388
1bf17cc4
NP
389 -site-file | --site-file | --site-fil | --site-fi | --site-f)
390 ac_prev=sitefile ;;
391 -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
392 sitefile="$ac_optarg" ;;
393
861bb6c1
JL
394 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
395 ac_prev=srcdir ;;
396 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
397 srcdir="$ac_optarg" ;;
398
399 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
400 | --syscon | --sysco | --sysc | --sys | --sy)
401 ac_prev=sysconfdir ;;
402 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
403 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
404 sysconfdir="$ac_optarg" ;;
405
406 -target | --target | --targe | --targ | --tar | --ta | --t)
407 ac_prev=target ;;
408 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
409 target="$ac_optarg" ;;
410
411 -v | -verbose | --verbose | --verbos | --verbo | --verb)
412 verbose=yes ;;
413
414 -version | --version | --versio | --versi | --vers)
b27d2bd5 415 echo "configure generated by autoconf version 2.13"
861bb6c1
JL
416 exit 0 ;;
417
418 -with-* | --with-*)
419 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
420 # Reject names that are not valid shell variable names.
421 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
422 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
423 fi
424 ac_package=`echo $ac_package| sed 's/-/_/g'`
425 case "$ac_option" in
426 *=*) ;;
427 *) ac_optarg=yes ;;
428 esac
429 eval "with_${ac_package}='$ac_optarg'" ;;
430
431 -without-* | --without-*)
432 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
433 # Reject names that are not valid shell variable names.
434 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
435 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
436 fi
437 ac_package=`echo $ac_package| sed 's/-/_/g'`
438 eval "with_${ac_package}=no" ;;
439
440 --x)
441 # Obsolete; use --with-x.
442 with_x=yes ;;
443
444 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
445 | --x-incl | --x-inc | --x-in | --x-i)
446 ac_prev=x_includes ;;
447 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
448 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
449 x_includes="$ac_optarg" ;;
450
451 -x-libraries | --x-libraries | --x-librarie | --x-librari \
452 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
453 ac_prev=x_libraries ;;
454 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
455 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
456 x_libraries="$ac_optarg" ;;
457
458 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
459 ;;
460
461 *)
462 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
463 echo "configure: warning: $ac_option: invalid host type" 1>&2
464 fi
465 if test "x$nonopt" != xNONE; then
466 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
467 fi
468 nonopt="$ac_option"
469 ;;
470
471 esac
472done
473
474if test -n "$ac_prev"; then
475 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
476fi
477
478trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
479
480# File descriptor usage:
481# 0 standard input
482# 1 file creation
483# 2 errors and warnings
484# 3 some systems may open it to /dev/tty
485# 4 used on the Kubota Titan
486# 6 checking for... messages and results
487# 5 compiler messages saved in config.log
488if test "$silent" = yes; then
489 exec 6>/dev/null
490else
491 exec 6>&1
492fi
493exec 5>./config.log
494
495echo "\
496This file contains any messages produced by compilers while
497running configure, to aid debugging if configure makes a mistake.
498" 1>&5
499
500# Strip out --no-create and --no-recursion so they do not pile up.
501# Also quote any args containing shell metacharacters.
502ac_configure_args=
503for ac_arg
504do
505 case "$ac_arg" in
506 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
507 | --no-cr | --no-c) ;;
508 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
509 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
510 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
511 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
512 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
513 esac
514done
515
516# NLS nuisances.
517# Only set these to C if already set. These must not be set unconditionally
518# because not all systems understand e.g. LANG=C (notably SCO).
519# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
520# Non-C LC_CTYPE values break the ctype check.
521if test "${LANG+set}" = set; then LANG=C; export LANG; fi
522if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
523if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
524if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
525
526# confdefs.h avoids OS command line length limits that DEFS can exceed.
527rm -rf conftest* confdefs.h
528# AIX cpp loses on an empty file, so make sure it contains at least a newline.
529echo > confdefs.h
530
531# A filename unique to this package, relative to the directory that
532# configure is in, which we can look for to find out if srcdir is correct.
533ac_unique_file=tree.c
534
535# Find the source files, if location was not specified.
536if test -z "$srcdir"; then
537 ac_srcdir_defaulted=yes
538 # Try the directory containing this script, then its parent.
539 ac_prog=$0
540 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
541 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
542 srcdir=$ac_confdir
543 if test ! -r $srcdir/$ac_unique_file; then
544 srcdir=..
545 fi
546else
547 ac_srcdir_defaulted=no
548fi
549if test ! -r $srcdir/$ac_unique_file; then
550 if test "$ac_srcdir_defaulted" = yes; then
551 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
552 else
553 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
554 fi
555fi
556srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
557
558# Prefer explicitly selected file to automatically selected ones.
1bf17cc4
NP
559if test -z "$sitefile"; then
560 if test -z "$CONFIG_SITE"; then
561 if test "x$prefix" != xNONE; then
562 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
563 else
564 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
565 fi
861bb6c1 566 fi
1bf17cc4
NP
567else
568 CONFIG_SITE="$sitefile"
861bb6c1
JL
569fi
570for ac_site_file in $CONFIG_SITE; do
571 if test -r "$ac_site_file"; then
572 echo "loading site script $ac_site_file"
573 . "$ac_site_file"
574 fi
575done
576
577if test -r "$cache_file"; then
578 echo "loading cache $cache_file"
579 . $cache_file
580else
581 echo "creating cache $cache_file"
582 > $cache_file
583fi
584
585ac_ext=c
586# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
587ac_cpp='$CPP $CPPFLAGS'
588ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
cd9e5e7c 589ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
861bb6c1
JL
590cross_compiling=$ac_cv_prog_cc_cross
591
cd9e5e7c
MK
592ac_exeext=
593ac_objext=o
861bb6c1
JL
594if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
595 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
596 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
597 ac_n= ac_c='
598' ac_t=' '
599 else
600 ac_n=-n ac_c= ac_t=
601 fi
602else
603 ac_n= ac_c='\c' ac_t=
604fi
605
606
607
608
861bb6c1
JL
609remove=rm
610hard_link=ln
611symbolic_link='ln -s'
612copy=cp
613
75a39864
JL
614# Check for bogus environment variables.
615# Test if LIBRARY_PATH contains the notation for the current directory
616# since this would lead to problems installing/building glibc.
617# LIBRARY_PATH contains the current directory if one of the following
618# is true:
619# - one of the terminals (":" and ";") is the first or last sign
620# - two terminals occur directly after each other
621# - the path contains an element with a dot in it
622echo $ac_n "checking LIBRARY_PATH variable""... $ac_c" 1>&6
1bf17cc4 623echo "configure:624: checking LIBRARY_PATH variable" >&5
75a39864
JL
624case ${LIBRARY_PATH} in
625 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
626 library_path_setting="contains current directory"
627 ;;
628 *)
629 library_path_setting="ok"
630 ;;
631esac
632echo "$ac_t""$library_path_setting" 1>&6
633if test "$library_path_setting" != "ok"; then
634{ echo "configure: error:
635*** LIBRARY_PATH shouldn't contain the current directory when
079bd08e 636*** building gcc. Please change the environment variable
75a39864
JL
637*** and run configure again." 1>&2; exit 1; }
638fi
639
640# Test if GCC_EXEC_PREFIX contains the notation for the current directory
641# since this would lead to problems installing/building glibc.
642# GCC_EXEC_PREFIX contains the current directory if one of the following
643# is true:
644# - one of the terminals (":" and ";") is the first or last sign
645# - two terminals occur directly after each other
646# - the path contains an element with a dot in it
647echo $ac_n "checking GCC_EXEC_PREFIX variable""... $ac_c" 1>&6
1bf17cc4 648echo "configure:649: checking GCC_EXEC_PREFIX variable" >&5
75a39864
JL
649case ${GCC_EXEC_PREFIX} in
650 [:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
651 gcc_exec_prefix_setting="contains current directory"
652 ;;
653 *)
654 gcc_exec_prefix_setting="ok"
655 ;;
656esac
657echo "$ac_t""$gcc_exec_prefix_setting" 1>&6
658if test "$gcc_exec_prefix_setting" != "ok"; then
659{ echo "configure: error:
660*** GCC_EXEC_PREFIX shouldn't contain the current directory when
079bd08e 661*** building gcc. Please change the environment variable
75a39864
JL
662*** and run configure again." 1>&2; exit 1; }
663fi
664
861bb6c1
JL
665# Check for additional parameters
666
667# With GNU ld
668# Check whether --with-gnu-ld or --without-gnu-ld was given.
669if test "${with_gnu_ld+set}" = set; then
670 withval="$with_gnu_ld"
df6faf79 671 gnu_ld_flag="$with_gnu_ld"
861bb6c1 672else
df6faf79 673 gnu_ld_flag=no
861bb6c1
JL
674fi
675
676
ab339d62
AO
677# With pre-defined ld
678# Check whether --with-ld or --without-ld was given.
679if test "${with_ld+set}" = set; then
680 withval="$with_ld"
3ccc3a56 681 DEFAULT_LINKER="$with_ld"
ab339d62
AO
682fi
683
3ccc3a56
AO
684if test x"${DEFAULT_LINKER+set}" = x"set"; then
685 if test ! -x "$DEFAULT_LINKER"; then
686 echo "configure: warning: cannot execute: $DEFAULT_LINKER: check --with-ld or env. var. DEFAULT_LINKER" 1>&2
e154a394 687 elif $DEFAULT_LINKER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
ab339d62
AO
688 gnu_ld_flag=yes
689 fi
690 cat >> confdefs.h <<EOF
3ccc3a56 691#define DEFAULT_LINKER "$DEFAULT_LINKER"
ab339d62
AO
692EOF
693
694fi
695
861bb6c1
JL
696# With GNU as
697# Check whether --with-gnu-as or --without-gnu-as was given.
698if test "${with_gnu_as+set}" = set; then
699 withval="$with_gnu_as"
df6faf79 700 gas_flag="$with_gnu_as"
861bb6c1 701else
df6faf79 702 gas_flag=no
861bb6c1
JL
703fi
704
705
ab339d62
AO
706# Check whether --with-as or --without-as was given.
707if test "${with_as+set}" = set; then
708 withval="$with_as"
3ccc3a56 709 DEFAULT_ASSEMBLER="$with_as"
ab339d62
AO
710fi
711
3ccc3a56
AO
712if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
713 if test ! -x "$DEFAULT_ASSEMBLER"; then
714 echo "configure: warning: cannot execute: $DEFAULT_ASSEMBLER: check --with-as or env. var. DEFAULT_ASSEMBLER" 1>&2
e154a394 715 elif $DEFAULT_ASSEMBLER -v < /dev/null 2>&1 | grep GNU > /dev/null; then
ab339d62
AO
716 gas_flag=yes
717 fi
718 cat >> confdefs.h <<EOF
3ccc3a56 719#define DEFAULT_ASSEMBLER "$DEFAULT_ASSEMBLER"
ab339d62
AO
720EOF
721
3ccc3a56 722fi
ab339d62 723
861bb6c1
JL
724# With stabs
725# Check whether --with-stabs or --without-stabs was given.
726if test "${with_stabs+set}" = set; then
727 withval="$with_stabs"
535b86ce 728 stabs="$with_stabs"
861bb6c1
JL
729else
730 stabs=no
731fi
732
733
734# With ELF
735# Check whether --with-elf or --without-elf was given.
736if test "${with_elf+set}" = set; then
737 withval="$with_elf"
535b86ce 738 elf="$with_elf"
861bb6c1
JL
739else
740 elf=no
741fi
742
743
744# Specify the local prefix
4e88d51b 745local_prefix=
861bb6c1
JL
746# Check whether --with-local-prefix or --without-local-prefix was given.
747if test "${with_local_prefix+set}" = set; then
748 withval="$with_local_prefix"
4e88d51b
JM
749 case "${withval}" in
750yes) { echo "configure: error: bad value ${withval} given for local include directory prefix" 1>&2; exit 1; } ;;
751no) ;;
752*) local_prefix=$with_local_prefix ;;
753esac
861bb6c1
JL
754fi
755
756
757# Default local prefix if it is empty
75bffa71 758if test x$local_prefix = x; then
861bb6c1
JL
759 local_prefix=/usr/local
760fi
761
8f8d3278
NC
762# Don't set gcc_gxx_include_dir to gxx_include_dir since that's only
763# passed in by the toplevel make and thus we'd get different behavior
764# depending on where we built the sources.
765gcc_gxx_include_dir=
861bb6c1
JL
766# Specify the g++ header file directory
767# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
768if test "${with_gxx_include_dir+set}" = set; then
769 withval="$with_gxx_include_dir"
4e88d51b
JM
770 case "${withval}" in
771yes) { echo "configure: error: bad value ${withval} given for g++ include directory" 1>&2; exit 1; } ;;
772no) ;;
8f8d3278 773*) gcc_gxx_include_dir=$with_gxx_include_dir ;;
4e88d51b 774esac
861bb6c1
JL
775fi
776
777
8f8d3278 778if test x${gcc_gxx_include_dir} = x; then
4e88d51b 779 if test x${enable_version_specific_runtime_libs} = xyes; then
8f8d3278 780 gcc_gxx_include_dir='${libsubdir}/include/g++'
4e88d51b 781 else
a270b446 782 topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
e2187d3b 783 gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir}
4e88d51b
JM
784 fi
785fi
786
39d6f2e8
MM
787# Determine whether or not multilibs are enabled.
788# Check whether --enable-multilib or --disable-multilib was given.
789if test "${enable_multilib+set}" = set; then
790 enableval="$enable_multilib"
791 :
792else
793 enable_multilib=yes
794fi
795
796
797
a494747c
MM
798# Enable expensive internal checks
799# Check whether --enable-checking or --disable-checking was given.
800if test "${enable_checking+set}" = set; then
801 enableval="$enable_checking"
119d24d1
KG
802 ac_checking=
803ac_tree_checking=
804ac_rtl_checking=
805ac_gc_checking=
806ac_gc_always_collect=
807case "${enableval}" in
51d0e20c 808yes) ac_checking=1 ; ac_tree_checking=1 ; ac_gc_checking=1 ;;
4e88d51b 809no) ;;
59f406b7 810*) IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS,"
f4524c9e
ZW
811 set fnord $enableval; shift
812 IFS="$ac_save_IFS"
c62e45ad
KG
813 for check
814 do
f4524c9e 815 case $check in
119d24d1
KG
816 misc) ac_checking=1 ;;
817 tree) ac_tree_checking=1 ;;
818 rtl) ac_rtl_checking=1 ;;
819 gc) ac_gc_checking=1 ;;
820 gcac) ac_gc_always_collect=1 ;;
821 *) { echo "configure: error: unknown check category $check" 1>&2; exit 1; } ;;
822 esac
823 done
824 ;;
825esac
51d0e20c
AJ
826
827else
828 # Enable some checks by default for development versions of GCC
829ac_checking=1; ac_tree_checking=1; ac_gc_checking=1;
830fi
831
119d24d1
KG
832if test x$ac_checking != x ; then
833 cat >> confdefs.h <<\EOF
f4524c9e
ZW
834#define ENABLE_CHECKING 1
835EOF
119d24d1
KG
836
837fi
838if test x$ac_tree_checking != x ; then
839 cat >> confdefs.h <<\EOF
f4524c9e
ZW
840#define ENABLE_TREE_CHECKING 1
841EOF
119d24d1
KG
842
843fi
844if test x$ac_rtl_checking != x ; then
845 cat >> confdefs.h <<\EOF
f4524c9e
ZW
846#define ENABLE_RTL_CHECKING 1
847EOF
119d24d1
KG
848
849fi
850if test x$ac_gc_checking != x ; then
851 cat >> confdefs.h <<\EOF
f4524c9e
ZW
852#define ENABLE_GC_CHECKING 1
853EOF
119d24d1
KG
854
855fi
856if test x$ac_gc_always_collect != x ; then
857 cat >> confdefs.h <<\EOF
f4524c9e
ZW
858#define ENABLE_GC_ALWAYS_COLLECT 1
859EOF
119d24d1
KG
860
861fi
862
a494747c 863
3ecc3258
ZW
864# Check whether --enable-cpp or --disable-cpp was given.
865if test "${enable_cpp+set}" = set; then
866 enableval="$enable_cpp"
867 :
868else
869 enable_cpp=yes
870fi
871
872
873# Check whether --with-cpp_install_dir or --without-cpp_install_dir was given.
874if test "${with_cpp_install_dir+set}" = set; then
875 withval="$with_cpp_install_dir"
876 if test x$withval = xyes; then
877 { echo "configure: error: option --with-cpp-install-dir requires an argument" 1>&2; exit 1; }
878elif test x$withval != xno; then
879 cpp_install_dir=$withval
880fi
881fi
882
883
c5c76735
JL
884# Enable Multibyte Characters for C/C++
885# Check whether --enable-c-mbchar or --disable-c-mbchar was given.
886if test "${enable_c_mbchar+set}" = set; then
887 enableval="$enable_c_mbchar"
2618c083 888 if test x$enable_c_mbchar != xno; then
9ec7291f
ZW
889 cat >> confdefs.h <<\EOF
890#define MULTIBYTE_CHARS 1
891EOF
892
c5c76735
JL
893fi
894fi
895
896
861bb6c1
JL
897# Enable threads
898# Pass with no value to take the default
899# Pass with a value to specify a thread package
900# Check whether --enable-threads or --disable-threads was given.
901if test "${enable_threads+set}" = set; then
902 enableval="$enable_threads"
981d4858 903 :
861bb6c1
JL
904else
905 enable_threads=''
906fi
907
908
e445171e 909enable_threads_flag=$enable_threads
861bb6c1 910# Check if a valid thread package
e445171e 911case x${enable_threads_flag} in
861bb6c1
JL
912 x | xno)
913 # No threads
a851212a 914 target_thread_file='single'
861bb6c1
JL
915 ;;
916 xyes)
917 # default
a851212a 918 target_thread_file=''
861bb6c1
JL
919 ;;
920 xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
a473fe45 921 xsolaris | xwin32 | xdce | xvxworks | xaix)
e445171e 922 target_thread_file=$enable_threads_flag
861bb6c1
JL
923 ;;
924 *)
925 echo "$enable_threads is an unknown thread package" 1>&2
926 exit 1
927 ;;
928esac
929
d8bb17c8
OP
930# Check whether --enable-objc-gc or --disable-objc-gc was given.
931if test "${enable_objc_gc+set}" = set; then
932 enableval="$enable_objc_gc"
2618c083 933 if test x$enable_objc_gc = xno; then
d8bb17c8
OP
934 objc_boehm_gc=''
935else
936 objc_boehm_gc=1
937fi
938else
939 objc_boehm_gc=''
940fi
941
942
90e6a802
RL
943# Check whether --with-dwarf2 or --without-dwarf2 was given.
944if test "${with_dwarf2+set}" = set; then
945 withval="$with_dwarf2"
946 dwarf2="$with_dwarf2"
947else
948 dwarf2=no
949fi
950
951
50503ac8
RH
952# Check whether --enable-shared or --disable-shared was given.
953if test "${enable_shared+set}" = set; then
954 enableval="$enable_shared"
c785e0fa
AO
955
956 case $enable_shared in
957 yes | no) ;;
958 *)
959 enable_shared=no
960 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
961 for pkg in $enableval; do
962 if test "X$pkg" = "Xgcc" || test "X$pkg" = "Xlibgcc"; then
963 enable_shared=yes
964 fi
965 done
966 IFS="$ac_save_ifs"
967 ;;
968 esac
969
50503ac8
RH
970else
971 enable_shared=yes
972fi
973
974
975
861bb6c1
JL
976# Determine the host, build, and target systems
977ac_aux_dir=
978for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
979 if test -f $ac_dir/install-sh; then
980 ac_aux_dir=$ac_dir
981 ac_install_sh="$ac_aux_dir/install-sh -c"
982 break
983 elif test -f $ac_dir/install.sh; then
984 ac_aux_dir=$ac_dir
985 ac_install_sh="$ac_aux_dir/install.sh -c"
986 break
987 fi
988done
989if test -z "$ac_aux_dir"; then
990 { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
991fi
992ac_config_guess=$ac_aux_dir/config.guess
993ac_config_sub=$ac_aux_dir/config.sub
994ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
995
996
997# Do some error checking and defaulting for the host and target type.
998# The inputs are:
999# configure --host=HOST --target=TARGET --build=BUILD NONOPT
1000#
1001# The rules are:
1002# 1. You are not allowed to specify --host, --target, and nonopt at the
1003# same time.
1004# 2. Host defaults to nonopt.
1005# 3. If nonopt is not specified, then host defaults to the current host,
1006# as determined by config.guess.
1007# 4. Target and build default to nonopt.
1008# 5. If nonopt is not specified, then target and build default to host.
1009
1010# The aliases save the names the user supplied, while $host etc.
1011# will get canonicalized.
1012case $host---$target---$nonopt in
1013NONE---*---* | *---NONE---* | *---*---NONE) ;;
1014*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
1015esac
1016
1017
1018# Make sure we can run config.sub.
6f144c9c 1019if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
861bb6c1
JL
1020else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1021fi
1022
1023echo $ac_n "checking host system type""... $ac_c" 1>&6
1bf17cc4 1024echo "configure:1025: checking host system type" >&5
861bb6c1
JL
1025
1026host_alias=$host
1027case "$host_alias" in
1028NONE)
1029 case $nonopt in
1030 NONE)
6f144c9c 1031 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
861bb6c1
JL
1032 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1033 fi ;;
1034 *) host_alias=$nonopt ;;
1035 esac ;;
1036esac
1037
6f144c9c 1038host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
861bb6c1
JL
1039host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1040host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1041host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1042echo "$ac_t""$host" 1>&6
1043
1044echo $ac_n "checking target system type""... $ac_c" 1>&6
1bf17cc4 1045echo "configure:1046: checking target system type" >&5
861bb6c1
JL
1046
1047target_alias=$target
1048case "$target_alias" in
1049NONE)
1050 case $nonopt in
1051 NONE) target_alias=$host_alias ;;
1052 *) target_alias=$nonopt ;;
1053 esac ;;
1054esac
1055
6f144c9c 1056target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
861bb6c1
JL
1057target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1058target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1059target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1060echo "$ac_t""$target" 1>&6
1061
1062echo $ac_n "checking build system type""... $ac_c" 1>&6
1bf17cc4 1063echo "configure:1064: checking build system type" >&5
861bb6c1
JL
1064
1065build_alias=$build
1066case "$build_alias" in
1067NONE)
1068 case $nonopt in
1069 NONE) build_alias=$host_alias ;;
1070 *) build_alias=$nonopt ;;
1071 esac ;;
1072esac
1073
6f144c9c 1074build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
861bb6c1
JL
1075build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078echo "$ac_t""$build" 1>&6
1079
1080test "$host_alias" != "$target_alias" &&
1081 test "$program_prefix$program_suffix$program_transform_name" = \
1082 NONENONEs,x,x, &&
1083 program_prefix=${target_alias}-
1084
1085
e9a25f70
JL
1086# Find the native compiler
1087# Extract the first word of "gcc", so it can be a program name with args.
1088set dummy gcc; ac_word=$2
1089echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 1090echo "configure:1091: checking for $ac_word" >&5
e9a25f70
JL
1091if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1092 echo $ac_n "(cached) $ac_c" 1>&6
1093else
1094 if test -n "$CC"; then
1095 ac_cv_prog_CC="$CC" # Let the user override the test.
1096else
cd9e5e7c 1097 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
1098 ac_dummy="$PATH"
1099 for ac_dir in $ac_dummy; do
e9a25f70
JL
1100 test -z "$ac_dir" && ac_dir=.
1101 if test -f $ac_dir/$ac_word; then
1102 ac_cv_prog_CC="gcc"
1103 break
1104 fi
1105 done
1106 IFS="$ac_save_ifs"
1107fi
1108fi
1109CC="$ac_cv_prog_CC"
1110if test -n "$CC"; then
1111 echo "$ac_t""$CC" 1>&6
1112else
1113 echo "$ac_t""no" 1>&6
1114fi
1115
1116if test -z "$CC"; then
1117 # Extract the first word of "cc", so it can be a program name with args.
1118set dummy cc; ac_word=$2
1119echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 1120echo "configure:1121: checking for $ac_word" >&5
e9a25f70
JL
1121if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1122 echo $ac_n "(cached) $ac_c" 1>&6
1123else
1124 if test -n "$CC"; then
1125 ac_cv_prog_CC="$CC" # Let the user override the test.
1126else
cd9e5e7c 1127 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
e9a25f70 1128 ac_prog_rejected=no
b27d2bd5
MK
1129 ac_dummy="$PATH"
1130 for ac_dir in $ac_dummy; do
e9a25f70
JL
1131 test -z "$ac_dir" && ac_dir=.
1132 if test -f $ac_dir/$ac_word; then
1133 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1134 ac_prog_rejected=yes
1135 continue
1136 fi
1137 ac_cv_prog_CC="cc"
1138 break
1139 fi
1140 done
1141 IFS="$ac_save_ifs"
1142if test $ac_prog_rejected = yes; then
1143 # We found a bogon in the path, so make sure we never use it.
1144 set dummy $ac_cv_prog_CC
1145 shift
1146 if test $# -gt 0; then
1147 # We chose a different compiler from the bogus one.
1148 # However, it has the same basename, so the bogon will be chosen
1149 # first if we set CC to just the basename; use the full file name.
1150 shift
1151 set dummy "$ac_dir/$ac_word" "$@"
1152 shift
1153 ac_cv_prog_CC="$@"
1154 fi
1155fi
1156fi
1157fi
1158CC="$ac_cv_prog_CC"
1159if test -n "$CC"; then
1160 echo "$ac_t""$CC" 1>&6
1161else
1162 echo "$ac_t""no" 1>&6
1163fi
1164
cd9e5e7c
MK
1165 if test -z "$CC"; then
1166 case "`uname -s`" in
1167 *win32* | *WIN32*)
1168 # Extract the first word of "cl", so it can be a program name with args.
1169set dummy cl; ac_word=$2
1170echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 1171echo "configure:1172: checking for $ac_word" >&5
cd9e5e7c
MK
1172if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1173 echo $ac_n "(cached) $ac_c" 1>&6
1174else
1175 if test -n "$CC"; then
1176 ac_cv_prog_CC="$CC" # Let the user override the test.
1177else
1178 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
1179 ac_dummy="$PATH"
1180 for ac_dir in $ac_dummy; do
cd9e5e7c
MK
1181 test -z "$ac_dir" && ac_dir=.
1182 if test -f $ac_dir/$ac_word; then
1183 ac_cv_prog_CC="cl"
1184 break
1185 fi
1186 done
1187 IFS="$ac_save_ifs"
1188fi
1189fi
1190CC="$ac_cv_prog_CC"
1191if test -n "$CC"; then
1192 echo "$ac_t""$CC" 1>&6
1193else
1194 echo "$ac_t""no" 1>&6
1195fi
1196 ;;
1197 esac
1198 fi
e9a25f70
JL
1199 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1200fi
1201
1202echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1bf17cc4 1203echo "configure:1204: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
e9a25f70
JL
1204
1205ac_ext=c
1206# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1207ac_cpp='$CPP $CPPFLAGS'
1208ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
cd9e5e7c 1209ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
e9a25f70
JL
1210cross_compiling=$ac_cv_prog_cc_cross
1211
b27d2bd5
MK
1212cat > conftest.$ac_ext << EOF
1213
1bf17cc4 1214#line 1215 "configure"
e9a25f70 1215#include "confdefs.h"
b27d2bd5 1216
e9a25f70
JL
1217main(){return(0);}
1218EOF
1bf17cc4 1219if { (eval echo configure:1220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
e9a25f70
JL
1220 ac_cv_prog_cc_works=yes
1221 # If we can't run a trivial program, we are probably using a cross compiler.
1222 if (./conftest; exit) 2>/dev/null; then
1223 ac_cv_prog_cc_cross=no
1224 else
1225 ac_cv_prog_cc_cross=yes
1226 fi
1227else
1228 echo "configure: failed program was:" >&5
1229 cat conftest.$ac_ext >&5
1230 ac_cv_prog_cc_works=no
1231fi
1232rm -fr conftest*
b27d2bd5
MK
1233ac_ext=c
1234# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1235ac_cpp='$CPP $CPPFLAGS'
1236ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1237ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1238cross_compiling=$ac_cv_prog_cc_cross
e9a25f70
JL
1239
1240echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1241if test $ac_cv_prog_cc_works = no; then
1242 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1243fi
1244echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1bf17cc4 1245echo "configure:1246: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
e9a25f70
JL
1246echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1247cross_compiling=$ac_cv_prog_cc_cross
1248
1249echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1bf17cc4 1250echo "configure:1251: checking whether we are using GNU C" >&5
e9a25f70
JL
1251if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1252 echo $ac_n "(cached) $ac_c" 1>&6
1253else
1254 cat > conftest.c <<EOF
1255#ifdef __GNUC__
1256 yes;
1257#endif
1258EOF
1bf17cc4 1259if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
e9a25f70
JL
1260 ac_cv_prog_gcc=yes
1261else
1262 ac_cv_prog_gcc=no
1263fi
1264fi
1265
1266echo "$ac_t""$ac_cv_prog_gcc" 1>&6
1267
1268if test $ac_cv_prog_gcc = yes; then
1269 GCC=yes
cd9e5e7c
MK
1270else
1271 GCC=
1272fi
1273
1274ac_test_CFLAGS="${CFLAGS+set}"
1275ac_save_CFLAGS="$CFLAGS"
1276CFLAGS=
1277echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
1bf17cc4 1278echo "configure:1279: checking whether ${CC-cc} accepts -g" >&5
e9a25f70
JL
1279if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
1280 echo $ac_n "(cached) $ac_c" 1>&6
1281else
1282 echo 'void f(){}' > conftest.c
1283if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
1284 ac_cv_prog_cc_g=yes
1285else
1286 ac_cv_prog_cc_g=no
1287fi
1288rm -f conftest*
1289
1290fi
1291
1292echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
cd9e5e7c
MK
1293if test "$ac_test_CFLAGS" = set; then
1294 CFLAGS="$ac_save_CFLAGS"
1295elif test $ac_cv_prog_cc_g = yes; then
1296 if test "$GCC" = yes; then
e9a25f70
JL
1297 CFLAGS="-g -O2"
1298 else
cd9e5e7c 1299 CFLAGS="-g"
81814e35 1300 fi
3723cad9 1301else
cd9e5e7c
MK
1302 if test "$GCC" = yes; then
1303 CFLAGS="-O2"
1304 else
1305 CFLAGS=
1306 fi
e9a25f70
JL
1307fi
1308
3ec83fc2
RH
1309if test "x$CC" != xcc; then
1310 echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
1bf17cc4 1311echo "configure:1312: checking whether $CC and cc understand -c and -o together" >&5
3ec83fc2
RH
1312else
1313 echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
1bf17cc4 1314echo "configure:1315: checking whether cc understands -c and -o together" >&5
3ec83fc2
RH
1315fi
1316set dummy $CC; ac_cc="`echo $2 |
1317 sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
1318if eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
1319 echo $ac_n "(cached) $ac_c" 1>&6
1320else
1321 echo 'foo(){}' > conftest.c
1322# Make sure it works both with $CC and with simple cc.
1323# We do the test twice because some compilers refuse to overwrite an
1324# existing .o file with -o, though they will create one.
1325ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
1bf17cc4
NP
1326if { (eval echo configure:1327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
1327 test -f conftest.o && { (eval echo configure:1328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
3ec83fc2
RH
1328then
1329 eval ac_cv_prog_cc_${ac_cc}_c_o=yes
1330 if test "x$CC" != xcc; then
1331 # Test first that cc exists at all.
1bf17cc4 1332 if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
3ec83fc2 1333 ac_try='cc -c conftest.c -o conftest.o 1>&5'
1bf17cc4
NP
1334 if { (eval echo configure:1335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
1335 test -f conftest.o && { (eval echo configure:1336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
3ec83fc2
RH
1336 then
1337 # cc works too.
1338 :
1339 else
1340 # cc exists but doesn't like -o.
1341 eval ac_cv_prog_cc_${ac_cc}_c_o=no
1342 fi
1343 fi
1344 fi
1345else
1346 eval ac_cv_prog_cc_${ac_cc}_c_o=no
1347fi
1348rm -f conftest*
1349
1350fi
1351if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
1352 echo "$ac_t""yes" 1>&6
1353else
1354 echo "$ac_t""no" 1>&6
1355 cat >> confdefs.h <<\EOF
1356#define NO_MINUS_C_MINUS_O 1
1357EOF
1358
1359fi
1360
b8dad04b 1361# autoconf is lame and doesn't give us any substitution variable for this.
e38df833 1362if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
b4c7e567 1363 NO_MINUS_C_MINUS_O=yes
b8dad04b
ZW
1364else
1365 OUTPUT_OPTION='-o $@'
b4c7e567 1366fi
3ec83fc2
RH
1367
1368
b8dad04b 1369
04cabffc 1370echo $ac_n "checking for long double""... $ac_c" 1>&6
1bf17cc4 1371echo "configure:1372: checking for long double" >&5
04cabffc
KG
1372if eval "test \"`echo '$''{'gcc_cv_c_long_double'+set}'`\" = set"; then
1373 echo $ac_n "(cached) $ac_c" 1>&6
1374else
1375 if test "$GCC" = yes; then
1376 gcc_cv_c_long_double=yes
1377else
1378cat > conftest.$ac_ext <<EOF
1bf17cc4 1379#line 1380 "configure"
04cabffc
KG
1380#include "confdefs.h"
1381
1382int main() {
1383/* The Stardent Vistra knows sizeof(long double), but does not support it. */
1384long double foo = 0.0;
1385/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
1386switch (0) case 0: case (sizeof(long double) >= sizeof(double)):;
1387; return 0; }
1388EOF
1bf17cc4 1389if { (eval echo configure:1390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
04cabffc
KG
1390 rm -rf conftest*
1391 gcc_cv_c_long_double=yes
1392else
1393 echo "configure: failed program was:" >&5
1394 cat conftest.$ac_ext >&5
1395 rm -rf conftest*
1396 gcc_cv_c_long_double=no
1397fi
1398rm -f conftest*
1399fi
1400fi
1401
1402echo "$ac_t""$gcc_cv_c_long_double" 1>&6
1403if test $gcc_cv_c_long_double = yes; then
1404 cat >> confdefs.h <<\EOF
1405#define HAVE_LONG_DOUBLE 1
1406EOF
1407
1408fi
1409
61842080 1410
ff5def20 1411echo $ac_n "checking whether ${CC-cc} accepts -Wno-long-long""... $ac_c" 1>&6
1bf17cc4 1412echo "configure:1413: checking whether ${CC-cc} accepts -Wno-long-long" >&5
5c3bc9fb
GK
1413if eval "test \"`echo '$''{'ac_cv_prog_cc_no_long_long'+set}'`\" = set"; then
1414 echo $ac_n "(cached) $ac_c" 1>&6
1415else
1416 save_CFLAGS="$CFLAGS"
1417CFLAGS="-Wno-long-long"
1418cat > conftest.$ac_ext <<EOF
1bf17cc4 1419#line 1420 "configure"
5c3bc9fb
GK
1420#include "confdefs.h"
1421
1422int main() {
1423
1424; return 0; }
1425EOF
1bf17cc4 1426if { (eval echo configure:1427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5c3bc9fb 1427 rm -rf conftest*
ff5def20
DA
1428 ac_cv_prog_cc_no_long_long=yes
1429else
5c3bc9fb
GK
1430 echo "configure: failed program was:" >&5
1431 cat conftest.$ac_ext >&5
1432 rm -rf conftest*
ff5def20
DA
1433 ac_cv_prog_cc_no_long_long=no
1434fi
1435rm -f conftest*
5c3bc9fb
GK
1436CFLAGS="$save_CFLAGS"
1437fi
1438
1439echo "$ac_t""$ac_cv_prog_cc_no_long_long" 1>&6
b8dad04b
ZW
1440strict1_warn=
1441if test $ac_cv_prog_cc_no_long_long = yes; then
1442 strict1_warn="-pedantic -Wno-long-long"
1443fi
1444
ff5def20 1445
61842080
MM
1446# If the native compiler is GCC, we can enable warnings even in stage1.
1447# That's useful for people building cross-compilers, or just running a
1448# quick `make'.
b8dad04b
ZW
1449warn_cflags=
1450if test "x$GCC" = "xyes"; then
1451 warn_cflags='$(GCC_WARN_CFLAGS)'
61842080
MM
1452fi
1453
b8dad04b 1454
5b67ad6f 1455# Stage specific cflags for build.
b8dad04b 1456stage1_cflags=
5b67ad6f
DA
1457case $build in
1458vax-*-*)
1459 if test x$GCC = xyes
1460 then
b8dad04b 1461 stage1_cflags="-Wa,-J"
5b67ad6f 1462 else
b8dad04b 1463 stage1_cflags="-J"
5b67ad6f
DA
1464 fi
1465 ;;
1466esac
1467
1468
e9a25f70 1469echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
1bf17cc4 1470echo "configure:1471: checking whether ${MAKE-make} sets \${MAKE}" >&5
e9a25f70
JL
1471set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
1472if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
1473 echo $ac_n "(cached) $ac_c" 1>&6
1474else
1475 cat > conftestmake <<\EOF
1476all:
1477 @echo 'ac_maketemp="${MAKE}"'
1478EOF
1479# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1480eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
1481if test -n "$ac_maketemp"; then
1482 eval ac_cv_prog_make_${ac_make}_set=yes
1483else
1484 eval ac_cv_prog_make_${ac_make}_set=no
1485fi
1486rm -f conftestmake
1487fi
1488if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1489 echo "$ac_t""yes" 1>&6
1490 SET_MAKE=
1491else
1492 echo "$ac_t""no" 1>&6
1493 SET_MAKE="MAKE=${MAKE-make}"
1494fi
1495
1496
ab339d62 1497echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6
1bf17cc4 1498echo "configure:1499: checking whether a default assembler was specified" >&5
3ccc3a56 1499if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
e154a394 1500 if test x"$gas_flag" = x"no"; then
3ccc3a56 1501 echo "$ac_t""yes ($DEFAULT_ASSEMBLER)" 1>&6
ab339d62 1502 else
3ccc3a56 1503 echo "$ac_t""yes ($DEFAULT_ASSEMBLER - GNU as)" 1>&6
ab339d62
AO
1504 fi
1505else
1506 echo "$ac_t""no" 1>&6
1507fi
1508
1509echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6
1bf17cc4 1510echo "configure:1511: checking whether a default linker was specified" >&5
3ccc3a56 1511if test x"${DEFAULT_LINKER+set}" = x"set"; then
e154a394 1512 if test x"$gnu_ld_flag" = x"no"; then
3ccc3a56 1513 echo "$ac_t""yes ($DEFAULT_LINKER)" 1>&6
ab339d62 1514 else
3ccc3a56 1515 echo "$ac_t""yes ($DEFAULT_LINKER - GNU ld)" 1>&6
ab339d62
AO
1516 fi
1517else
1518 echo "$ac_t""no" 1>&6
1519fi
1520
4070d885 1521echo $ac_n "checking for GNU C library""... $ac_c" 1>&6
1bf17cc4 1522echo "configure:1523: checking for GNU C library" >&5
4070d885
AJ
1523if eval "test \"`echo '$''{'gcc_cv_glibc'+set}'`\" = set"; then
1524 echo $ac_n "(cached) $ac_c" 1>&6
1525else
1526 cat > conftest.$ac_ext <<EOF
1bf17cc4 1527#line 1528 "configure"
4070d885
AJ
1528#include "confdefs.h"
1529#include <features.h>
1530int main() {
1531
1532#if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
1533#error Not a GNU C library system
1534#endif
1535; return 0; }
1536EOF
1bf17cc4 1537if { (eval echo configure:1538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4070d885
AJ
1538 rm -rf conftest*
1539 gcc_cv_glibc=yes
1540else
1541 echo "configure: failed program was:" >&5
1542 cat conftest.$ac_ext >&5
1543 rm -rf conftest*
1544 gcc_cv_glibc=no
1545fi
1546rm -f conftest*
1547fi
1548
1549echo "$ac_t""$gcc_cv_glibc" 1>&6
c2f7d403 1550if test $gcc_cv_glibc = yes; then
4070d885
AJ
1551 cat >> confdefs.h <<\EOF
1552#define _GNU_SOURCE 1
1553EOF
1554
1555fi
1556
8708335a 1557echo $ac_n "checking for inline""... $ac_c" 1>&6
1bf17cc4 1558echo "configure:1559: checking for inline" >&5
8708335a
PT
1559if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1560 echo $ac_n "(cached) $ac_c" 1>&6
1561else
1562 ac_cv_c_inline=no
1563for ac_kw in inline __inline__ __inline; do
1564 cat > conftest.$ac_ext <<EOF
1bf17cc4 1565#line 1566 "configure"
8708335a
PT
1566#include "confdefs.h"
1567
1568int main() {
130fadbb 1569} $ac_kw foo() {
8708335a
PT
1570; return 0; }
1571EOF
1bf17cc4 1572if { (eval echo configure:1573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8708335a
PT
1573 rm -rf conftest*
1574 ac_cv_c_inline=$ac_kw; break
1575else
1576 echo "configure: failed program was:" >&5
1577 cat conftest.$ac_ext >&5
1578fi
1579rm -f conftest*
1580done
1581
1582fi
1583
1584echo "$ac_t""$ac_cv_c_inline" 1>&6
1585case "$ac_cv_c_inline" in
1586 inline | yes) ;;
1587 no) cat >> confdefs.h <<\EOF
1588#define inline
1589EOF
1590 ;;
1591 *) cat >> confdefs.h <<EOF
1592#define inline $ac_cv_c_inline
1593EOF
1594 ;;
1595esac
1596
1597
861bb6c1 1598# Find some useful tools
11642c3a 1599for ac_prog in mawk gawk nawk awk
861bb6c1
JL
1600do
1601# Extract the first word of "$ac_prog", so it can be a program name with args.
1602set dummy $ac_prog; ac_word=$2
1603echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 1604echo "configure:1605: checking for $ac_word" >&5
861bb6c1
JL
1605if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
1606 echo $ac_n "(cached) $ac_c" 1>&6
1607else
1608 if test -n "$AWK"; then
1609 ac_cv_prog_AWK="$AWK" # Let the user override the test.
1610else
cd9e5e7c 1611 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
1612 ac_dummy="$PATH"
1613 for ac_dir in $ac_dummy; do
861bb6c1
JL
1614 test -z "$ac_dir" && ac_dir=.
1615 if test -f $ac_dir/$ac_word; then
1616 ac_cv_prog_AWK="$ac_prog"
1617 break
1618 fi
1619 done
1620 IFS="$ac_save_ifs"
1621fi
1622fi
1623AWK="$ac_cv_prog_AWK"
1624if test -n "$AWK"; then
1625 echo "$ac_t""$AWK" 1>&6
1626else
1627 echo "$ac_t""no" 1>&6
1628fi
1629
1630test -n "$AWK" && break
1631done
1632
0a4b6309 1633echo $ac_n "checking whether ln works""... $ac_c" 1>&6
1bf17cc4 1634echo "configure:1635: checking whether ln works" >&5
0a4b6309
RL
1635if eval "test \"`echo '$''{'gcc_cv_prog_LN'+set}'`\" = set"; then
1636 echo $ac_n "(cached) $ac_c" 1>&6
1637else
1638 rm -f conftestdata_t
1639echo >conftestdata_f
1640if ln conftestdata_f conftestdata_t 2>/dev/null
1641then
1642 gcc_cv_prog_LN="ln"
1643else
1644 if ln -s conftestdata_f conftestdata_t 2>/dev/null
1645 then
1646 gcc_cv_prog_LN="ln -s"
1647 else
1648 gcc_cv_prog_LN=cp
1649 fi
1650fi
1651rm -f conftestdata_f conftestdata_t
1652
1653fi
1654LN="$gcc_cv_prog_LN"
1655if test "$gcc_cv_prog_LN" = "ln"; then
1656 echo "$ac_t""yes" 1>&6
1657else
1658 if test "$gcc_cv_prog_LN" = "ln -s"; then
1659 echo "$ac_t""no, using ln -s" 1>&6
1660 else
1661 echo "$ac_t""no, and neither does ln -s, so using cp" 1>&6
1662 fi
1663fi
1664
1665echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
1bf17cc4 1666echo "configure:1667: checking whether ln -s works" >&5
0a4b6309
RL
1667if eval "test \"`echo '$''{'gcc_cv_prog_LN_S'+set}'`\" = set"; then
1668 echo $ac_n "(cached) $ac_c" 1>&6
1669else
1670 rm -f conftestdata_t
1671echo >conftestdata_f
1672if ln -s conftestdata_f conftestdata_t 2>/dev/null
1673then
1674 gcc_cv_prog_LN_S="ln -s"
1675else
1676 if ln conftestdata_f conftestdata_t 2>/dev/null
1677 then
1678 gcc_cv_prog_LN_S=ln
1679 else
1680 gcc_cv_prog_LN_S=cp
1681 fi
1682fi
1683rm -f conftestdata_f conftestdata_t
1684
1685fi
1686LN_S="$gcc_cv_prog_LN_S"
1687if test "$gcc_cv_prog_LN_S" = "ln -s"; then
1688 echo "$ac_t""yes" 1>&6
1689else
1690 if test "$gcc_cv_prog_LN_S" = "ln"; then
1691 echo "$ac_t""no, using ln" 1>&6
1692 else
1693 echo "$ac_t""no, and neither does ln, so using cp" 1>&6
1694 fi
1695fi
1696
1697echo $ac_n "checking for volatile""... $ac_c" 1>&6
1bf17cc4 1698echo "configure:1699: checking for volatile" >&5
0a4b6309
RL
1699if eval "test \"`echo '$''{'gcc_cv_c_volatile'+set}'`\" = set"; then
1700 echo $ac_n "(cached) $ac_c" 1>&6
1701else
1702 cat > conftest.$ac_ext <<EOF
1bf17cc4 1703#line 1704 "configure"
0a4b6309
RL
1704#include "confdefs.h"
1705
1706int main() {
1707volatile int foo;
1708; return 0; }
1709EOF
1bf17cc4 1710if { (eval echo configure:1711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
0a4b6309
RL
1711 rm -rf conftest*
1712 gcc_cv_c_volatile=yes
1713else
1714 echo "configure: failed program was:" >&5
1715 cat conftest.$ac_ext >&5
1716 rm -rf conftest*
1717 gcc_cv_c_volatile=no
1718fi
1719rm -f conftest*
1720fi
1721
1722echo "$ac_t""$gcc_cv_c_volatile" 1>&6
1723if test $gcc_cv_c_volatile = yes ; then
1724 cat >> confdefs.h <<\EOF
1725#define HAVE_VOLATILE 1
1726EOF
1727
1728fi
1729
861bb6c1
JL
1730# Extract the first word of "ranlib", so it can be a program name with args.
1731set dummy ranlib; ac_word=$2
1732echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 1733echo "configure:1734: checking for $ac_word" >&5
861bb6c1
JL
1734if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1735 echo $ac_n "(cached) $ac_c" 1>&6
1736else
1737 if test -n "$RANLIB"; then
1738 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1739else
cd9e5e7c 1740 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
1741 ac_dummy="$PATH"
1742 for ac_dir in $ac_dummy; do
861bb6c1
JL
1743 test -z "$ac_dir" && ac_dir=.
1744 if test -f $ac_dir/$ac_word; then
1745 ac_cv_prog_RANLIB="ranlib"
1746 break
1747 fi
1748 done
1749 IFS="$ac_save_ifs"
1750 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1751fi
1752fi
1753RANLIB="$ac_cv_prog_RANLIB"
1754if test -n "$RANLIB"; then
1755 echo "$ac_t""$RANLIB" 1>&6
1756else
1757 echo "$ac_t""no" 1>&6
1758fi
1759
0a4b6309
RL
1760# Find a good install program. We prefer a C program (faster),
1761# so one script is as good as another. But avoid the broken or
1762# incompatible versions:
1763# SysV /etc/install, /usr/sbin/install
1764# SunOS /usr/etc/install
1765# IRIX /sbin/install
1766# AIX /bin/install
1767# AFS /usr/afsws/bin/install, which mishandles nonexistent args
1768# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1769# ./install, which can be erroneously created by make from ./install.sh.
1770echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1bf17cc4 1771echo "configure:1772: checking for a BSD compatible install" >&5
0a4b6309
RL
1772if test -z "$INSTALL"; then
1773if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1774 echo $ac_n "(cached) $ac_c" 1>&6
1775else
1776 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
1777 for ac_dir in $PATH; do
1778 # Account for people who put trailing slashes in PATH elements.
1779 case "$ac_dir/" in
1780 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1781 *)
1782 # OSF1 and SCO ODT 3.0 have their own names for install.
1783 for ac_prog in ginstall scoinst install; do
1784 if test -f $ac_dir/$ac_prog; then
1785 if test $ac_prog = install &&
1786 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1787 # AIX install. It has an incompatible calling convention.
1788 # OSF/1 installbsd also uses dspmsg, but is usable.
1789 :
1790 else
1791 ac_cv_path_install="$ac_dir/$ac_prog -c"
1792 break 2
1793 fi
1794 fi
1795 done
1796 ;;
1797 esac
1798 done
1799 IFS="$ac_save_IFS"
1800
1801fi
1802 if test "${ac_cv_path_install+set}" = set; then
1803 INSTALL="$ac_cv_path_install"
1804 else
1805 # As a last resort, use the slow shell script. We don't cache a
1806 # path for INSTALL within a source directory, because that will
1807 # break other packages using the cache if that directory is
1808 # removed, or if the path is relative.
1809 INSTALL="$ac_install_sh"
1810 fi
1811fi
1812echo "$ac_t""$INSTALL" 1>&6
1813
1814# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1815# It thinks the first close brace ends the variable substitution.
1816test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1817
1818test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1819
861bb6c1 1820
861bb6c1 1821echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1bf17cc4 1822echo "configure:1823: checking how to run the C preprocessor" >&5
861bb6c1
JL
1823# On Suns, sometimes $CPP names a directory.
1824if test -n "$CPP" && test -d "$CPP"; then
1825 CPP=
1826fi
1827if test -z "$CPP"; then
1828if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1829 echo $ac_n "(cached) $ac_c" 1>&6
1830else
1831 # This must be in double quotes, not single quotes, because CPP may get
1832 # substituted into the Makefile and "${CC-cc}" will confuse make.
1833 CPP="${CC-cc} -E"
1834 # On the NeXT, cc -E runs the code through the compiler's parser,
1835 # not just through cpp.
1836 cat > conftest.$ac_ext <<EOF
1bf17cc4 1837#line 1838 "configure"
861bb6c1
JL
1838#include "confdefs.h"
1839#include <assert.h>
1840Syntax Error
1841EOF
1842ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 1843{ (eval echo configure:1844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 1844ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
861bb6c1
JL
1845if test -z "$ac_err"; then
1846 :
1847else
1848 echo "$ac_err" >&5
1849 echo "configure: failed program was:" >&5
1850 cat conftest.$ac_ext >&5
1851 rm -rf conftest*
1852 CPP="${CC-cc} -E -traditional-cpp"
1853 cat > conftest.$ac_ext <<EOF
1bf17cc4 1854#line 1855 "configure"
cd9e5e7c
MK
1855#include "confdefs.h"
1856#include <assert.h>
1857Syntax Error
1858EOF
1859ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 1860{ (eval echo configure:1861: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c
MK
1861ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1862if test -z "$ac_err"; then
1863 :
1864else
1865 echo "$ac_err" >&5
1866 echo "configure: failed program was:" >&5
1867 cat conftest.$ac_ext >&5
1868 rm -rf conftest*
1869 CPP="${CC-cc} -nologo -E"
1870 cat > conftest.$ac_ext <<EOF
1bf17cc4 1871#line 1872 "configure"
20fced2c
MM
1872#include "confdefs.h"
1873#include <assert.h>
1874Syntax Error
1875EOF
1876ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 1877{ (eval echo configure:1878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 1878ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
861bb6c1
JL
1879if test -z "$ac_err"; then
1880 :
1881else
1882 echo "$ac_err" >&5
1883 echo "configure: failed program was:" >&5
1884 cat conftest.$ac_ext >&5
1885 rm -rf conftest*
1886 CPP=/lib/cpp
1887fi
1888rm -f conftest*
1889fi
cd9e5e7c
MK
1890rm -f conftest*
1891fi
861bb6c1
JL
1892rm -f conftest*
1893 ac_cv_prog_CPP="$CPP"
1894fi
1895 CPP="$ac_cv_prog_CPP"
1896else
1897 ac_cv_prog_CPP="$CPP"
1898fi
1899echo "$ac_t""$CPP" 1>&6
1900
956d6950 1901echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1bf17cc4 1902echo "configure:1903: checking for ANSI C header files" >&5
956d6950
JL
1903if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1904 echo $ac_n "(cached) $ac_c" 1>&6
1905else
1906 cat > conftest.$ac_ext <<EOF
1bf17cc4 1907#line 1908 "configure"
956d6950
JL
1908#include "confdefs.h"
1909#include <stdlib.h>
1910#include <stdarg.h>
1911#include <string.h>
1912#include <float.h>
1913EOF
1914ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 1915{ (eval echo configure:1916: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 1916ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
956d6950
JL
1917if test -z "$ac_err"; then
1918 rm -rf conftest*
1919 ac_cv_header_stdc=yes
1920else
1921 echo "$ac_err" >&5
1922 echo "configure: failed program was:" >&5
1923 cat conftest.$ac_ext >&5
1924 rm -rf conftest*
1925 ac_cv_header_stdc=no
1926fi
1927rm -f conftest*
1928
1929if test $ac_cv_header_stdc = yes; then
1930 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
1931cat > conftest.$ac_ext <<EOF
1bf17cc4 1932#line 1933 "configure"
956d6950
JL
1933#include "confdefs.h"
1934#include <string.h>
1935EOF
1936if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1937 egrep "memchr" >/dev/null 2>&1; then
1938 :
1939else
1940 rm -rf conftest*
1941 ac_cv_header_stdc=no
1942fi
1943rm -f conftest*
1944
1945fi
1946
1947if test $ac_cv_header_stdc = yes; then
1948 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1949cat > conftest.$ac_ext <<EOF
1bf17cc4 1950#line 1951 "configure"
956d6950
JL
1951#include "confdefs.h"
1952#include <stdlib.h>
1953EOF
1954if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1955 egrep "free" >/dev/null 2>&1; then
1956 :
1957else
1958 rm -rf conftest*
1959 ac_cv_header_stdc=no
1960fi
1961rm -f conftest*
1962
1963fi
1964
1965if test $ac_cv_header_stdc = yes; then
1966 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1967if test "$cross_compiling" = yes; then
1968 :
1969else
1970 cat > conftest.$ac_ext <<EOF
1bf17cc4 1971#line 1972 "configure"
956d6950
JL
1972#include "confdefs.h"
1973#include <ctype.h>
1974#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1975#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1976#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1977int main () { int i; for (i = 0; i < 256; i++)
1978if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1979exit (0); }
1980
1981EOF
1bf17cc4 1982if { (eval echo configure:1983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
956d6950
JL
1983then
1984 :
1985else
1986 echo "configure: failed program was:" >&5
1987 cat conftest.$ac_ext >&5
1988 rm -fr conftest*
1989 ac_cv_header_stdc=no
1990fi
1991rm -fr conftest*
1992fi
1993
1994fi
1995fi
1996
1997echo "$ac_t""$ac_cv_header_stdc" 1>&6
1998if test $ac_cv_header_stdc = yes; then
1999 cat >> confdefs.h <<\EOF
2000#define STDC_HEADERS 1
2001EOF
2002
2003fi
2004
2005echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1bf17cc4 2006echo "configure:2007: checking whether time.h and sys/time.h may both be included" >&5
956d6950
JL
2007if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
2008 echo $ac_n "(cached) $ac_c" 1>&6
2009else
2010 cat > conftest.$ac_ext <<EOF
1bf17cc4 2011#line 2012 "configure"
956d6950
JL
2012#include "confdefs.h"
2013#include <sys/types.h>
2014#include <sys/time.h>
2015#include <time.h>
2016int main() {
2017struct tm *tp;
2018; return 0; }
2019EOF
1bf17cc4 2020if { (eval echo configure:2021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
956d6950
JL
2021 rm -rf conftest*
2022 ac_cv_header_time=yes
2023else
2024 echo "configure: failed program was:" >&5
2025 cat conftest.$ac_ext >&5
2026 rm -rf conftest*
2027 ac_cv_header_time=no
2028fi
2029rm -f conftest*
2030fi
2031
2032echo "$ac_t""$ac_cv_header_time" 1>&6
2033if test $ac_cv_header_time = yes; then
2034 cat >> confdefs.h <<\EOF
2035#define TIME_WITH_SYS_TIME 1
2036EOF
2037
2038fi
2039
0a4b6309 2040echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
1bf17cc4 2041echo "configure:2042: checking whether string.h and strings.h may both be included" >&5
0a4b6309
RL
2042if eval "test \"`echo '$''{'gcc_cv_header_string'+set}'`\" = set"; then
2043 echo $ac_n "(cached) $ac_c" 1>&6
2044else
2045 cat > conftest.$ac_ext <<EOF
1bf17cc4 2046#line 2047 "configure"
0a4b6309
RL
2047#include "confdefs.h"
2048#include <string.h>
2049#include <strings.h>
2050int main() {
2051
2052; return 0; }
2053EOF
1bf17cc4 2054if { (eval echo configure:2055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
0a4b6309
RL
2055 rm -rf conftest*
2056 gcc_cv_header_string=yes
2057else
2058 echo "configure: failed program was:" >&5
2059 cat conftest.$ac_ext >&5
2060 rm -rf conftest*
2061 gcc_cv_header_string=no
2062fi
2063rm -f conftest*
2064fi
2065
2066echo "$ac_t""$gcc_cv_header_string" 1>&6
2067if test $gcc_cv_header_string = yes; then
2068 cat >> confdefs.h <<\EOF
2069#define STRING_WITH_STRINGS 1
2070EOF
2071
2072fi
2073
e9831ca0 2074echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1bf17cc4 2075echo "configure:2076: checking for sys/wait.h that is POSIX.1 compatible" >&5
e9831ca0
KG
2076if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
2077 echo $ac_n "(cached) $ac_c" 1>&6
2078else
2079 cat > conftest.$ac_ext <<EOF
1bf17cc4 2080#line 2081 "configure"
e9831ca0
KG
2081#include "confdefs.h"
2082#include <sys/types.h>
2083#include <sys/wait.h>
2084#ifndef WEXITSTATUS
2085#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
2086#endif
2087#ifndef WIFEXITED
2088#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
2089#endif
2090int main() {
2091int s;
2092wait (&s);
2093s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
2094; return 0; }
2095EOF
1bf17cc4 2096if { (eval echo configure:2097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
e9831ca0
KG
2097 rm -rf conftest*
2098 ac_cv_header_sys_wait_h=yes
2099else
2100 echo "configure: failed program was:" >&5
2101 cat conftest.$ac_ext >&5
2102 rm -rf conftest*
2103 ac_cv_header_sys_wait_h=no
2104fi
2105rm -f conftest*
2106fi
2107
2108echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
2109if test $ac_cv_header_sys_wait_h = yes; then
2110 cat >> confdefs.h <<\EOF
2111#define HAVE_SYS_WAIT_H 1
2112EOF
2113
2114fi
2115
03c41c05
ZW
2116for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \
2117 fcntl.h unistd.h stab.h sys/file.h sys/time.h \
2118 sys/resource.h sys/param.h sys/times.h sys/stat.h \
d6edb99e 2119 direct.h malloc.h langinfo.h iconv.h stdbool.h
861bb6c1
JL
2120do
2121ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2122echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1bf17cc4 2123echo "configure:2124: checking for $ac_hdr" >&5
861bb6c1
JL
2124if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2125 echo $ac_n "(cached) $ac_c" 1>&6
2126else
2127 cat > conftest.$ac_ext <<EOF
1bf17cc4 2128#line 2129 "configure"
861bb6c1
JL
2129#include "confdefs.h"
2130#include <$ac_hdr>
2131EOF
956d6950 2132ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 2133{ (eval echo configure:2134: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 2134ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
956d6950
JL
2135if test -z "$ac_err"; then
2136 rm -rf conftest*
2137 eval "ac_cv_header_$ac_safe=yes"
2138else
2139 echo "$ac_err" >&5
2140 echo "configure: failed program was:" >&5
2141 cat conftest.$ac_ext >&5
2142 rm -rf conftest*
2143 eval "ac_cv_header_$ac_safe=no"
2144fi
2145rm -f conftest*
2146fi
2147if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2148 echo "$ac_t""yes" 1>&6
2149 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2150 cat >> confdefs.h <<EOF
2151#define $ac_tr_hdr 1
2152EOF
2153
2154else
2155 echo "$ac_t""no" 1>&6
2156fi
2157done
2158
2159
f24af81b
TT
2160# Check for thread headers.
2161ac_safe=`echo "thread.h" | sed 'y%./+-%__p_%'`
2162echo $ac_n "checking for thread.h""... $ac_c" 1>&6
1bf17cc4 2163echo "configure:2164: checking for thread.h" >&5
f24af81b
TT
2164if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2165 echo $ac_n "(cached) $ac_c" 1>&6
2166else
2167 cat > conftest.$ac_ext <<EOF
1bf17cc4 2168#line 2169 "configure"
f24af81b
TT
2169#include "confdefs.h"
2170#include <thread.h>
2171EOF
2172ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 2173{ (eval echo configure:2174: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 2174ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
f24af81b
TT
2175if test -z "$ac_err"; then
2176 rm -rf conftest*
2177 eval "ac_cv_header_$ac_safe=yes"
2178else
2179 echo "$ac_err" >&5
2180 echo "configure: failed program was:" >&5
2181 cat conftest.$ac_ext >&5
2182 rm -rf conftest*
2183 eval "ac_cv_header_$ac_safe=no"
2184fi
2185rm -f conftest*
2186fi
2187if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2188 echo "$ac_t""yes" 1>&6
2189 have_thread_h=yes
2190else
2191 echo "$ac_t""no" 1>&6
2192have_thread_h=
2193fi
2194
2195ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
2196echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
1bf17cc4 2197echo "configure:2198: checking for pthread.h" >&5
f24af81b
TT
2198if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2199 echo $ac_n "(cached) $ac_c" 1>&6
2200else
2201 cat > conftest.$ac_ext <<EOF
1bf17cc4 2202#line 2203 "configure"
f24af81b
TT
2203#include "confdefs.h"
2204#include <pthread.h>
2205EOF
2206ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 2207{ (eval echo configure:2208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 2208ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
f24af81b
TT
2209if test -z "$ac_err"; then
2210 rm -rf conftest*
2211 eval "ac_cv_header_$ac_safe=yes"
2212else
2213 echo "$ac_err" >&5
2214 echo "configure: failed program was:" >&5
2215 cat conftest.$ac_ext >&5
2216 rm -rf conftest*
2217 eval "ac_cv_header_$ac_safe=no"
2218fi
2219rm -f conftest*
2220fi
2221if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2222 echo "$ac_t""yes" 1>&6
2223 have_pthread_h=yes
2224else
2225 echo "$ac_t""no" 1>&6
2226have_pthread_h=
2227fi
2228
2229
bcf12124
JL
2230# See if GNAT has been installed
2231# Extract the first word of "gnatbind", so it can be a program name with args.
2232set dummy gnatbind; ac_word=$2
2233echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 2234echo "configure:2235: checking for $ac_word" >&5
1ffc5c6e 2235if eval "test \"`echo '$''{'ac_cv_prog_have_gnat'+set}'`\" = set"; then
bcf12124
JL
2236 echo $ac_n "(cached) $ac_c" 1>&6
2237else
1ffc5c6e
RK
2238 if test -n "$have_gnat"; then
2239 ac_cv_prog_have_gnat="$have_gnat" # Let the user override the test.
bcf12124 2240else
cd9e5e7c 2241 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
2242 ac_dummy="$PATH"
2243 for ac_dir in $ac_dummy; do
bcf12124
JL
2244 test -z "$ac_dir" && ac_dir=.
2245 if test -f $ac_dir/$ac_word; then
1ffc5c6e 2246 ac_cv_prog_have_gnat="yes"
bcf12124
JL
2247 break
2248 fi
2249 done
2250 IFS="$ac_save_ifs"
1ffc5c6e 2251 test -z "$ac_cv_prog_have_gnat" && ac_cv_prog_have_gnat="no"
bcf12124
JL
2252fi
2253fi
1ffc5c6e
RK
2254have_gnat="$ac_cv_prog_have_gnat"
2255if test -n "$have_gnat"; then
2256 echo "$ac_t""$have_gnat" 1>&6
bcf12124
JL
2257else
2258 echo "$ac_t""no" 1>&6
2259fi
2260
2261
955be633
JM
2262# See if we have the mktemp command.
2263# Extract the first word of "mktemp", so it can be a program name with args.
2264set dummy mktemp; ac_word=$2
2265echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 2266echo "configure:2267: checking for $ac_word" >&5
955be633
JM
2267if eval "test \"`echo '$''{'ac_cv_prog_have_mktemp_command'+set}'`\" = set"; then
2268 echo $ac_n "(cached) $ac_c" 1>&6
2269else
2270 if test -n "$have_mktemp_command"; then
2271 ac_cv_prog_have_mktemp_command="$have_mktemp_command" # Let the user override the test.
2272else
2273 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2274 ac_dummy="$PATH"
2275 for ac_dir in $ac_dummy; do
2276 test -z "$ac_dir" && ac_dir=.
2277 if test -f $ac_dir/$ac_word; then
2278 ac_cv_prog_have_mktemp_command="yes"
2279 break
2280 fi
2281 done
2282 IFS="$ac_save_ifs"
2283 test -z "$ac_cv_prog_have_mktemp_command" && ac_cv_prog_have_mktemp_command="no"
2284fi
2285fi
2286have_mktemp_command="$ac_cv_prog_have_mktemp_command"
2287if test -n "$have_mktemp_command"; then
2288 echo "$ac_t""$have_mktemp_command" 1>&6
2289else
2290 echo "$ac_t""no" 1>&6
2291fi
2292
2293
09fa0705
ZW
2294# Do we have a single-tree copy of texinfo?
2295if test -f $srcdir/../texinfo/Makefile.in; then
2296 MAKEINFO='$(objdir)/../texinfo/makeinfo/makeinfo'
2297 gcc_cv_prog_makeinfo_modern=yes
2298 echo "$ac_t""Using makeinfo from the unified source tree." 1>&6
2299else
2300 # See if makeinfo has been installed and is modern enough
2301 # that we can use it.
2302 # Extract the first word of "makeinfo", so it can be a program name with args.
2303set dummy makeinfo; ac_word=$2
2304echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 2305echo "configure:2306: checking for $ac_word" >&5
09fa0705
ZW
2306if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
2307 echo $ac_n "(cached) $ac_c" 1>&6
2308else
2309 if test -n "$MAKEINFO"; then
2310 ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
2311else
2312 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2313 ac_dummy="$PATH"
2314 for ac_dir in $ac_dummy; do
2315 test -z "$ac_dir" && ac_dir=.
2316 if test -f $ac_dir/$ac_word; then
2317 ac_cv_prog_MAKEINFO="makeinfo"
2318 break
2319 fi
2320 done
2321 IFS="$ac_save_ifs"
2322fi
2323fi
2324MAKEINFO="$ac_cv_prog_MAKEINFO"
2325if test -n "$MAKEINFO"; then
2326 echo "$ac_t""$MAKEINFO" 1>&6
2327else
2328 echo "$ac_t""no" 1>&6
2329fi
2330
2331if test -n "$MAKEINFO"; then
2332 # Found it, now check the version.
2333 echo $ac_n "checking for modern makeinfo""... $ac_c" 1>&6
1bf17cc4 2334echo "configure:2335: checking for modern makeinfo" >&5
09fa0705
ZW
2335if eval "test \"`echo '$''{'gcc_cv_prog_makeinfo_modern'+set}'`\" = set"; then
2336 echo $ac_n "(cached) $ac_c" 1>&6
2337else
2338 ac_prog_version=`$MAKEINFO --version 2>&1 |
2339 sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
1bf17cc4 2340 echo "configure:2341: version of makeinfo is $ac_prog_version" >&5
09fa0705
ZW
2341 case $ac_prog_version in
2342 '') gcc_cv_prog_makeinfo_modern=no;;
fd939e46 2343 4.*)
09fa0705
ZW
2344 gcc_cv_prog_makeinfo_modern=yes;;
2345 *) gcc_cv_prog_makeinfo_modern=no;;
2346 esac
2347
2348fi
2349
2350echo "$ac_t""$gcc_cv_prog_makeinfo_modern" 1>&6
2351else
2352 gcc_cv_prog_makeinfo_modern=no
2353fi
2354
2355fi
2356
2357if test $gcc_cv_prog_makeinfo_modern = no; then
2358 echo "configure: warning:
2359*** Makeinfo is missing or too old.
17db6582 2360*** Info documentation will not be built." 1>&2
d21445e7 2361 BUILD_INFO=
09fa0705
ZW
2362else
2363 BUILD_INFO=info
09fa0705
ZW
2364fi
2365
3f896fc2
JM
2366# Is pod2man recent enough to regenerate manpages?
2367echo $ac_n "checking for recent Pod::Man""... $ac_c" 1>&6
1bf17cc4 2368echo "configure:2369: checking for recent Pod::Man" >&5
3f896fc2 2369if perl -e 'use 1.10 Pod::Man' >/dev/null 2>&1; then
fd939e46
JM
2370 echo "$ac_t""yes" 1>&6
2371 GENERATED_MANPAGES=generated-manpages
2372else
2373 echo "$ac_t""no" 1>&6
2374 GENERATED_MANPAGES=
2375fi
2376
1e608388
ZW
2377# How about lex?
2378if test -f $srcdir/../flex/skel.c; then
2379 FLEX='$(objdir)/../flex/flex'
2380else
2381 # Extract the first word of "flex", so it can be a program name with args.
2382set dummy flex; ac_word=$2
2383echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 2384echo "configure:2385: checking for $ac_word" >&5
1e608388
ZW
2385if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then
2386 echo $ac_n "(cached) $ac_c" 1>&6
2387else
2388 if test -n "$FLEX"; then
2389 ac_cv_prog_FLEX="$FLEX" # Let the user override the test.
2390else
2391 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2392 ac_dummy="$PATH"
2393 for ac_dir in $ac_dummy; do
2394 test -z "$ac_dir" && ac_dir=.
2395 if test -f $ac_dir/$ac_word; then
2396 ac_cv_prog_FLEX="flex"
2397 break
2398 fi
2399 done
2400 IFS="$ac_save_ifs"
2401 test -z "$ac_cv_prog_FLEX" && ac_cv_prog_FLEX="false"
2402fi
2403fi
2404FLEX="$ac_cv_prog_FLEX"
2405if test -n "$FLEX"; then
2406 echo "$ac_t""$FLEX" 1>&6
2407else
2408 echo "$ac_t""no" 1>&6
2409fi
2410
2411fi
2412
2413# Bison?
2414# The -L switch is so bison can find its skeleton file.
2415if test -f $srcdir/../bison/bison.simple; then
2416 BISON='$(objdir)/../bison/bison -L $(srcdir)/../bison/'
2417else
2418 # Extract the first word of "bison", so it can be a program name with args.
2419set dummy bison; ac_word=$2
2420echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 2421echo "configure:2422: checking for $ac_word" >&5
1e608388
ZW
2422if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then
2423 echo $ac_n "(cached) $ac_c" 1>&6
2424else
2425 if test -n "$BISON"; then
2426 ac_cv_prog_BISON="$BISON" # Let the user override the test.
2427else
2428 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
2429 ac_dummy="$PATH"
2430 for ac_dir in $ac_dummy; do
2431 test -z "$ac_dir" && ac_dir=.
2432 if test -f $ac_dir/$ac_word; then
2433 ac_cv_prog_BISON="bison"
2434 break
2435 fi
2436 done
2437 IFS="$ac_save_ifs"
2438 test -z "$ac_cv_prog_BISON" && ac_cv_prog_BISON="false"
2439fi
2440fi
2441BISON="$ac_cv_prog_BISON"
2442if test -n "$BISON"; then
2443 echo "$ac_t""$BISON" 1>&6
2444else
2445 echo "$ac_t""no" 1>&6
2446fi
2447
2448fi
2449
890ad3ea
KG
2450# See if the stage1 system preprocessor understands the ANSI C
2451# preprocessor stringification operator.
2452
2453
2454echo $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6
1bf17cc4 2455echo "configure:2456: checking for preprocessor stringizing operator" >&5
890ad3ea 2456if eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then
76844337
RH
2457 echo $ac_n "(cached) $ac_c" 1>&6
2458else
2459 cat > conftest.$ac_ext <<EOF
1bf17cc4 2460#line 2461 "configure"
76844337
RH
2461#include "confdefs.h"
2462
890ad3ea
KG
2463#define x(y) #y
2464
2465char *s = x(teststring);
2466
76844337 2467EOF
890ad3ea
KG
2468if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2469 egrep "#teststring" >/dev/null 2>&1; then
76844337 2470 rm -rf conftest*
890ad3ea 2471 ac_cv_c_stringize=no
76844337 2472else
76844337 2473 rm -rf conftest*
890ad3ea 2474 ac_cv_c_stringize=yes
76844337
RH
2475fi
2476rm -f conftest*
890ad3ea 2477
76844337
RH
2478fi
2479
890ad3ea
KG
2480if test "${ac_cv_c_stringize}" = yes
2481then
2482 cat >> confdefs.h <<\EOF
2483#define HAVE_STRINGIZE 1
76844337
RH
2484EOF
2485
2486fi
890ad3ea
KG
2487echo "$ac_t""${ac_cv_c_stringize}" 1>&6
2488
76844337 2489
956d6950
JL
2490# Use <inttypes.h> only if it exists,
2491# doesn't clash with <sys/types.h>, and declares intmax_t.
2492echo $ac_n "checking for inttypes.h""... $ac_c" 1>&6
1bf17cc4 2493echo "configure:2494: checking for inttypes.h" >&5
956d6950
JL
2494if eval "test \"`echo '$''{'gcc_cv_header_inttypes_h'+set}'`\" = set"; then
2495 echo $ac_n "(cached) $ac_c" 1>&6
2496else
2497 cat > conftest.$ac_ext <<EOF
1bf17cc4 2498#line 2499 "configure"
956d6950
JL
2499#include "confdefs.h"
2500#include <sys/types.h>
2501#include <inttypes.h>
2502int main() {
2503intmax_t i = -1;
2504; return 0; }
2505EOF
1bf17cc4 2506if { (eval echo configure:2507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
956d6950 2507 rm -rf conftest*
0056a9b5 2508 gcc_cv_header_inttypes_h=yes
956d6950
JL
2509else
2510 echo "configure: failed program was:" >&5
2511 cat conftest.$ac_ext >&5
2512 rm -rf conftest*
2513 gcc_cv_header_inttypes_h=no
2514fi
2515rm -f conftest*
2516fi
2517
2518echo "$ac_t""$gcc_cv_header_inttypes_h" 1>&6
0056a9b5
KG
2519if test $gcc_cv_header_inttypes_h = yes; then
2520 cat >> confdefs.h <<\EOF
2521#define HAVE_INTTYPES_H 1
2522EOF
2523
2524fi
956d6950 2525
c149cc37
RL
2526#
2527# Determine if enumerated bitfields are unsigned. ISO C says they can
2528# be either signed or unsigned.
2529#
2530echo $ac_n "checking for unsigned enumerated bitfields""... $ac_c" 1>&6
1bf17cc4 2531echo "configure:2532: checking for unsigned enumerated bitfields" >&5
c149cc37
RL
2532if eval "test \"`echo '$''{'gcc_cv_enum_bf_unsigned'+set}'`\" = set"; then
2533 echo $ac_n "(cached) $ac_c" 1>&6
2534else
2535 if test "$cross_compiling" = yes; then
2536 gcc_cv_enum_bf_unsigned=yes
2537else
2538 cat > conftest.$ac_ext <<EOF
1bf17cc4 2539#line 2540 "configure"
c149cc37
RL
2540#include "confdefs.h"
2541#include <stdlib.h>
2542enum t { BLAH = 128 } ;
2543struct s_t { enum t member : 8; } s ;
2544int main(void)
2545{
2546 s.member = BLAH;
2547 if (s.member < 0) exit(1);
2548 exit(0);
2549
2550}
2551EOF
1bf17cc4 2552if { (eval echo configure:2553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c149cc37
RL
2553then
2554 gcc_cv_enum_bf_unsigned=yes
2555else
2556 echo "configure: failed program was:" >&5
2557 cat conftest.$ac_ext >&5
2558 rm -fr conftest*
2559 gcc_cv_enum_bf_unsigned=no
2560fi
2561rm -fr conftest*
2562fi
2563
2564fi
2565
c149cc37
RL
2566echo "$ac_t""$gcc_cv_enum_bf_unsigned" 1>&6
2567if test $gcc_cv_enum_bf_unsigned = yes; then
2568 cat >> confdefs.h <<\EOF
2569#define ENUM_BITFIELDS_ARE_UNSIGNED 1
2570EOF
2571
2572fi
2573
2e09e75a
JM
2574for ac_func in strtoul bsearch putenv popen bcopy \
2575 strchr strrchr kill getrlimit setrlimit atoll atoq \
54953b66 2576 sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \
130fadbb 2577 fputs_unlocked getrusage iconv nl_langinfo
956d6950
JL
2578do
2579echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1bf17cc4 2580echo "configure:2581: checking for $ac_func" >&5
956d6950
JL
2581if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2582 echo $ac_n "(cached) $ac_c" 1>&6
2583else
2584 cat > conftest.$ac_ext <<EOF
1bf17cc4 2585#line 2586 "configure"
956d6950
JL
2586#include "confdefs.h"
2587/* System header to define __stub macros and hopefully few prototypes,
2588 which can conflict with char $ac_func(); below. */
2589#include <assert.h>
2590/* Override any gcc2 internal prototype to avoid an error. */
2591/* We use char because int might match the return type of a gcc2
2592 builtin and then its argument prototype would still apply. */
2593char $ac_func();
2594
2595int main() {
2596
2597/* The GNU C library defines this for functions which it implements
2598 to always fail with ENOSYS. Some functions are actually named
2599 something starting with __ and the normal name is an alias. */
2600#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2601choke me
2602#else
99b09ff3 2603$ac_func();
956d6950
JL
2604#endif
2605
2606; return 0; }
2607EOF
1bf17cc4 2608if { (eval echo configure:2609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
956d6950
JL
2609 rm -rf conftest*
2610 eval "ac_cv_func_$ac_func=yes"
2611else
2612 echo "configure: failed program was:" >&5
2613 cat conftest.$ac_ext >&5
2614 rm -rf conftest*
2615 eval "ac_cv_func_$ac_func=no"
2616fi
2617rm -f conftest*
2618fi
2619
2620if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2621 echo "$ac_t""yes" 1>&6
2622 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2623 cat >> confdefs.h <<EOF
2624#define $ac_tr_func 1
2625EOF
2626
2627else
2628 echo "$ac_t""no" 1>&6
2629fi
2630done
2631
6885fc87 2632
f12bc141 2633echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
1bf17cc4 2634echo "configure:2635: checking for ssize_t" >&5
f12bc141
ZW
2635if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
2636 echo $ac_n "(cached) $ac_c" 1>&6
2637else
2638 cat > conftest.$ac_ext <<EOF
1bf17cc4 2639#line 2640 "configure"
f12bc141
ZW
2640#include "confdefs.h"
2641#include <sys/types.h>
2642#if STDC_HEADERS
2643#include <stdlib.h>
2644#include <stddef.h>
2645#endif
2646EOF
2647if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2648 egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
2649 rm -rf conftest*
2650 ac_cv_type_ssize_t=yes
2651else
2652 rm -rf conftest*
2653 ac_cv_type_ssize_t=no
2654fi
2655rm -f conftest*
2656
2657fi
2658echo "$ac_t""$ac_cv_type_ssize_t" 1>&6
2659if test $ac_cv_type_ssize_t = no; then
2660 cat >> confdefs.h <<\EOF
2661#define ssize_t int
2662EOF
2663
2664fi
2665
0b9d02c6 2666
e256b8b6
DA
2667# Try to determine the array type of the second argument of getgroups
2668# for the target system (int or gid_t).
2669echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
1bf17cc4 2670echo "configure:2671: checking for uid_t in sys/types.h" >&5
e256b8b6
DA
2671if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
2672 echo $ac_n "(cached) $ac_c" 1>&6
2673else
2674 cat > conftest.$ac_ext <<EOF
1bf17cc4 2675#line 2676 "configure"
e256b8b6
DA
2676#include "confdefs.h"
2677#include <sys/types.h>
2678EOF
2679if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2680 egrep "uid_t" >/dev/null 2>&1; then
2681 rm -rf conftest*
2682 ac_cv_type_uid_t=yes
2683else
2684 rm -rf conftest*
2685 ac_cv_type_uid_t=no
2686fi
2687rm -f conftest*
2688
2689fi
2690
2691echo "$ac_t""$ac_cv_type_uid_t" 1>&6
2692if test $ac_cv_type_uid_t = no; then
2693 cat >> confdefs.h <<\EOF
2694#define uid_t int
2695EOF
2696
2697 cat >> confdefs.h <<\EOF
2698#define gid_t int
2699EOF
2700
2701fi
2702
2703echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
1bf17cc4 2704echo "configure:2705: checking type of array argument to getgroups" >&5
e256b8b6
DA
2705if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
2706 echo $ac_n "(cached) $ac_c" 1>&6
2707else
2708 if test "$cross_compiling" = yes; then
2709 ac_cv_type_getgroups=cross
2710else
2711 cat > conftest.$ac_ext <<EOF
1bf17cc4 2712#line 2713 "configure"
e256b8b6
DA
2713#include "confdefs.h"
2714
2715/* Thanks to Mike Rendell for this test. */
2716#include <sys/types.h>
2717#define NGID 256
2718#undef MAX
2719#define MAX(x, y) ((x) > (y) ? (x) : (y))
2720main()
2721{
2722 gid_t gidset[NGID];
2723 int i, n;
2724 union { gid_t gval; long lval; } val;
2725
2726 val.lval = -1;
2727 for (i = 0; i < NGID; i++)
2728 gidset[i] = val.gval;
2729 n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
2730 gidset);
2731 /* Exit non-zero if getgroups seems to require an array of ints. This
2732 happens when gid_t is short but getgroups modifies an array of ints. */
2733 exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
2734}
2735
2736EOF
1bf17cc4 2737if { (eval echo configure:2738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
e256b8b6
DA
2738then
2739 ac_cv_type_getgroups=gid_t
2740else
2741 echo "configure: failed program was:" >&5
2742 cat conftest.$ac_ext >&5
2743 rm -fr conftest*
2744 ac_cv_type_getgroups=int
2745fi
2746rm -fr conftest*
2747fi
2748
2749if test $ac_cv_type_getgroups = cross; then
2750 cat > conftest.$ac_ext <<EOF
1bf17cc4 2751#line 2752 "configure"
e256b8b6
DA
2752#include "confdefs.h"
2753#include <unistd.h>
2754EOF
2755if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2756 egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
2757 rm -rf conftest*
2758 ac_cv_type_getgroups=gid_t
2759else
2760 rm -rf conftest*
2761 ac_cv_type_getgroups=int
2762fi
2763rm -f conftest*
2764
2765fi
2766fi
2767
2768echo "$ac_t""$ac_cv_type_getgroups" 1>&6
2769cat >> confdefs.h <<EOF
2770#define GETGROUPS_T $ac_cv_type_getgroups
2771EOF
2772
2773
2774if test "${target}" = "${build}"; then
2775 TARGET_GETGROUPS_T=$ac_cv_type_getgroups
2776else
2777 case "${target}" in
2778 # This condition may need some tweaking. It should include all
2779 # targets where the array type of the second argument of getgroups
2780 # is int and the type of gid_t is not equivalent to int.
2781 *-*-sunos* | *-*-ultrix*)
2782 TARGET_GETGROUPS_T=int
2783 ;;
2784 *)
2785 TARGET_GETGROUPS_T=gid_t
2786 ;;
2787 esac
2788fi
2789
2790
0a4b6309 2791echo $ac_n "checking for vprintf""... $ac_c" 1>&6
1bf17cc4 2792echo "configure:2793: checking for vprintf" >&5
0a4b6309
RL
2793if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
2794 echo $ac_n "(cached) $ac_c" 1>&6
2795else
2796 cat > conftest.$ac_ext <<EOF
1bf17cc4 2797#line 2798 "configure"
0a4b6309
RL
2798#include "confdefs.h"
2799/* System header to define __stub macros and hopefully few prototypes,
2800 which can conflict with char vprintf(); below. */
2801#include <assert.h>
2802/* Override any gcc2 internal prototype to avoid an error. */
2803/* We use char because int might match the return type of a gcc2
2804 builtin and then its argument prototype would still apply. */
2805char vprintf();
2806
2807int main() {
2808
2809/* The GNU C library defines this for functions which it implements
2810 to always fail with ENOSYS. Some functions are actually named
2811 something starting with __ and the normal name is an alias. */
2812#if defined (__stub_vprintf) || defined (__stub___vprintf)
2813choke me
2814#else
99b09ff3 2815vprintf();
0a4b6309
RL
2816#endif
2817
2818; return 0; }
2819EOF
1bf17cc4 2820if { (eval echo configure:2821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0a4b6309
RL
2821 rm -rf conftest*
2822 eval "ac_cv_func_vprintf=yes"
2823else
2824 echo "configure: failed program was:" >&5
2825 cat conftest.$ac_ext >&5
2826 rm -rf conftest*
2827 eval "ac_cv_func_vprintf=no"
2828fi
2829rm -f conftest*
2830fi
2831
2832if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
2833 echo "$ac_t""yes" 1>&6
2834 cat >> confdefs.h <<\EOF
2835#define HAVE_VPRINTF 1
2836EOF
2837
2838else
2839 echo "$ac_t""no" 1>&6
2840fi
8fa1f09f 2841
0a4b6309
RL
2842if test "$ac_cv_func_vprintf" != yes; then
2843echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
1bf17cc4 2844echo "configure:2845: checking for _doprnt" >&5
0a4b6309
RL
2845if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
2846 echo $ac_n "(cached) $ac_c" 1>&6
2847else
2848 cat > conftest.$ac_ext <<EOF
1bf17cc4 2849#line 2850 "configure"
0a4b6309
RL
2850#include "confdefs.h"
2851/* System header to define __stub macros and hopefully few prototypes,
2852 which can conflict with char _doprnt(); below. */
2853#include <assert.h>
2854/* Override any gcc2 internal prototype to avoid an error. */
2855/* We use char because int might match the return type of a gcc2
2856 builtin and then its argument prototype would still apply. */
2857char _doprnt();
2858
2859int main() {
2860
2861/* The GNU C library defines this for functions which it implements
2862 to always fail with ENOSYS. Some functions are actually named
2863 something starting with __ and the normal name is an alias. */
2864#if defined (__stub__doprnt) || defined (__stub____doprnt)
2865choke me
2866#else
99b09ff3 2867_doprnt();
0a4b6309
RL
2868#endif
2869
2870; return 0; }
2871EOF
1bf17cc4 2872if { (eval echo configure:2873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0a4b6309
RL
2873 rm -rf conftest*
2874 eval "ac_cv_func__doprnt=yes"
2875else
2876 echo "configure: failed program was:" >&5
2877 cat conftest.$ac_ext >&5
2878 rm -rf conftest*
2879 eval "ac_cv_func__doprnt=no"
2880fi
2881rm -f conftest*
2882fi
2883
2884if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
2885 echo "$ac_t""yes" 1>&6
2886 cat >> confdefs.h <<\EOF
2887#define HAVE_DOPRNT 1
2888EOF
2889
2890else
2891 echo "$ac_t""no" 1>&6
2892fi
2893
2894fi
2895
2896vfprintf=
2897doprint=
2898if test $ac_cv_func_vprintf != yes ; then
2899 vfprintf=vfprintf.o
2900 if test $ac_cv_func__doprnt != yes ; then
2901 doprint=doprint.o
2902 fi
2903fi
2904
2905
2906
b3e1e64f
MS
2907for ac_func in strstr
2908do
2909echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1bf17cc4 2910echo "configure:2911: checking for $ac_func" >&5
b3e1e64f
MS
2911if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2912 echo $ac_n "(cached) $ac_c" 1>&6
2913else
2914 cat > conftest.$ac_ext <<EOF
1bf17cc4 2915#line 2916 "configure"
b3e1e64f
MS
2916#include "confdefs.h"
2917/* System header to define __stub macros and hopefully few prototypes,
2918 which can conflict with char $ac_func(); below. */
2919#include <assert.h>
2920/* Override any gcc2 internal prototype to avoid an error. */
2921/* We use char because int might match the return type of a gcc2
2922 builtin and then its argument prototype would still apply. */
2923char $ac_func();
2924
2925int main() {
2926
2927/* The GNU C library defines this for functions which it implements
2928 to always fail with ENOSYS. Some functions are actually named
2929 something starting with __ and the normal name is an alias. */
2930#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2931choke me
2932#else
2933$ac_func();
2934#endif
2935
2936; return 0; }
2937EOF
1bf17cc4 2938if { (eval echo configure:2939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
b3e1e64f
MS
2939 rm -rf conftest*
2940 eval "ac_cv_func_$ac_func=yes"
2941else
2942 echo "configure: failed program was:" >&5
2943 cat conftest.$ac_ext >&5
2944 rm -rf conftest*
2945 eval "ac_cv_func_$ac_func=no"
2946fi
2947rm -f conftest*
2948fi
2949
2950if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2951 echo "$ac_t""yes" 1>&6
2952 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2953 cat >> confdefs.h <<EOF
2954#define $ac_tr_func 1
2955EOF
2956 strstr=
2957else
2958 echo "$ac_t""no" 1>&6
2959strstr=strstr.o
2960fi
2961done
2962
2963
0a4b6309 2964echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
1bf17cc4 2965echo "configure:2966: checking whether the printf functions support %p" >&5
0a4b6309
RL
2966if eval "test \"`echo '$''{'gcc_cv_func_printf_ptr'+set}'`\" = set"; then
2967 echo $ac_n "(cached) $ac_c" 1>&6
2968else
2969 if test "$cross_compiling" = yes; then
2970 gcc_cv_func_printf_ptr=no
2971else
2972 cat > conftest.$ac_ext <<EOF
1bf17cc4 2973#line 2974 "configure"
0a4b6309
RL
2974#include "confdefs.h"
2975#include <stdio.h>
2976
86cf1cbd 2977int main()
0a4b6309
RL
2978{
2979 char buf[64];
2980 char *p = buf, *q = NULL;
2981 sprintf(buf, "%p", p);
2982 sscanf(buf, "%p", &q);
86cf1cbd 2983 return (p != q);
0a4b6309
RL
2984}
2985EOF
1bf17cc4 2986if { (eval echo configure:2987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
0a4b6309
RL
2987then
2988 gcc_cv_func_printf_ptr=yes
2989else
2990 echo "configure: failed program was:" >&5
2991 cat conftest.$ac_ext >&5
2992 rm -fr conftest*
2993 gcc_cv_func_printf_ptr=no
2994fi
2995rm -fr conftest*
2996fi
2997
2998rm -f core core.* *.core
2999fi
3000
3001echo "$ac_t""$gcc_cv_func_printf_ptr" 1>&6
3002if test $gcc_cv_func_printf_ptr = yes ; then
3003 cat >> confdefs.h <<\EOF
3004#define HAVE_PRINTF_PTR 1
3005EOF
3006
3007fi
3008
b27d2bd5
MK
3009
3010case "${host}" in
3011*-*-uwin*)
34fa3e7d
MM
3012 { echo "configure: error:
3013*** UWIN may not be used as a host platform because
3014*** linking with posix.dll is not allowed by the GNU GPL" 1>&2; exit 1; }
b27d2bd5
MK
3015 ;;
3016esac
c375c43b 3017echo $ac_n "checking for pid_t""... $ac_c" 1>&6
1bf17cc4 3018echo "configure:3019: checking for pid_t" >&5
c375c43b
KG
3019if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
3020 echo $ac_n "(cached) $ac_c" 1>&6
3021else
3022 cat > conftest.$ac_ext <<EOF
1bf17cc4 3023#line 3024 "configure"
c375c43b
KG
3024#include "confdefs.h"
3025#include <sys/types.h>
3026#if STDC_HEADERS
3027#include <stdlib.h>
3028#include <stddef.h>
3029#endif
3030EOF
3031if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
b27d2bd5 3032 egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
c375c43b
KG
3033 rm -rf conftest*
3034 ac_cv_type_pid_t=yes
3035else
3036 rm -rf conftest*
3037 ac_cv_type_pid_t=no
3038fi
3039rm -f conftest*
3040
3041fi
3042echo "$ac_t""$ac_cv_type_pid_t" 1>&6
3043if test $ac_cv_type_pid_t = no; then
3044 cat >> confdefs.h <<\EOF
3045#define pid_t int
3046EOF
3047
3048fi
3049
3050ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
3051echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
1bf17cc4 3052echo "configure:3053: checking for vfork.h" >&5
c375c43b
KG
3053if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3054 echo $ac_n "(cached) $ac_c" 1>&6
3055else
3056 cat > conftest.$ac_ext <<EOF
1bf17cc4 3057#line 3058 "configure"
c375c43b
KG
3058#include "confdefs.h"
3059#include <vfork.h>
3060EOF
3061ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 3062{ (eval echo configure:3063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 3063ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
c375c43b
KG
3064if test -z "$ac_err"; then
3065 rm -rf conftest*
3066 eval "ac_cv_header_$ac_safe=yes"
3067else
3068 echo "$ac_err" >&5
3069 echo "configure: failed program was:" >&5
3070 cat conftest.$ac_ext >&5
3071 rm -rf conftest*
3072 eval "ac_cv_header_$ac_safe=no"
3073fi
3074rm -f conftest*
3075fi
3076if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3077 echo "$ac_t""yes" 1>&6
3078 cat >> confdefs.h <<\EOF
3079#define HAVE_VFORK_H 1
3080EOF
3081
3082else
3083 echo "$ac_t""no" 1>&6
3084fi
3085
3086echo $ac_n "checking for working vfork""... $ac_c" 1>&6
1bf17cc4 3087echo "configure:3088: checking for working vfork" >&5
c375c43b
KG
3088if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
3089 echo $ac_n "(cached) $ac_c" 1>&6
3090else
3091 if test "$cross_compiling" = yes; then
3092 echo $ac_n "checking for vfork""... $ac_c" 1>&6
1bf17cc4 3093echo "configure:3094: checking for vfork" >&5
c375c43b
KG
3094if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
3095 echo $ac_n "(cached) $ac_c" 1>&6
3096else
3097 cat > conftest.$ac_ext <<EOF
1bf17cc4 3098#line 3099 "configure"
c375c43b
KG
3099#include "confdefs.h"
3100/* System header to define __stub macros and hopefully few prototypes,
3101 which can conflict with char vfork(); below. */
3102#include <assert.h>
3103/* Override any gcc2 internal prototype to avoid an error. */
3104/* We use char because int might match the return type of a gcc2
3105 builtin and then its argument prototype would still apply. */
3106char vfork();
3107
3108int main() {
3109
3110/* The GNU C library defines this for functions which it implements
3111 to always fail with ENOSYS. Some functions are actually named
3112 something starting with __ and the normal name is an alias. */
3113#if defined (__stub_vfork) || defined (__stub___vfork)
3114choke me
3115#else
99b09ff3 3116vfork();
c375c43b
KG
3117#endif
3118
3119; return 0; }
3120EOF
1bf17cc4 3121if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c375c43b
KG
3122 rm -rf conftest*
3123 eval "ac_cv_func_vfork=yes"
3124else
3125 echo "configure: failed program was:" >&5
3126 cat conftest.$ac_ext >&5
3127 rm -rf conftest*
3128 eval "ac_cv_func_vfork=no"
3129fi
3130rm -f conftest*
3131fi
3132
3133if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
3134 echo "$ac_t""yes" 1>&6
3135 :
3136else
3137 echo "$ac_t""no" 1>&6
3138fi
3139
3140ac_cv_func_vfork_works=$ac_cv_func_vfork
3141else
3142 cat > conftest.$ac_ext <<EOF
1bf17cc4 3143#line 3144 "configure"
c375c43b
KG
3144#include "confdefs.h"
3145/* Thanks to Paul Eggert for this test. */
3146#include <stdio.h>
3147#include <sys/types.h>
3148#include <sys/stat.h>
3149#ifdef HAVE_UNISTD_H
3150#include <unistd.h>
3151#endif
3152#ifdef HAVE_VFORK_H
3153#include <vfork.h>
3154#endif
3155/* On some sparc systems, changes by the child to local and incoming
3156 argument registers are propagated back to the parent.
3157 The compiler is told about this with #include <vfork.h>,
3158 but some compilers (e.g. gcc -O) don't grok <vfork.h>.
3159 Test for this by using a static variable whose address
3160 is put into a register that is clobbered by the vfork. */
3161static
3162#ifdef __cplusplus
3163sparc_address_test (int arg)
3164#else
3165sparc_address_test (arg) int arg;
3166#endif
3167{
3168 static pid_t child;
3169 if (!child) {
3170 child = vfork ();
3171 if (child < 0) {
3172 perror ("vfork");
3173 _exit(2);
3174 }
3175 if (!child) {
3176 arg = getpid();
3177 write(-1, "", 0);
3178 _exit (arg);
3179 }
3180 }
3181}
3182main() {
3183 pid_t parent = getpid ();
3184 pid_t child;
3185
3186 sparc_address_test ();
3187
3188 child = vfork ();
3189
3190 if (child == 0) {
3191 /* Here is another test for sparc vfork register problems.
3192 This test uses lots of local variables, at least
3193 as many local variables as main has allocated so far
3194 including compiler temporaries. 4 locals are enough for
3195 gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
3196 A buggy compiler should reuse the register of parent
3197 for one of the local variables, since it will think that
3198 parent can't possibly be used any more in this routine.
3199 Assigning to the local variable will thus munge parent
3200 in the parent process. */
3201 pid_t
3202 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
3203 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
3204 /* Convince the compiler that p..p7 are live; otherwise, it might
3205 use the same hardware register for all 8 local variables. */
3206 if (p != p1 || p != p2 || p != p3 || p != p4
3207 || p != p5 || p != p6 || p != p7)
3208 _exit(1);
3209
3210 /* On some systems (e.g. IRIX 3.3),
3211 vfork doesn't separate parent from child file descriptors.
3212 If the child closes a descriptor before it execs or exits,
3213 this munges the parent's descriptor as well.
3214 Test for this by closing stdout in the child. */
3215 _exit(close(fileno(stdout)) != 0);
3216 } else {
3217 int status;
3218 struct stat st;
3219
3220 while (wait(&status) != child)
3221 ;
3222 exit(
3223 /* Was there some problem with vforking? */
3224 child < 0
3225
3226 /* Did the child fail? (This shouldn't happen.) */
3227 || status
3228
3229 /* Did the vfork/compiler bug occur? */
3230 || parent != getpid()
3231
3232 /* Did the file descriptor bug occur? */
3233 || fstat(fileno(stdout), &st) != 0
3234 );
3235 }
3236}
3237EOF
1bf17cc4 3238if { (eval echo configure:3239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
c375c43b
KG
3239then
3240 ac_cv_func_vfork_works=yes
3241else
3242 echo "configure: failed program was:" >&5
3243 cat conftest.$ac_ext >&5
3244 rm -fr conftest*
3245 ac_cv_func_vfork_works=no
3246fi
3247rm -fr conftest*
3248fi
3249
3250fi
3251
3252echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
3253if test $ac_cv_func_vfork_works = no; then
3254 cat >> confdefs.h <<\EOF
3255#define vfork fork
3256EOF
3257
3258fi
3259
81bf3d9e 3260for ac_func in getpagesize
0a4b6309 3261do
81bf3d9e 3262echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1bf17cc4 3263echo "configure:3264: checking for $ac_func" >&5
81bf3d9e 3264if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
0a4b6309
RL
3265 echo $ac_n "(cached) $ac_c" 1>&6
3266else
3267 cat > conftest.$ac_ext <<EOF
1bf17cc4 3268#line 3269 "configure"
0a4b6309 3269#include "confdefs.h"
81bf3d9e
RH
3270/* System header to define __stub macros and hopefully few prototypes,
3271 which can conflict with char $ac_func(); below. */
3272#include <assert.h>
3273/* Override any gcc2 internal prototype to avoid an error. */
3274/* We use char because int might match the return type of a gcc2
3275 builtin and then its argument prototype would still apply. */
3276char $ac_func();
8fa1f09f 3277
81bf3d9e
RH
3278int main() {
3279
3280/* The GNU C library defines this for functions which it implements
3281 to always fail with ENOSYS. Some functions are actually named
3282 something starting with __ and the normal name is an alias. */
3283#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3284choke me
c5c76735 3285#else
99b09ff3 3286$ac_func();
c5c76735
JL
3287#endif
3288
c5c76735
JL
3289; return 0; }
3290EOF
1bf17cc4 3291if { (eval echo configure:3292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
c5c76735 3292 rm -rf conftest*
81bf3d9e 3293 eval "ac_cv_func_$ac_func=yes"
c5c76735
JL
3294else
3295 echo "configure: failed program was:" >&5
3296 cat conftest.$ac_ext >&5
3297 rm -rf conftest*
81bf3d9e 3298 eval "ac_cv_func_$ac_func=no"
c5c76735
JL
3299fi
3300rm -f conftest*
3301fi
3302
81bf3d9e 3303if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
c5c76735 3304 echo "$ac_t""yes" 1>&6
81bf3d9e 3305 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
c5c76735 3306 cat >> confdefs.h <<EOF
81bf3d9e 3307#define $ac_tr_func 1
c5c76735 3308EOF
81bf3d9e 3309
c5c76735
JL
3310else
3311 echo "$ac_t""no" 1>&6
3312fi
c5c76735
JL
3313done
3314
825b6926
ZW
3315# The test program for the next two tests is the same except for one
3316# set of ifdefs.
3317cat >ct-mmap.inc <<'EOF'
d2cabf16 3318#include <sys/types.h>
81bf3d9e 3319#include <sys/mman.h>
825b6926
ZW
3320#include <fcntl.h>
3321#include <signal.h>
3322#include <setjmp.h>
3323#include <stdio.h>
0a4b6309 3324
4c1331d6
DA
3325#if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
3326# define MAP_ANONYMOUS MAP_ANON
3327#endif
3328
81bf3d9e
RH
3329/* This mess was copied from the GNU getpagesize.h. */
3330#ifndef HAVE_GETPAGESIZE
3331# ifdef HAVE_UNISTD_H
3332# include <unistd.h>
3333# endif
0a4b6309 3334
81bf3d9e
RH
3335/* Assume that all systems that can run configure have sys/param.h. */
3336# ifndef HAVE_SYS_PARAM_H
3337# define HAVE_SYS_PARAM_H 1
3338# endif
0a4b6309 3339
81bf3d9e
RH
3340# ifdef _SC_PAGESIZE
3341# define getpagesize() sysconf(_SC_PAGESIZE)
3342# else /* no _SC_PAGESIZE */
3343# ifdef HAVE_SYS_PARAM_H
3344# include <sys/param.h>
3345# ifdef EXEC_PAGESIZE
3346# define getpagesize() EXEC_PAGESIZE
3347# else /* no EXEC_PAGESIZE */
3348# ifdef NBPG
3349# define getpagesize() NBPG * CLSIZE
3350# ifndef CLSIZE
3351# define CLSIZE 1
3352# endif /* no CLSIZE */
3353# else /* no NBPG */
3354# ifdef NBPC
3355# define getpagesize() NBPC
3356# else /* no NBPC */
3357# ifdef PAGESIZE
3358# define getpagesize() PAGESIZE
3359# endif /* PAGESIZE */
3360# endif /* no NBPC */
3361# endif /* no NBPG */
3362# endif /* no EXEC_PAGESIZE */
3363# else /* no HAVE_SYS_PARAM_H */
3364# define getpagesize() 8192 /* punt totally */
3365# endif /* no HAVE_SYS_PARAM_H */
3366# endif /* no _SC_PAGESIZE */
0a4b6309 3367
81bf3d9e 3368#endif /* no HAVE_GETPAGESIZE */
0a4b6309 3369
825b6926
ZW
3370#ifndef MAP_FAILED
3371# define MAP_FAILED -1
4c1331d6 3372#endif
81bf3d9e 3373
825b6926
ZW
3374#undef perror_exit
3375#define perror_exit(str, val) \
3376 do { perror(str); exit(val); } while (0)
3377
3378/* Some versions of cygwin mmap require that munmap is called with the
3379 same parameters as mmap. GCC expects that this is not the case.
3380 Test for various forms of this problem. Warning - icky signal games. */
3381
3382static sigset_t unblock_sigsegv;
3383static jmp_buf r;
3384static size_t pg;
3385static int devzero;
3386
3387static char *
3388anonmap (size)
3389 size_t size;
3390{
3391#ifdef USE_MAP_ANON
3392 return (char *) mmap (0, size, PROT_READ|PROT_WRITE,
3393 MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
4c1331d6 3394#else
825b6926
ZW
3395 return (char *) mmap (0, size, PROT_READ|PROT_WRITE,
3396 MAP_PRIVATE, devzero, 0);
4c1331d6 3397#endif
825b6926
ZW
3398}
3399
3400static void
3401sigsegv (unused)
3402 int unused;
3403{
3404 sigprocmask (SIG_UNBLOCK, &unblock_sigsegv, 0);
3405 longjmp (r, 1);
3406}
3407
3408/* Basic functionality test. */
3409void
3410test_0 ()
3411{
3412 char *x = anonmap (pg);
3413 if (x == (char *) MAP_FAILED)
3414 perror_exit("test 0 mmap", 2);
81bf3d9e 3415
4acab94b 3416 *(int *)x += 1;
81bf3d9e 3417
4acab94b 3418 if (munmap(x, pg) < 0)
825b6926
ZW
3419 perror_exit("test 0 munmap", 3);
3420}
3421
3422/* 1. If we map a 2-page region and unmap its second page, the first page
3423 must remain. */
3424static void
3425test_1 ()
3426{
3427 char *x = anonmap (pg * 2);
3428 if (x == (char *)MAP_FAILED)
3429 perror_exit ("test 1 mmap", 4);
3430
3431 signal (SIGSEGV, sigsegv);
3432 if (setjmp (r))
3433 perror_exit ("test 1 fault", 5);
3434
3435 x[0] = 1;
3436 x[pg] = 1;
3437
3438 if (munmap (x + pg, pg) < 0)
3439 perror_exit ("test 1 munmap 1", 6);
3440 x[0] = 2;
3441
3442 if (setjmp (r) == 0)
3443 {
3444 x[pg] = 1;
3445 perror_exit ("test 1 no fault", 7);
3446 }
3447 if (munmap (x, pg) < 0)
3448 perror_exit ("test 1 munmap 2", 8);
3449}
3450
3451/* 2. If we map a 2-page region and unmap its first page, the second
3452 page must remain. */
3453static void
3454test_2 ()
3455{
3456 char *x = anonmap (pg * 2);
3457 if (x == (char *)MAP_FAILED)
3458 perror_exit ("test 2 mmap", 9);
3459
3460 signal (SIGSEGV, sigsegv);
3461 if (setjmp (r))
3462 perror_exit ("test 2 fault", 10);
3463
3464 x[0] = 1;
3465 x[pg] = 1;
3466
3467 if (munmap (x, pg) < 0)
3468 perror_exit ("test 2 munmap 1", 11);
3469
3470 x[pg] = 2;
3471
3472 if (setjmp (r) == 0)
3473 {
3474 x[0] = 1;
3475 perror_exit ("test 2 no fault", 12);
3476 }
3477
3478 if (munmap (x+pg, pg) < 0)
3479 perror_exit ("test 2 munmap 2", 13);
3480}
3481
3482/* 3. If we map two adjacent 1-page regions and unmap them both with
3483 one munmap, both must go away.
3484
3485 Getting two adjacent 1-page regions with two mmap calls is slightly
3486 tricky. All OS's tested skip over already-allocated blocks; therefore
3487 we have been careful to unmap all allocated regions in previous tests.
3488 HP/UX allocates pages backward in memory. No OS has yet been observed
3489 to be so perverse as to leave unmapped space between consecutive calls
3490 to mmap. */
3491
3492static void
3493test_3 ()
3494{
3495 char *x, *y, *z;
3496
3497 x = anonmap (pg);
3498 if (x == (char *)MAP_FAILED)
3499 perror_exit ("test 3 mmap 1", 14);
3500 y = anonmap (pg);
3501 if (y == (char *)MAP_FAILED)
3502 perror_exit ("test 3 mmap 2", 15);
3503
3504 if (y != x + pg)
3505 {
3506 if (y == x - pg)
3507 z = y, y = x, x = z;
3508 else
3509 {
3510 fprintf (stderr, "test 3 nonconsecutive pages - %lx, %lx\n",
3511 (unsigned long)x, (unsigned long)y);
3512 exit (16);
3513 }
3514 }
3515
3516 signal (SIGSEGV, sigsegv);
3517 if (setjmp (r))
3518 perror_exit ("test 3 fault", 17);
3519
3520 x[0] = 1;
3521 y[0] = 1;
3522
3523 if (munmap (x, pg*2) < 0)
3524 perror_exit ("test 3 munmap", 18);
3525
3526 if (setjmp (r) == 0)
3527 {
3528 x[0] = 1;
3529 perror_exit ("test 3 no fault 1", 19);
3530 }
3531
3532 signal (SIGSEGV, sigsegv);
3533 if (setjmp (r) == 0)
3534 {
3535 y[0] = 1;
3536 perror_exit ("test 3 no fault 2", 20);
3537 }
3538}
3539
3540int
3541main ()
3542{
3543 sigemptyset (&unblock_sigsegv);
3544 sigaddset (&unblock_sigsegv, SIGSEGV);
3545 pg = getpagesize ();
3546#ifndef USE_MAP_ANON
3547 devzero = open ("/dev/zero", O_RDWR);
3548 if (devzero < 0)
3549 perror_exit ("open /dev/zero", 1);
3550#endif
3551
3552 test_0();
3553 test_1();
3554 test_2();
3555 test_3();
81bf3d9e 3556
4acab94b
AO
3557 exit(0);
3558}
81bf3d9e 3559EOF
825b6926
ZW
3560
3561echo $ac_n "checking for working mmap from /dev/zero""... $ac_c" 1>&6
1bf17cc4 3562echo "configure:3563: checking for working mmap from /dev/zero" >&5
825b6926
ZW
3563if eval "test \"`echo '$''{'ac_cv_func_mmap_dev_zero'+set}'`\" = set"; then
3564 echo $ac_n "(cached) $ac_c" 1>&6
3565else
3566 if test "$cross_compiling" = yes; then
3567 # If this is not cygwin, and /dev/zero is a character device, it's probably
3568 # safe to assume it works.
3569 case "$host_os" in
3570 cygwin* | win32 | pe | mingw* ) ac_cv_func_mmap_dev_zero=buggy ;;
3571 * ) if test -c /dev/zero
3572 then ac_cv_func_mmap_dev_zero=yes
3573 else ac_cv_func_mmap_dev_zero=no
3574 fi ;;
3575 esac
3576else
3577 cat > conftest.$ac_ext <<EOF
1bf17cc4 3578#line 3579 "configure"
825b6926
ZW
3579#include "confdefs.h"
3580#include "ct-mmap.inc"
3581EOF
1bf17cc4 3582if { (eval echo configure:3583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
825b6926
ZW
3583then
3584 ac_cv_func_mmap_dev_zero=yes
3585else
3586 echo "configure: failed program was:" >&5
3587 cat conftest.$ac_ext >&5
3588 rm -fr conftest*
3589 if test $? -lt 4
3590 then ac_cv_func_mmap_dev_zero=no
3591 else ac_cv_func_mmap_dev_zero=buggy
3592 fi
3593fi
3594rm -fr conftest*
3595fi
3596
3597
3598fi
3599
3600echo "$ac_t""$ac_cv_func_mmap_dev_zero" 1>&6
3601if test $ac_cv_func_mmap_dev_zero = yes; then
3602 cat >> confdefs.h <<\EOF
3603#define HAVE_MMAP_DEV_ZERO 1
3604EOF
3605
3606fi
3607
3608echo $ac_n "checking for working mmap with MAP_ANON(YMOUS)""... $ac_c" 1>&6
1bf17cc4 3609echo "configure:3610: checking for working mmap with MAP_ANON(YMOUS)" >&5
825b6926
ZW
3610if eval "test \"`echo '$''{'ac_cv_func_mmap_anon'+set}'`\" = set"; then
3611 echo $ac_n "(cached) $ac_c" 1>&6
3612else
3613 if test "$cross_compiling" = yes; then
3614 # Unlike /dev/zero, it is not safe to assume MAP_ANON(YMOUS) works
3615 # just because it's there. Some SCO Un*xen define it but don't implement it.
3616 ac_cv_func_mmap_anon=no
3617else
3618 cat > conftest.$ac_ext <<EOF
1bf17cc4 3619#line 3620 "configure"
825b6926
ZW
3620#include "confdefs.h"
3621#define USE_MAP_ANON
3622#include "ct-mmap.inc"
3623EOF
1bf17cc4 3624if { (eval echo configure:3625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
81bf3d9e 3625then
825b6926 3626 ac_cv_func_mmap_anon=yes
81bf3d9e
RH
3627else
3628 echo "configure: failed program was:" >&5
3629 cat conftest.$ac_ext >&5
3630 rm -fr conftest*
825b6926
ZW
3631 if test $? -lt 4
3632 then ac_cv_func_mmap_anon=no
3633 else ac_cv_func_mmap_anon=buggy
3634 fi
81bf3d9e
RH
3635fi
3636rm -fr conftest*
3637fi
3638
825b6926 3639
81bf3d9e
RH
3640fi
3641
825b6926
ZW
3642echo "$ac_t""$ac_cv_func_mmap_anon" 1>&6
3643if test $ac_cv_func_mmap_anon = yes; then
81bf3d9e 3644 cat >> confdefs.h <<\EOF
825b6926 3645#define HAVE_MMAP_ANON 1
81bf3d9e
RH
3646EOF
3647
3648fi
825b6926 3649rm -f ct-mmap.inc
81bf3d9e 3650
56f02b88 3651echo $ac_n "checking for working mmap of a file""... $ac_c" 1>&6
1bf17cc4 3652echo "configure:3653: checking for working mmap of a file" >&5
56f02b88
ZW
3653if eval "test \"`echo '$''{'ac_cv_func_mmap_file'+set}'`\" = set"; then
3654 echo $ac_n "(cached) $ac_c" 1>&6
3655else
3656 # Create a file one thousand bytes long.
3657for i in 1 2 3 4 5 6 7 8 9 0
3658do for j in 1 2 3 4 5 6 7 8 9 0
3659do echo $i $j xxxxx
3660done
3661done > conftestdata$$
3662
3663if test "$cross_compiling" = yes; then
3664 ac_cv_func_mmap_file=no
3665else
3666 cat > conftest.$ac_ext <<EOF
1bf17cc4 3667#line 3668 "configure"
56f02b88
ZW
3668#include "confdefs.h"
3669
3670/* Test by Zack Weinberg. Modified from MMAP_ANYWHERE test by
3671 Richard Henderson and Alexandre Oliva.
3672 Check whether read-only mmap of a plain file works. */
3673#include <sys/types.h>
3674#include <sys/stat.h>
3675#include <fcntl.h>
3676#include <sys/mman.h>
3677
3678int main()
3679{
3680 char *x;
3681 int fd;
3682 struct stat st;
3683
3684 fd = open("conftestdata$$", O_RDONLY);
3685 if (fd < 0)
3686 exit(1);
3687
3688 if (fstat (fd, &st))
3689 exit(2);
3690
3691 x = (char*)mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
3692 if (x == (char *) -1)
3693 exit(3);
3694
3695 if (x[0] != '1' || x[1] != ' ' || x[2] != '1' || x[3] != ' ')
3696 exit(4);
3697
3698 if (munmap(x, st.st_size) < 0)
3699 exit(5);
3700
3701 exit(0);
3702}
3703EOF
1bf17cc4 3704if { (eval echo configure:3705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
56f02b88
ZW
3705then
3706 ac_cv_func_mmap_file=yes
3707else
3708 echo "configure: failed program was:" >&5
3709 cat conftest.$ac_ext >&5
3710 rm -fr conftest*
3711 ac_cv_func_mmap_file=no
3712fi
3713rm -fr conftest*
3714fi
3715
3716fi
3717
3718echo "$ac_t""$ac_cv_func_mmap_file" 1>&6
3719if test $ac_cv_func_mmap_file = yes; then
3720 cat >> confdefs.h <<\EOF
3721#define HAVE_MMAP_FILE 1
3722EOF
3723
3724fi
3725
81bf3d9e 3726
86cf1cbd
KG
3727# We will need to find libiberty.h and ansidecl.h
3728saved_CFLAGS="$CFLAGS"
3729CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
2e09e75a
JM
3730for ac_func in bcopy \
3731 getenv atol sbrk abort atof getcwd getwd \
86cf1cbd 3732 strsignal putc_unlocked fputs_unlocked strstr environ \
f31e826b 3733 malloc realloc calloc free basename getopt
81bf3d9e 3734do
f31e826b
KG
3735 ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3736echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
1bf17cc4 3737echo "configure:3738: checking whether $ac_func is declared" >&5
f31e826b 3738if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
81bf3d9e
RH
3739 echo $ac_n "(cached) $ac_c" 1>&6
3740else
3741 cat > conftest.$ac_ext <<EOF
1bf17cc4 3742#line 3743 "configure"
81bf3d9e 3743#include "confdefs.h"
7afe8c41
KG
3744#undef $ac_tr_decl
3745#define $ac_tr_decl 1
3746
86cf1cbd
KG
3747#include "gansidecl.h"
3748#include "system.h"
f31e826b 3749
81bf3d9e 3750int main() {
86cf1cbd
KG
3751#ifndef $ac_func
3752char *(*pfn) = (char *(*)) $ac_func ;
3753#endif
81bf3d9e
RH
3754; return 0; }
3755EOF
1bf17cc4 3756if { (eval echo configure:3757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
81bf3d9e 3757 rm -rf conftest*
f31e826b 3758 eval "gcc_cv_have_decl_$ac_func=yes"
81bf3d9e
RH
3759else
3760 echo "configure: failed program was:" >&5
3761 cat conftest.$ac_ext >&5
3762 rm -rf conftest*
f31e826b 3763 eval "gcc_cv_have_decl_$ac_func=no"
81bf3d9e
RH
3764fi
3765rm -f conftest*
3766fi
3767
f31e826b
KG
3768if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
3769 echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
86cf1cbd 3770#define $ac_tr_decl 1
81bf3d9e 3771EOF
86cf1cbd 3772
81bf3d9e 3773else
f31e826b
KG
3774 echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
3775#define $ac_tr_decl 0
3776EOF
3777
81bf3d9e
RH
3778fi
3779
3780done
86cf1cbd 3781if test x = y ; then
81bf3d9e 3782 cat >> confdefs.h <<EOF
f31e826b 3783#define HAVE_DECL_BCOPY 1
86cf1cbd
KG
3784EOF
3785 \
3786 cat >> confdefs.h <<EOF
f31e826b 3787#define HAVE_DECL_GETENV 1
86cf1cbd
KG
3788EOF
3789 cat >> confdefs.h <<EOF
f31e826b 3790#define HAVE_DECL_ATOL 1
86cf1cbd
KG
3791EOF
3792 cat >> confdefs.h <<EOF
f31e826b 3793#define HAVE_DECL_SBRK 1
86cf1cbd
KG
3794EOF
3795 cat >> confdefs.h <<EOF
f31e826b 3796#define HAVE_DECL_ABORT 1
86cf1cbd
KG
3797EOF
3798 cat >> confdefs.h <<EOF
f31e826b 3799#define HAVE_DECL_ATOF 1
86cf1cbd
KG
3800EOF
3801 cat >> confdefs.h <<EOF
f31e826b 3802#define HAVE_DECL_GETCWD 1
86cf1cbd
KG
3803EOF
3804 cat >> confdefs.h <<EOF
f31e826b 3805#define HAVE_DECL_GETWD 1
86cf1cbd
KG
3806EOF
3807 \
3808 cat >> confdefs.h <<EOF
f31e826b 3809#define HAVE_DECL_STRSIGNAL 1
86cf1cbd
KG
3810EOF
3811 cat >> confdefs.h <<EOF
f31e826b 3812#define HAVE_DECL_PUTC_UNLOCKED 1
86cf1cbd
KG
3813EOF
3814 cat >> confdefs.h <<EOF
f31e826b 3815#define HAVE_DECL_FPUTS_UNLOCKED 1
86cf1cbd
KG
3816EOF
3817 cat >> confdefs.h <<EOF
f31e826b 3818#define HAVE_DECL_STRSTR 1
86cf1cbd
KG
3819EOF
3820 cat >> confdefs.h <<EOF
f31e826b 3821#define HAVE_DECL_ENVIRON 1
86cf1cbd
KG
3822EOF
3823 \
3824 cat >> confdefs.h <<EOF
f31e826b
KG
3825#define HAVE_DECL_MALLOC 1
3826EOF
3827 cat >> confdefs.h <<EOF
3828#define HAVE_DECL_REALLOC 1
86cf1cbd
KG
3829EOF
3830 cat >> confdefs.h <<EOF
f31e826b 3831#define HAVE_DECL_CALLOC 1
86cf1cbd
KG
3832EOF
3833 cat >> confdefs.h <<EOF
f31e826b 3834#define HAVE_DECL_FREE 1
86cf1cbd
KG
3835EOF
3836 cat >> confdefs.h <<EOF
f31e826b
KG
3837#define HAVE_DECL_BASENAME 1
3838EOF
3839 cat >> confdefs.h <<EOF
3840#define HAVE_DECL_GETOPT 1
81bf3d9e 3841EOF
81bf3d9e
RH
3842fi
3843
81bf3d9e
RH
3844
3845for ac_func in getrlimit setrlimit getrusage
3846do
f31e826b
KG
3847 ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3848echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
1bf17cc4 3849echo "configure:3850: checking whether $ac_func is declared" >&5
f31e826b 3850if eval "test \"`echo '$''{'gcc_cv_have_decl_$ac_func'+set}'`\" = set"; then
81bf3d9e
RH
3851 echo $ac_n "(cached) $ac_c" 1>&6
3852else
3853 cat > conftest.$ac_ext <<EOF
1bf17cc4 3854#line 3855 "configure"
81bf3d9e 3855#include "confdefs.h"
7afe8c41
KG
3856#undef $ac_tr_decl
3857#define $ac_tr_decl 1
3858
86cf1cbd
KG
3859#include "gansidecl.h"
3860#include "system.h"
81bf3d9e
RH
3861#ifdef HAVE_SYS_RESOURCE_H
3862#include <sys/resource.h>
3863#endif
3864
f31e826b 3865
81bf3d9e 3866int main() {
86cf1cbd
KG
3867#ifndef $ac_func
3868char *(*pfn) = (char *(*)) $ac_func ;
3869#endif
81bf3d9e
RH
3870; return 0; }
3871EOF
1bf17cc4 3872if { (eval echo configure:3873: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
81bf3d9e 3873 rm -rf conftest*
f31e826b 3874 eval "gcc_cv_have_decl_$ac_func=yes"
81bf3d9e
RH
3875else
3876 echo "configure: failed program was:" >&5
3877 cat conftest.$ac_ext >&5
3878 rm -rf conftest*
f31e826b 3879 eval "gcc_cv_have_decl_$ac_func=no"
81bf3d9e
RH
3880fi
3881rm -f conftest*
3882fi
3883
f31e826b
KG
3884if eval "test \"`echo '$gcc_cv_have_decl_'$ac_func`\" = yes"; then
3885 echo "$ac_t""yes" 1>&6 ; cat >> confdefs.h <<EOF
86cf1cbd 3886#define $ac_tr_decl 1
81bf3d9e 3887EOF
86cf1cbd 3888
81bf3d9e 3889else
f31e826b
KG
3890 echo "$ac_t""no" 1>&6 ; cat >> confdefs.h <<EOF
3891#define $ac_tr_decl 0
3892EOF
3893
81bf3d9e
RH
3894fi
3895
3896done
86cf1cbd
KG
3897if test x = y ; then
3898 cat >> confdefs.h <<EOF
f31e826b 3899#define HAVE_DECL_GETRLIMIT 1
86cf1cbd
KG
3900EOF
3901 cat >> confdefs.h <<EOF
f31e826b 3902#define HAVE_DECL_SETRLIMIT 1
86cf1cbd
KG
3903EOF
3904 cat >> confdefs.h <<EOF
f31e826b 3905#define HAVE_DECL_GETRUSAGE 1
86cf1cbd
KG
3906EOF
3907fi
3908
81bf3d9e 3909
86cf1cbd
KG
3910# Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
3911CFLAGS="$saved_CFLAGS"
81bf3d9e 3912
75923b2f
MK
3913# mkdir takes a single argument on some systems.
3914echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
1bf17cc4 3915echo "configure:3916: checking if mkdir takes one argument" >&5
75923b2f
MK
3916if eval "test \"`echo '$''{'gcc_cv_mkdir_takes_one_arg'+set}'`\" = set"; then
3917 echo $ac_n "(cached) $ac_c" 1>&6
3918else
3919 cat > conftest.$ac_ext <<EOF
1bf17cc4 3920#line 3921 "configure"
75923b2f
MK
3921#include "confdefs.h"
3922
3923#include <sys/types.h>
3924#ifdef HAVE_SYS_STAT_H
3925# include <sys/stat.h>
3926#endif
3927#ifdef HAVE_UNISTD_H
3928# include <unistd.h>
3929#endif
3930#ifdef HAVE_DIRECT_H
3931# include <direct.h>
3932#endif
3933int main() {
3934mkdir ("foo", 0);
3935; return 0; }
3936EOF
1bf17cc4 3937if { (eval echo configure:3938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
75923b2f
MK
3938 rm -rf conftest*
3939 gcc_cv_mkdir_takes_one_arg=no
3940else
3941 echo "configure: failed program was:" >&5
3942 cat conftest.$ac_ext >&5
3943 rm -rf conftest*
3944 gcc_cv_mkdir_takes_one_arg=yes
3945fi
3946rm -f conftest*
3947fi
3948
3949echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6
3950if test $gcc_cv_mkdir_takes_one_arg = yes ; then
3951 cat >> confdefs.h <<\EOF
3952#define MKDIR_TAKES_ONE_ARG 1
3953EOF
3954
3955fi
3956
3957
861bb6c1
JL
3958# File extensions
3959manext='.1'
3960objext='.o'
3961
3962
3963
3964build_xm_file=
f6cb0e63 3965build_xm_defines=
861bb6c1
JL
3966build_install_headers_dir=install-headers-tar
3967build_exeext=
3968host_xm_file=
f6cb0e63 3969host_xm_defines=
861bb6c1
JL
3970host_xmake_file=
3971host_truncate_target=
6e26218f 3972host_exeext=
861bb6c1
JL
3973
3974# Decode the host machine, then the target machine.
3975# For the host machine, we save the xm_file variable as host_xm_file;
3976# then we decode the target machine and forget everything else
3977# that came from the host machine.
3978for machine in $build $host $target; do
61ed06c3 3979 . ${srcdir}/config.gcc
861bb6c1
JL
3980done
3981
3982extra_objs="${host_extra_objs} ${extra_objs}"
3983
3984# Default the target-machine variables that were not explicitly set.
75bffa71 3985if test x"$tm_file" = x
861bb6c1
JL
3986then tm_file=$cpu_type/$cpu_type.h; fi
3987
6b2adea9 3988if test x"$extra_headers" = x
861bb6c1
JL
3989then extra_headers=; fi
3990
75bffa71 3991if test x"$xm_file" = x
861bb6c1
JL
3992then xm_file=$cpu_type/xm-$cpu_type.h; fi
3993
75bffa71 3994if test x$md_file = x
e98e406f 3995then md_file=$cpu_type/$cpu_type.md; fi
861bb6c1 3996
75bffa71 3997if test x$out_file = x
861bb6c1
JL
3998then out_file=$cpu_type/$cpu_type.c; fi
3999
75bffa71 4000if test x"$tmake_file" = x
861bb6c1
JL
4001then tmake_file=$cpu_type/t-$cpu_type
4002fi
4003
90e6a802 4004if test x"$dwarf2" = xyes
756ee602 4005then tm_file="$tm_file tm-dwarf2.h"
90e6a802
RL
4006fi
4007
75bffa71 4008if test x$float_format = x
861bb6c1
JL
4009then float_format=i64
4010fi
4011
027ea2a7
JW
4012if test $float_format = none
4013then float_h_file=Makefile.in
4014else float_h_file=float-$float_format.h
4015fi
4016
9fc9b82a 4017# Handle cpp installation.
3ecc3258 4018if test x$enable_cpp != xno
9fc9b82a
L
4019then
4020 tmake_file="$tmake_file t-install-cpp"
4021fi
4022
861bb6c1 4023# Say what files are being used for the output code and MD file.
11642c3a 4024echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
861bb6c1
JL
4025echo "Using \`$srcdir/config/$md_file' as machine description file."
4026
11642c3a
ZW
4027# If any of the xm_file variables contain nonexistent files, warn
4028# about them and drop them. But $cpu/xm-$cpu.h is allowed not to
4029# exist, if we have nothing for it to do.
4030
4031bx=
4032for x in $build_xm_file; do
4033 if test -f $srcdir/config/$x
4034 then bx="$bx $x"
4035 elif echo $x | grep '\(a-z0-9a-z0-9*\)/xm-\1\.h' >/dev/null
4036 then :
4037 else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
4038 fi
4039done
4040build_xm_file="$bx"
4041
4042hx=
4043for x in $host_xm_file; do
4044 if test -f $srcdir/config/$x
4045 then hx="$hx $x"
4046 elif echo $x | grep '\(a-z0-9a-z0-9*\)/xm-\1\.h' >/dev/null
4047 then :
4048 else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
4049 fi
4050done
4051host_xm_file="$hx"
4052
4053tx=
4054for x in $xm_file; do
4055 if test -f $srcdir/config/$x
4056 then tx="$tx $x"
4057 elif echo $x | grep '\(a-z0-9a-z0-9*\)/xm-\1\.h' >/dev/null
4058 then :
4059 else echo "configure: warning: $srcdir/config/$x does not exist." 1>&2
4060 fi
4061done
4062xm_file="$tx"
4063
861bb6c1
JL
4064count=a
4065for f in $tm_file; do
4066 count=${count}x
4067done
75bffa71 4068if test $count = ax; then
861bb6c1
JL
4069 echo "Using \`$srcdir/config/$tm_file' as target machine macro file."
4070else
4071 echo "Using the following target machine macro files:"
4072 for f in $tm_file; do
4073 echo " $srcdir/config/$f"
4074 done
4075fi
4076
4077count=a
4078for f in $host_xm_file; do
4079 count=${count}x
4080done
11642c3a
ZW
4081if test $count = a; then
4082 :
4083elif test $count = ax; then
861bb6c1
JL
4084 echo "Using \`$srcdir/config/$host_xm_file' as host machine macro file."
4085else
4086 echo "Using the following host machine macro files:"
4087 for f in $host_xm_file; do
4088 echo " $srcdir/config/$f"
4089 done
4090fi
4091
75bffa71 4092if test "$host_xm_file" != "$build_xm_file"; then
861bb6c1
JL
4093 count=a
4094 for f in $build_xm_file; do
4095 count=${count}x
4096 done
11642c3a
ZW
4097 if test $count = a; then
4098 :
4099 elif test $count = ax; then
861bb6c1
JL
4100 echo "Using \`$srcdir/config/$build_xm_file' as build machine macro file."
4101 else
4102 echo "Using the following build machine macro files:"
4103 for f in $build_xm_file; do
4104 echo " $srcdir/config/$f"
4105 done
4106 fi
4107fi
4108
75bffa71
ILT
4109if test x$thread_file = x; then
4110 if test x$target_thread_file != x; then
a851212a
JW
4111 thread_file=$target_thread_file
4112 else
4113 thread_file='single'
4114 fi
861bb6c1
JL
4115fi
4116
b7cb92ad 4117# auto-host.h is the file containing items generated by autoconf and is
e9a25f70 4118# the first file included by config.h.
b7cb92ad 4119# If host=build, it is correct to have hconfig include auto-host.h
db81d74a
RH
4120# as well. If host!=build, we are in error and need to do more
4121# work to find out the build config parameters.
75bffa71 4122if test x$host = x$build
db81d74a 4123then
eaf4e618 4124 build_auto=auto-host.h
b7cb92ad
JL
4125else
4126 # We create a subdir, then run autoconf in the subdir.
4127 # To prevent recursion we set host and build for the new
4128 # invocation of configure to the build for this invocation
4129 # of configure.
4130 tempdir=build.$$
4131 rm -rf $tempdir
4132 mkdir $tempdir
4133 cd $tempdir
4134 case ${srcdir} in
255b8a49 4135 /* | A-Za-z:\\/* ) realsrcdir=${srcdir};;
b7cb92ad
JL
4136 *) realsrcdir=../${srcdir};;
4137 esac
fe81dd69 4138 CC=${CC_FOR_BUILD} ${realsrcdir}/configure \
b7cb92ad
JL
4139 --target=$target --host=$build --build=$build
4140
4141 # We just finished tests for the build machine, so rename
4142 # the file auto-build.h in the gcc directory.
4143 mv auto-host.h ../auto-build.h
4144 cd ..
4145 rm -rf $tempdir
eaf4e618 4146 build_auto=auto-build.h
db81d74a
RH
4147fi
4148
eaf4e618
ZW
4149tm_file="${tm_file} defaults.h"
4150host_xm_file="auto-host.h gansidecl.h ${host_xm_file} ${tm_file} hwint.h"
4151build_xm_file="${build_auto} gansidecl.h ${build_xm_file} ${tm_file} hwint.h"
4152xm_file="gansidecl.h ${xm_file} ${tm_file}"
0056a9b5 4153
861bb6c1 4154# Truncate the target if necessary
75bffa71 4155if test x$host_truncate_target != x; then
861bb6c1
JL
4156 target=`echo $target | sed -e 's/\(..............\).*/\1/'`
4157fi
4158
f1943b77 4159# Get the version trigger filename from the toplevel
75bffa71 4160if test "${with_gcc_version_trigger+set}" = set; then
f1943b77
MH
4161 gcc_version_trigger=$with_gcc_version_trigger
4162else
4163 gcc_version_trigger=${srcdir}/version.c
4164fi
8763704d
JM
4165gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
4166gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
861bb6c1 4167
cc1e60ea 4168# Compile in configure arguments.
8105825d 4169if test -f configargs.h ; then
cc1e60ea
JM
4170 # Being re-configured.
4171 gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
4172 gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
4173else
4174 gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
4175fi
4176cat > configargs.h <<EOF
4177/* Generated automatically. */
4178static const char configuration_arguments[] = "$gcc_config_arguments";
4179EOF
4180
ab87f8c8
JL
4181# Internationalization
4182PACKAGE=gcc
4183VERSION="$gcc_version"
4184cat >> confdefs.h <<EOF
4185#define PACKAGE "$PACKAGE"
4186EOF
861bb6c1 4187
ab87f8c8
JL
4188cat >> confdefs.h <<EOF
4189#define VERSION "$VERSION"
4190EOF
861bb6c1 4191
861bb6c1 4192
ab87f8c8
JL
4193
4194
2be36552 4195ALL_LINGUAS="sv"
ab87f8c8 4196
dc6746e7 4197# Enable NLS support by default
ab87f8c8
JL
4198# Check whether --enable-nls or --disable-nls was given.
4199if test "${enable_nls+set}" = set; then
4200 enableval="$enable_nls"
4201 :
861bb6c1 4202else
dc6746e7 4203 enable_nls=yes
861bb6c1 4204fi
861bb6c1 4205
861bb6c1 4206
dc6746e7
PT
4207# if cross compiling, disable NLS support.
4208# It's not worth the trouble, at least for now.
4209
063a4b85 4210if test "${build}" != "${host}" && test "x$enable_nls" = "xyes"; then
dc6746e7
PT
4211 echo "configure: warning: Disabling NLS support for canadian cross compiler." 1>&2
4212 enable_nls=no
4213fi
4214
4adee315
PT
4215# if NLS is enabled, also enable check in po subdir
4216if test $enable_nls = yes; then
4217 CHECK_PO=check-po
4218else
4219 CHECK_PO=""
4220fi
4221
4222
4223
861bb6c1 4224
ab87f8c8 4225 echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
1bf17cc4 4226echo "configure:4227: checking for strerror in -lcposix" >&5
ab87f8c8
JL
4227ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
4228if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4229 echo $ac_n "(cached) $ac_c" 1>&6
4230else
4231 ac_save_LIBS="$LIBS"
4232LIBS="-lcposix $LIBS"
4233cat > conftest.$ac_ext <<EOF
1bf17cc4 4234#line 4235 "configure"
ab87f8c8
JL
4235#include "confdefs.h"
4236/* Override any gcc2 internal prototype to avoid an error. */
4237/* We use char because int might match the return type of a gcc2
4238 builtin and then its argument prototype would still apply. */
4239char strerror();
861bb6c1 4240
ab87f8c8
JL
4241int main() {
4242strerror()
4243; return 0; }
4244EOF
1bf17cc4 4245if { (eval echo configure:4246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
4246 rm -rf conftest*
4247 eval "ac_cv_lib_$ac_lib_var=yes"
4248else
4249 echo "configure: failed program was:" >&5
4250 cat conftest.$ac_ext >&5
4251 rm -rf conftest*
4252 eval "ac_cv_lib_$ac_lib_var=no"
861bb6c1 4253fi
ab87f8c8
JL
4254rm -f conftest*
4255LIBS="$ac_save_LIBS"
861bb6c1 4256
861bb6c1 4257fi
ab87f8c8
JL
4258if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4259 echo "$ac_t""yes" 1>&6
4260 LIBS="$LIBS -lcposix"
861bb6c1 4261else
ab87f8c8 4262 echo "$ac_t""no" 1>&6
861bb6c1
JL
4263fi
4264
ab87f8c8 4265
2ce3c6c6 4266
ab87f8c8 4267echo $ac_n "checking for working const""... $ac_c" 1>&6
1bf17cc4 4268echo "configure:4269: checking for working const" >&5
ab87f8c8
JL
4269if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
4270 echo $ac_n "(cached) $ac_c" 1>&6
861bb6c1 4271else
ab87f8c8 4272 cat > conftest.$ac_ext <<EOF
1bf17cc4 4273#line 4274 "configure"
ab87f8c8 4274#include "confdefs.h"
861bb6c1 4275
ab87f8c8
JL
4276int main() {
4277
4278/* Ultrix mips cc rejects this. */
130fadbb 4279typedef int charset[2]; const charset x;
ab87f8c8
JL
4280/* SunOS 4.1.1 cc rejects this. */
4281char const *const *ccp;
4282char **p;
4283/* NEC SVR4.0.2 mips cc rejects this. */
4284struct point {int x, y;};
4285static struct point const zero = {0,0};
4286/* AIX XL C 1.02.0.0 rejects this.
4287 It does not let you subtract one const X* pointer from another in an arm
4288 of an if-expression whose if-part is not a constant expression */
4289const char *g = "string";
4290ccp = &g + (g ? g-g : 0);
4291/* HPUX 7.0 cc rejects these. */
4292++ccp;
4293p = (char**) ccp;
4294ccp = (char const *const *) p;
4295{ /* SCO 3.2v4 cc rejects this. */
4296 char *t;
4297 char const *s = 0 ? (char *) 0 : (char const *) 0;
4298
4299 *t++ = 0;
4300}
4301{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
4302 int x[] = {25, 17};
4303 const int *foo = &x[0];
4304 ++foo;
4305}
4306{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4307 typedef const int *iptr;
4308 iptr p = 0;
4309 ++p;
4310}
4311{ /* AIX XL C 1.02.0.0 rejects this saying
4312 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4313 struct s { int j; const int *ap[3]; };
4314 struct s *b; b->j = 5;
4315}
4316{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4317 const int foo = 10;
4318}
4319
4320; return 0; }
4321EOF
1bf17cc4 4322if { (eval echo configure:4323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
ab87f8c8
JL
4323 rm -rf conftest*
4324 ac_cv_c_const=yes
861bb6c1 4325else
ab87f8c8
JL
4326 echo "configure: failed program was:" >&5
4327 cat conftest.$ac_ext >&5
4328 rm -rf conftest*
4329 ac_cv_c_const=no
4330fi
4331rm -f conftest*
861bb6c1
JL
4332fi
4333
ab87f8c8
JL
4334echo "$ac_t""$ac_cv_c_const" 1>&6
4335if test $ac_cv_c_const = no; then
4336 cat >> confdefs.h <<\EOF
4337#define const
4338EOF
4339
861bb6c1
JL
4340fi
4341
ab87f8c8 4342echo $ac_n "checking for off_t""... $ac_c" 1>&6
1bf17cc4 4343echo "configure:4344: checking for off_t" >&5
ab87f8c8
JL
4344if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
4345 echo $ac_n "(cached) $ac_c" 1>&6
4346else
4347 cat > conftest.$ac_ext <<EOF
1bf17cc4 4348#line 4349 "configure"
ab87f8c8
JL
4349#include "confdefs.h"
4350#include <sys/types.h>
4351#if STDC_HEADERS
4352#include <stdlib.h>
4353#include <stddef.h>
4354#endif
4355EOF
4356if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
b27d2bd5 4357 egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
ab87f8c8
JL
4358 rm -rf conftest*
4359 ac_cv_type_off_t=yes
4360else
4361 rm -rf conftest*
4362 ac_cv_type_off_t=no
4363fi
4364rm -f conftest*
4365
4366fi
4367echo "$ac_t""$ac_cv_type_off_t" 1>&6
4368if test $ac_cv_type_off_t = no; then
4369 cat >> confdefs.h <<\EOF
4370#define off_t long
4371EOF
4372
4373fi
4374
4375echo $ac_n "checking for size_t""... $ac_c" 1>&6
1bf17cc4 4376echo "configure:4377: checking for size_t" >&5
ab87f8c8
JL
4377if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
4378 echo $ac_n "(cached) $ac_c" 1>&6
4379else
4380 cat > conftest.$ac_ext <<EOF
1bf17cc4 4381#line 4382 "configure"
ab87f8c8
JL
4382#include "confdefs.h"
4383#include <sys/types.h>
4384#if STDC_HEADERS
4385#include <stdlib.h>
4386#include <stddef.h>
4387#endif
4388EOF
4389if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
b27d2bd5 4390 egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
ab87f8c8
JL
4391 rm -rf conftest*
4392 ac_cv_type_size_t=yes
4393else
4394 rm -rf conftest*
4395 ac_cv_type_size_t=no
4396fi
4397rm -f conftest*
4398
4399fi
4400echo "$ac_t""$ac_cv_type_size_t" 1>&6
4401if test $ac_cv_type_size_t = no; then
4402 cat >> confdefs.h <<\EOF
4403#define size_t unsigned
4404EOF
4405
4406fi
4407
b548dffb 4408
ab87f8c8
JL
4409 for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
4410unistd.h sys/param.h
4411do
4412ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4413echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1bf17cc4 4414echo "configure:4415: checking for $ac_hdr" >&5
ab87f8c8
JL
4415if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4416 echo $ac_n "(cached) $ac_c" 1>&6
4417else
4418 cat > conftest.$ac_ext <<EOF
1bf17cc4 4419#line 4420 "configure"
ab87f8c8
JL
4420#include "confdefs.h"
4421#include <$ac_hdr>
4422EOF
4423ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 4424{ (eval echo configure:4425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 4425ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ab87f8c8
JL
4426if test -z "$ac_err"; then
4427 rm -rf conftest*
4428 eval "ac_cv_header_$ac_safe=yes"
4429else
4430 echo "$ac_err" >&5
4431 echo "configure: failed program was:" >&5
4432 cat conftest.$ac_ext >&5
4433 rm -rf conftest*
4434 eval "ac_cv_header_$ac_safe=no"
4435fi
4436rm -f conftest*
4437fi
4438if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4439 echo "$ac_t""yes" 1>&6
4440 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4441 cat >> confdefs.h <<EOF
4442#define $ac_tr_hdr 1
4443EOF
4444
4445else
4446 echo "$ac_t""no" 1>&6
4447fi
4448done
4449
4450 for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \
4451strdup __argz_count __argz_stringify __argz_next
4452do
4453echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1bf17cc4 4454echo "configure:4455: checking for $ac_func" >&5
ab87f8c8
JL
4455if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4456 echo $ac_n "(cached) $ac_c" 1>&6
4457else
4458 cat > conftest.$ac_ext <<EOF
1bf17cc4 4459#line 4460 "configure"
ab87f8c8
JL
4460#include "confdefs.h"
4461/* System header to define __stub macros and hopefully few prototypes,
4462 which can conflict with char $ac_func(); below. */
4463#include <assert.h>
4464/* Override any gcc2 internal prototype to avoid an error. */
4465/* We use char because int might match the return type of a gcc2
4466 builtin and then its argument prototype would still apply. */
4467char $ac_func();
4468
4469int main() {
4470
4471/* The GNU C library defines this for functions which it implements
4472 to always fail with ENOSYS. Some functions are actually named
4473 something starting with __ and the normal name is an alias. */
4474#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4475choke me
4476#else
99b09ff3 4477$ac_func();
ab87f8c8
JL
4478#endif
4479
4480; return 0; }
4481EOF
1bf17cc4 4482if { (eval echo configure:4483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
4483 rm -rf conftest*
4484 eval "ac_cv_func_$ac_func=yes"
4485else
4486 echo "configure: failed program was:" >&5
4487 cat conftest.$ac_ext >&5
4488 rm -rf conftest*
4489 eval "ac_cv_func_$ac_func=no"
4490fi
4491rm -f conftest*
4492fi
4493
4494if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4495 echo "$ac_t""yes" 1>&6
4496 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4497 cat >> confdefs.h <<EOF
4498#define $ac_tr_func 1
4499EOF
4500
4501else
4502 echo "$ac_t""no" 1>&6
4503fi
4504done
4505
4506
4507 if test "${ac_cv_func_stpcpy+set}" != "set"; then
4508 for ac_func in stpcpy
4509do
4510echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1bf17cc4 4511echo "configure:4512: checking for $ac_func" >&5
ab87f8c8
JL
4512if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4513 echo $ac_n "(cached) $ac_c" 1>&6
4514else
4515 cat > conftest.$ac_ext <<EOF
1bf17cc4 4516#line 4517 "configure"
ab87f8c8
JL
4517#include "confdefs.h"
4518/* System header to define __stub macros and hopefully few prototypes,
4519 which can conflict with char $ac_func(); below. */
4520#include <assert.h>
4521/* Override any gcc2 internal prototype to avoid an error. */
4522/* We use char because int might match the return type of a gcc2
4523 builtin and then its argument prototype would still apply. */
4524char $ac_func();
4525
4526int main() {
4527
4528/* The GNU C library defines this for functions which it implements
4529 to always fail with ENOSYS. Some functions are actually named
4530 something starting with __ and the normal name is an alias. */
4531#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4532choke me
4533#else
99b09ff3 4534$ac_func();
ab87f8c8
JL
4535#endif
4536
4537; return 0; }
4538EOF
1bf17cc4 4539if { (eval echo configure:4540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
4540 rm -rf conftest*
4541 eval "ac_cv_func_$ac_func=yes"
4542else
4543 echo "configure: failed program was:" >&5
4544 cat conftest.$ac_ext >&5
4545 rm -rf conftest*
4546 eval "ac_cv_func_$ac_func=no"
4547fi
4548rm -f conftest*
4549fi
4550
4551if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4552 echo "$ac_t""yes" 1>&6
4553 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4554 cat >> confdefs.h <<EOF
4555#define $ac_tr_func 1
4556EOF
4557
4558else
4559 echo "$ac_t""no" 1>&6
4560fi
4561done
4562
4563 fi
4564 if test "${ac_cv_func_stpcpy}" = "yes"; then
4565 cat >> confdefs.h <<\EOF
4566#define HAVE_STPCPY 1
4567EOF
4568
4569 fi
4570
4571 if test $ac_cv_header_locale_h = yes; then
4572 echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
1bf17cc4 4573echo "configure:4574: checking for LC_MESSAGES" >&5
ab87f8c8
JL
4574if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
4575 echo $ac_n "(cached) $ac_c" 1>&6
4576else
4577 cat > conftest.$ac_ext <<EOF
1bf17cc4 4578#line 4579 "configure"
ab87f8c8
JL
4579#include "confdefs.h"
4580#include <locale.h>
4581int main() {
4582return LC_MESSAGES
4583; return 0; }
4584EOF
1bf17cc4 4585if { (eval echo configure:4586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
4586 rm -rf conftest*
4587 am_cv_val_LC_MESSAGES=yes
4588else
4589 echo "configure: failed program was:" >&5
4590 cat conftest.$ac_ext >&5
4591 rm -rf conftest*
4592 am_cv_val_LC_MESSAGES=no
4593fi
4594rm -f conftest*
4595fi
4596
4597echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6
4598 if test $am_cv_val_LC_MESSAGES = yes; then
4599 cat >> confdefs.h <<\EOF
4600#define HAVE_LC_MESSAGES 1
4601EOF
4602
4603 fi
4604 fi
4605 echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
1bf17cc4 4606echo "configure:4607: checking whether NLS is requested" >&5
ab87f8c8
JL
4607 # Check whether --enable-nls or --disable-nls was given.
4608if test "${enable_nls+set}" = set; then
4609 enableval="$enable_nls"
4610 USE_NLS=$enableval
4611else
4612 USE_NLS=yes
4613fi
4614
4615 echo "$ac_t""$USE_NLS" 1>&6
4616
4617
4618 USE_INCLUDED_LIBINTL=no
4619
4620 if test "$USE_NLS" = "yes"; then
4621 cat >> confdefs.h <<\EOF
4622#define ENABLE_NLS 1
4623EOF
4624
4625 echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
1bf17cc4 4626echo "configure:4627: checking whether included gettext is requested" >&5
ab87f8c8
JL
4627 # Check whether --with-included-gettext or --without-included-gettext was given.
4628if test "${with_included_gettext+set}" = set; then
4629 withval="$with_included_gettext"
4630 nls_cv_force_use_gnu_gettext=$withval
4631else
bfa29b63 4632 nls_cv_force_use_gnu_gettext=no
ab87f8c8
JL
4633fi
4634
4635 echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6
4636
4637 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
4638 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
4639 nls_cv_header_intl=
4640 nls_cv_header_libgt=
4641 CATOBJEXT=NONE
4642
4643 ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
4644echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
1bf17cc4 4645echo "configure:4646: checking for libintl.h" >&5
ab87f8c8
JL
4646if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4647 echo $ac_n "(cached) $ac_c" 1>&6
4648else
4649 cat > conftest.$ac_ext <<EOF
1bf17cc4 4650#line 4651 "configure"
ab87f8c8
JL
4651#include "confdefs.h"
4652#include <libintl.h>
4653EOF
4654ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 4655{ (eval echo configure:4656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 4656ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ab87f8c8
JL
4657if test -z "$ac_err"; then
4658 rm -rf conftest*
4659 eval "ac_cv_header_$ac_safe=yes"
4660else
4661 echo "$ac_err" >&5
4662 echo "configure: failed program was:" >&5
4663 cat conftest.$ac_ext >&5
4664 rm -rf conftest*
4665 eval "ac_cv_header_$ac_safe=no"
4666fi
4667rm -f conftest*
4668fi
4669if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4670 echo "$ac_t""yes" 1>&6
4671 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
1bf17cc4 4672echo "configure:4673: checking for gettext in libc" >&5
ab87f8c8
JL
4673if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
4674 echo $ac_n "(cached) $ac_c" 1>&6
4675else
4676 cat > conftest.$ac_ext <<EOF
1bf17cc4 4677#line 4678 "configure"
ab87f8c8
JL
4678#include "confdefs.h"
4679#include <libintl.h>
4680int main() {
4681return (int) gettext ("")
4682; return 0; }
4683EOF
1bf17cc4 4684if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
4685 rm -rf conftest*
4686 gt_cv_func_gettext_libc=yes
4687else
4688 echo "configure: failed program was:" >&5
4689 cat conftest.$ac_ext >&5
4690 rm -rf conftest*
4691 gt_cv_func_gettext_libc=no
4692fi
4693rm -f conftest*
4694fi
4695
4696echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
4697
4698 if test "$gt_cv_func_gettext_libc" != "yes"; then
4699 echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
1bf17cc4 4700echo "configure:4701: checking for bindtextdomain in -lintl" >&5
ab87f8c8
JL
4701ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
4702if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4703 echo $ac_n "(cached) $ac_c" 1>&6
4704else
4705 ac_save_LIBS="$LIBS"
4706LIBS="-lintl $LIBS"
4707cat > conftest.$ac_ext <<EOF
1bf17cc4 4708#line 4709 "configure"
ab87f8c8
JL
4709#include "confdefs.h"
4710/* Override any gcc2 internal prototype to avoid an error. */
4711/* We use char because int might match the return type of a gcc2
4712 builtin and then its argument prototype would still apply. */
4713char bindtextdomain();
4714
4715int main() {
4716bindtextdomain()
4717; return 0; }
4718EOF
1bf17cc4 4719if { (eval echo configure:4720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
4720 rm -rf conftest*
4721 eval "ac_cv_lib_$ac_lib_var=yes"
4722else
4723 echo "configure: failed program was:" >&5
4724 cat conftest.$ac_ext >&5
4725 rm -rf conftest*
4726 eval "ac_cv_lib_$ac_lib_var=no"
4727fi
4728rm -f conftest*
4729LIBS="$ac_save_LIBS"
4730
4731fi
4732if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4733 echo "$ac_t""yes" 1>&6
4734 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
1bf17cc4 4735echo "configure:4736: checking for gettext in libintl" >&5
ab87f8c8
JL
4736if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
4737 echo $ac_n "(cached) $ac_c" 1>&6
4738else
4739 echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
1bf17cc4 4740echo "configure:4741: checking for gettext in -lintl" >&5
ab87f8c8
JL
4741ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`
4742if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4743 echo $ac_n "(cached) $ac_c" 1>&6
4744else
4745 ac_save_LIBS="$LIBS"
4746LIBS="-lintl $LIBS"
4747cat > conftest.$ac_ext <<EOF
1bf17cc4 4748#line 4749 "configure"
ab87f8c8
JL
4749#include "confdefs.h"
4750/* Override any gcc2 internal prototype to avoid an error. */
4751/* We use char because int might match the return type of a gcc2
4752 builtin and then its argument prototype would still apply. */
4753char gettext();
4754
4755int main() {
4756gettext()
4757; return 0; }
4758EOF
1bf17cc4 4759if { (eval echo configure:4760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
4760 rm -rf conftest*
4761 eval "ac_cv_lib_$ac_lib_var=yes"
4762else
4763 echo "configure: failed program was:" >&5
4764 cat conftest.$ac_ext >&5
4765 rm -rf conftest*
4766 eval "ac_cv_lib_$ac_lib_var=no"
4767fi
4768rm -f conftest*
4769LIBS="$ac_save_LIBS"
4770
4771fi
4772if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4773 echo "$ac_t""yes" 1>&6
4774 gt_cv_func_gettext_libintl=yes
4775else
4776 echo "$ac_t""no" 1>&6
4777gt_cv_func_gettext_libintl=no
4778fi
4779
4780fi
4781
4782echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6
4783else
4784 echo "$ac_t""no" 1>&6
4785fi
4786
4787 fi
4788
380a627a
PT
4789 if test "$gt_cv_func_gettext_libintl" = "yes"; then
4790 LIBS="-lintl $LIBS"
4791 fi
4792
ab87f8c8
JL
4793 if test "$gt_cv_func_gettext_libc" = "yes" \
4794 || test "$gt_cv_func_gettext_libintl" = "yes"; then
4795 cat >> confdefs.h <<\EOF
4796#define HAVE_GETTEXT 1
4797EOF
4798
4799 # Extract the first word of "msgfmt", so it can be a program name with args.
4800set dummy msgfmt; ac_word=$2
4801echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 4802echo "configure:4803: checking for $ac_word" >&5
00036f5c 4803if eval "test \"`echo '$''{'gcc_cv_path_MSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
4804 echo $ac_n "(cached) $ac_c" 1>&6
4805else
4806 case "$MSGFMT" in
4807 /*)
00036f5c 4808 gcc_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
4809 ;;
4810 *)
4811 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4812 for ac_dir in $PATH; do
4813 test -z "$ac_dir" && ac_dir=.
4814 if test -f $ac_dir/$ac_word; then
4815 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
00036f5c 4816 gcc_cv_path_MSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
4817 break
4818 fi
4819 fi
4820 done
4821 IFS="$ac_save_ifs"
00036f5c 4822 test -z "$gcc_cv_path_MSGFMT" && gcc_cv_path_MSGFMT="no"
ab87f8c8
JL
4823 ;;
4824esac
4825fi
00036f5c 4826MSGFMT="$gcc_cv_path_MSGFMT"
ab87f8c8
JL
4827if test -n "$MSGFMT"; then
4828 echo "$ac_t""$MSGFMT" 1>&6
4829else
4830 echo "$ac_t""no" 1>&6
4831fi
4832 if test "$MSGFMT" != "no"; then
4833 for ac_func in dcgettext
4834do
4835echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1bf17cc4 4836echo "configure:4837: checking for $ac_func" >&5
ab87f8c8
JL
4837if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4838 echo $ac_n "(cached) $ac_c" 1>&6
4839else
4840 cat > conftest.$ac_ext <<EOF
1bf17cc4 4841#line 4842 "configure"
ab87f8c8
JL
4842#include "confdefs.h"
4843/* System header to define __stub macros and hopefully few prototypes,
4844 which can conflict with char $ac_func(); below. */
4845#include <assert.h>
4846/* Override any gcc2 internal prototype to avoid an error. */
4847/* We use char because int might match the return type of a gcc2
4848 builtin and then its argument prototype would still apply. */
4849char $ac_func();
4850
4851int main() {
4852
4853/* The GNU C library defines this for functions which it implements
4854 to always fail with ENOSYS. Some functions are actually named
4855 something starting with __ and the normal name is an alias. */
4856#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4857choke me
4858#else
99b09ff3 4859$ac_func();
ab87f8c8
JL
4860#endif
4861
4862; return 0; }
4863EOF
1bf17cc4 4864if { (eval echo configure:4865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
4865 rm -rf conftest*
4866 eval "ac_cv_func_$ac_func=yes"
4867else
4868 echo "configure: failed program was:" >&5
4869 cat conftest.$ac_ext >&5
4870 rm -rf conftest*
4871 eval "ac_cv_func_$ac_func=no"
4872fi
4873rm -f conftest*
4874fi
4875
4876if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4877 echo "$ac_t""yes" 1>&6
4878 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4879 cat >> confdefs.h <<EOF
4880#define $ac_tr_func 1
4881EOF
4882
4883else
4884 echo "$ac_t""no" 1>&6
4885fi
4886done
4887
4888 # Extract the first word of "gmsgfmt", so it can be a program name with args.
4889set dummy gmsgfmt; ac_word=$2
4890echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 4891echo "configure:4892: checking for $ac_word" >&5
00036f5c 4892if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
4893 echo $ac_n "(cached) $ac_c" 1>&6
4894else
4895 case "$GMSGFMT" in
4896 /*)
00036f5c 4897 gcc_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
4898 ;;
4899 ?:/*)
00036f5c 4900 gcc_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
ab87f8c8
JL
4901 ;;
4902 *)
cd9e5e7c 4903 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
4904 ac_dummy="$PATH"
4905 for ac_dir in $ac_dummy; do
ab87f8c8
JL
4906 test -z "$ac_dir" && ac_dir=.
4907 if test -f $ac_dir/$ac_word; then
00036f5c 4908 gcc_cv_path_GMSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
4909 break
4910 fi
4911 done
4912 IFS="$ac_save_ifs"
00036f5c 4913 test -z "$gcc_cv_path_GMSGFMT" && gcc_cv_path_GMSGFMT="$MSGFMT"
ab87f8c8
JL
4914 ;;
4915esac
4916fi
00036f5c 4917GMSGFMT="$gcc_cv_path_GMSGFMT"
ab87f8c8
JL
4918if test -n "$GMSGFMT"; then
4919 echo "$ac_t""$GMSGFMT" 1>&6
4920else
4921 echo "$ac_t""no" 1>&6
4922fi
4923
4924 # Extract the first word of "xgettext", so it can be a program name with args.
4925set dummy xgettext; ac_word=$2
4926echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 4927echo "configure:4928: checking for $ac_word" >&5
00036f5c 4928if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then
ab87f8c8
JL
4929 echo $ac_n "(cached) $ac_c" 1>&6
4930else
4931 case "$XGETTEXT" in
4932 /*)
00036f5c 4933 gcc_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
ab87f8c8
JL
4934 ;;
4935 *)
4936 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
4937 for ac_dir in $PATH; do
4938 test -z "$ac_dir" && ac_dir=.
4939 if test -f $ac_dir/$ac_word; then
4940 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
00036f5c 4941 gcc_cv_path_XGETTEXT="$ac_dir/$ac_word"
ab87f8c8
JL
4942 break
4943 fi
4944 fi
4945 done
4946 IFS="$ac_save_ifs"
00036f5c 4947 test -z "$gcc_cv_path_XGETTEXT" && gcc_cv_path_XGETTEXT=":"
ab87f8c8
JL
4948 ;;
4949esac
4950fi
00036f5c 4951XGETTEXT="$gcc_cv_path_XGETTEXT"
ab87f8c8
JL
4952if test -n "$XGETTEXT"; then
4953 echo "$ac_t""$XGETTEXT" 1>&6
4954else
4955 echo "$ac_t""no" 1>&6
4956fi
4957
4958 cat > conftest.$ac_ext <<EOF
1bf17cc4 4959#line 4960 "configure"
ab87f8c8
JL
4960#include "confdefs.h"
4961
4962int main() {
4963extern int _nl_msg_cat_cntr;
4964 return _nl_msg_cat_cntr
4965; return 0; }
4966EOF
1bf17cc4 4967if { (eval echo configure:4968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
4968 rm -rf conftest*
4969 CATOBJEXT=.gmo
4970 DATADIRNAME=share
4971else
4972 echo "configure: failed program was:" >&5
4973 cat conftest.$ac_ext >&5
4974 rm -rf conftest*
4975 CATOBJEXT=.mo
4976 DATADIRNAME=lib
4977fi
4978rm -f conftest*
4979 INSTOBJEXT=.mo
9fdf713f
PT
4980 else
4981 create_catalogs="no"
ab87f8c8
JL
4982 fi
4983 fi
4984
4985else
4986 echo "$ac_t""no" 1>&6
4987fi
4988
4989
4990 if test "$CATOBJEXT" = "NONE"; then
4991 echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
1bf17cc4 4992echo "configure:4993: checking whether catgets can be used" >&5
ab87f8c8
JL
4993 # Check whether --with-catgets or --without-catgets was given.
4994if test "${with_catgets+set}" = set; then
4995 withval="$with_catgets"
4996 nls_cv_use_catgets=$withval
4997else
4998 nls_cv_use_catgets=no
4999fi
5000
5001 echo "$ac_t""$nls_cv_use_catgets" 1>&6
5002
5003 if test "$nls_cv_use_catgets" = "yes"; then
5004 echo $ac_n "checking for main in -li""... $ac_c" 1>&6
1bf17cc4 5005echo "configure:5006: checking for main in -li" >&5
ab87f8c8
JL
5006ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
5007if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5008 echo $ac_n "(cached) $ac_c" 1>&6
5009else
5010 ac_save_LIBS="$LIBS"
5011LIBS="-li $LIBS"
5012cat > conftest.$ac_ext <<EOF
1bf17cc4 5013#line 5014 "configure"
ab87f8c8
JL
5014#include "confdefs.h"
5015
5016int main() {
5017main()
5018; return 0; }
5019EOF
1bf17cc4 5020if { (eval echo configure:5021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
5021 rm -rf conftest*
5022 eval "ac_cv_lib_$ac_lib_var=yes"
5023else
5024 echo "configure: failed program was:" >&5
5025 cat conftest.$ac_ext >&5
5026 rm -rf conftest*
5027 eval "ac_cv_lib_$ac_lib_var=no"
5028fi
5029rm -f conftest*
5030LIBS="$ac_save_LIBS"
5031
5032fi
5033if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5034 echo "$ac_t""yes" 1>&6
5035 ac_tr_lib=HAVE_LIB`echo i | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5036 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5037 cat >> confdefs.h <<EOF
5038#define $ac_tr_lib 1
5039EOF
5040
5041 LIBS="-li $LIBS"
5042
5043else
5044 echo "$ac_t""no" 1>&6
5045fi
5046
5047 echo $ac_n "checking for catgets""... $ac_c" 1>&6
1bf17cc4 5048echo "configure:5049: checking for catgets" >&5
ab87f8c8
JL
5049if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
5050 echo $ac_n "(cached) $ac_c" 1>&6
5051else
5052 cat > conftest.$ac_ext <<EOF
1bf17cc4 5053#line 5054 "configure"
ab87f8c8
JL
5054#include "confdefs.h"
5055/* System header to define __stub macros and hopefully few prototypes,
5056 which can conflict with char catgets(); below. */
5057#include <assert.h>
5058/* Override any gcc2 internal prototype to avoid an error. */
5059/* We use char because int might match the return type of a gcc2
5060 builtin and then its argument prototype would still apply. */
5061char catgets();
5062
5063int main() {
5064
5065/* The GNU C library defines this for functions which it implements
5066 to always fail with ENOSYS. Some functions are actually named
5067 something starting with __ and the normal name is an alias. */
5068#if defined (__stub_catgets) || defined (__stub___catgets)
5069choke me
5070#else
99b09ff3 5071catgets();
ab87f8c8
JL
5072#endif
5073
5074; return 0; }
5075EOF
1bf17cc4 5076if { (eval echo configure:5077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ab87f8c8
JL
5077 rm -rf conftest*
5078 eval "ac_cv_func_catgets=yes"
5079else
5080 echo "configure: failed program was:" >&5
5081 cat conftest.$ac_ext >&5
5082 rm -rf conftest*
5083 eval "ac_cv_func_catgets=no"
5084fi
5085rm -f conftest*
5086fi
5087
5088if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then
5089 echo "$ac_t""yes" 1>&6
5090 cat >> confdefs.h <<\EOF
5091#define HAVE_CATGETS 1
5092EOF
5093
5094 INTLOBJS="\$(CATOBJS)"
5095 # Extract the first word of "gencat", so it can be a program name with args.
5096set dummy gencat; ac_word=$2
5097echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 5098echo "configure:5099: checking for $ac_word" >&5
00036f5c 5099if eval "test \"`echo '$''{'gcc_cv_path_GENCAT'+set}'`\" = set"; then
ab87f8c8
JL
5100 echo $ac_n "(cached) $ac_c" 1>&6
5101else
5102 case "$GENCAT" in
5103 /*)
00036f5c 5104 gcc_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path.
ab87f8c8
JL
5105 ;;
5106 ?:/*)
00036f5c 5107 gcc_cv_path_GENCAT="$GENCAT" # Let the user override the test with a dos path.
ab87f8c8
JL
5108 ;;
5109 *)
cd9e5e7c 5110 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
5111 ac_dummy="$PATH"
5112 for ac_dir in $ac_dummy; do
ab87f8c8
JL
5113 test -z "$ac_dir" && ac_dir=.
5114 if test -f $ac_dir/$ac_word; then
00036f5c 5115 gcc_cv_path_GENCAT="$ac_dir/$ac_word"
ab87f8c8
JL
5116 break
5117 fi
5118 done
5119 IFS="$ac_save_ifs"
00036f5c 5120 test -z "$gcc_cv_path_GENCAT" && gcc_cv_path_GENCAT="no"
ab87f8c8
JL
5121 ;;
5122esac
5123fi
00036f5c 5124GENCAT="$gcc_cv_path_GENCAT"
ab87f8c8
JL
5125if test -n "$GENCAT"; then
5126 echo "$ac_t""$GENCAT" 1>&6
5127else
5128 echo "$ac_t""no" 1>&6
5129fi
5130 if test "$GENCAT" != "no"; then
5131 # Extract the first word of "gmsgfmt", so it can be a program name with args.
5132set dummy gmsgfmt; ac_word=$2
5133echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 5134echo "configure:5135: checking for $ac_word" >&5
00036f5c 5135if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
5136 echo $ac_n "(cached) $ac_c" 1>&6
5137else
5138 case "$GMSGFMT" in
5139 /*)
00036f5c 5140 gcc_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
5141 ;;
5142 ?:/*)
00036f5c 5143 gcc_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
ab87f8c8
JL
5144 ;;
5145 *)
cd9e5e7c 5146 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
5147 ac_dummy="$PATH"
5148 for ac_dir in $ac_dummy; do
ab87f8c8
JL
5149 test -z "$ac_dir" && ac_dir=.
5150 if test -f $ac_dir/$ac_word; then
00036f5c 5151 gcc_cv_path_GMSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
5152 break
5153 fi
5154 done
5155 IFS="$ac_save_ifs"
00036f5c 5156 test -z "$gcc_cv_path_GMSGFMT" && gcc_cv_path_GMSGFMT="no"
ab87f8c8
JL
5157 ;;
5158esac
5159fi
00036f5c 5160GMSGFMT="$gcc_cv_path_GMSGFMT"
ab87f8c8
JL
5161if test -n "$GMSGFMT"; then
5162 echo "$ac_t""$GMSGFMT" 1>&6
5163else
5164 echo "$ac_t""no" 1>&6
5165fi
5166
5167 if test "$GMSGFMT" = "no"; then
5168 # Extract the first word of "msgfmt", so it can be a program name with args.
5169set dummy msgfmt; ac_word=$2
5170echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 5171echo "configure:5172: checking for $ac_word" >&5
00036f5c 5172if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
5173 echo $ac_n "(cached) $ac_c" 1>&6
5174else
5175 case "$GMSGFMT" in
5176 /*)
00036f5c 5177 gcc_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
5178 ;;
5179 *)
5180 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5181 for ac_dir in $PATH; do
5182 test -z "$ac_dir" && ac_dir=.
5183 if test -f $ac_dir/$ac_word; then
5184 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
00036f5c 5185 gcc_cv_path_GMSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
5186 break
5187 fi
5188 fi
5189 done
5190 IFS="$ac_save_ifs"
00036f5c 5191 test -z "$gcc_cv_path_GMSGFMT" && gcc_cv_path_GMSGFMT="msgfmt"
ab87f8c8
JL
5192 ;;
5193esac
5194fi
00036f5c 5195GMSGFMT="$gcc_cv_path_GMSGFMT"
ab87f8c8
JL
5196if test -n "$GMSGFMT"; then
5197 echo "$ac_t""$GMSGFMT" 1>&6
5198else
5199 echo "$ac_t""no" 1>&6
5200fi
5201
cab10d56 5202 if test "$GMSGFMT" = "msgfmt"; then
17297c41
PT
5203 create_catalogs="no"
5204 fi
ab87f8c8
JL
5205 fi
5206 # Extract the first word of "xgettext", so it can be a program name with args.
5207set dummy xgettext; ac_word=$2
5208echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 5209echo "configure:5210: checking for $ac_word" >&5
00036f5c 5210if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then
ab87f8c8
JL
5211 echo $ac_n "(cached) $ac_c" 1>&6
5212else
5213 case "$XGETTEXT" in
5214 /*)
00036f5c 5215 gcc_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
ab87f8c8
JL
5216 ;;
5217 *)
5218 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5219 for ac_dir in $PATH; do
5220 test -z "$ac_dir" && ac_dir=.
5221 if test -f $ac_dir/$ac_word; then
5222 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
00036f5c 5223 gcc_cv_path_XGETTEXT="$ac_dir/$ac_word"
ab87f8c8
JL
5224 break
5225 fi
5226 fi
5227 done
5228 IFS="$ac_save_ifs"
00036f5c 5229 test -z "$gcc_cv_path_XGETTEXT" && gcc_cv_path_XGETTEXT=":"
ab87f8c8
JL
5230 ;;
5231esac
5232fi
00036f5c 5233XGETTEXT="$gcc_cv_path_XGETTEXT"
ab87f8c8
JL
5234if test -n "$XGETTEXT"; then
5235 echo "$ac_t""$XGETTEXT" 1>&6
5236else
5237 echo "$ac_t""no" 1>&6
5238fi
5239
5240 USE_INCLUDED_LIBINTL=yes
5241 CATOBJEXT=.cat
5242 INSTOBJEXT=.cat
5243 DATADIRNAME=lib
5244 INTLDEPS='$(top_builddir)/intl/libintl.a'
5245 INTLLIBS=$INTLDEPS
5246 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
5247 nls_cv_header_intl=intl/libintl.h
5248 nls_cv_header_libgt=intl/libgettext.h
5249 fi
5250else
5251 echo "$ac_t""no" 1>&6
5252fi
5253
5254 fi
5255 fi
5256
5257 if test "$CATOBJEXT" = "NONE"; then
5258 nls_cv_use_gnu_gettext=yes
5259 fi
5260 fi
5261
5262 if test "$nls_cv_use_gnu_gettext" = "yes"; then
5263 INTLOBJS="\$(GETTOBJS)"
5264 # Extract the first word of "msgfmt", so it can be a program name with args.
5265set dummy msgfmt; ac_word=$2
5266echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 5267echo "configure:5268: checking for $ac_word" >&5
00036f5c 5268if eval "test \"`echo '$''{'gcc_cv_path_MSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
5269 echo $ac_n "(cached) $ac_c" 1>&6
5270else
5271 case "$MSGFMT" in
5272 /*)
00036f5c 5273 gcc_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
5274 ;;
5275 *)
5276 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5277 for ac_dir in $PATH; do
5278 test -z "$ac_dir" && ac_dir=.
5279 if test -f $ac_dir/$ac_word; then
5280 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
00036f5c 5281 gcc_cv_path_MSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
5282 break
5283 fi
5284 fi
5285 done
5286 IFS="$ac_save_ifs"
00036f5c 5287 test -z "$gcc_cv_path_MSGFMT" && gcc_cv_path_MSGFMT="msgfmt"
ab87f8c8
JL
5288 ;;
5289esac
5290fi
00036f5c 5291MSGFMT="$gcc_cv_path_MSGFMT"
ab87f8c8
JL
5292if test -n "$MSGFMT"; then
5293 echo "$ac_t""$MSGFMT" 1>&6
5294else
5295 echo "$ac_t""no" 1>&6
5296fi
5297
5298 # Extract the first word of "gmsgfmt", so it can be a program name with args.
5299set dummy gmsgfmt; ac_word=$2
5300echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 5301echo "configure:5302: checking for $ac_word" >&5
00036f5c 5302if eval "test \"`echo '$''{'gcc_cv_path_GMSGFMT'+set}'`\" = set"; then
ab87f8c8
JL
5303 echo $ac_n "(cached) $ac_c" 1>&6
5304else
5305 case "$GMSGFMT" in
5306 /*)
00036f5c 5307 gcc_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
ab87f8c8
JL
5308 ;;
5309 ?:/*)
00036f5c 5310 gcc_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
ab87f8c8
JL
5311 ;;
5312 *)
cd9e5e7c 5313 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
b27d2bd5
MK
5314 ac_dummy="$PATH"
5315 for ac_dir in $ac_dummy; do
ab87f8c8
JL
5316 test -z "$ac_dir" && ac_dir=.
5317 if test -f $ac_dir/$ac_word; then
00036f5c 5318 gcc_cv_path_GMSGFMT="$ac_dir/$ac_word"
ab87f8c8
JL
5319 break
5320 fi
5321 done
5322 IFS="$ac_save_ifs"
00036f5c 5323 test -z "$gcc_cv_path_GMSGFMT" && gcc_cv_path_GMSGFMT="$MSGFMT"
ab87f8c8
JL
5324 ;;
5325esac
5326fi
00036f5c 5327GMSGFMT="$gcc_cv_path_GMSGFMT"
ab87f8c8
JL
5328if test -n "$GMSGFMT"; then
5329 echo "$ac_t""$GMSGFMT" 1>&6
5330else
5331 echo "$ac_t""no" 1>&6
5332fi
5333
cab10d56 5334 if test "$MSGFMT" = "msgfmt" && test "$GMSGFMT" = "msgfmt"; then
17297c41 5335 create_catalogs="no"
17297c41 5336 fi
ab87f8c8
JL
5337 # Extract the first word of "xgettext", so it can be a program name with args.
5338set dummy xgettext; ac_word=$2
5339echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1bf17cc4 5340echo "configure:5341: checking for $ac_word" >&5
00036f5c 5341if eval "test \"`echo '$''{'gcc_cv_path_XGETTEXT'+set}'`\" = set"; then
ab87f8c8
JL
5342 echo $ac_n "(cached) $ac_c" 1>&6
5343else
5344 case "$XGETTEXT" in
5345 /*)
00036f5c 5346 gcc_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
ab87f8c8
JL
5347 ;;
5348 *)
5349 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
5350 for ac_dir in $PATH; do
5351 test -z "$ac_dir" && ac_dir=.
5352 if test -f $ac_dir/$ac_word; then
5353 if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
00036f5c 5354 gcc_cv_path_XGETTEXT="$ac_dir/$ac_word"
ab87f8c8
JL
5355 break
5356 fi
5357 fi
5358 done
5359 IFS="$ac_save_ifs"
00036f5c 5360 test -z "$gcc_cv_path_XGETTEXT" && gcc_cv_path_XGETTEXT=":"
ab87f8c8
JL
5361 ;;
5362esac
5363fi
00036f5c 5364XGETTEXT="$gcc_cv_path_XGETTEXT"
ab87f8c8
JL
5365if test -n "$XGETTEXT"; then
5366 echo "$ac_t""$XGETTEXT" 1>&6
5367else
5368 echo "$ac_t""no" 1>&6
5369fi
5370
5371
5372 USE_INCLUDED_LIBINTL=yes
5373 CATOBJEXT=.gmo
5374 INSTOBJEXT=.mo
5375 DATADIRNAME=share
5376 INTLDEPS='$(top_builddir)/intl/libintl.a'
5377 INTLLIBS=$INTLDEPS
5378 LIBS=`echo $LIBS | sed -e 's/-lintl//'`
5379 nls_cv_header_intl=intl/libintl.h
5380 nls_cv_header_libgt=intl/libgettext.h
5381 fi
5382
5383 if test "$XGETTEXT" != ":"; then
5384 if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
5385 : ;
5386 else
5387 echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6
5388 XGETTEXT=":"
5389 fi
5390 fi
5391
17297c41
PT
5392
5393
ab87f8c8
JL
5394 # We need to process the po/ directory.
5395 POSUB=po
5396 else
5397 DATADIRNAME=share
5398 nls_cv_header_intl=intl/libintl.h
5399 nls_cv_header_libgt=intl/libgettext.h
5400 fi
5401
5402
5403
5404
5405 # If this is used in GNU gettext we have to set USE_NLS to `yes'
5406 # because some of the sources are only built for this goal.
5407 if test "$PACKAGE" = gettext; then
5408 USE_NLS=yes
5409 USE_INCLUDED_LIBINTL=yes
5410 fi
5411
5412 for lang in $ALL_LINGUAS; do
5413 GMOFILES="$GMOFILES $lang.gmo"
5414 POFILES="$POFILES $lang.po"
5415 done
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
4d0230e1 5430 if test "x$create_catalogs" = "xno"; then
9fdf713f
PT
5431 echo "configure: warning: No program for building catalogs found -> building disabled" 1>&2
5432 fi
5433
17297c41 5434 if test "x$CATOBJEXT" != "x" && test "x$create_catalogs" != "xno" ; then
ab87f8c8
JL
5435 if test "x$ALL_LINGUAS" = "x"; then
5436 LINGUAS=
5437 else
5438 echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
1bf17cc4 5439echo "configure:5440: checking for catalogs to be installed" >&5
47f01856
PT
5440 if test "x$LINGUAS" = "x"; then
5441 LINGUAS=$ALL_LINGUAS
5442 else
5443 NEW_LINGUAS=
5444 for lang in $ALL_LINGUAS; do
5445 case " $LINGUAS " in
5446 *" $lang "*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
5447 esac
5448 done
5449 LINGUAS=$NEW_LINGUAS
5450 fi
ab87f8c8
JL
5451 echo "$ac_t""$LINGUAS" 1>&6
5452 fi
5453
5454 if test -n "$LINGUAS"; then
5455 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
5456 fi
5457 fi
5458
5459 if test $ac_cv_header_locale_h = yes; then
5460 INCLUDE_LOCALE_H="#include <locale.h>"
5461 else
5462 INCLUDE_LOCALE_H="\
5463/* The system does not provide the header <locale.h>. Take care yourself. */"
5464 fi
5465
5466
5467 test -d intl || mkdir intl
5468 if test "$CATOBJEXT" = ".cat"; then
5469 ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
5470echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
1bf17cc4 5471echo "configure:5472: checking for linux/version.h" >&5
ab87f8c8
JL
5472if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5473 echo $ac_n "(cached) $ac_c" 1>&6
5474else
5475 cat > conftest.$ac_ext <<EOF
1bf17cc4 5476#line 5477 "configure"
ab87f8c8
JL
5477#include "confdefs.h"
5478#include <linux/version.h>
5479EOF
5480ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1bf17cc4 5481{ (eval echo configure:5482: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
cd9e5e7c 5482ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
ab87f8c8
JL
5483if test -z "$ac_err"; then
5484 rm -rf conftest*
5485 eval "ac_cv_header_$ac_safe=yes"
5486else
5487 echo "$ac_err" >&5
5488 echo "configure: failed program was:" >&5
5489 cat conftest.$ac_ext >&5
5490 rm -rf conftest*
5491 eval "ac_cv_header_$ac_safe=no"
5492fi
5493rm -f conftest*
5494fi
5495if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5496 echo "$ac_t""yes" 1>&6
5497 msgformat=linux
5498else
5499 echo "$ac_t""no" 1>&6
5500msgformat=xopen
5501fi
5502
5503
5504 sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
5505 fi
5506 sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
5507 $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
5508
5509 if test "$PACKAGE" = "gettext"; then
5510 GT_NO="#NO#"
5511 GT_YES=
5512 else
5513 GT_NO=
5514 GT_YES="#YES#"
5515 fi
5516
5517
5518
5519 MKINSTALLDIRS=
5520 if test -n "$ac_aux_dir"; then
5521 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
5522 fi
5523 if test -z "$MKINSTALLDIRS"; then
5524 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
5525 fi
5526
5527
5528 l=
5529
5530
5531 test -d po || mkdir po
5532 if test "x$srcdir" != "x."; then
5533 if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
5534 posrcprefix="$srcdir/"
5535 else
5536 posrcprefix="../$srcdir/"
5537 fi
5538 else
5539 posrcprefix="../"
5540 fi
5541 rm -f po/POTFILES
5542 sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
5543 < $srcdir/po/POTFILES.in > po/POTFILES
5544
5545XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
5546
f4ab28e3
MK
5547# Windows32 Registry support for specifying GCC installation paths.
5548# Check whether --enable-win32-registry or --disable-win32-registry was given.
5549if test "${enable_win32_registry+set}" = set; then
5550 enableval="$enable_win32_registry"
5551 :
5552fi
5553
5554
5555echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6
1bf17cc4 5556echo "configure:5557: checking whether windows registry support is requested" >&5
f4ab28e3
MK
5557if test x$enable_win32_registry != xno; then
5558 cat >> confdefs.h <<\EOF
5559#define ENABLE_WIN32_REGISTRY 1
5560EOF
5561
5562 echo "$ac_t""yes" 1>&6
5563else
5564 echo "$ac_t""no" 1>&6
5565fi
5566
5567# Check if user specified a different registry key.
5568case x${enable_win32_registry} in
5569x | xyes)
5570 # default.
5571 gcc_cv_win32_registry_key="$VERSION"
5572 ;;
5573xno)
5574 # no registry lookup.
5575 gcc_cv_win32_registry_key=''
5576 ;;
5577*)
5578 # user-specified key.
5579 gcc_cv_win32_registry_key="$enable_win32_registry"
5580 ;;
5581esac
5582
5583if test x$enable_win32_registry != xno; then
5584 echo $ac_n "checking registry key on windows hosts""... $ac_c" 1>&6
1bf17cc4 5585echo "configure:5586: checking registry key on windows hosts" >&5
f4ab28e3
MK
5586 cat >> confdefs.h <<EOF
5587#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
5588EOF
5589
5590 echo "$ac_t""$gcc_cv_win32_registry_key" 1>&6
5591fi
5592
ab87f8c8
JL
5593# Get an absolute path to the GCC top-level source directory
5594holddir=`pwd`
5595cd $srcdir
5596topdir=`pwd`
5597cd $holddir
5598
5599# Conditionalize the makefile for this host machine.
5600# Make-host contains the concatenation of all host makefile fragments
5601# [there can be more than one]. This file is built by configure.frag.
5602host_overrides=Make-host
5603dep_host_xmake_file=
5604for f in .. ${host_xmake_file}
5605do
5606 if test -f ${srcdir}/config/$f
5607 then
5608 dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
5609 fi
5610done
5611
5612# Conditionalize the makefile for this target machine.
5613# Make-target contains the concatenation of all host makefile fragments
5614# [there can be more than one]. This file is built by configure.frag.
5615target_overrides=Make-target
5616dep_tmake_file=
5617for f in .. ${tmake_file}
5618do
5619 if test -f ${srcdir}/config/$f
5620 then
5621 dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
5622 fi
5623done
5624
5625# If the host doesn't support symlinks, modify CC in
5626# FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works.
5627# Otherwise, we can use "CC=$(CC)".
5628rm -f symtest.tem
5629if $symbolic_link $srcdir/gcc.c symtest.tem 2>/dev/null
5630then
5631 cc_set_by_configure="\$(CC)"
5aa82ace 5632 quoted_cc_set_by_configure="\$(CC)"
ab87f8c8
JL
5633 stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
5634else
5635 rm -f symtest.tem
5636 if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null
5637 then
5638 symbolic_link="cp -p"
5639 else
5640 symbolic_link="cp"
5641 fi
5642 cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`"
5aa82ace 5643 quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`"
ab87f8c8
JL
5644 stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`"
5645fi
5646rm -f symtest.tem
5647
5648out_object_file=`basename $out_file .c`.o
5649
5650tm_file_list=
5651for f in $tm_file; do
64ccbc99 5652 case $f in
22fdd65e 5653 gansidecl.h | defaults.h )
64ccbc99
KG
5654 tm_file_list="${tm_file_list} $f" ;;
5655 *) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
5656 esac
ab87f8c8
JL
5657done
5658
11642c3a
ZW
5659tm_p_file_list=
5660for f in $tm_p_file; do
5661 tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
5662done
5663
ab87f8c8
JL
5664host_xm_file_list=
5665for f in $host_xm_file; do
64ccbc99 5666 case $f in
c913b6f1 5667 auto-host.h | gansidecl.h | defaults.h | hwint.h )
64ccbc99
KG
5668 host_xm_file_list="${host_xm_file_list} $f" ;;
5669 *) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
5670 esac
ab87f8c8
JL
5671done
5672
5673build_xm_file_list=
5674for f in $build_xm_file; do
64ccbc99 5675 case $f in
c913b6f1 5676 auto-build.h | auto-host.h | gansidecl.h | defaults.h | hwint.h )
64ccbc99
KG
5677 build_xm_file_list="${build_xm_file_list} $f" ;;
5678 *) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
5679 esac
ab87f8c8
JL
5680done
5681
5682# Define macro CROSS_COMPILE in compilation
5683# if this is a cross-compiler.
5684# Also use all.cross instead of all.internal
5685# and add cross-make to Makefile.
5686cross_overrides="/dev/null"
5687if test x$host != x$target
5688then
5689 cross_defines="CROSS=-DCROSS_COMPILE"
5690 cross_overrides="${topdir}/cross-make"
5691fi
5692
b39d221a
EC
5693# If this is a cross-compiler that does not
5694# have its own set of headers then define
5695# inhibit_libc
5696
5697# If this is using newlib, then define inhibit_libc in
5698# LIBGCC2_CFLAGS. This will cause __eprintf to be left out of
5699# libgcc.a, but that's OK because newlib should have its own version of
5700# assert.h.
5701inhibit_libc=
5702if test x$host != x$target && test x$with_headers = x; then
5703 inhibit_libc=-Dinhibit_libc
5704else
5705 if test x$with_newlib = xyes; then
5706 inhibit_libc=-Dinhibit_libc
5707 fi
5708fi
5709
5710
ab87f8c8
JL
5711# When building gcc with a cross-compiler, we need to fix a few things.
5712# This must come after cross-make as we want all.build to override
5713# all.cross.
5714build_overrides="/dev/null"
5715if test x$build != x$host
5716then
5717 build_overrides="${topdir}/build-make"
5718fi
5719
5720# Expand extra_headers to include complete path.
5721# This substitutes for lots of t-* files.
5722extra_headers_list=
5723if test "x$extra_headers" = x
5724then true
5725else
5726 # Prepend ${srcdir}/ginclude/ to every entry in extra_headers.
5727 for file in $extra_headers;
5728 do
5729 extra_headers_list="${extra_headers_list} \$(srcdir)/ginclude/${file}"
5730 done
5731fi
5732
5733if test x$use_collect2 = xno; then
5734 use_collect2=
5735fi
5736
5737# Add a definition of USE_COLLECT2 if system wants one.
5738# Also tell toplev.c what to do.
5739# This substitutes for lots of t-* files.
5740if test x$use_collect2 = x
5741then
5742 will_use_collect2=
5743 maybe_use_collect2=
5744else
5745 will_use_collect2="collect2"
5746 maybe_use_collect2="-DUSE_COLLECT2"
5747fi
5748
ab87f8c8
JL
5749# If we have gas in the build tree, make a link to it.
5750if test -f ../gas/Makefile; then
5751 rm -f as; $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
5752fi
5753
5754# If we have nm in the build tree, make a link to it.
5755if test -f ../binutils/Makefile; then
5756 rm -f nm; $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null
5757fi
5758
5759# If we have ld in the build tree, make a link to it.
5760if test -f ../ld/Makefile; then
5761# if test x$use_collect2 = x; then
5762# rm -f ld; $symbolic_link ../ld/ld-new$host_exeext ld$host_exeext 2>/dev/null
5763# else
5764 rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null
5765# fi
5766fi
5767
981d4858
JM
5768# Figure out what assembler we will be using.
5769echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
1bf17cc4 5770echo "configure:5771: checking what assembler to use" >&5
ab87f8c8 5771gcc_cv_as=
981d4858
JM
5772gcc_cv_gas_major_version=
5773gcc_cv_gas_minor_version=
ab87f8c8
JL
5774gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
5775if test -x "$DEFAULT_ASSEMBLER"; then
5776 gcc_cv_as="$DEFAULT_ASSEMBLER"
5777elif test -x "$AS"; then
5778 gcc_cv_as="$AS"
5779elif test -x as$host_exeext; then
5780 # Build using assembler in the current directory.
5781 gcc_cv_as=./as$host_exeext
5782elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then
5783 # Single tree build which includes gas.
5784 for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
5785 do
5786 gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
5787 if test x$gcc_cv_gas_version != x; then
5788 break
5789 fi
5790 done
5791 gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([0-9]*\)"`
5792 gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
981d4858 5793fi
9e423e6d 5794
981d4858 5795if test "x$gcc_cv_as" = x -a x$host = x$target; then
9e423e6d 5796 # Native build.
779243f7
JL
5797 # Search the same directories that the installed compiler will
5798 # search. Else we may find the wrong assembler and lose. If we
5799 # do not find a suitable assembler binary, then try the user's
5800 # path.
5801 #
5802 # Also note we have to check MD_EXEC_PREFIX before checking the
5803 # user's path. Unfortunately, there is no good way to get at the
5804 # value of MD_EXEC_PREFIX here. So we do a brute force search
5805 # through all the known MD_EXEC_PREFIX values. Ugh. This needs
5806 # to be fixed as part of the make/configure rewrite too.
5807
5808 if test "x$exec_prefix" = xNONE; then
5809 if test "x$prefix" = xNONE; then
5810 test_prefix=/usr/local
5811 else
5812 test_prefix=$prefix
5813 fi
5814 else
5815 test_prefix=$exec_prefix
5816 fi
5817
5818 # If the loop below does not find an assembler, then use whatever
5819 # one we can find in the users's path.
5820 # user's path.
5821 as=as$host_exeext
5822
5823 test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \
5824 $test_prefix/lib/gcc-lib/$target \
5825 /usr/lib/gcc/$target/$gcc_version \
5826 /usr/lib/gcc/$target \
5827 $test_prefix/$target/bin/$target/$gcc_version \
5828 $test_prefix/$target/bin \
5829 /usr/libexec \
5830 /usr/ccs/gcc \
5831 /usr/ccs/bin \
5832 /udk/usr/ccs/bin \
5833 /bsd43/usr/lib/cmplrs/cc \
5834 /usr/cross64/usr/bin \
5835 /usr/lib/cmplrs/cc \
5836 /sysv/usr/lib/cmplrs/cc \
5837 /svr4/usr/lib/cmplrs/cc \
5838 /usr/bin"
5839
5840 for dir in $test_dirs; do
5841 if test -f $dir/as$host_exeext; then
5842 gcc_cv_as=$dir/as$host_exeext
5843 break;
5844 fi
5845 done
9e423e6d 5846fi
981d4858
JM
5847if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
5848 echo "$ac_t"""newly built gas"" 1>&6
5849else
5850 echo "$ac_t""$gcc_cv_as" 1>&6
5851fi
5852
5853# Figure out what nm we will be using.
5854echo $ac_n "checking what nm to use""... $ac_c" 1>&6
1bf17cc4 5855echo "configure:5856: checking what nm to use" >&5
981d4858
JM
5856if test -x nm$host_exeext; then
5857 gcc_cv_nm=./nm$host_exeext
5858elif test x$host = x$target; then
5859 # Native build.
5860 gcc_cv_nm=nm$host_exeext
5861fi
5862echo "$ac_t""$gcc_cv_nm" 1>&6
5863
5864# Figure out what assembler alignment features are present.
5865echo $ac_n "checking assembler alignment features""... $ac_c" 1>&6
1bf17cc4 5866echo "configure:5867: checking assembler alignment features" >&5
9d147085 5867gcc_cv_as_alignment_features=none
981d4858
JM
5868if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
5869 # Gas version 2.6 and later support for .balign and .p2align.
5870 # bytes to skip when using .p2align.
5871 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 6 -o "$gcc_cv_gas_major_version" -gt 2; then
5872 gcc_cv_as_alignment_features=".balign and .p2align"
5873 cat >> confdefs.h <<\EOF
5874#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
5875EOF
5876
5877 fi
5878 # Gas version 2.8 and later support specifying the maximum
5879 # bytes to skip when using .p2align.
5880 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 8 -o "$gcc_cv_gas_major_version" -gt 2; then
5881 gcc_cv_as_alignment_features=".p2align including maximum skip"
5882 cat >> confdefs.h <<\EOF
5883#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
5884EOF
5885
5886 fi
5887elif test x$gcc_cv_as != x; then
00ccc16d
JL
5888 # Check if we have .balign and .p2align
5889 echo ".balign 4" > conftest.s
5890 echo ".p2align 2" >> conftest.s
5891 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
5892 gcc_cv_as_alignment_features=".balign and .p2align"
5893 cat >> confdefs.h <<\EOF
5894#define HAVE_GAS_BALIGN_AND_P2ALIGN 1
5895EOF
5896
5897 fi
5898 rm -f conftest.s conftest.o
9e423e6d
JW
5899 # Check if specifying the maximum bytes to skip when
5900 # using .p2align is supported.
5901 echo ".p2align 4,,7" > conftest.s
5902 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
5903 gcc_cv_as_alignment_features=".p2align including maximum skip"
5904 cat >> confdefs.h <<\EOF
5905#define HAVE_GAS_MAX_SKIP_P2ALIGN 1
5906EOF
5907
5908 fi
5909 rm -f conftest.s conftest.o
5910fi
5911echo "$ac_t""$gcc_cv_as_alignment_features" 1>&6
5912
d1accaa3 5913echo $ac_n "checking assembler subsection support""... $ac_c" 1>&6
1bf17cc4 5914echo "configure:5915: checking assembler subsection support" >&5
9d147085 5915gcc_cv_as_subsections=no
981d4858
JM
5916if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
5917 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
5918 gcc_cv_as_subsections="working .subsection -1"
5919 fi
5920elif test x$gcc_cv_as != x; then
d1accaa3
JJ
5921 # Check if we have .subsection
5922 echo ".subsection 1" > conftest.s
5923 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
5924 gcc_cv_as_subsections=".subsection"
d1accaa3
JJ
5925 if test x$gcc_cv_nm != x; then
5926 cat > conftest.s <<EOF
5927conftest_label1: .word 0
5928.subsection -1
5929conftest_label2: .word 0
5930.previous
5931EOF
5932 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
5933 $gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
5934 $gcc_cv_nm conftest.o | grep conftest_label2 | sed -e 's/label2/label1/' > conftest.nm2
1b015bec
AO
5935 if cmp conftest.nm1 conftest.nm2 > /dev/null 2>&1; then
5936 :
5937 else
d1accaa3 5938 gcc_cv_as_subsections="working .subsection -1"
d1accaa3
JJ
5939 fi
5940 fi
5941 fi
5942 fi
5943 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
981d4858
JM
5944fi
5945if test x"$gcc_cv_as_subsections" = x"working .subsection -1"; then
5946 cat >> confdefs.h <<\EOF
5947#define HAVE_GAS_SUBSECTION_ORDERING 1
5948EOF
5949
d1accaa3
JJ
5950fi
5951echo "$ac_t""$gcc_cv_as_subsections" 1>&6
5952
12822146 5953echo $ac_n "checking assembler weak support""... $ac_c" 1>&6
1bf17cc4 5954echo "configure:5955: checking assembler weak support" >&5
9d147085 5955gcc_cv_as_weak=no
981d4858
JM
5956if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
5957 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 2 -o "$gcc_cv_gas_major_version" -gt 2; then
5958 gcc_cv_as_weak="yes"
5959 fi
5960elif test x$gcc_cv_as != x; then
12822146
JL
5961 # Check if we have .weak
5962 echo " .weak foobar" > conftest.s
5963 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
12822146
JL
5964 gcc_cv_as_weak="yes"
5965 fi
5966 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
981d4858
JM
5967fi
5968if test x"$gcc_cv_as_weak" = xyes; then
5969 cat >> confdefs.h <<\EOF
5970#define HAVE_GAS_WEAK 1
5971EOF
5972
12822146
JL
5973fi
5974echo "$ac_t""$gcc_cv_as_weak" 1>&6
5975
6a9c5260 5976echo $ac_n "checking assembler hidden support""... $ac_c" 1>&6
1bf17cc4 5977echo "configure:5978: checking assembler hidden support" >&5
9d147085 5978gcc_cv_as_hidden=no
981d4858
JM
5979if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
5980 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
5981 gcc_cv_as_hidden="yes"
5982 fi
5983elif test x$gcc_cv_as != x; then
6a9c5260
UD
5984 # Check if we have .hidden
5985 echo " .hidden foobar" > conftest.s
5986 echo "foobar:" >> conftest.s
5987 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
6a9c5260
UD
5988 gcc_cv_as_hidden="yes"
5989 fi
5990 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
981d4858
JM
5991fi
5992if test x"$gcc_cv_as_hidden" = xyes; then
5993 cat >> confdefs.h <<\EOF
5994#define HAVE_GAS_HIDDEN 1
5995EOF
5996
6a9c5260
UD
5997fi
5998echo "$ac_t""$gcc_cv_as_hidden" 1>&6
5999
b7460f24 6000echo $ac_n "checking assembler leb128 support""... $ac_c" 1>&6
1bf17cc4 6001echo "configure:6002: checking assembler leb128 support" >&5
b7460f24
RH
6002gcc_cv_as_hidden=no
6003if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
6004 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
6005 gcc_cv_as_leb128="yes"
6006 fi
6007elif test x$gcc_cv_as != x; then
6008 # Check if we have .[us]leb128, and support symbol arithmetic with it.
6009 cat > conftest.s <<EOF
6010 .data
6011 .uleb128 L2 - L1
6012L1:
6013 .uleb128 1280
6014 .sleb128 -1010
6015L2:
6016EOF
6017 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
6018 gcc_cv_as_leb128="yes"
6019 fi
6020 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
6021fi
6022if test x"$gcc_cv_as_leb128" = xyes; then
6023 cat >> confdefs.h <<\EOF
6024#define HAVE_AS_LEB128 1
6025EOF
6026
6027fi
6028echo "$ac_t""$gcc_cv_as_leb128" 1>&6
6029
1cb36a98
RH
6030case "$target" in
6031 sparc*-*-*)
6032 echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
1bf17cc4 6033echo "configure:6034: checking assembler .register pseudo-op support" >&5
5b68c389
AO
6034if eval "test \"`echo '$''{'gcc_cv_as_register_pseudo_op'+set}'`\" = set"; then
6035 echo $ac_n "(cached) $ac_c" 1>&6
6036else
6037
6038 gcc_cv_as_register_pseudo_op=unknown
6039 if test x$gcc_cv_as != x; then
6040 # Check if we have .register
6041 echo ".register %g2, #scratch" > conftest.s
6042 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
1cb36a98 6043 gcc_cv_as_register_pseudo_op=yes
5b68c389
AO
6044 else
6045 gcc_cv_as_register_pseudo_op=no
6046 fi
6047 rm -f conftest.s conftest.o
6048 fi
6049
6050fi
6051
6052echo "$ac_t""$gcc_cv_as_register_pseudo_op" 1>&6
6053 if test "x$gcc_cv_as_register_pseudo_op" = xyes; then
6054 cat >> confdefs.h <<\EOF
1cb36a98
RH
6055#define HAVE_AS_REGISTER_PSEUDO_OP 1
6056EOF
6057
1cb36a98 6058 fi
1cb36a98 6059
e95b1e6a 6060 echo $ac_n "checking assembler supports -relax""... $ac_c" 1>&6
1bf17cc4 6061echo "configure:6062: checking assembler supports -relax" >&5
e95b1e6a
JJ
6062if eval "test \"`echo '$''{'gcc_cv_as_relax_opt'+set}'`\" = set"; then
6063 echo $ac_n "(cached) $ac_c" 1>&6
6064else
6065
6066 gcc_cv_as_relax_opt=unknown
6067 if test x$gcc_cv_as != x; then
6068 # Check if gas supports -relax
6069 echo ".text" > conftest.s
6070 if $gcc_cv_as -relax -o conftest.o conftest.s > /dev/null 2>&1; then
6071 gcc_cv_as_relax_opt=yes
6072 else
6073 gcc_cv_as_relax_opt=no
6074 fi
6075 rm -f conftest.s conftest.o
6076 fi
6077
6078fi
6079
6080echo "$ac_t""$gcc_cv_as_relax_opt" 1>&6
6081 if test "x$gcc_cv_as_relax_opt" = xyes; then
6082 cat >> confdefs.h <<\EOF
6083#define HAVE_AS_RELAX_OPTION 1
6084EOF
6085
6086 fi
6087
5b68c389
AO
6088 case "$tm_file" in
6089 *64*)
6090 echo $ac_n "checking for 64 bit support in assembler ($gcc_cv_as)""... $ac_c" 1>&6
1bf17cc4 6091echo "configure:6092: checking for 64 bit support in assembler ($gcc_cv_as)" >&5
5b68c389
AO
6092if eval "test \"`echo '$''{'gcc_cv_as_flags64'+set}'`\" = set"; then
6093 echo $ac_n "(cached) $ac_c" 1>&6
6094else
6095
6096 if test -n "$gcc_cv_as"; then
6097 echo ".xword foo" > conftest.s
6098 gcc_cv_as_flags64=no
8a90b95d 6099 for flag in "-xarch=v9" "-64 -Av9"; do
5b68c389
AO
6100 if $gcc_cv_as $flag -o conftest.o conftest.s \
6101 > /dev/null 2>&1; then
6102 gcc_cv_as_flags64=$flag
6103 break
6104 fi
6105 done
6106 rm -f conftest.s conftest.o
6107 else
6108 if test "$gas" = yes; then
6109 gcc_cv_as_flags64="-64 -Av9"
6110 else
6111 gcc_cv_as_flags64="-xarch=v9"
6112 fi
1cb36a98 6113 fi
5b68c389
AO
6114
6115fi
6116
6117echo "$ac_t""$gcc_cv_as_flags64" 1>&6
6118 if test "x$gcc_cv_as_flags64" = xno; then
6119
6120 tmake_file=`echo " $tmake_file " | sed -e 's, sparc/t-sol2-64 , ,' -e 's,^ ,,' -e 's, $,,'`
6121 dep_tmake_file=`echo " $dep_tmake_file " | sed -e 's, [^ ]*/config/sparc/t-sol2-64 , ,' -e 's,^ ,,' -e 's, $,,'`
6122
6123 else
6124 cat >> confdefs.h <<EOF
6125#define AS_SPARC64_FLAG "$gcc_cv_as_flags64"
6126EOF
6127
1cb36a98 6128 fi
5b68c389
AO
6129 ;;
6130 *) gcc_cv_as_flags64=${gcc_cv_as_flags64-no}
6131 ;;
6132 esac
6133
6134 if test "x$gcc_cv_as_flags64" != xno; then
6135 echo $ac_n "checking for assembler offsetable %lo() support""... $ac_c" 1>&6
1bf17cc4 6136echo "configure:6137: checking for assembler offsetable %lo() support" >&5
5b68c389
AO
6137if eval "test \"`echo '$''{'gcc_cv_as_offsetable_lo10'+set}'`\" = set"; then
6138 echo $ac_n "(cached) $ac_c" 1>&6
6139else
6140
6141 gcc_cv_as_offsetable_lo10=unknown
6142 if test "x$gcc_cv_as" != x; then
6143 # Check if assembler has offsetable %lo()
6144 echo "or %g1, %lo(ab) + 12, %g1" > conftest.s
6145 echo "or %g1, %lo(ab + 12), %g1" > conftest1.s
6146 if $gcc_cv_as $gcc_cv_as_flags64 -o conftest.o conftest.s \
6147 > /dev/null 2>&1 &&
6148 $gcc_cv_as $gcc_cv_as_flags64 -o conftest1.o conftest1.s \
6149 > /dev/null 2>&1; then
6150 if cmp conftest.o conftest1.o > /dev/null 2>&1; then
6151 gcc_cv_as_offsetable_lo10=no
6152 else
6153 gcc_cv_as_offsetable_lo10=yes
6154 fi
6155 else
6156 gcc_cv_as_offsetable_lo10=no
6157 fi
6158 rm -f conftest.s conftest.o conftest1.s conftest1.o
6159 fi
6160
6161fi
6162
6163echo "$ac_t""$gcc_cv_as_offsetable_lo10" 1>&6
6164 if test "x$gcc_cv_as_offsetable_lo10" = xyes; then
6165 cat >> confdefs.h <<\EOF
1cb36a98
RH
6166#define HAVE_AS_OFFSETABLE_LO10 1
6167EOF
6168
1cb36a98 6169 fi
1cb36a98 6170 fi
1cb36a98
RH
6171 ;;
6172
6173 i[34567]86-*-*)
6174 echo $ac_n "checking assembler instructions""... $ac_c" 1>&6
1bf17cc4 6175echo "configure:6176: checking assembler instructions" >&5
1cb36a98 6176 gcc_cv_as_instructions=
981d4858
JM
6177 if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x; then
6178 if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 9 -o "$gcc_cv_gas_major_version" -gt 2; then
6179 gcc_cv_as_instructions="filds fists"
6180 fi
6181 elif test x$gcc_cv_as != x; then
53b5ce19
JW
6182 set "filds fists" "filds mem; fists mem"
6183 while test $# -gt 0
6184 do
6185 echo "$2" > conftest.s
6186 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
6187 gcc_cv_as_instructions=${gcc_cv_as_instructions}$1" "
53b5ce19
JW
6188 fi
6189 shift 2
6190 done
6191 rm -f conftest.s conftest.o
1cb36a98 6192 fi
981d4858
JM
6193 if test x"$gcc_cv_as_instructions" != x; then
6194 cat >> confdefs.h <<EOF
ee7692d2 6195#define HAVE_GAS_`echo "$gcc_cv_as_instructions" | sed -e 's/ $//' | tr 'a-z ' 'A-Z_'` 1
981d4858
JM
6196EOF
6197
6198 fi
1cb36a98
RH
6199 echo "$ac_t""$gcc_cv_as_instructions" 1>&6
6200 ;;
6201esac
53b5ce19 6202
9d147085 6203echo $ac_n "checking assembler dwarf2 debug_line support""... $ac_c" 1>&6
1bf17cc4 6204echo "configure:6205: checking assembler dwarf2 debug_line support" >&5
9d147085
RH
6205gcc_cv_as_dwarf2_debug_line=no
6206# ??? Not all targets support dwarf2 debug_line, even within a version
6207# of gas. Moreover, we need to emit a valid instruction to trigger any
6208# info to the output file. So, as supported targets are added to gas 2.11,
6209# add some instruction here to (also) show we expect this might work.
6210# ??? Once 2.11 is released, probably need to add first known working
6211# version to the per-target configury.
6212case "$target" in
e6978109 6213 i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-*)
9d147085
RH
6214 insn="nop"
6215 ;;
6216 ia64*-*-*)
6217 insn="nop 0"
6218 ;;
6219 esac
6220if test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x;
6221then
6222 if test "$gcc_cv_gas_major_version" -eq 2 \
6223 -a "$gcc_cv_gas_minor_version" -ge 11 \
6224 -o "$gcc_cv_gas_major_version" -gt 2 \
6225 && grep 'obj_format = elf' ../gas/Makefile > /dev/null \
6226 && test x"$insn" != x ; then
6227 gcc_cv_as_dwarf2_debug_line="yes"
6228 fi
6229elif test x$gcc_cv_as != x -a x"$insn" != x ; then
6230 echo ' .file 0 "conftest.s"' > conftest.s
6231 echo ' .loc 0 3 0' >> conftest.s
6232 echo " $insn" >> conftest.s
6233 if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
6234 && grep debug_line conftest.o > /dev/null 2>&1 ; then
6235 gcc_cv_as_dwarf2_debug_line="yes"
6236 fi
6237 rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
6238fi
6239if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then
6240 cat >> confdefs.h <<\EOF
6241#define HAVE_AS_DWARF2_DEBUG_LINE 1
6242EOF
6243
6244fi
6245echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
6246
861bb6c1 6247# Figure out what language subdirectories are present.
71205e0b
MH
6248# Look if the user specified --enable-languages="..."; if not, use
6249# the environment variable $LANGUAGES if defined. $LANGUAGES might
6250# go away some day.
6251if test x"${enable_languages+set}" != xset; then
6252 if test x"${LANGUAGES+set}" = xset; then
6253 enable_languages="`echo ${LANGUAGES} | tr ' ' ','`"
6254 else
6255 enable_languages=all
6256 fi
d6c6b553
PE
6257else
6258 if test x"${enable_languages}" = x; then
6259 { echo "configure: error: --enable-languages needs at least one argument" 1>&2; exit 1; }
6260 fi
71205e0b 6261fi
75382c6d
TT
6262
6263# First scan to see if an enabled language requires some other language.
6264# We assume that a given config-lang.in will list all the language
6265# front ends it requires, even if some are required indirectly.
6266for lang in ${srcdir}/*/config-lang.in ..
6267do
6268 case $lang in
6269 ..)
6270 ;;
6271 # The odd quoting in the next line works around
6272 # an apparent bug in bash 1.12 on linux.
6273 ${srcdir}/[*]/config-lang.in)
6274 ;;
6275 *)
6276 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
6277 this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang`
6278 for other in $this_lang_requires
6279 do
6280 case ,${enable_languages}, in
6281 *,$other,*)
6282 ;;
6283 *,all,*)
6284 ;;
1bf17cc4 6285 *,$lang_alias,*)
75382c6d
TT
6286 enable_languages="$enable_languages,$other"
6287 ;;
6288 esac
6289 done
6290 ;;
6291 esac
6292done
6293
861bb6c1
JL
6294subdirs=
6295for lang in ${srcdir}/*/config-lang.in ..
6296do
6297 case $lang in
6298 ..) ;;
6299 # The odd quoting in the next line works around
6300 # an apparent bug in bash 1.12 on linux.
6301 ${srcdir}/[*]/config-lang.in) ;;
71205e0b
MH
6302 *)
6303 lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang`
2b60b2cb
AO
6304 this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang`
6305 build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang`
71205e0b
MH
6306 if test "x$lang_alias" = x
6307 then
6308 echo "$lang doesn't set \$language." 1>&2
6309 exit 1
6310 fi
2b60b2cb
AO
6311 case ${build_by_default},${enable_languages}, in
6312 *,$lang_alias,*) add_this_lang=yes ;;
6313 no,*) add_this_lang=no ;;
6314 *,all,*) add_this_lang=yes ;;
6315 *) add_this_lang=no ;;
6316 esac
71205e0b
MH
6317 if test x"${add_this_lang}" = xyes; then
6318 case $lang in
6319 ${srcdir}/ada/config-lang.in)
1ffc5c6e 6320 if test x$have_gnat = xyes ; then
71205e0b
MH
6321 subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
6322 fi
6323 ;;
6324 *)
6325 subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([^/]*\)/config-lang.in$,\1,'`"
6326 ;;
6327 esac
6328 fi
6329 ;;
861bb6c1
JL
6330 esac
6331done
6332
f24af81b
TT
6333# Make gthr-default.h if we have a thread file.
6334gthread_flags=
75bffa71 6335if test $thread_file != single; then
f24af81b 6336 rm -f gthr-default.h
db0d1ed9 6337 echo "#include \"gthr-${thread_file}.h\"" > gthr-default.h
f24af81b
TT
6338 gthread_flags=-DHAVE_GTHR_DEFAULT
6339fi
6340
6341
81bf3d9e
RH
6342# Find out what GC implementation we want, or may, use.
6343# Check whether --with-gc or --without-gc was given.
6344if test "${with_gc+set}" = set; then
6345 withval="$with_gc"
6346 case "$withval" in
6347 simple | page)
6348 GGC=ggc-$withval
6349 ;;
6350 *)
6351 { echo "configure: error: $withval is an invalid option to --with-gc" 1>&2; exit 1; }
6352 ;;
6353esac
6354else
005537df 6355 GGC=ggc-page
81bf3d9e
RH
6356fi
6357
6358
6359echo "Using $GGC for garbage collection."
6360
3c809ba4 6361# Use the system's zlib library.
b8dad04b
ZW
6362zlibdir=-L../zlib
6363zlibinc="-I\$(srcdir)/../zlib"
3c809ba4
AG
6364# Check whether --with-system-zlib or --without-system-zlib was given.
6365if test "${with_system_zlib+set}" = set; then
6366 withval="$with_system_zlib"
6367 zlibdir=
6368zlibinc=
6369
6370fi
6371
6372
6373
6374
119d24d1 6375cat >> confdefs.h <<EOF
22fdd65e 6376#define ENABLE_STD_NAMESPACE 1
119d24d1 6377EOF
7822500a
BK
6378
6379
dc6746e7
PT
6380
6381echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
1bf17cc4 6382echo "configure:6383: checking whether to enable maintainer-specific portions of Makefiles" >&5
dc6746e7
PT
6383 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
6384if test "${enable_maintainer_mode+set}" = set; then
6385 enableval="$enable_maintainer_mode"
6386 maintainer_mode=$enableval
6387else
6388 maintainer_mode=no
6389fi
6390
6391
6392echo "$ac_t""$maintainer_mode" 1>&6
6393
6394if test "$maintainer_mode" = "yes"; then
6395 MAINT=''
6396else
6397 MAINT='#'
6398fi
6399
861bb6c1
JL
6400# Make empty files to contain the specs and options for each language.
6401# Then add #include lines to for a compiler that has specs and/or options.
6402
6403lang_specs_files=
6404lang_options_files=
3103b7db
ML
6405lang_tree_files=
6406rm -f specs.h options.h gencheck.h
6407touch specs.h options.h gencheck.h
861bb6c1
JL
6408for subdir in . $subdirs
6409do
75bffa71 6410 if test -f $srcdir/$subdir/lang-specs.h; then
861bb6c1
JL
6411 echo "#include \"$subdir/lang-specs.h\"" >>specs.h
6412 lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
6413 fi
75bffa71 6414 if test -f $srcdir/$subdir/lang-options.h; then
861bb6c1
JL
6415 echo "#include \"$subdir/lang-options.h\"" >>options.h
6416 lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
6417 fi
3103b7db
ML
6418 if test -f $srcdir/$subdir/$subdir-tree.def; then
6419 echo "#include \"$subdir/$subdir-tree.def\"" >>gencheck.h
6420 lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
6421 fi
861bb6c1
JL
6422done
6423
6424# These (without "all_") are set in each config-lang.in.
6425# `language' must be a single word so is spelled singularly.
6426all_languages=
6427all_boot_languages=
6428all_compilers=
6429all_stagestuff=
6430all_diff_excludes=
3ec83fc2 6431all_outputs='Makefile intl/Makefile po/Makefile.in fixinc/Makefile gccbug mklibgcc'
861bb6c1
JL
6432# List of language makefile fragments.
6433all_lang_makefiles=
6434all_headers=
6435all_lib2funcs=
6436
6437# Add the language fragments.
6438# Languages are added via two mechanisms. Some information must be
6439# recorded in makefile variables, these are defined in config-lang.in.
6440# We accumulate them and plug them into the main Makefile.
6441# The other mechanism is a set of hooks for each of the main targets
6442# like `clean', `install', etc.
6443
6444language_fragments="Make-lang"
6445language_hooks="Make-hooks"
861bb6c1
JL
6446
6447for s in .. $subdirs
6448do
75bffa71 6449 if test $s != ".."
861bb6c1
JL
6450 then
6451 language=
6452 boot_language=
6453 compilers=
6454 stagestuff=
6455 diff_excludes=
6456 headers=
6457 outputs=
6458 lib2funcs=
6459 . ${srcdir}/$s/config-lang.in
75bffa71 6460 if test "x$language" = x
861bb6c1
JL
6461 then
6462 echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
6463 exit 1
6464 fi
72aaffbd
ZW
6465 all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in"
6466 if test -f ${srcdir}/$s/Makefile.in
6467 then all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Makefile.in"
6468 fi
861bb6c1 6469 all_languages="$all_languages $language"
75bffa71 6470 if test "x$boot_language" = xyes
861bb6c1
JL
6471 then
6472 all_boot_languages="$all_boot_languages $language"
6473 fi
6474 all_compilers="$all_compilers $compilers"
6475 all_stagestuff="$all_stagestuff $stagestuff"
6476 all_diff_excludes="$all_diff_excludes $diff_excludes"
6477 all_headers="$all_headers $headers"
6478 all_outputs="$all_outputs $outputs"
861bb6c1
JL
6479 all_lib2funcs="$all_lib2funcs $lib2funcs"
6480 fi
6481done
6482
cbc59f01
DD
6483check_languages=
6484for language in .. $all_languages
6485do
6486 if test $language != ".."
6487 then
6488 check_languages="$check_languages check-$language"
6489 fi
6490done
6491
861bb6c1
JL
6492# Since we can't use `::' targets, we link each language in
6493# with a set of hooks, reached indirectly via lang.${target}.
6494
6495rm -f Make-hooks
6496touch Make-hooks
6497target_list="all.build all.cross start.encap rest.encap \
6498 info dvi \
6499 install-normal install-common install-info install-man \
436a88a6 6500 uninstall \
861bb6c1
JL
6501 mostlyclean clean distclean extraclean maintainer-clean \
6502 stage1 stage2 stage3 stage4"
6503for t in $target_list
6504do
6505 x=
ab87f8c8 6506 for lang in .. $all_languages
861bb6c1 6507 do
ab87f8c8
JL
6508 if test $lang != ".."; then
6509 x="$x $lang.$t"
861bb6c1
JL
6510 fi
6511 done
6512 echo "lang.$t: $x" >> Make-hooks
6513done
6514
cc06d68c 6515# Create .gdbinit.
861bb6c1 6516
cc06d68c
GP
6517echo "dir ." > .gdbinit
6518echo "dir ${srcdir}" >> .gdbinit
6519if test x$gdb_needs_out_file_path = xyes
6520then
6521 echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
6522fi
6523if test "x$subdirs" != x; then
6524 for s in $subdirs
6525 do
6526 echo "dir ${srcdir}/$s" >> .gdbinit
6527 done
861bb6c1 6528fi
cc06d68c 6529echo "source ${srcdir}/gdbinit.in" >> .gdbinit
861bb6c1 6530
88111b26
JL
6531# Define variables host_canonical and build_canonical
6532# because some Cygnus local changes in the Makefile depend on them.
6533build_canonical=${build}
6534host_canonical=${host}
6535target_subdir=
75bffa71 6536if test "${host}" != "${target}" ; then
88111b26
JL
6537 target_subdir=${target}/
6538fi
6539
6540
6541
6542
8f8d3278
NC
6543# If $(exec_prefix) exists and is not the same as $(prefix), then compute an
6544# absolute path for gcc_tooldir based on inserting the number of up-directory
6545# movements required to get from $(exec_prefix) to $(prefix) into the basic
6546# $(libsubdir)/@(unlibsubdir) based path.
82cbf8f7
JL
6547# Don't set gcc_tooldir to tooldir since that's only passed in by the toplevel
6548# make and thus we'd get different behavior depending on where we built the
6549# sources.
5949a9fc 6550if test x$exec_prefix = xNONE -o x$exec_prefix = x$prefix; then
d062c304
JL
6551 gcc_tooldir='$(libsubdir)/$(unlibsubdir)/../$(target_alias)'
6552else
8f8d3278
NC
6553# An explanation of the sed strings:
6554# -e 's|^\$(prefix)||' matches and eliminates 'prefix' from 'exec_prefix'
6555# -e 's|/$||' match a trailing forward slash and eliminates it
6556# -e 's|^[^/]|/|' forces the string to start with a forward slash (*)
6557# -e 's|/[^/]*|../|g' replaces each occurance of /<directory> with ../
6558#
6559# (*) Note this pattern overwrites the first character of the string
6560# with a forward slash if one is not already present. This is not a
6561# problem because the exact names of the sub-directories concerned is
6562# unimportant, just the number of them matters.
6563#
6564# The practical upshot of these patterns is like this:
6565#
6566# prefix exec_prefix result
6567# ------ ----------- ------
6568# /foo /foo/bar ../
6569# /foo/ /foo/bar ../
6570# /foo /foo/bar/ ../
6571# /foo/ /foo/bar/ ../
6572# /foo /foo/bar/ugg ../../
6573#
4c112cda
NC
6574 dollar='$$'
6575 gcc_tooldir="\$(libsubdir)/\$(unlibsubdir)/\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/\$(dollar)||' -e 's|^[^/]|/|' -e 's|/[^/]*|../|g'\`\$(target_alias)"
d062c304
JL
6576fi
6577
6578
2ce3c6c6 6579
2bbea3a6
RH
6580# Find a directory in which to install a shared libgcc.
6581
6582# Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given.
6583if test "${enable_version_specific_runtime_libs+set}" = set; then
6584 enableval="$enable_version_specific_runtime_libs"
6585 :
6586fi
6587
6588
5b15f277
RH
6589# Check whether --with-slibdir or --without-slibdir was given.
6590if test "${with_slibdir+set}" = set; then
6591 withval="$with_slibdir"
6592 slibdir="$with_slibdir"
6593else
6594 if test "${enable_version_specific_runtime_libs+set}" = set; then
2bbea3a6 6595 slibdir='$(libsubdir)'
5b15f277 6596elif test "$host" != "$target"; then
2bbea3a6
RH
6597 slibdir='$(build_tooldir)/lib'
6598else
5b15f277 6599 slibdir='$(libdir)'
2bbea3a6 6600fi
5b15f277
RH
6601fi
6602
2bbea3a6
RH
6603
6604
7e717196
JL
6605# Nothing to do for FLOAT_H, float_format already handled.
6606objdir=`pwd`
6607
6608
861bb6c1
JL
6609# Process the language and host/target makefile fragments.
6610${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
6611
6612# Substitute configuration variables
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
9b16d2c4 6659
e9a25f70 6660
6e26218f 6661
c8724862 6662
e061d1ce 6663
d8bb17c8 6664
11642c3a
ZW
6665
6666
6667
6668
6669
6670
6671
6672
9fc9b82a 6673
8763704d 6674
aac69a49
NC
6675
6676
cc1e60ea 6677
e2187d3b 6678
cbc59f01 6679
861bb6c1
JL
6680
6681
6682# Echo that links are built
75bffa71 6683if test x$host = x$target
861bb6c1
JL
6684then
6685 str1="native "
6686else
6687 str1="cross-"
6688 str2=" from $host"
6689fi
6690
75bffa71 6691if test x$host != x$build
861bb6c1
JL
6692then
6693 str3=" on a $build system"
6694fi
6695
75bffa71 6696if test "x$str2" != x || test "x$str3" != x
861bb6c1
JL
6697then
6698 str4=
6699fi
6700
6701echo "Links are now set up to build a ${str1}compiler for ${target}$str4" 1>&2
6702
75bffa71 6703if test "x$str2" != x || test "x$str3" != x
861bb6c1
JL
6704then
6705 echo " ${str2}${str3}." 1>&2
6706fi
6707
f6cb0e63 6708# Truncate the target if necessary
75bffa71 6709if test x$host_truncate_target != x; then
f6cb0e63
JL
6710 target=`echo $target | sed -e 's/\(..............\).*/\1/'`
6711fi
6712
861bb6c1
JL
6713# Configure the subdirectories
6714# AC_CONFIG_SUBDIRS($subdirs)
6715
6716# Create the Makefile
6717# and configure language subdirectories
6718trap '' 1 2 15
6719cat > confcache <<\EOF
6720# This file is a shell script that caches the results of configure
6721# tests run on this system so they can be shared between configure
6722# scripts and configure runs. It is not useful on other systems.
6723# If it contains results you don't want to keep, you may remove or edit it.
6724#
6725# By default, configure uses ./config.cache as the cache file,
6726# creating it if it does not exist already. You can give configure
6727# the --cache-file=FILE option to use a different cache file; that is
6728# what configure does when it calls configure scripts in
6729# subdirectories, so they share the cache.
6730# Giving --cache-file=/dev/null disables caching, for debugging configure.
6731# config.status only pays attention to the cache file if you give it the
6732# --recheck option to rerun configure.
6733#
6734EOF
6735# The following way of writing the cache mishandles newlines in values,
6736# but we know of no workaround that is simple, portable, and efficient.
6737# So, don't put newlines in cache variables' values.
6738# Ultrix sh set writes to stderr and can't be redirected directly,
6739# and sets the high bit in the cache file unless we assign to the vars.
6740(set) 2>&1 |
b27d2bd5 6741 case `(ac_space=' '; set | grep ac_space) 2>&1` in
861bb6c1
JL
6742 *ac_space=\ *)
6743 # `set' does not quote correctly, so add quotes (double-quote substitution
6744 # turns \\\\ into \\, and sed turns \\ into \).
6745 sed -n \
6746 -e "s/'/'\\\\''/g" \
6747 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
6748 ;;
6749 *)
6750 # `set' quotes correctly as required by POSIX, so do not add quotes.
6751 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
6752 ;;
6753 esac >> confcache
6754if cmp -s $cache_file confcache; then
6755 :
6756else
6757 if test -w $cache_file; then
6758 echo "updating cache $cache_file"
6759 cat confcache > $cache_file
6760 else
6761 echo "not updating unwritable cache $cache_file"
6762 fi
6763fi
6764rm -f confcache
6765
6766trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
6767
6768test "x$prefix" = xNONE && prefix=$ac_default_prefix
6769# Let make expand exec_prefix.
6770test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
6771
6772# Any assignment to VPATH causes Sun make to only execute
6773# the first set of double-colon rules, so remove it if not needed.
6774# If there is a colon in the path, we need to keep it.
6775if test "x$srcdir" = x.; then
6776 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
6777fi
6778
6779trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
6780
6781DEFS=-DHAVE_CONFIG_H
6782
6783# Without the "./", some shells look in PATH for config.status.
6784: ${CONFIG_STATUS=./config.status}
6785
6786echo creating $CONFIG_STATUS
6787rm -f $CONFIG_STATUS
6788cat > $CONFIG_STATUS <<EOF
6789#! /bin/sh
6790# Generated automatically by configure.
6791# Run this file to recreate the current configuration.
6792# This directory was configured as follows,
6793# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
6794#
6795# $0 $ac_configure_args
6796#
6797# Compiler output produced by configure, useful for debugging
6798# configure, is in ./config.log if it exists.
6799
6800ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
6801for ac_option
6802do
6803 case "\$ac_option" in
6804 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
6805 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
6806 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
6807 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
b27d2bd5 6808 echo "$CONFIG_STATUS generated by autoconf version 2.13"
861bb6c1
JL
6809 exit 0 ;;
6810 -help | --help | --hel | --he | --h)
6811 echo "\$ac_cs_usage"; exit 0 ;;
6812 *) echo "\$ac_cs_usage"; exit 1 ;;
6813 esac
6814done
6815
6816ac_given_srcdir=$srcdir
861bb6c1 6817
b7cb92ad 6818trap 'rm -fr `echo "$all_outputs auto-host.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
861bb6c1
JL
6819EOF
6820cat >> $CONFIG_STATUS <<EOF
6821
6822# Protect against being on the right side of a sed subst in config.status.
6823sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
6824 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
6825$ac_vpsub
6826$extrasub
6f144c9c 6827s%@SHELL@%$SHELL%g
861bb6c1
JL
6828s%@CFLAGS@%$CFLAGS%g
6829s%@CPPFLAGS@%$CPPFLAGS%g
6830s%@CXXFLAGS@%$CXXFLAGS%g
b27d2bd5 6831s%@FFLAGS@%$FFLAGS%g
861bb6c1
JL
6832s%@DEFS@%$DEFS%g
6833s%@LDFLAGS@%$LDFLAGS%g
6834s%@LIBS@%$LIBS%g
6835s%@exec_prefix@%$exec_prefix%g
6836s%@prefix@%$prefix%g
6837s%@program_transform_name@%$program_transform_name%g
6838s%@bindir@%$bindir%g
6839s%@sbindir@%$sbindir%g
6840s%@libexecdir@%$libexecdir%g
6841s%@datadir@%$datadir%g
6842s%@sysconfdir@%$sysconfdir%g
6843s%@sharedstatedir@%$sharedstatedir%g
6844s%@localstatedir@%$localstatedir%g
6845s%@libdir@%$libdir%g
6846s%@includedir@%$includedir%g
6847s%@oldincludedir@%$oldincludedir%g
6848s%@infodir@%$infodir%g
6849s%@mandir@%$mandir%g
39d6f2e8 6850s%@enable_multilib@%$enable_multilib%g
50503ac8 6851s%@enable_shared@%$enable_shared%g
861bb6c1
JL
6852s%@host@%$host%g
6853s%@host_alias@%$host_alias%g
6854s%@host_cpu@%$host_cpu%g
6855s%@host_vendor@%$host_vendor%g
6856s%@host_os@%$host_os%g
6857s%@target@%$target%g
6858s%@target_alias@%$target_alias%g
6859s%@target_cpu@%$target_cpu%g
6860s%@target_vendor@%$target_vendor%g
6861s%@target_os@%$target_os%g
6862s%@build@%$build%g
6863s%@build_alias@%$build_alias%g
6864s%@build_cpu@%$build_cpu%g
6865s%@build_vendor@%$build_vendor%g
6866s%@build_os@%$build_os%g
e9a25f70 6867s%@CC@%$CC%g
3ec83fc2 6868s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
b8dad04b
ZW
6869s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
6870s%@strict1_warn@%$strict1_warn%g
6871s%@warn_cflags@%$warn_cflags%g
6872s%@stage1_cflags@%$stage1_cflags%g
e9a25f70 6873s%@SET_MAKE@%$SET_MAKE%g
861bb6c1 6874s%@AWK@%$AWK%g
0a4b6309
RL
6875s%@LN@%$LN%g
6876s%@LN_S@%$LN_S%g
861bb6c1 6877s%@RANLIB@%$RANLIB%g
0a4b6309
RL
6878s%@INSTALL@%$INSTALL%g
6879s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
6880s%@INSTALL_DATA@%$INSTALL_DATA%g
861bb6c1 6881s%@CPP@%$CPP%g
1ffc5c6e 6882s%@have_gnat@%$have_gnat%g
955be633 6883s%@have_mktemp_command@%$have_mktemp_command%g
09fa0705
ZW
6884s%@MAKEINFO@%$MAKEINFO%g
6885s%@BUILD_INFO@%$BUILD_INFO%g
fd939e46 6886s%@GENERATED_MANPAGES@%$GENERATED_MANPAGES%g
1e608388
ZW
6887s%@FLEX@%$FLEX%g
6888s%@BISON@%$BISON%g
e256b8b6 6889s%@TARGET_GETGROUPS_T@%$TARGET_GETGROUPS_T%g
0a4b6309
RL
6890s%@vfprintf@%$vfprintf%g
6891s%@doprint@%$doprint%g
b3e1e64f 6892s%@strstr@%$strstr%g
861bb6c1 6893s%@manext@%$manext%g
992d1248 6894s%@objext@%$objext%g
ab87f8c8
JL
6895s%@PACKAGE@%$PACKAGE%g
6896s%@VERSION@%$VERSION%g
4adee315 6897s%@CHECK_PO@%$CHECK_PO%g
ab87f8c8
JL
6898s%@USE_NLS@%$USE_NLS%g
6899s%@MSGFMT@%$MSGFMT%g
6900s%@GMSGFMT@%$GMSGFMT%g
6901s%@XGETTEXT@%$XGETTEXT%g
6902s%@GENCAT@%$GENCAT%g
6903s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g
6904s%@CATALOGS@%$CATALOGS%g
6905s%@CATOBJEXT@%$CATOBJEXT%g
6906s%@DATADIRNAME@%$DATADIRNAME%g
6907s%@GMOFILES@%$GMOFILES%g
6908s%@INSTOBJEXT@%$INSTOBJEXT%g
6909s%@INTLDEPS@%$INTLDEPS%g
6910s%@INTLLIBS@%$INTLLIBS%g
6911s%@INTLOBJS@%$INTLOBJS%g
6912s%@POFILES@%$POFILES%g
6913s%@POSUB@%$POSUB%g
6914s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
6915s%@GT_NO@%$GT_NO%g
6916s%@GT_YES@%$GT_YES%g
6917s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
6918s%@l@%$l%g
b39d221a 6919s%@inhibit_libc@%$inhibit_libc%g
f24af81b 6920s%@gthread_flags@%$gthread_flags%g
81bf3d9e 6921s%@GGC@%$GGC%g
3c809ba4
AG
6922s%@zlibdir@%$zlibdir%g
6923s%@zlibinc@%$zlibinc%g
dc6746e7 6924s%@MAINT@%$MAINT%g
88111b26
JL
6925s%@build_canonical@%$build_canonical%g
6926s%@host_canonical@%$host_canonical%g
6927s%@target_subdir@%$target_subdir%g
d062c304 6928s%@gcc_tooldir@%$gcc_tooldir%g
4c112cda 6929s%@dollar@%$dollar%g
2bbea3a6 6930s%@slibdir@%$slibdir%g
7e717196 6931s%@objdir@%$objdir%g
861bb6c1 6932s%@subdirs@%$subdirs%g
861bb6c1
JL
6933s%@all_boot_languages@%$all_boot_languages%g
6934s%@all_compilers@%$all_compilers%g
861bb6c1 6935s%@all_diff_excludes@%$all_diff_excludes%g
861bb6c1 6936s%@all_headers@%$all_headers%g
4f3ae93c
BK
6937s%@all_lang_makefiles@%$all_lang_makefiles%g
6938s%@all_languages@%$all_languages%g
6939s%@all_lib2funcs@%$all_lib2funcs%g
6940s%@all_stagestuff@%$all_stagestuff%g
6941s%@build_exeext@%$build_exeext%g
6942s%@build_install_headers_dir@%$build_install_headers_dir%g
6943s%@build_xm_file_list@%$build_xm_file_list%g
11642c3a
ZW
6944s%@build_xm_file@%$build_xm_file%g
6945s%@build_xm_defines@%$build_xm_defines%g
cbc59f01 6946s%@check_languages@%$check_languages%g
4f3ae93c 6947s%@cc_set_by_configure@%$cc_set_by_configure%g
5aa82ace 6948s%@quoted_cc_set_by_configure@%$quoted_cc_set_by_configure%g
4f3ae93c 6949s%@cpp_install_dir@%$cpp_install_dir%g
4f3ae93c
BK
6950s%@dep_host_xmake_file@%$dep_host_xmake_file%g
6951s%@dep_tmake_file@%$dep_tmake_file%g
6952s%@extra_c_flags@%$extra_c_flags%g
4f3ae93c 6953s%@extra_headers_list@%$extra_headers_list%g
861bb6c1 6954s%@extra_objs@%$extra_objs%g
4f3ae93c
BK
6955s%@extra_parts@%$extra_parts%g
6956s%@extra_passes@%$extra_passes%g
6957s%@extra_programs@%$extra_programs%g
4f3ae93c 6958s%@float_h_file@%$float_h_file%g
cc1e60ea 6959s%@gcc_config_arguments@%$gcc_config_arguments%g
4f3ae93c 6960s%@gcc_gxx_include_dir@%$gcc_gxx_include_dir%g
e2187d3b 6961s%@libstdcxx_incdir@%$libstdcxx_incdir%g
4f3ae93c 6962s%@gcc_version@%$gcc_version%g
8763704d 6963s%@gcc_version_full@%$gcc_version_full%g
4f3ae93c
BK
6964s%@gcc_version_trigger@%$gcc_version_trigger%g
6965s%@host_exeext@%$host_exeext%g
861bb6c1 6966s%@host_extra_gcc_objs@%$host_extra_gcc_objs%g
861bb6c1 6967s%@host_xm_file_list@%$host_xm_file_list%g
11642c3a
ZW
6968s%@host_xm_file@%$host_xm_file%g
6969s%@host_xm_defines@%$host_xm_defines%g
4f3ae93c 6970s%@install@%$install%g
861bb6c1 6971s%@lang_options_files@%$lang_options_files%g
4f3ae93c 6972s%@lang_specs_files@%$lang_specs_files%g
3103b7db 6973s%@lang_tree_files@%$lang_tree_files%g
861bb6c1 6974s%@local_prefix@%$local_prefix%g
861bb6c1 6975s%@maybe_use_collect2@%$maybe_use_collect2%g
4f3ae93c
BK
6976s%@md_file@%$md_file%g
6977s%@objc_boehm_gc@%$objc_boehm_gc%g
6978s%@out_file@%$out_file%g
6979s%@out_object_file@%$out_object_file%g
861bb6c1 6980s%@stage_prefix_set_by_configure@%$stage_prefix_set_by_configure%g
e9a25f70 6981s%@symbolic_link@%$symbolic_link%g
4f3ae93c
BK
6982s%@thread_file@%$thread_file%g
6983s%@tm_file_list@%$tm_file_list%g
11642c3a
ZW
6984s%@tm_file@%$tm_file%g
6985s%@tm_p_file_list@%$tm_p_file_list%g
6986s%@tm_p_file@%$tm_p_file%g
6987s%@xm_file@%$xm_file%g
4f3ae93c 6988s%@will_use_collect2@%$will_use_collect2%g
aac69a49
NC
6989s%@c_target_objs@%$c_target_objs%g
6990s%@cxx_target_objs@%$cxx_target_objs%g
11642c3a 6991s%@target_cpu_default@%$target_cpu_default%g
861bb6c1
JL
6992/@target_overrides@/r $target_overrides
6993s%@target_overrides@%%g
6994/@host_overrides@/r $host_overrides
6995s%@host_overrides@%%g
6996s%@cross_defines@%$cross_defines%g
6997/@cross_overrides@/r $cross_overrides
6998s%@cross_overrides@%%g
6999/@build_overrides@/r $build_overrides
7000s%@build_overrides@%%g
7001/@language_fragments@/r $language_fragments
7002s%@language_fragments@%%g
7003/@language_hooks@/r $language_hooks
7004s%@language_hooks@%%g
7005
7006CEOF
7007EOF
7008
7009cat >> $CONFIG_STATUS <<\EOF
7010
7011# Split the substitutions into bite-sized pieces for seds with
7012# small command number limits, like on Digital OSF/1 and HP-UX.
7013ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
7014ac_file=1 # Number of current file.
7015ac_beg=1 # First line for current file.
7016ac_end=$ac_max_sed_cmds # Line after last line for current file.
7017ac_more_lines=:
7018ac_sed_cmds=""
7019while $ac_more_lines; do
7020 if test $ac_beg -gt 1; then
7021 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
7022 else
7023 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
7024 fi
7025 if test ! -s conftest.s$ac_file; then
7026 ac_more_lines=false
7027 rm -f conftest.s$ac_file
7028 else
7029 if test -z "$ac_sed_cmds"; then
7030 ac_sed_cmds="sed -f conftest.s$ac_file"
7031 else
7032 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
7033 fi
7034 ac_file=`expr $ac_file + 1`
7035 ac_beg=$ac_end
7036 ac_end=`expr $ac_end + $ac_max_sed_cmds`
7037 fi
7038done
7039if test -z "$ac_sed_cmds"; then
7040 ac_sed_cmds=cat
7041fi
7042EOF
7043
7044cat >> $CONFIG_STATUS <<EOF
7045
7046CONFIG_FILES=\${CONFIG_FILES-"$all_outputs"}
7047EOF
7048cat >> $CONFIG_STATUS <<\EOF
7049for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
7050 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7051 case "$ac_file" in
7052 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7053 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7054 *) ac_file_in="${ac_file}.in" ;;
7055 esac
7056
7057 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
7058
7059 # Remove last slash and all that follows it. Not all systems have dirname.
7060 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7061 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7062 # The file is in a subdirectory.
7063 test ! -d "$ac_dir" && mkdir "$ac_dir"
7064 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
7065 # A "../" for each directory in $ac_dir_suffix.
7066 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
7067 else
7068 ac_dir_suffix= ac_dots=
7069 fi
7070
7071 case "$ac_given_srcdir" in
7072 .) srcdir=.
7073 if test -z "$ac_dots"; then top_srcdir=.
7074 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
7075 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
7076 *) # Relative path.
7077 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
7078 top_srcdir="$ac_dots$ac_given_srcdir" ;;
7079 esac
7080
861bb6c1
JL
7081
7082 echo creating "$ac_file"
7083 rm -f "$ac_file"
7084 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
7085 case "$ac_file" in
7086 *Makefile*) ac_comsub="1i\\
7087# $configure_input" ;;
7088 *) ac_comsub= ;;
7089 esac
7090
7091 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7092 sed -e "$ac_comsub
7093s%@configure_input@%$configure_input%g
7094s%@srcdir@%$srcdir%g
7095s%@top_srcdir@%$top_srcdir%g
861bb6c1
JL
7096" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
7097fi; done
7098rm -f conftest.s*
7099
7100# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
7101# NAME is the cpp macro being defined and VALUE is the value it is being given.
7102#
7103# ac_d sets the value in "#define NAME VALUE" lines.
7104ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
7105ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
7106ac_dC='\3'
7107ac_dD='%g'
7108# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
7109ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
7110ac_uB='\([ ]\)%\1#\2define\3'
7111ac_uC=' '
7112ac_uD='\4%g'
7113# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
7114ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
7115ac_eB='$%\1#\2define\3'
7116ac_eC=' '
7117ac_eD='%g'
7118
7119if test "${CONFIG_HEADERS+set}" != set; then
7120EOF
7121cat >> $CONFIG_STATUS <<EOF
b7cb92ad 7122 CONFIG_HEADERS="auto-host.h:config.in"
861bb6c1
JL
7123EOF
7124cat >> $CONFIG_STATUS <<\EOF
7125fi
7126for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
7127 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
7128 case "$ac_file" in
7129 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
7130 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7131 *) ac_file_in="${ac_file}.in" ;;
7132 esac
7133
7134 echo creating $ac_file
7135
7136 rm -f conftest.frag conftest.in conftest.out
7137 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
7138 cat $ac_file_inputs > conftest.in
7139
7140EOF
7141
7142# Transform confdefs.h into a sed script conftest.vals that substitutes
7143# the proper values into config.h.in to produce config.h. And first:
7144# Protect against being on the right side of a sed subst in config.status.
7145# Protect against being in an unquoted here document in config.status.
7146rm -f conftest.vals
7147cat > conftest.hdr <<\EOF
7148s/[\\&%]/\\&/g
7149s%[\\$`]%\\&%g
7150s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
7151s%ac_d%ac_u%gp
7152s%ac_u%ac_e%gp
7153EOF
7154sed -n -f conftest.hdr confdefs.h > conftest.vals
7155rm -f conftest.hdr
7156
7157# This sed command replaces #undef with comments. This is necessary, for
7158# example, in the case of _POSIX_SOURCE, which is predefined and required
7159# on some systems where configure will not decide to define it.
7160cat >> conftest.vals <<\EOF
7161s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
7162EOF
7163
7164# Break up conftest.vals because some shells have a limit on
7165# the size of here documents, and old seds have small limits too.
7166
7167rm -f conftest.tail
7168while :
7169do
7170 ac_lines=`grep -c . conftest.vals`
7171 # grep -c gives empty output for an empty file on some AIX systems.
7172 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
7173 # Write a limited-size here document to conftest.frag.
7174 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
7175 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
7176 echo 'CEOF
7177 sed -f conftest.frag conftest.in > conftest.out
7178 rm -f conftest.in
7179 mv conftest.out conftest.in
7180' >> $CONFIG_STATUS
7181 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
7182 rm -f conftest.vals
7183 mv conftest.tail conftest.vals
7184done
7185rm -f conftest.vals
7186
7187cat >> $CONFIG_STATUS <<\EOF
7188 rm -f conftest.frag conftest.h
7189 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
7190 cat conftest.in >> conftest.h
7191 rm -f conftest.in
7192 if cmp -s $ac_file conftest.h 2>/dev/null; then
7193 echo "$ac_file is unchanged"
7194 rm -f conftest.h
7195 else
7196 # Remove last slash and all that follows it. Not all systems have dirname.
7197 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
7198 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
7199 # The file is in a subdirectory.
7200 test ! -d "$ac_dir" && mkdir "$ac_dir"
7201 fi
7202 rm -f $ac_file
7203 mv conftest.h $ac_file
7204 fi
7205fi; done
7206
ab87f8c8
JL
7207EOF
7208
7209cat >> $CONFIG_STATUS <<EOF
7210ac_sources="$nls_cv_header_libgt"
7211ac_dests="$nls_cv_header_intl"
7212EOF
7213
7214cat >> $CONFIG_STATUS <<\EOF
7215srcdir=$ac_given_srcdir
7216while test -n "$ac_sources"; do
7217 set $ac_dests; ac_dest=$1; shift; ac_dests=$*
7218 set $ac_sources; ac_source=$1; shift; ac_sources=$*
7219
7220 echo "linking $srcdir/$ac_source to $ac_dest"
7221
7222 if test ! -r $srcdir/$ac_source; then
7223 { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
7224 fi
7225 rm -f $ac_dest
7226
7227 # Make relative symlinks.
7228 # Remove last slash and all that follows it. Not all systems have dirname.
7229 ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
7230 if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
7231 # The dest file is in a subdirectory.
7232 test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
7233 ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
7234 # A "../" for each directory in $ac_dest_dir_suffix.
7235 ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
7236 else
7237 ac_dest_dir_suffix= ac_dots=
7238 fi
7239
7240 case "$srcdir" in
7241 [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
7242 *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
7243 esac
7244
7245 # Make a symlink if possible; otherwise try a hard link.
7246 if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
7247 ln $srcdir/$ac_source $ac_dest; then :
7248 else
7249 { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
7250 fi
7251done
861bb6c1
JL
7252EOF
7253cat >> $CONFIG_STATUS <<EOF
7254
ab87f8c8 7255
861bb6c1
JL
7256host='${host}'
7257build='${build}'
7258target='${target}'
7259target_alias='${target_alias}'
7260srcdir='${srcdir}'
7261subdirs='${subdirs}'
861bb6c1
JL
7262symbolic_link='${symbolic_link}'
7263program_transform_set='${program_transform_set}'
7264program_transform_name='${program_transform_name}'
7265dep_host_xmake_file='${dep_host_xmake_file}'
7266host_xmake_file='${host_xmake_file}'
7267dep_tmake_file='${dep_tmake_file}'
7268tmake_file='${tmake_file}'
7269thread_file='${thread_file}'
cc1e60ea 7270gcc_config_arguments='${gcc_config_arguments}'
f1943b77 7271gcc_version='${gcc_version}'
8763704d 7272gcc_version_full='${gcc_version_full}'
f1943b77 7273gcc_version_trigger='${gcc_version_trigger}'
861bb6c1
JL
7274local_prefix='${local_prefix}'
7275build_install_headers_dir='${build_install_headers_dir}'
7276build_exeext='${build_exeext}'
6e26218f 7277host_exeext='${host_exeext}'
7ed46111 7278out_file='${out_file}'
861bb6c1
JL
7279gdb_needs_out_file_path='${gdb_needs_out_file_path}'
7280SET_MAKE='${SET_MAKE}'
861bb6c1
JL
7281target_list='${target_list}'
7282target_overrides='${target_overrides}'
7283host_overrides='${host_overrides}'
7284cross_defines='${cross_defines}'
7285cross_overrides='${cross_overrides}'
7286build_overrides='${build_overrides}'
9fc9b82a 7287cpp_install_dir='${cpp_install_dir}'
861bb6c1
JL
7288
7289EOF
7290cat >> $CONFIG_STATUS <<\EOF
ab87f8c8
JL
7291case "$CONFIG_FILES" in *po/Makefile.in*)
7292 sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
7293 esac
861bb6c1 7294
861bb6c1 7295case x$CONFIG_HEADERS in
b7cb92ad 7296xauto-host.h:config.in)
861bb6c1
JL
7297echo > cstamp-h ;;
7298esac
93cf819d
BK
7299# If the host supports symlinks, point stage[1234] at ../stage[1234] so
7300# bootstrapping and the installation procedure can still use
7301# CC="stage1/xgcc -Bstage1/". If the host doesn't support symlinks,
7302# FLAGS_TO_PASS has been modified to solve the problem there.
7303# This is virtually a duplicate of what happens in configure.lang; we do
7304# an extra check to make sure this only happens if ln -s can be used.
75bffa71 7305if test "$symbolic_link" = "ln -s"; then
93cf819d 7306 for d in .. ${subdirs} ; do
75bffa71 7307 if test $d != ..; then
4e8a434e
BK
7308 STARTDIR=`pwd`
7309 cd $d
7310 for t in stage1 stage2 stage3 stage4 include
7311 do
7312 rm -f $t
7313 $symbolic_link ../$t $t 2>/dev/null
7314 done
7315 cd $STARTDIR
93cf819d
BK
7316 fi
7317 done
7318else true ; fi
ab87f8c8
JL
7319# Avoid having to add intl to our include paths.
7320if test -f intl/libintl.h; then
7321 echo creating libintl.h
7322 echo '#include "intl/libintl.h"' >libintl.h
7323fi
861bb6c1
JL
7324
7325exit 0
7326EOF
7327chmod +x $CONFIG_STATUS
7328rm -fr confdefs* $ac_clean_files
7329test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
7330