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