]> git.ipfire.org Git - thirdparty/gcc.git/blame - libiberty/configure
gcj.texi: Fixed gcj invocation example so that it compiles.
[thirdparty/gcc.git] / libiberty / configure
CommitLineData
0bc0cd11
JL
1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
687361c8 4# Generated automatically using autoconf version 2.13
0bc0cd11
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
cd862df8
L
15 --with-target-subdir=SUBDIR Configuring in a subdirectory for target"
16ac_help="$ac_help
17 --with-build-subdir=SUBDIR Configuring in a subdirectory for build"
ca6b370d
JL
18ac_help="$ac_help
19 --with-cross-host=HOST Configuring with a cross compiler"
0bc0cd11
JL
20ac_help="$ac_help
21 --with-newlib Configuring with newlib"
aaa5f039
DD
22ac_help="$ac_help
23 --enable-maintainer-mode
24 enable make rules and dependencies not useful
25 (and sometimes confusing) to the casual installer"
48d7db63
PE
26ac_help="$ac_help
27 --enable-install-libiberty Install headers for end users"
0bc0cd11
JL
28
29# Initialize some variables set by options.
30# The variables have the same names as the options, with
31# dashes changed to underlines.
32build=NONE
33cache_file=./config.cache
34exec_prefix=NONE
35host=NONE
36no_create=
37nonopt=NONE
38no_recursion=
39prefix=NONE
40program_prefix=NONE
41program_suffix=NONE
42program_transform_name=s,x,x,
43silent=
44site=
6706f116 45sitefile=
0bc0cd11
JL
46srcdir=
47target=NONE
48verbose=
49x_includes=NONE
50x_libraries=NONE
51bindir='${exec_prefix}/bin'
52sbindir='${exec_prefix}/sbin'
53libexecdir='${exec_prefix}/libexec'
54datadir='${prefix}/share'
55sysconfdir='${prefix}/etc'
56sharedstatedir='${prefix}/com'
57localstatedir='${prefix}/var'
58libdir='${exec_prefix}/lib'
59includedir='${prefix}/include'
60oldincludedir='/usr/include'
61infodir='${prefix}/info'
62mandir='${prefix}/man'
63
64# Initialize some other variables.
65subdirs=
66MFLAGS= MAKEFLAGS=
67SHELL=${CONFIG_SHELL-/bin/sh}
68# Maximum number of lines to put in a shell here document.
69ac_max_here_lines=12
70
71ac_prev=
72for ac_option
73do
74
75 # If the previous option needs an argument, assign it.
76 if test -n "$ac_prev"; then
77 eval "$ac_prev=\$ac_option"
78 ac_prev=
79 continue
80 fi
81
82 case "$ac_option" in
83 -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
84 *) ac_optarg= ;;
85 esac
86
87 # Accept the important Cygnus configure options, so we can diagnose typos.
88
89 case "$ac_option" in
90
91 -bindir | --bindir | --bindi | --bind | --bin | --bi)
92 ac_prev=bindir ;;
93 -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
94 bindir="$ac_optarg" ;;
95
96 -build | --build | --buil | --bui | --bu)
97 ac_prev=build ;;
98 -build=* | --build=* | --buil=* | --bui=* | --bu=*)
99 build="$ac_optarg" ;;
100
101 -cache-file | --cache-file | --cache-fil | --cache-fi \
102 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
103 ac_prev=cache_file ;;
104 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
105 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
106 cache_file="$ac_optarg" ;;
107
108 -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
109 ac_prev=datadir ;;
110 -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
111 | --da=*)
112 datadir="$ac_optarg" ;;
113
114 -disable-* | --disable-*)
115 ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
116 # Reject names that are not valid shell variable names.
117 if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
118 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
119 fi
120 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
121 eval "enable_${ac_feature}=no" ;;
122
123 -enable-* | --enable-*)
124 ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
125 # Reject names that are not valid shell variable names.
126 if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
127 { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
128 fi
129 ac_feature=`echo $ac_feature| sed 's/-/_/g'`
130 case "$ac_option" in
131 *=*) ;;
132 *) ac_optarg=yes ;;
133 esac
134 eval "enable_${ac_feature}='$ac_optarg'" ;;
135
136 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
137 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
138 | --exec | --exe | --ex)
139 ac_prev=exec_prefix ;;
140 -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
141 | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
142 | --exec=* | --exe=* | --ex=*)
143 exec_prefix="$ac_optarg" ;;
144
145 -gas | --gas | --ga | --g)
146 # Obsolete; use --with-gas.
147 with_gas=yes ;;
148
149 -help | --help | --hel | --he)
150 # Omit some internal or obsolete options to make the list less imposing.
151 # This message is too long to be a string in the A/UX 3.1 sh.
152 cat << EOF
153Usage: configure [options] [host]
154Options: [defaults in brackets after descriptions]
155Configuration:
156 --cache-file=FILE cache test results in FILE
157 --help print this message
158 --no-create do not create output files
159 --quiet, --silent do not print \`checking...' messages
6706f116 160 --site-file=FILE use FILE as the site file
0bc0cd11
JL
161 --version print the version of autoconf that created configure
162Directory and file names:
163 --prefix=PREFIX install architecture-independent files in PREFIX
164 [$ac_default_prefix]
165 --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
166 [same as prefix]
167 --bindir=DIR user executables in DIR [EPREFIX/bin]
168 --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
169 --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
170 --datadir=DIR read-only architecture-independent data in DIR
171 [PREFIX/share]
172 --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
173 --sharedstatedir=DIR modifiable architecture-independent data in DIR
174 [PREFIX/com]
175 --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
176 --libdir=DIR object code libraries in DIR [EPREFIX/lib]
177 --includedir=DIR C header files in DIR [PREFIX/include]
178 --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
179 --infodir=DIR info documentation in DIR [PREFIX/info]
180 --mandir=DIR man documentation in DIR [PREFIX/man]
181 --srcdir=DIR find the sources in DIR [configure dir or ..]
182 --program-prefix=PREFIX prepend PREFIX to installed program names
183 --program-suffix=SUFFIX append SUFFIX to installed program names
184 --program-transform-name=PROGRAM
185 run sed PROGRAM on installed program names
186EOF
187 cat << EOF
188Host type:
189 --build=BUILD configure for building on BUILD [BUILD=HOST]
190 --host=HOST configure for HOST [guessed]
191 --target=TARGET configure for TARGET [TARGET=HOST]
192Features and packages:
193 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
194 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
195 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
196 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
197 --x-includes=DIR X include files are in DIR
198 --x-libraries=DIR X library files are in DIR
199EOF
200 if test -n "$ac_help"; then
201 echo "--enable and --with options recognized:$ac_help"
202 fi
203 exit 0 ;;
204
205 -host | --host | --hos | --ho)
206 ac_prev=host ;;
207 -host=* | --host=* | --hos=* | --ho=*)
208 host="$ac_optarg" ;;
209
210 -includedir | --includedir | --includedi | --included | --include \
211 | --includ | --inclu | --incl | --inc)
212 ac_prev=includedir ;;
213 -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
214 | --includ=* | --inclu=* | --incl=* | --inc=*)
215 includedir="$ac_optarg" ;;
216
217 -infodir | --infodir | --infodi | --infod | --info | --inf)
218 ac_prev=infodir ;;
219 -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
220 infodir="$ac_optarg" ;;
221
222 -libdir | --libdir | --libdi | --libd)
223 ac_prev=libdir ;;
224 -libdir=* | --libdir=* | --libdi=* | --libd=*)
225 libdir="$ac_optarg" ;;
226
227 -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
228 | --libexe | --libex | --libe)
229 ac_prev=libexecdir ;;
230 -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
231 | --libexe=* | --libex=* | --libe=*)
232 libexecdir="$ac_optarg" ;;
233
234 -localstatedir | --localstatedir | --localstatedi | --localstated \
235 | --localstate | --localstat | --localsta | --localst \
236 | --locals | --local | --loca | --loc | --lo)
237 ac_prev=localstatedir ;;
238 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
239 | --localstate=* | --localstat=* | --localsta=* | --localst=* \
240 | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
241 localstatedir="$ac_optarg" ;;
242
243 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
244 ac_prev=mandir ;;
245 -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
246 mandir="$ac_optarg" ;;
247
248 -nfp | --nfp | --nf)
249 # Obsolete; use --without-fp.
250 with_fp=no ;;
251
252 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
253 | --no-cr | --no-c)
254 no_create=yes ;;
255
256 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
257 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
258 no_recursion=yes ;;
259
260 -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
261 | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
262 | --oldin | --oldi | --old | --ol | --o)
263 ac_prev=oldincludedir ;;
264 -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
265 | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
266 | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
267 oldincludedir="$ac_optarg" ;;
268
269 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
270 ac_prev=prefix ;;
271 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
272 prefix="$ac_optarg" ;;
273
274 -program-prefix | --program-prefix | --program-prefi | --program-pref \
275 | --program-pre | --program-pr | --program-p)
276 ac_prev=program_prefix ;;
277 -program-prefix=* | --program-prefix=* | --program-prefi=* \
278 | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
279 program_prefix="$ac_optarg" ;;
280
281 -program-suffix | --program-suffix | --program-suffi | --program-suff \
282 | --program-suf | --program-su | --program-s)
283 ac_prev=program_suffix ;;
284 -program-suffix=* | --program-suffix=* | --program-suffi=* \
285 | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
286 program_suffix="$ac_optarg" ;;
287
288 -program-transform-name | --program-transform-name \
289 | --program-transform-nam | --program-transform-na \
290 | --program-transform-n | --program-transform- \
291 | --program-transform | --program-transfor \
292 | --program-transfo | --program-transf \
293 | --program-trans | --program-tran \
294 | --progr-tra | --program-tr | --program-t)
295 ac_prev=program_transform_name ;;
296 -program-transform-name=* | --program-transform-name=* \
297 | --program-transform-nam=* | --program-transform-na=* \
298 | --program-transform-n=* | --program-transform-=* \
299 | --program-transform=* | --program-transfor=* \
300 | --program-transfo=* | --program-transf=* \
301 | --program-trans=* | --program-tran=* \
302 | --progr-tra=* | --program-tr=* | --program-t=*)
303 program_transform_name="$ac_optarg" ;;
304
305 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
306 | -silent | --silent | --silen | --sile | --sil)
307 silent=yes ;;
308
309 -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
310 ac_prev=sbindir ;;
311 -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
312 | --sbi=* | --sb=*)
313 sbindir="$ac_optarg" ;;
314
315 -sharedstatedir | --sharedstatedir | --sharedstatedi \
316 | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
317 | --sharedst | --shareds | --shared | --share | --shar \
318 | --sha | --sh)
319 ac_prev=sharedstatedir ;;
320 -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
321 | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
322 | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
323 | --sha=* | --sh=*)
324 sharedstatedir="$ac_optarg" ;;
325
326 -site | --site | --sit)
327 ac_prev=site ;;
328 -site=* | --site=* | --sit=*)
329 site="$ac_optarg" ;;
330
6706f116
AO
331 -site-file | --site-file | --site-fil | --site-fi | --site-f)
332 ac_prev=sitefile ;;
333 -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
334 sitefile="$ac_optarg" ;;
335
0bc0cd11
JL
336 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
337 ac_prev=srcdir ;;
338 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
339 srcdir="$ac_optarg" ;;
340
341 -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
342 | --syscon | --sysco | --sysc | --sys | --sy)
343 ac_prev=sysconfdir ;;
344 -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
345 | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
346 sysconfdir="$ac_optarg" ;;
347
348 -target | --target | --targe | --targ | --tar | --ta | --t)
349 ac_prev=target ;;
350 -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
351 target="$ac_optarg" ;;
352
353 -v | -verbose | --verbose | --verbos | --verbo | --verb)
354 verbose=yes ;;
355
356 -version | --version | --versio | --versi | --vers)
687361c8 357 echo "configure generated by autoconf version 2.13"
0bc0cd11
JL
358 exit 0 ;;
359
360 -with-* | --with-*)
361 ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
362 # Reject names that are not valid shell variable names.
363 if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
364 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
365 fi
366 ac_package=`echo $ac_package| sed 's/-/_/g'`
367 case "$ac_option" in
368 *=*) ;;
369 *) ac_optarg=yes ;;
370 esac
371 eval "with_${ac_package}='$ac_optarg'" ;;
372
373 -without-* | --without-*)
374 ac_package=`echo $ac_option|sed -e 's/-*without-//'`
375 # Reject names that are not valid shell variable names.
376 if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
377 { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
378 fi
379 ac_package=`echo $ac_package| sed 's/-/_/g'`
380 eval "with_${ac_package}=no" ;;
381
382 --x)
383 # Obsolete; use --with-x.
384 with_x=yes ;;
385
386 -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
387 | --x-incl | --x-inc | --x-in | --x-i)
388 ac_prev=x_includes ;;
389 -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
390 | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
391 x_includes="$ac_optarg" ;;
392
393 -x-libraries | --x-libraries | --x-librarie | --x-librari \
394 | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
395 ac_prev=x_libraries ;;
396 -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
397 | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
398 x_libraries="$ac_optarg" ;;
399
400 -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
401 ;;
402
403 *)
404 if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
405 echo "configure: warning: $ac_option: invalid host type" 1>&2
406 fi
407 if test "x$nonopt" != xNONE; then
408 { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
409 fi
410 nonopt="$ac_option"
411 ;;
412
413 esac
414done
415
416if test -n "$ac_prev"; then
417 { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
418fi
419
420trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
421
422# File descriptor usage:
423# 0 standard input
424# 1 file creation
425# 2 errors and warnings
426# 3 some systems may open it to /dev/tty
427# 4 used on the Kubota Titan
428# 6 checking for... messages and results
429# 5 compiler messages saved in config.log
430if test "$silent" = yes; then
431 exec 6>/dev/null
432else
433 exec 6>&1
434fi
435exec 5>./config.log
436
437echo "\
438This file contains any messages produced by compilers while
439running configure, to aid debugging if configure makes a mistake.
440" 1>&5
441
442# Strip out --no-create and --no-recursion so they do not pile up.
443# Also quote any args containing shell metacharacters.
444ac_configure_args=
445for ac_arg
446do
447 case "$ac_arg" in
448 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
449 | --no-cr | --no-c) ;;
450 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
451 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
452 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
453 ac_configure_args="$ac_configure_args '$ac_arg'" ;;
454 *) ac_configure_args="$ac_configure_args $ac_arg" ;;
455 esac
456done
457
458# NLS nuisances.
459# Only set these to C if already set. These must not be set unconditionally
460# because not all systems understand e.g. LANG=C (notably SCO).
461# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
462# Non-C LC_CTYPE values break the ctype check.
463if test "${LANG+set}" = set; then LANG=C; export LANG; fi
464if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
465if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
466if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
467
468# confdefs.h avoids OS command line length limits that DEFS can exceed.
469rm -rf conftest* confdefs.h
470# AIX cpp loses on an empty file, so make sure it contains at least a newline.
471echo > confdefs.h
472
473# A filename unique to this package, relative to the directory that
474# configure is in, which we can look for to find out if srcdir is correct.
475ac_unique_file=pexecute.c
476
477# Find the source files, if location was not specified.
478if test -z "$srcdir"; then
479 ac_srcdir_defaulted=yes
480 # Try the directory containing this script, then its parent.
481 ac_prog=$0
482 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
483 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
484 srcdir=$ac_confdir
485 if test ! -r $srcdir/$ac_unique_file; then
486 srcdir=..
487 fi
488else
489 ac_srcdir_defaulted=no
490fi
491if test ! -r $srcdir/$ac_unique_file; then
492 if test "$ac_srcdir_defaulted" = yes; then
493 { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
494 else
495 { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
496 fi
497fi
498srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
499
500# Prefer explicitly selected file to automatically selected ones.
6706f116
AO
501if test -z "$sitefile"; then
502 if test -z "$CONFIG_SITE"; then
503 if test "x$prefix" != xNONE; then
504 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
505 else
506 CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
507 fi
0bc0cd11 508 fi
6706f116
AO
509else
510 CONFIG_SITE="$sitefile"
0bc0cd11
JL
511fi
512for ac_site_file in $CONFIG_SITE; do
513 if test -r "$ac_site_file"; then
514 echo "loading site script $ac_site_file"
515 . "$ac_site_file"
516 fi
517done
518
519if test -r "$cache_file"; then
520 echo "loading cache $cache_file"
521 . $cache_file
522else
523 echo "creating cache $cache_file"
524 > $cache_file
525fi
526
527ac_ext=c
528# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
529ac_cpp='$CPP $CPPFLAGS'
530ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
687361c8 531ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
0bc0cd11
JL
532cross_compiling=$ac_cv_prog_cc_cross
533
687361c8
ME
534ac_exeext=
535ac_objext=o
0bc0cd11
JL
536if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
537 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
538 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
539 ac_n= ac_c='
540' ac_t=' '
541 else
542 ac_n=-n ac_c= ac_t=
543 fi
544else
545 ac_n= ac_c='\c' ac_t=
546fi
547
548
549
6706f116
AO
550# This works around the fact that libtool configuration may change LD
551# for this particular configuration, but some shells, instead of
552# keeping the changes in LD private, export them just because LD is
553# exported. We don't use libtool yet, but some day we might, so...
554ORIGINAL_LD_FOR_MULTILIBS=$LD
555
0bc0cd11
JL
556# Check whether --with-target-subdir or --without-target-subdir was given.
557if test "${with_target_subdir+set}" = set; then
558 withval="$with_target_subdir"
559 :
560fi
561
cd862df8
L
562# Check whether --with-build-subdir or --without-build-subdir was given.
563if test "${with_build_subdir+set}" = set; then
564 withval="$with_build_subdir"
565 :
566fi
567
ca6b370d
JL
568# Check whether --with-cross-host or --without-cross-host was given.
569if test "${with_cross_host+set}" = set; then
570 withval="$with_cross_host"
571 :
572fi
573
0bc0cd11
JL
574# Check whether --with-newlib or --without-newlib was given.
575if test "${with_newlib+set}" = set; then
576 withval="$with_newlib"
577 :
578fi
579
580
581if test "${srcdir}" = "."; then
cd862df8
L
582 if test -n "${with_build_subdir}"; then
583 libiberty_topdir="${srcdir}/../.."
584 with_target_subdir=
585 elif test -z "${with_target_subdir}"; then
0bc0cd11
JL
586 libiberty_topdir="${srcdir}/.."
587 else
588 if test "${with_target_subdir}" != "."; then
589 libiberty_topdir="${srcdir}/${with_multisrctop}../.."
590 else
591 libiberty_topdir="${srcdir}/${with_multisrctop}.."
592 fi
593 fi
594else
595 libiberty_topdir="${srcdir}/.."
596fi
597ac_aux_dir=
598for ac_dir in $libiberty_topdir $srcdir/$libiberty_topdir; do
599 if test -f $ac_dir/install-sh; then
600 ac_aux_dir=$ac_dir
601 ac_install_sh="$ac_aux_dir/install-sh -c"
602 break
603 elif test -f $ac_dir/install.sh; then
604 ac_aux_dir=$ac_dir
605 ac_install_sh="$ac_aux_dir/install.sh -c"
606 break
607 fi
608done
609if test -z "$ac_aux_dir"; then
610 { echo "configure: error: can not find install-sh or install.sh in $libiberty_topdir $srcdir/$libiberty_topdir" 1>&2; exit 1; }
611fi
612ac_config_guess=$ac_aux_dir/config.guess
613ac_config_sub=$ac_aux_dir/config.sub
614ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
615
616
617
aaa5f039 618echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
6706f116 619echo "configure:620: checking whether to enable maintainer-specific portions of Makefiles" >&5
aaa5f039
DD
620 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
621if test "${enable_maintainer_mode+set}" = set; then
622 enableval="$enable_maintainer_mode"
623 maintainer_mode=$enableval
624else
625 maintainer_mode=no
626fi
627
628
629echo "$ac_t""$maintainer_mode" 1>&6
630
631if test "$maintainer_mode" = "yes"; then
632 MAINT=''
633 NOTMAINT='#'
634else
635 MAINT='#'
636 NOTMAINT=''
637fi
638
0e30ffc5
DD
639# Do we have a single-tree copy of texinfo? Even if we do, we can't
640# rely on it - libiberty is built before texinfo.
641# Extract the first word of "makeinfo", so it can be a program name with args.
aaa5f039
DD
642set dummy makeinfo; ac_word=$2
643echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6706f116 644echo "configure:645: checking for $ac_word" >&5
aaa5f039
DD
645if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
646 echo $ac_n "(cached) $ac_c" 1>&6
647else
648 if test -n "$MAKEINFO"; then
649 ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
650else
651 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
652 ac_dummy="$PATH"
653 for ac_dir in $ac_dummy; do
654 test -z "$ac_dir" && ac_dir=.
655 if test -f $ac_dir/$ac_word; then
656 ac_cv_prog_MAKEINFO="makeinfo"
657 break
658 fi
659 done
660 IFS="$ac_save_ifs"
661fi
662fi
663MAKEINFO="$ac_cv_prog_MAKEINFO"
664if test -n "$MAKEINFO"; then
665 echo "$ac_t""$MAKEINFO" 1>&6
666else
667 echo "$ac_t""no" 1>&6
668fi
669
f749bd83
AM
670if test "x$MAKEINFO" = "x"; then
671 MAKEINFO="@echo makeinfo missing; true"
0e30ffc5 672 BUILD_INFO=
f749bd83
AM
673else
674 BUILD_INFO=info
675 case x"`$MAKEINFO --version | grep 'GNU texinfo'`" in
676 x*\ [1-3].* )
677 MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true"
678 BUILD_INFO=
679 echo "configure: warning:
0e30ffc5 680*** Makeinfo is too old. Info documentation will not be built." 1>&2
f749bd83
AM
681 ;;
682 esac
683fi
0e30ffc5 684
aaa5f039
DD
685
686
687# Extract the first word of "perl", so it can be a program name with args.
688set dummy perl; ac_word=$2
689echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6706f116 690echo "configure:691: checking for $ac_word" >&5
aaa5f039
DD
691if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
692 echo $ac_n "(cached) $ac_c" 1>&6
693else
694 if test -n "$PERL"; then
695 ac_cv_prog_PERL="$PERL" # Let the user override the test.
696else
697 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
698 ac_dummy="$PATH"
699 for ac_dir in $ac_dummy; do
700 test -z "$ac_dir" && ac_dir=.
701 if test -f $ac_dir/$ac_word; then
702 ac_cv_prog_PERL="perl"
703 break
704 fi
705 done
706 IFS="$ac_save_ifs"
707fi
708fi
709PERL="$ac_cv_prog_PERL"
710if test -n "$PERL"; then
711 echo "$ac_t""$PERL" 1>&6
712else
713 echo "$ac_t""no" 1>&6
714fi
715
716if test x"$PERL" = x""; then
717 HAVE_PERL='#'
718else
719 HAVE_PERL=''
720fi
721
722
723
0bc0cd11
JL
724# Make sure we can run config.sub.
725if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
726else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
727fi
728
729echo $ac_n "checking host system type""... $ac_c" 1>&6
6706f116 730echo "configure:731: checking host system type" >&5
0bc0cd11
JL
731
732host_alias=$host
733case "$host_alias" in
734NONE)
735 case $nonopt in
736 NONE)
737 if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
738 else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
739 fi ;;
740 *) host_alias=$nonopt ;;
741 esac ;;
742esac
743
744host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
745host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
746host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
747host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
748echo "$ac_t""$host" 1>&6
749
750
751
752echo $ac_n "checking build system type""... $ac_c" 1>&6
6706f116 753echo "configure:754: checking build system type" >&5
0bc0cd11
JL
754
755build_alias=$build
756case "$build_alias" in
757NONE)
758 case $nonopt in
759 NONE) build_alias=$host_alias ;;
760 *) build_alias=$nonopt ;;
761 esac ;;
762esac
763
764build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
765build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
766build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
767build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
768echo "$ac_t""$build" 1>&6
769
770if test $host != $build; then
771 ac_tool_prefix=${host_alias}-
772else
773 ac_tool_prefix=
774fi
775
776# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
777set dummy ${ac_tool_prefix}ar; ac_word=$2
778echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6706f116 779echo "configure:780: checking for $ac_word" >&5
0bc0cd11
JL
780if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
781 echo $ac_n "(cached) $ac_c" 1>&6
782else
783 if test -n "$AR"; then
784 ac_cv_prog_AR="$AR" # Let the user override the test.
785else
687361c8
ME
786 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
787 ac_dummy="$PATH"
788 for ac_dir in $ac_dummy; do
0bc0cd11
JL
789 test -z "$ac_dir" && ac_dir=.
790 if test -f $ac_dir/$ac_word; then
791 ac_cv_prog_AR="${ac_tool_prefix}ar"
792 break
793 fi
794 done
795 IFS="$ac_save_ifs"
796 test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
797fi
798fi
799AR="$ac_cv_prog_AR"
800if test -n "$AR"; then
801 echo "$ac_t""$AR" 1>&6
802else
803 echo "$ac_t""no" 1>&6
804fi
805
806
807
808# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
809set dummy ${ac_tool_prefix}ranlib; ac_word=$2
810echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6706f116 811echo "configure:812: checking for $ac_word" >&5
0bc0cd11
JL
812if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
813 echo $ac_n "(cached) $ac_c" 1>&6
814else
815 if test -n "$RANLIB"; then
816 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
817else
687361c8
ME
818 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
819 ac_dummy="$PATH"
820 for ac_dir in $ac_dummy; do
0bc0cd11
JL
821 test -z "$ac_dir" && ac_dir=.
822 if test -f $ac_dir/$ac_word; then
823 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
824 break
825 fi
826 done
827 IFS="$ac_save_ifs"
828fi
829fi
830RANLIB="$ac_cv_prog_RANLIB"
831if test -n "$RANLIB"; then
832 echo "$ac_t""$RANLIB" 1>&6
833else
834 echo "$ac_t""no" 1>&6
835fi
836
837
838if test -z "$ac_cv_prog_RANLIB"; then
839if test -n "$ac_tool_prefix"; then
840 # Extract the first word of "ranlib", so it can be a program name with args.
841set dummy ranlib; ac_word=$2
842echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6706f116 843echo "configure:844: checking for $ac_word" >&5
0bc0cd11
JL
844if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
845 echo $ac_n "(cached) $ac_c" 1>&6
846else
847 if test -n "$RANLIB"; then
848 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
849else
687361c8
ME
850 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
851 ac_dummy="$PATH"
852 for ac_dir in $ac_dummy; do
0bc0cd11
JL
853 test -z "$ac_dir" && ac_dir=.
854 if test -f $ac_dir/$ac_word; then
855 ac_cv_prog_RANLIB="ranlib"
856 break
857 fi
858 done
859 IFS="$ac_save_ifs"
860 test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
861fi
862fi
863RANLIB="$ac_cv_prog_RANLIB"
864if test -n "$RANLIB"; then
865 echo "$ac_t""$RANLIB" 1>&6
866else
867 echo "$ac_t""no" 1>&6
868fi
869
870else
871 RANLIB=":"
872fi
873fi
874
875
1eaf7d9c 876
0bc0cd11
JL
877# Extract the first word of "gcc", so it can be a program name with args.
878set dummy gcc; ac_word=$2
879echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6706f116 880echo "configure:881: checking for $ac_word" >&5
0bc0cd11
JL
881if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
882 echo $ac_n "(cached) $ac_c" 1>&6
883else
884 if test -n "$CC"; then
885 ac_cv_prog_CC="$CC" # Let the user override the test.
886else
687361c8
ME
887 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
888 ac_dummy="$PATH"
889 for ac_dir in $ac_dummy; do
0bc0cd11
JL
890 test -z "$ac_dir" && ac_dir=.
891 if test -f $ac_dir/$ac_word; then
892 ac_cv_prog_CC="gcc"
893 break
894 fi
895 done
896 IFS="$ac_save_ifs"
897fi
898fi
899CC="$ac_cv_prog_CC"
900if test -n "$CC"; then
901 echo "$ac_t""$CC" 1>&6
902else
903 echo "$ac_t""no" 1>&6
904fi
905
906if test -z "$CC"; then
907 # Extract the first word of "cc", so it can be a program name with args.
908set dummy cc; ac_word=$2
909echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
6706f116 910echo "configure:911: checking for $ac_word" >&5
0bc0cd11
JL
911if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
912 echo $ac_n "(cached) $ac_c" 1>&6
913else
914 if test -n "$CC"; then
915 ac_cv_prog_CC="$CC" # Let the user override the test.
916else
687361c8 917 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
0bc0cd11 918 ac_prog_rejected=no
687361c8
ME
919 ac_dummy="$PATH"
920 for ac_dir in $ac_dummy; do
0bc0cd11
JL
921 test -z "$ac_dir" && ac_dir=.
922 if test -f $ac_dir/$ac_word; then
923 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
924 ac_prog_rejected=yes
925 continue
926 fi
927 ac_cv_prog_CC="cc"
928 break
929 fi
930 done
931 IFS="$ac_save_ifs"
932if test $ac_prog_rejected = yes; then
933 # We found a bogon in the path, so make sure we never use it.
934 set dummy $ac_cv_prog_CC
935 shift
936 if test $# -gt 0; then
937 # We chose a different compiler from the bogus one.
938 # However, it has the same basename, so the bogon will be chosen
939 # first if we set CC to just the basename; use the full file name.
940 shift
941 set dummy "$ac_dir/$ac_word" "$@"
942 shift
943 ac_cv_prog_CC="$@"
944 fi
945fi
946fi
947fi
948CC="$ac_cv_prog_CC"
949if test -n "$CC"; then
950 echo "$ac_t""$CC" 1>&6
951else
952 echo "$ac_t""no" 1>&6
953fi
954
955 test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
956fi
957
958echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
6706f116 959echo "configure:960: checking whether we are using GNU C" >&5
0bc0cd11
JL
960if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
961 echo $ac_n "(cached) $ac_c" 1>&6
962else
963 cat > conftest.c <<EOF
964#ifdef __GNUC__
965 yes;
966#endif
967EOF
6706f116 968if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
0bc0cd11
JL
969 ac_cv_prog_gcc=yes
970else
971 ac_cv_prog_gcc=no
972fi
973fi
974
975echo "$ac_t""$ac_cv_prog_gcc" 1>&6
976
977if test $ac_cv_prog_gcc = yes; then
978 GCC=yes
69197e7e 979 ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
0bc0cd11
JL
980 ac_test_CFLAGS="${CFLAGS+set}"
981 ac_save_CFLAGS="$CFLAGS"
982 CFLAGS=
983 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
6706f116 984echo "configure:985: checking whether ${CC-cc} accepts -g" >&5
0bc0cd11
JL
985if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
986 echo $ac_n "(cached) $ac_c" 1>&6
987else
988 echo 'void f(){}' > conftest.c
989if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
990 ac_cv_prog_cc_g=yes
991else
992 ac_cv_prog_cc_g=no
993fi
994rm -f conftest*
995
996fi
997
998echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
999 if test "$ac_test_CFLAGS" = set; then
1000 CFLAGS="$ac_save_CFLAGS"
1001 elif test $ac_cv_prog_cc_g = yes; then
1002 CFLAGS="-g -O2"
1003 else
1004 CFLAGS="-O2"
1005 fi
1006else
1007 GCC=
1eaf7d9c 1008 ac_libiberty_warn_cflags=
0bc0cd11
JL
1009 test "${CFLAGS+set}" = set || CFLAGS="-g"
1010fi
1011
1012
d1209685 1013
0bc0cd11 1014echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
6706f116 1015echo "configure:1016: checking for POSIXized ISC" >&5
0bc0cd11
JL
1016if test -d /etc/conf/kconfig.d &&
1017 grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
1018then
1019 echo "$ac_t""yes" 1>&6
1020 ISC=yes # If later tests want to check for ISC.
1021 cat >> confdefs.h <<\EOF
1022#define _POSIX_SOURCE 1
1023EOF
1024
1025 if test "$GCC" = yes; then
1026 CC="$CC -posix"
1027 else
1028 CC="$CC -Xp"
1029 fi
1030else
1031 echo "$ac_t""no" 1>&6
1032 ISC=
1033fi
1034
d1209685 1035echo $ac_n "checking for working const""... $ac_c" 1>&6
6706f116 1036echo "configure:1037: checking for working const" >&5
d1209685
ZW
1037if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
1038 echo $ac_n "(cached) $ac_c" 1>&6
1039else
1040 cat > conftest.$ac_ext <<EOF
6706f116 1041#line 1042 "configure"
d1209685
ZW
1042#include "confdefs.h"
1043
1044int main() {
1045
1046/* Ultrix mips cc rejects this. */
dac45916 1047typedef int charset[2]; const charset x;
d1209685
ZW
1048/* SunOS 4.1.1 cc rejects this. */
1049char const *const *ccp;
1050char **p;
1051/* NEC SVR4.0.2 mips cc rejects this. */
1052struct point {int x, y;};
1053static struct point const zero = {0,0};
1054/* AIX XL C 1.02.0.0 rejects this.
1055 It does not let you subtract one const X* pointer from another in an arm
1056 of an if-expression whose if-part is not a constant expression */
1057const char *g = "string";
1058ccp = &g + (g ? g-g : 0);
1059/* HPUX 7.0 cc rejects these. */
1060++ccp;
1061p = (char**) ccp;
1062ccp = (char const *const *) p;
1063{ /* SCO 3.2v4 cc rejects this. */
1064 char *t;
1065 char const *s = 0 ? (char *) 0 : (char const *) 0;
1066
1067 *t++ = 0;
1068}
1069{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
1070 int x[] = {25, 17};
1071 const int *foo = &x[0];
1072 ++foo;
1073}
1074{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1075 typedef const int *iptr;
1076 iptr p = 0;
1077 ++p;
1078}
1079{ /* AIX XL C 1.02.0.0 rejects this saying
1080 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1081 struct s { int j; const int *ap[3]; };
1082 struct s *b; b->j = 5;
1083}
1084{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1085 const int foo = 10;
1086}
1087
1088; return 0; }
1089EOF
6706f116 1090if { (eval echo configure:1091: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
d1209685
ZW
1091 rm -rf conftest*
1092 ac_cv_c_const=yes
1093else
1094 echo "configure: failed program was:" >&5
1095 cat conftest.$ac_ext >&5
1096 rm -rf conftest*
1097 ac_cv_c_const=no
1098fi
1099rm -f conftest*
1100fi
1101
1102echo "$ac_t""$ac_cv_c_const" 1>&6
1103if test $ac_cv_c_const = no; then
1104 cat >> confdefs.h <<\EOF
1105#define const
1106EOF
1107
1108fi
1109
1110echo $ac_n "checking for inline""... $ac_c" 1>&6
6706f116 1111echo "configure:1112: checking for inline" >&5
d1209685
ZW
1112if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1113 echo $ac_n "(cached) $ac_c" 1>&6
1114else
1115 ac_cv_c_inline=no
1116for ac_kw in inline __inline__ __inline; do
1117 cat > conftest.$ac_ext <<EOF
6706f116 1118#line 1119 "configure"
d1209685
ZW
1119#include "confdefs.h"
1120
1121int main() {
dac45916 1122} $ac_kw foo() {
d1209685
ZW
1123; return 0; }
1124EOF
6706f116 1125if { (eval echo configure:1126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
d1209685
ZW
1126 rm -rf conftest*
1127 ac_cv_c_inline=$ac_kw; break
1128else
1129 echo "configure: failed program was:" >&5
1130 cat conftest.$ac_ext >&5
1131fi
1132rm -f conftest*
1133done
1134
1135fi
1136
1137echo "$ac_t""$ac_cv_c_inline" 1>&6
1138case "$ac_cv_c_inline" in
1139 inline | yes) ;;
1140 no) cat >> confdefs.h <<\EOF
1141#define inline
1142EOF
1143 ;;
1144 *) cat >> confdefs.h <<EOF
1145#define inline $ac_cv_c_inline
1146EOF
1147 ;;
1148esac
1149
0bc0cd11
JL
1150
1151
1152
1153
1154
1155
1156# Find a good install program. We prefer a C program (faster),
1157# so one script is as good as another. But avoid the broken or
1158# incompatible versions:
1159# SysV /etc/install, /usr/sbin/install
1160# SunOS /usr/etc/install
1161# IRIX /sbin/install
1162# AIX /bin/install
1163# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1164# AFS /usr/afsws/bin/install, which mishandles nonexistent args
1165# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1166# ./install, which can be erroneously created by make from ./install.sh.
1167echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
6706f116 1168echo "configure:1169: checking for a BSD compatible install" >&5
0bc0cd11
JL
1169if test -z "$INSTALL"; then
1170if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1171 echo $ac_n "(cached) $ac_c" 1>&6
1172else
687361c8 1173 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
0bc0cd11
JL
1174 for ac_dir in $PATH; do
1175 # Account for people who put trailing slashes in PATH elements.
1176 case "$ac_dir/" in
1177 /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1178 *)
1179 # OSF1 and SCO ODT 3.0 have their own names for install.
1180 # Don't use installbsd from OSF since it installs stuff as root
1181 # by default.
1182 for ac_prog in ginstall scoinst install; do
1183 if test -f $ac_dir/$ac_prog; then
1184 if test $ac_prog = install &&
1185 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1186 # AIX install. It has an incompatible calling convention.
1187 :
1188 else
1189 ac_cv_path_install="$ac_dir/$ac_prog -c"
1190 break 2
1191 fi
1192 fi
1193 done
1194 ;;
1195 esac
1196 done
1197 IFS="$ac_save_IFS"
1198
1199fi
1200 if test "${ac_cv_path_install+set}" = set; then
1201 INSTALL="$ac_cv_path_install"
1202 else
1203 # As a last resort, use the slow shell script. We don't cache a
1204 # path for INSTALL within a source directory, because that will
1205 # break other packages using the cache if that directory is
1206 # removed, or if the path is relative.
1207 INSTALL="$ac_install_sh"
1208 fi
1209fi
1210echo "$ac_t""$INSTALL" 1>&6
1211
1212# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1213# It thinks the first close brace ends the variable substitution.
1214test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1215
687361c8
ME
1216test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1217
0bc0cd11
JL
1218test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1219
1220
1221. ${srcdir}/config.table
1222host_makefile_frag=${frag}
1223
1224
1225# It's OK to check for header files. Although the compiler may not be
1226# able to link anything, it had better be able to at least compile
1227# something.
1228echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
6706f116 1229echo "configure:1230: checking how to run the C preprocessor" >&5
0bc0cd11
JL
1230# On Suns, sometimes $CPP names a directory.
1231if test -n "$CPP" && test -d "$CPP"; then
1232 CPP=
1233fi
1234if test -z "$CPP"; then
1235if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1236 echo $ac_n "(cached) $ac_c" 1>&6
1237else
1238 # This must be in double quotes, not single quotes, because CPP may get
1239 # substituted into the Makefile and "${CC-cc}" will confuse make.
1240 CPP="${CC-cc} -E"
1241 # On the NeXT, cc -E runs the code through the compiler's parser,
1242 # not just through cpp.
1243 cat > conftest.$ac_ext <<EOF
6706f116 1244#line 1245 "configure"
0bc0cd11
JL
1245#include "confdefs.h"
1246#include <assert.h>
1247Syntax Error
1248EOF
1249ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6706f116 1250{ (eval echo configure:1251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
687361c8 1251ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
0bc0cd11
JL
1252if test -z "$ac_err"; then
1253 :
1254else
1255 echo "$ac_err" >&5
1256 echo "configure: failed program was:" >&5
1257 cat conftest.$ac_ext >&5
1258 rm -rf conftest*
1259 CPP="${CC-cc} -E -traditional-cpp"
1260 cat > conftest.$ac_ext <<EOF
6706f116 1261#line 1262 "configure"
0bc0cd11
JL
1262#include "confdefs.h"
1263#include <assert.h>
1264Syntax Error
1265EOF
1266ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6706f116 1267{ (eval echo configure:1268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
687361c8
ME
1268ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1269if test -z "$ac_err"; then
1270 :
1271else
1272 echo "$ac_err" >&5
1273 echo "configure: failed program was:" >&5
1274 cat conftest.$ac_ext >&5
1275 rm -rf conftest*
1276 CPP="${CC-cc} -nologo -E"
1277 cat > conftest.$ac_ext <<EOF
6706f116 1278#line 1279 "configure"
687361c8
ME
1279#include "confdefs.h"
1280#include <assert.h>
1281Syntax Error
1282EOF
1283ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6706f116 1284{ (eval echo configure:1285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
687361c8 1285ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
0bc0cd11
JL
1286if test -z "$ac_err"; then
1287 :
1288else
1289 echo "$ac_err" >&5
1290 echo "configure: failed program was:" >&5
1291 cat conftest.$ac_ext >&5
1292 rm -rf conftest*
1293 CPP=/lib/cpp
1294fi
1295rm -f conftest*
1296fi
687361c8
ME
1297rm -f conftest*
1298fi
0bc0cd11
JL
1299rm -f conftest*
1300 ac_cv_prog_CPP="$CPP"
1301fi
1302 CPP="$ac_cv_prog_CPP"
1303else
1304 ac_cv_prog_CPP="$CPP"
1305fi
1306echo "$ac_t""$CPP" 1>&6
1307
c3bb7df0 1308for ac_hdr in sys/file.h sys/param.h limits.h stdlib.h string.h unistd.h strings.h sys/time.h time.h sys/resource.h sys/stat.h sys/mman.h fcntl.h alloca.h
0bc0cd11
JL
1309do
1310ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1311echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6706f116 1312echo "configure:1313: checking for $ac_hdr" >&5
0bc0cd11
JL
1313if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1314 echo $ac_n "(cached) $ac_c" 1>&6
1315else
1316 cat > conftest.$ac_ext <<EOF
6706f116 1317#line 1318 "configure"
0bc0cd11
JL
1318#include "confdefs.h"
1319#include <$ac_hdr>
1320EOF
1321ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6706f116 1322{ (eval echo configure:1323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
687361c8 1323ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
0bc0cd11
JL
1324if test -z "$ac_err"; then
1325 rm -rf conftest*
1326 eval "ac_cv_header_$ac_safe=yes"
1327else
1328 echo "$ac_err" >&5
1329 echo "configure: failed program was:" >&5
1330 cat conftest.$ac_ext >&5
1331 rm -rf conftest*
1332 eval "ac_cv_header_$ac_safe=no"
1333fi
1334rm -f conftest*
1335fi
1336if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1337 echo "$ac_t""yes" 1>&6
1338 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1339 cat >> confdefs.h <<EOF
1340#define $ac_tr_hdr 1
1341EOF
1342
1343else
1344 echo "$ac_t""no" 1>&6
1345fi
1346done
1347
a6458d1d 1348echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
6706f116 1349echo "configure:1350: checking for sys/wait.h that is POSIX.1 compatible" >&5
a6458d1d
KG
1350if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
1351 echo $ac_n "(cached) $ac_c" 1>&6
1352else
1353 cat > conftest.$ac_ext <<EOF
6706f116 1354#line 1355 "configure"
a6458d1d
KG
1355#include "confdefs.h"
1356#include <sys/types.h>
1357#include <sys/wait.h>
1358#ifndef WEXITSTATUS
1359#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
1360#endif
1361#ifndef WIFEXITED
1362#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
1363#endif
1364int main() {
1365int s;
1366wait (&s);
1367s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
1368; return 0; }
1369EOF
6706f116 1370if { (eval echo configure:1371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
a6458d1d
KG
1371 rm -rf conftest*
1372 ac_cv_header_sys_wait_h=yes
1373else
1374 echo "configure: failed program was:" >&5
1375 cat conftest.$ac_ext >&5
1376 rm -rf conftest*
1377 ac_cv_header_sys_wait_h=no
1378fi
1379rm -f conftest*
1380fi
1381
1382echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
1383if test $ac_cv_header_sys_wait_h = yes; then
1384 cat >> confdefs.h <<\EOF
1385#define HAVE_SYS_WAIT_H 1
1386EOF
1387
1388fi
1389
c6451ce1 1390echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
6706f116 1391echo "configure:1392: checking whether time.h and sys/time.h may both be included" >&5
c6451ce1
MS
1392if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1393 echo $ac_n "(cached) $ac_c" 1>&6
1394else
1395 cat > conftest.$ac_ext <<EOF
6706f116 1396#line 1397 "configure"
c6451ce1
MS
1397#include "confdefs.h"
1398#include <sys/types.h>
1399#include <sys/time.h>
1400#include <time.h>
1401int main() {
1402struct tm *tp;
1403; return 0; }
1404EOF
6706f116 1405if { (eval echo configure:1406: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
c6451ce1
MS
1406 rm -rf conftest*
1407 ac_cv_header_time=yes
1408else
1409 echo "configure: failed program was:" >&5
1410 cat conftest.$ac_ext >&5
1411 rm -rf conftest*
1412 ac_cv_header_time=no
1413fi
1414rm -f conftest*
1415fi
1416
1417echo "$ac_t""$ac_cv_header_time" 1>&6
1418if test $ac_cv_header_time = yes; then
1419 cat >> confdefs.h <<\EOF
1420#define TIME_WITH_SYS_TIME 1
1421EOF
1422
1423fi
1424
0bc0cd11 1425
3b58c099 1426echo $ac_n "checking whether errno must be declared""... $ac_c" 1>&6
6706f116 1427echo "configure:1428: checking whether errno must be declared" >&5
3b58c099
MS
1428if eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then
1429 echo $ac_n "(cached) $ac_c" 1>&6
1430else
1431 cat > conftest.$ac_ext <<EOF
6706f116 1432#line 1433 "configure"
3b58c099
MS
1433#include "confdefs.h"
1434#include <errno.h>
1435int main() {
1436int x = errno;
1437; return 0; }
1438EOF
6706f116 1439if { (eval echo configure:1440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3b58c099
MS
1440 rm -rf conftest*
1441 libiberty_cv_declare_errno=no
1442else
1443 echo "configure: failed program was:" >&5
1444 cat conftest.$ac_ext >&5
1445 rm -rf conftest*
1446 libiberty_cv_declare_errno=yes
1447fi
1448rm -f conftest*
1449fi
1450
1451echo "$ac_t""$libiberty_cv_declare_errno" 1>&6
1452if test $libiberty_cv_declare_errno = yes
1453then cat >> confdefs.h <<\EOF
1454#define NEED_DECLARATION_ERRNO 1
1455EOF
1456
1457fi
1458
1459
fdfc290b 1460echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
6706f116 1461echo "configure:1462: checking for ANSI C header files" >&5
fdfc290b
DR
1462if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
1463 echo $ac_n "(cached) $ac_c" 1>&6
1464else
1465 cat > conftest.$ac_ext <<EOF
6706f116 1466#line 1467 "configure"
fdfc290b
DR
1467#include "confdefs.h"
1468#include <stdlib.h>
1469#include <stdarg.h>
1470#include <string.h>
1471#include <float.h>
1472EOF
1473ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6706f116 1474{ (eval echo configure:1475: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
fdfc290b
DR
1475ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1476if test -z "$ac_err"; then
1477 rm -rf conftest*
1478 ac_cv_header_stdc=yes
1479else
1480 echo "$ac_err" >&5
1481 echo "configure: failed program was:" >&5
1482 cat conftest.$ac_ext >&5
1483 rm -rf conftest*
1484 ac_cv_header_stdc=no
1485fi
1486rm -f conftest*
1487
1488if test $ac_cv_header_stdc = yes; then
1489 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
d3982b71 1490cat > conftest.$ac_ext <<EOF
6706f116 1491#line 1492 "configure"
fdfc290b
DR
1492#include "confdefs.h"
1493#include <string.h>
1494EOF
1495if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1496 egrep "memchr" >/dev/null 2>&1; then
1497 :
1498else
1499 rm -rf conftest*
1500 ac_cv_header_stdc=no
1501fi
1502rm -f conftest*
1503
1504fi
1505
1506if test $ac_cv_header_stdc = yes; then
1507 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
1508cat > conftest.$ac_ext <<EOF
6706f116 1509#line 1510 "configure"
fdfc290b
DR
1510#include "confdefs.h"
1511#include <stdlib.h>
1512EOF
1513if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1514 egrep "free" >/dev/null 2>&1; then
1515 :
1516else
1517 rm -rf conftest*
1518 ac_cv_header_stdc=no
1519fi
1520rm -f conftest*
1521
1522fi
1523
1524if test $ac_cv_header_stdc = yes; then
1525 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
1526if test "$cross_compiling" = yes; then
1527 :
1528else
1529 cat > conftest.$ac_ext <<EOF
6706f116 1530#line 1531 "configure"
fdfc290b
DR
1531#include "confdefs.h"
1532#include <ctype.h>
1533#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
1534#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
1535#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
1536int main () { int i; for (i = 0; i < 256; i++)
1537if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
1538exit (0); }
1539
1540EOF
6706f116 1541if { (eval echo configure:1542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
fdfc290b
DR
1542then
1543 :
1544else
1545 echo "configure: failed program was:" >&5
1546 cat conftest.$ac_ext >&5
1547 rm -fr conftest*
1548 ac_cv_header_stdc=no
1549fi
1550rm -fr conftest*
1551fi
1552
1553fi
1554fi
1555
1556echo "$ac_t""$ac_cv_header_stdc" 1>&6
1557if test $ac_cv_header_stdc = yes; then
1558 cat >> confdefs.h <<\EOF
1559#define STDC_HEADERS 1
1560EOF
1561
1562fi
1563
1564echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6
6706f116 1565echo "configure:1566: checking for uintptr_t" >&5
fdfc290b
DR
1566if eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then
1567 echo $ac_n "(cached) $ac_c" 1>&6
1568else
1569 cat > conftest.$ac_ext <<EOF
6706f116 1570#line 1571 "configure"
d3982b71
JL
1571#include "confdefs.h"
1572#include <sys/types.h>
fdfc290b
DR
1573#if STDC_HEADERS
1574#include <stdlib.h>
1575#include <stddef.h>
1576#endif
d3982b71
JL
1577EOF
1578if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
fdfc290b 1579 egrep "(^|[^a-zA-Z_0-9])uintptr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
d3982b71 1580 rm -rf conftest*
fdfc290b 1581 ac_cv_type_uintptr_t=yes
d3982b71
JL
1582else
1583 rm -rf conftest*
fdfc290b 1584 ac_cv_type_uintptr_t=no
d3982b71
JL
1585fi
1586rm -f conftest*
1587
fdfc290b
DR
1588fi
1589echo "$ac_t""$ac_cv_type_uintptr_t" 1>&6
1590if test $ac_cv_type_uintptr_t = no; then
1591 cat >> confdefs.h <<\EOF
1592#define uintptr_t unsigned long
1593EOF
1594
1595fi
d3982b71 1596
fdfc290b
DR
1597
1598if test $ac_cv_type_uintptr_t = yes
d3982b71
JL
1599then
1600 cat >> confdefs.h <<\EOF
1601#define HAVE_UINTPTR_T 1
1602EOF
1603
d3982b71
JL
1604fi
1605
deae2ed9 1606echo $ac_n "checking for pid_t""... $ac_c" 1>&6
6706f116 1607echo "configure:1608: checking for pid_t" >&5
deae2ed9
MM
1608if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1609 echo $ac_n "(cached) $ac_c" 1>&6
1610else
1611 cat > conftest.$ac_ext <<EOF
6706f116 1612#line 1613 "configure"
deae2ed9
MM
1613#include "confdefs.h"
1614#include <sys/types.h>
1615#if STDC_HEADERS
1616#include <stdlib.h>
1617#include <stddef.h>
1618#endif
1619EOF
1620if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1621 egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1622 rm -rf conftest*
1623 ac_cv_type_pid_t=yes
1624else
1625 rm -rf conftest*
1626 ac_cv_type_pid_t=no
1627fi
1628rm -f conftest*
1629
1630fi
1631echo "$ac_t""$ac_cv_type_pid_t" 1>&6
1632if test $ac_cv_type_pid_t = no; then
1633 cat >> confdefs.h <<\EOF
1634#define pid_t int
1635EOF
1636
1637fi
1638
1639
0bc0cd11
JL
1640# This is the list of functions which libiberty will provide if they
1641# are not available on the host.
1642
1643funcs="asprintf"
1644funcs="$funcs atexit"
1645funcs="$funcs basename"
1646funcs="$funcs bcmp"
1647funcs="$funcs bcopy"
dac45916 1648funcs="$funcs bsearch"
0bc0cd11 1649funcs="$funcs bzero"
a9acf741 1650funcs="$funcs calloc"
0bc0cd11 1651funcs="$funcs clock"
29650b2b 1652funcs="$funcs ffs"
0bc0cd11
JL
1653funcs="$funcs getcwd"
1654funcs="$funcs getpagesize"
1655funcs="$funcs index"
1656funcs="$funcs insque"
1657funcs="$funcs memchr"
1658funcs="$funcs memcmp"
1659funcs="$funcs memcpy"
1660funcs="$funcs memmove"
1661funcs="$funcs memset"
687361c8 1662funcs="$funcs mkstemps"
9eb4080f 1663funcs="$funcs putenv"
0bc0cd11
JL
1664funcs="$funcs random"
1665funcs="$funcs rename"
1666funcs="$funcs rindex"
9eb4080f 1667funcs="$funcs setenv"
0bc0cd11
JL
1668funcs="$funcs sigsetmask"
1669funcs="$funcs strcasecmp"
1670funcs="$funcs strchr"
1671funcs="$funcs strdup"
1672funcs="$funcs strncasecmp"
1673funcs="$funcs strrchr"
1674funcs="$funcs strstr"
1675funcs="$funcs strtod"
1676funcs="$funcs strtol"
1677funcs="$funcs strtoul"
1678funcs="$funcs tmpnam"
1679funcs="$funcs vasprintf"
1680funcs="$funcs vfprintf"
1681funcs="$funcs vprintf"
1682funcs="$funcs vsprintf"
1683funcs="$funcs waitpid"
1684
1685# Also in the old function.def file: alloca, vfork, getopt.
1686
1687vars="sys_errlist sys_nerr sys_siglist"
1688
90e72e20 1689checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
0bc0cd11
JL
1690
1691# These are neither executed nor required, but they help keep
1692# autoheader happy without adding a bunch of text to acconfig.h.
1693if test "x" = "y"; then
dac45916 1694 for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock
0bc0cd11
JL
1695do
1696echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 1697echo "configure:1698: checking for $ac_func" >&5
0bc0cd11
JL
1698if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1699 echo $ac_n "(cached) $ac_c" 1>&6
1700else
1701 cat > conftest.$ac_ext <<EOF
6706f116 1702#line 1703 "configure"
0bc0cd11
JL
1703#include "confdefs.h"
1704/* System header to define __stub macros and hopefully few prototypes,
1705 which can conflict with char $ac_func(); below. */
1706#include <assert.h>
1707/* Override any gcc2 internal prototype to avoid an error. */
1708/* We use char because int might match the return type of a gcc2
1709 builtin and then its argument prototype would still apply. */
1710char $ac_func();
1711
1712int main() {
1713
1714/* The GNU C library defines this for functions which it implements
1715 to always fail with ENOSYS. Some functions are actually named
1716 something starting with __ and the normal name is an alias. */
1717#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1718choke me
1719#else
1720$ac_func();
1721#endif
1722
1723; return 0; }
1724EOF
6706f116 1725if { (eval echo configure:1726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
1726 rm -rf conftest*
1727 eval "ac_cv_func_$ac_func=yes"
1728else
1729 echo "configure: failed program was:" >&5
1730 cat conftest.$ac_ext >&5
1731 rm -rf conftest*
1732 eval "ac_cv_func_$ac_func=no"
1733fi
1734rm -f conftest*
1735fi
1736
1737if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1738 echo "$ac_t""yes" 1>&6
1739 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1740 cat >> confdefs.h <<EOF
1741#define $ac_tr_func 1
1742EOF
1743
1744else
1745 echo "$ac_t""no" 1>&6
1746fi
1747done
1748
dac45916 1749 for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy
0bc0cd11
JL
1750do
1751echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 1752echo "configure:1753: checking for $ac_func" >&5
0bc0cd11
JL
1753if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1754 echo $ac_n "(cached) $ac_c" 1>&6
1755else
1756 cat > conftest.$ac_ext <<EOF
6706f116 1757#line 1758 "configure"
0bc0cd11
JL
1758#include "confdefs.h"
1759/* System header to define __stub macros and hopefully few prototypes,
1760 which can conflict with char $ac_func(); below. */
1761#include <assert.h>
1762/* Override any gcc2 internal prototype to avoid an error. */
1763/* We use char because int might match the return type of a gcc2
1764 builtin and then its argument prototype would still apply. */
1765char $ac_func();
1766
1767int main() {
1768
1769/* The GNU C library defines this for functions which it implements
1770 to always fail with ENOSYS. Some functions are actually named
1771 something starting with __ and the normal name is an alias. */
1772#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1773choke me
1774#else
1775$ac_func();
1776#endif
1777
1778; return 0; }
1779EOF
6706f116 1780if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
1781 rm -rf conftest*
1782 eval "ac_cv_func_$ac_func=yes"
1783else
1784 echo "configure: failed program was:" >&5
1785 cat conftest.$ac_ext >&5
1786 rm -rf conftest*
1787 eval "ac_cv_func_$ac_func=no"
1788fi
1789rm -f conftest*
1790fi
1791
1792if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1793 echo "$ac_t""yes" 1>&6
1794 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1795 cat >> confdefs.h <<EOF
1796#define $ac_tr_func 1
1797EOF
1798
1799else
1800 echo "$ac_t""no" 1>&6
1801fi
1802done
1803
dac45916 1804 for ac_func in memmove memset putenv random rename rindex sigsetmask
0bc0cd11
JL
1805do
1806echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 1807echo "configure:1808: checking for $ac_func" >&5
0bc0cd11
JL
1808if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1809 echo $ac_n "(cached) $ac_c" 1>&6
1810else
1811 cat > conftest.$ac_ext <<EOF
6706f116 1812#line 1813 "configure"
0bc0cd11
JL
1813#include "confdefs.h"
1814/* System header to define __stub macros and hopefully few prototypes,
1815 which can conflict with char $ac_func(); below. */
1816#include <assert.h>
1817/* Override any gcc2 internal prototype to avoid an error. */
1818/* We use char because int might match the return type of a gcc2
1819 builtin and then its argument prototype would still apply. */
1820char $ac_func();
1821
1822int main() {
1823
1824/* The GNU C library defines this for functions which it implements
1825 to always fail with ENOSYS. Some functions are actually named
1826 something starting with __ and the normal name is an alias. */
1827#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1828choke me
1829#else
1830$ac_func();
1831#endif
1832
1833; return 0; }
1834EOF
6706f116 1835if { (eval echo configure:1836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
1836 rm -rf conftest*
1837 eval "ac_cv_func_$ac_func=yes"
1838else
1839 echo "configure: failed program was:" >&5
1840 cat conftest.$ac_ext >&5
1841 rm -rf conftest*
1842 eval "ac_cv_func_$ac_func=no"
1843fi
1844rm -f conftest*
1845fi
1846
1847if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1848 echo "$ac_t""yes" 1>&6
1849 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1850 cat >> confdefs.h <<EOF
1851#define $ac_tr_func 1
1852EOF
1853
1854else
1855 echo "$ac_t""no" 1>&6
1856fi
1857done
1858
dac45916 1859 for ac_func in strcasecmp setenv strchr strdup strncasecmp strrchr strstr
0bc0cd11
JL
1860do
1861echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 1862echo "configure:1863: checking for $ac_func" >&5
0bc0cd11
JL
1863if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1864 echo $ac_n "(cached) $ac_c" 1>&6
1865else
1866 cat > conftest.$ac_ext <<EOF
6706f116 1867#line 1868 "configure"
0bc0cd11
JL
1868#include "confdefs.h"
1869/* System header to define __stub macros and hopefully few prototypes,
1870 which can conflict with char $ac_func(); below. */
1871#include <assert.h>
1872/* Override any gcc2 internal prototype to avoid an error. */
1873/* We use char because int might match the return type of a gcc2
1874 builtin and then its argument prototype would still apply. */
1875char $ac_func();
1876
1877int main() {
1878
1879/* The GNU C library defines this for functions which it implements
1880 to always fail with ENOSYS. Some functions are actually named
1881 something starting with __ and the normal name is an alias. */
1882#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1883choke me
1884#else
1885$ac_func();
1886#endif
1887
1888; return 0; }
1889EOF
6706f116 1890if { (eval echo configure:1891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
1891 rm -rf conftest*
1892 eval "ac_cv_func_$ac_func=yes"
1893else
1894 echo "configure: failed program was:" >&5
1895 cat conftest.$ac_ext >&5
1896 rm -rf conftest*
1897 eval "ac_cv_func_$ac_func=no"
1898fi
1899rm -f conftest*
1900fi
1901
1902if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1903 echo "$ac_t""yes" 1>&6
1904 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1905 cat >> confdefs.h <<EOF
1906#define $ac_tr_func 1
1907EOF
1908
1909else
1910 echo "$ac_t""no" 1>&6
1911fi
1912done
1913
dac45916 1914 for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf
0bc0cd11
JL
1915do
1916echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 1917echo "configure:1918: checking for $ac_func" >&5
0bc0cd11
JL
1918if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1919 echo $ac_n "(cached) $ac_c" 1>&6
1920else
1921 cat > conftest.$ac_ext <<EOF
6706f116 1922#line 1923 "configure"
0bc0cd11
JL
1923#include "confdefs.h"
1924/* System header to define __stub macros and hopefully few prototypes,
1925 which can conflict with char $ac_func(); below. */
1926#include <assert.h>
1927/* Override any gcc2 internal prototype to avoid an error. */
1928/* We use char because int might match the return type of a gcc2
1929 builtin and then its argument prototype would still apply. */
1930char $ac_func();
1931
1932int main() {
1933
1934/* The GNU C library defines this for functions which it implements
1935 to always fail with ENOSYS. Some functions are actually named
1936 something starting with __ and the normal name is an alias. */
1937#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1938choke me
1939#else
1940$ac_func();
1941#endif
1942
1943; return 0; }
1944EOF
6706f116 1945if { (eval echo configure:1946: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
1946 rm -rf conftest*
1947 eval "ac_cv_func_$ac_func=yes"
1948else
1949 echo "configure: failed program was:" >&5
1950 cat conftest.$ac_ext >&5
1951 rm -rf conftest*
1952 eval "ac_cv_func_$ac_func=no"
1953fi
1954rm -f conftest*
1955fi
1956
1957if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1958 echo "$ac_t""yes" 1>&6
1959 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1960 cat >> confdefs.h <<EOF
1961#define $ac_tr_func 1
1962EOF
1963
1964else
1965 echo "$ac_t""no" 1>&6
1966fi
1967done
1968
dac45916 1969 for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal
0bc0cd11
JL
1970do
1971echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 1972echo "configure:1973: checking for $ac_func" >&5
0bc0cd11
JL
1973if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1974 echo $ac_n "(cached) $ac_c" 1>&6
1975else
1976 cat > conftest.$ac_ext <<EOF
6706f116 1977#line 1978 "configure"
0bc0cd11
JL
1978#include "confdefs.h"
1979/* System header to define __stub macros and hopefully few prototypes,
1980 which can conflict with char $ac_func(); below. */
1981#include <assert.h>
1982/* Override any gcc2 internal prototype to avoid an error. */
1983/* We use char because int might match the return type of a gcc2
1984 builtin and then its argument prototype would still apply. */
1985char $ac_func();
1986
1987int main() {
1988
1989/* The GNU C library defines this for functions which it implements
1990 to always fail with ENOSYS. Some functions are actually named
1991 something starting with __ and the normal name is an alias. */
1992#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1993choke me
1994#else
1995$ac_func();
1996#endif
1997
1998; return 0; }
1999EOF
6706f116 2000if { (eval echo configure:2001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
2001 rm -rf conftest*
2002 eval "ac_cv_func_$ac_func=yes"
2003else
2004 echo "configure: failed program was:" >&5
2005 cat conftest.$ac_ext >&5
2006 rm -rf conftest*
2007 eval "ac_cv_func_$ac_func=no"
2008fi
2009rm -f conftest*
2010fi
2011
2012if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2013 echo "$ac_t""yes" 1>&6
2014 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2015 cat >> confdefs.h <<EOF
2016#define $ac_tr_func 1
2017EOF
2018
acbbd80a
MK
2019else
2020 echo "$ac_t""no" 1>&6
2021fi
2022done
2023
29650b2b 2024 for ac_func in sysconf times sbrk gettimeofday ffs
acbbd80a
MK
2025do
2026echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 2027echo "configure:2028: checking for $ac_func" >&5
acbbd80a
MK
2028if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2029 echo $ac_n "(cached) $ac_c" 1>&6
2030else
2031 cat > conftest.$ac_ext <<EOF
6706f116 2032#line 2033 "configure"
acbbd80a
MK
2033#include "confdefs.h"
2034/* System header to define __stub macros and hopefully few prototypes,
2035 which can conflict with char $ac_func(); below. */
2036#include <assert.h>
2037/* Override any gcc2 internal prototype to avoid an error. */
2038/* We use char because int might match the return type of a gcc2
2039 builtin and then its argument prototype would still apply. */
2040char $ac_func();
2041
2042int main() {
2043
2044/* The GNU C library defines this for functions which it implements
2045 to always fail with ENOSYS. Some functions are actually named
2046 something starting with __ and the normal name is an alias. */
2047#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2048choke me
2049#else
2050$ac_func();
2051#endif
2052
2053; return 0; }
2054EOF
6706f116 2055if { (eval echo configure:2056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
acbbd80a
MK
2056 rm -rf conftest*
2057 eval "ac_cv_func_$ac_func=yes"
2058else
2059 echo "configure: failed program was:" >&5
2060 cat conftest.$ac_ext >&5
2061 rm -rf conftest*
2062 eval "ac_cv_func_$ac_func=no"
2063fi
2064rm -f conftest*
2065fi
2066
2067if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2068 echo "$ac_t""yes" 1>&6
2069 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2070 cat >> confdefs.h <<EOF
2071#define $ac_tr_func 1
2072EOF
2073
0bc0cd11
JL
2074else
2075 echo "$ac_t""no" 1>&6
2076fi
2077done
2078
d1209685
ZW
2079 cat >> confdefs.h <<\EOF
2080#define HAVE_SYS_ERRLIST 1
2081EOF
2082
2083 cat >> confdefs.h <<\EOF
dac45916 2084#define HAVE_SYS_NERR 1
d1209685
ZW
2085EOF
2086
2087 cat >> confdefs.h <<\EOF
2088#define HAVE_SYS_SIGLIST 1
2089EOF
2090
0bc0cd11
JL
2091fi
2092
2093# For each of these functions, if the host does not provide the
2094# function we want to put FN.o in LIBOBJS, and if the host does
b548dffb 2095# provide the function, we want to define HAVE_FN in config.h.
0bc0cd11
JL
2096
2097setobjs=
7c72138a 2098CHECK=
48d7db63 2099target_header_dir=
0bc0cd11
JL
2100if test -n "${with_target_subdir}"; then
2101
ca6b370d 2102 # We are being configured as a target library. AC_REPLACE_FUNCS
0bc0cd11 2103 # may not work correctly, because the compiler may not be able to
ca6b370d
JL
2104 # link executables. Note that we may still be being configured
2105 # native.
0bc0cd11
JL
2106
2107 # If we are being configured for newlib, we know which functions
2108 # newlib provide and which ones we will be expected to provide.
2109
2110 if test "x${with_newlib}" = "xyes"; then
ca6b370d 2111 LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
0bc0cd11
JL
2112
2113 for f in $funcs; do
2114 case "$f" in
ca6b370d 2115 asprintf | basename | insque | random | strdup | vasprintf)
0bc0cd11
JL
2116 ;;
2117 *)
2118 n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2119 cat >> confdefs.h <<EOF
2120#define $n 1
2121EOF
2122
2123 ;;
2124 esac
2125 done
2126
2127 # newlib doesnt provide any of the variables in $vars, so we
2128 # dont have to check them here.
2129
ca6b370d 2130 # Of the functions in $checkfuncs, newlib only has strerror.
0bc0cd11
JL
2131 cat >> confdefs.h <<\EOF
2132#define HAVE_STRERROR 1
2133EOF
2134
2135
2136 setobjs=yes
2137
2138 fi
7c72138a 2139
48d7db63
PE
2140 # We may wish to install the target headers somewhere.
2141 # Check whether --enable-install-libiberty or --disable-install-libiberty was given.
2142if test "${enable_install_libiberty+set}" = set; then
2143 enableval="$enable_install_libiberty"
2144 enable_install_libiberty=$enableval
2145else
2146 enable_install_libiberty=no
2147fi
2148
2149 # Option parsed, now set things appropriately.
2150 case x"$enable_install_libiberty" in
2151 xyes|x)
2152 target_header_dir=libiberty
2153 ;;
2154 xno)
2155 target_header_dir=
2156 ;;
2157 *)
2158 # This could be sanity-checked in various ways...
2159 target_header_dir="${enable_install_libiberty}"
2160 ;;
2161 esac
2162
2163
7c72138a
TT
2164else
2165
2166 # Not a target library, so we set things up to run the test suite.
2167 CHECK=check-cplus-dem
2168
0bc0cd11
JL
2169fi
2170
7c72138a
TT
2171
2172
48d7db63 2173
b1c45ae4 2174case "${host}" in
46af757b 2175 *-*-cygwin* | *-*-mingw*)
b1c45ae4
CF
2176 cat >> confdefs.h <<\EOF
2177#define HAVE_SYS_ERRLIST 1
2178EOF
2179
2180 cat >> confdefs.h <<\EOF
2181#define HAVE_SYS_NERR 1
2182EOF
2183
2184 ;;
2185esac
2186
0bc0cd11
JL
2187if test -z "${setobjs}"; then
2188 case "${host}" in
2189
2190 *-*-vxworks*)
2191 # Handle VxWorks configuration specially, since on VxWorks the
2192 # libraries are actually on the target board, not in the file
2193 # system.
2194 LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
2195 LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
2196 for f in $funcs; do
2197 case "$f" in
2198 basename | getpagesize | insque | random | strcasecmp)
2199 ;;
2200 strncasecmp | strdup | vfork | waitpid | vasprintf)
2201 ;;
2202 *)
2203 n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2204 cat >> confdefs.h <<EOF
2205#define $n 1
2206EOF
2207
2208 ;;
2209 esac
2210 done
2211
2212 # VxWorks doesn't provide any of the variables in $vars, so we
2213 # don't have to check them here.
2214
2215 # Of the functions in $checkfuncs, VxWorks only has strerror.
2216 cat >> confdefs.h <<\EOF
2217#define HAVE_STRERROR 1
2218EOF
2219
2220
2221 setobjs=yes
2222 ;;
2223
2224 esac
2225fi
2226
2227if test -z "${setobjs}"; then
2228
2229 case "${host}" in
2230
dd8f3ed5
GN
2231 *-*-cygwin*)
2232 # The Cygwin library actually uses a couple of files from
0bc0cd11 2233 # libiberty when it is built. If we are building a native
dd8f3ed5 2234 # Cygwin, and we run the tests, we will appear to have these
0bc0cd11
JL
2235 # files. However, when we go on to build winsup, we will wind up
2236 # with a library which does not have the files, since they should
2237 # have come from libiberty.
2238
2239 # We handle this by removing the functions the winsup library
2240 # provides from our shell variables, so that they appear to be
2241 # missing.
2242
2f31ed7e
DD
2243 # DJ - only if we're *building* cygwin, not just building *with* cygwin
2244
2245 if test -n "${with_target_subdir}"
2246 then
2247 funcs="`echo $funcs | sed -e 's/random//'`"
2248 LIBOBJS="$LIBOBJS random.o"
2249 vars="`echo $vars | sed -e 's/sys_siglist//'`"
2250 checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
2251 fi
0bc0cd11
JL
2252 ;;
2253
2254 *-*-mingw32*)
2255 # Under mingw32, sys_nerr and sys_errlist exist, but they are
2256 # macros, so the test below won't find them.
d1209685
ZW
2257 libiberty_cv_var_sys_nerr=yes
2258 libiberty_cv_var_sys_errlist=yes
0bc0cd11
JL
2259 ;;
2260
89f602a7
MK
2261 *-*-uwin*)
2262 # Under some versions of uwin, vfork is notoriously buggy and the test
2263 # can hang configure; on other versions, vfork exists just as a stub.
2264 # FIXME: This should be removed once vfork in uwin's runtime is fixed.
2265 ac_cv_func_vfork_works=no
62133b5e
MK
2266 # Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are
2267 # macros (actually, these are imported from a DLL, but the end effect
2268 # is the same), so the test below won't find them.
d1209685
ZW
2269 libiberty_cv_var_sys_nerr=yes
2270 libiberty_cv_var_sys_errlist=yes
89f602a7
MK
2271 ;;
2272
ee262b6f
DR
2273 *-*-*vms*)
2274 # Under VMS, vfork works very different than on Unix. The standard test
2275 # won't work, and it isn't easily adaptable. It makes more sense to
2276 # just force it.
2277 ac_cv_func_vfork_works=yes
2278 ;;
2279
0bc0cd11
JL
2280 esac
2281
2282 # We haven't set the list of objects yet. Use the standard autoconf
2283 # tests. This will only work if the compiler works.
2284 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
6706f116 2285echo "configure:2286: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
0bc0cd11
JL
2286
2287ac_ext=c
2288# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2289ac_cpp='$CPP $CPPFLAGS'
2290ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
687361c8 2291ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
0bc0cd11
JL
2292cross_compiling=$ac_cv_prog_cc_cross
2293
687361c8
ME
2294cat > conftest.$ac_ext << EOF
2295
6706f116 2296#line 2297 "configure"
0bc0cd11 2297#include "confdefs.h"
687361c8 2298
0bc0cd11
JL
2299main(){return(0);}
2300EOF
6706f116 2301if { (eval echo configure:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
2302 ac_cv_prog_cc_works=yes
2303 # If we can't run a trivial program, we are probably using a cross compiler.
2304 if (./conftest; exit) 2>/dev/null; then
2305 ac_cv_prog_cc_cross=no
2306 else
2307 ac_cv_prog_cc_cross=yes
2308 fi
2309else
2310 echo "configure: failed program was:" >&5
2311 cat conftest.$ac_ext >&5
2312 ac_cv_prog_cc_works=no
2313fi
2314rm -fr conftest*
687361c8
ME
2315ac_ext=c
2316# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2317ac_cpp='$CPP $CPPFLAGS'
2318ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2319ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2320cross_compiling=$ac_cv_prog_cc_cross
0bc0cd11
JL
2321
2322echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2323if test $ac_cv_prog_cc_works = no; then
2324 { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2325fi
2326echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
6706f116 2327echo "configure:2328: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
0bc0cd11
JL
2328echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2329cross_compiling=$ac_cv_prog_cc_cross
2330
2331 for ac_func in $funcs
2332do
2333echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 2334echo "configure:2335: checking for $ac_func" >&5
0bc0cd11
JL
2335if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2336 echo $ac_n "(cached) $ac_c" 1>&6
2337else
2338 cat > conftest.$ac_ext <<EOF
6706f116 2339#line 2340 "configure"
0bc0cd11
JL
2340#include "confdefs.h"
2341/* System header to define __stub macros and hopefully few prototypes,
2342 which can conflict with char $ac_func(); below. */
2343#include <assert.h>
2344/* Override any gcc2 internal prototype to avoid an error. */
2345/* We use char because int might match the return type of a gcc2
2346 builtin and then its argument prototype would still apply. */
2347char $ac_func();
2348
2349int main() {
2350
2351/* The GNU C library defines this for functions which it implements
2352 to always fail with ENOSYS. Some functions are actually named
2353 something starting with __ and the normal name is an alias. */
2354#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2355choke me
2356#else
2357$ac_func();
2358#endif
2359
2360; return 0; }
2361EOF
6706f116 2362if { (eval echo configure:2363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
2363 rm -rf conftest*
2364 eval "ac_cv_func_$ac_func=yes"
2365else
2366 echo "configure: failed program was:" >&5
2367 cat conftest.$ac_ext >&5
2368 rm -rf conftest*
2369 eval "ac_cv_func_$ac_func=no"
2370fi
2371rm -f conftest*
2372fi
2373
2374if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2375 echo "$ac_t""yes" 1>&6
2376 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2377 cat >> confdefs.h <<EOF
2378#define $ac_tr_func 1
2379EOF
2380
2381else
2382 echo "$ac_t""no" 1>&6
687361c8 2383LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
0bc0cd11
JL
2384fi
2385done
2386
2387
b548dffb 2388 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
6706f116 2389echo "configure:2390: checking whether alloca needs Cray hooks" >&5
0bc0cd11
JL
2390if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
2391 echo $ac_n "(cached) $ac_c" 1>&6
2392else
2393 cat > conftest.$ac_ext <<EOF
6706f116 2394#line 2395 "configure"
0bc0cd11
JL
2395#include "confdefs.h"
2396#if defined(CRAY) && ! defined(CRAY2)
2397webecray
2398#else
2399wenotbecray
2400#endif
2401
2402EOF
2403if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2404 egrep "webecray" >/dev/null 2>&1; then
2405 rm -rf conftest*
2406 ac_cv_os_cray=yes
2407else
2408 rm -rf conftest*
2409 ac_cv_os_cray=no
2410fi
2411rm -f conftest*
2412
2413fi
2414
2415echo "$ac_t""$ac_cv_os_cray" 1>&6
2416if test $ac_cv_os_cray = yes; then
b548dffb
ZW
2417 for ac_func in _getb67 GETB67 getb67; do
2418 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 2419echo "configure:2420: checking for $ac_func" >&5
0bc0cd11
JL
2420if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2421 echo $ac_n "(cached) $ac_c" 1>&6
2422else
2423 cat > conftest.$ac_ext <<EOF
6706f116 2424#line 2425 "configure"
0bc0cd11
JL
2425#include "confdefs.h"
2426/* System header to define __stub macros and hopefully few prototypes,
2427 which can conflict with char $ac_func(); below. */
2428#include <assert.h>
2429/* Override any gcc2 internal prototype to avoid an error. */
2430/* We use char because int might match the return type of a gcc2
2431 builtin and then its argument prototype would still apply. */
2432char $ac_func();
2433
2434int main() {
2435
2436/* The GNU C library defines this for functions which it implements
2437 to always fail with ENOSYS. Some functions are actually named
2438 something starting with __ and the normal name is an alias. */
2439#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2440choke me
2441#else
2442$ac_func();
2443#endif
2444
2445; return 0; }
2446EOF
6706f116 2447if { (eval echo configure:2448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
2448 rm -rf conftest*
2449 eval "ac_cv_func_$ac_func=yes"
2450else
2451 echo "configure: failed program was:" >&5
2452 cat conftest.$ac_ext >&5
2453 rm -rf conftest*
2454 eval "ac_cv_func_$ac_func=no"
2455fi
2456rm -f conftest*
2457fi
2458
2459if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2460 echo "$ac_t""yes" 1>&6
2461 cat >> confdefs.h <<EOF
2462#define CRAY_STACKSEG_END $ac_func
2463EOF
0bc0cd11
JL
2464 break
2465else
2466 echo "$ac_t""no" 1>&6
2467fi
2468
b548dffb 2469 done
0bc0cd11
JL
2470fi
2471
2472echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
6706f116 2473echo "configure:2474: checking stack direction for C alloca" >&5
0bc0cd11
JL
2474if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
2475 echo $ac_n "(cached) $ac_c" 1>&6
2476else
2477 if test "$cross_compiling" = yes; then
2478 ac_cv_c_stack_direction=0
2479else
2480 cat > conftest.$ac_ext <<EOF
6706f116 2481#line 2482 "configure"
0bc0cd11
JL
2482#include "confdefs.h"
2483find_stack_direction ()
2484{
2485 static char *addr = 0;
2486 auto char dummy;
2487 if (addr == 0)
2488 {
2489 addr = &dummy;
2490 return find_stack_direction ();
2491 }
2492 else
2493 return (&dummy > addr) ? 1 : -1;
2494}
2495main ()
2496{
2497 exit (find_stack_direction() < 0);
2498}
2499EOF
6706f116 2500if { (eval echo configure:2501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
0bc0cd11
JL
2501then
2502 ac_cv_c_stack_direction=1
2503else
2504 echo "configure: failed program was:" >&5
2505 cat conftest.$ac_ext >&5
2506 rm -fr conftest*
2507 ac_cv_c_stack_direction=-1
2508fi
2509rm -fr conftest*
2510fi
2511
2512fi
2513
2514echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
2515cat >> confdefs.h <<EOF
2516#define STACK_DIRECTION $ac_cv_c_stack_direction
2517EOF
2518
7dd88617 2519
deae2ed9 2520 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
0bc0cd11 2521echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
6706f116 2522echo "configure:2523: checking for vfork.h" >&5
0bc0cd11
JL
2523if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2524 echo $ac_n "(cached) $ac_c" 1>&6
2525else
2526 cat > conftest.$ac_ext <<EOF
6706f116 2527#line 2528 "configure"
0bc0cd11
JL
2528#include "confdefs.h"
2529#include <vfork.h>
2530EOF
2531ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6706f116 2532{ (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
687361c8 2533ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
0bc0cd11
JL
2534if test -z "$ac_err"; then
2535 rm -rf conftest*
2536 eval "ac_cv_header_$ac_safe=yes"
2537else
2538 echo "$ac_err" >&5
2539 echo "configure: failed program was:" >&5
2540 cat conftest.$ac_ext >&5
2541 rm -rf conftest*
2542 eval "ac_cv_header_$ac_safe=no"
2543fi
2544rm -f conftest*
2545fi
2546if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2547 echo "$ac_t""yes" 1>&6
2548 cat >> confdefs.h <<\EOF
2549#define HAVE_VFORK_H 1
2550EOF
2551
2552else
2553 echo "$ac_t""no" 1>&6
2554fi
2555
2556echo $ac_n "checking for working vfork""... $ac_c" 1>&6
6706f116 2557echo "configure:2558: checking for working vfork" >&5
0bc0cd11
JL
2558if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
2559 echo $ac_n "(cached) $ac_c" 1>&6
2560else
2561 if test "$cross_compiling" = yes; then
2562 echo $ac_n "checking for vfork""... $ac_c" 1>&6
6706f116 2563echo "configure:2564: checking for vfork" >&5
0bc0cd11
JL
2564if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
2565 echo $ac_n "(cached) $ac_c" 1>&6
2566else
2567 cat > conftest.$ac_ext <<EOF
6706f116 2568#line 2569 "configure"
0bc0cd11
JL
2569#include "confdefs.h"
2570/* System header to define __stub macros and hopefully few prototypes,
2571 which can conflict with char vfork(); below. */
2572#include <assert.h>
2573/* Override any gcc2 internal prototype to avoid an error. */
2574/* We use char because int might match the return type of a gcc2
2575 builtin and then its argument prototype would still apply. */
2576char vfork();
2577
2578int main() {
2579
2580/* The GNU C library defines this for functions which it implements
2581 to always fail with ENOSYS. Some functions are actually named
2582 something starting with __ and the normal name is an alias. */
2583#if defined (__stub_vfork) || defined (__stub___vfork)
2584choke me
2585#else
2586vfork();
2587#endif
2588
2589; return 0; }
2590EOF
6706f116 2591if { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
2592 rm -rf conftest*
2593 eval "ac_cv_func_vfork=yes"
2594else
2595 echo "configure: failed program was:" >&5
2596 cat conftest.$ac_ext >&5
2597 rm -rf conftest*
2598 eval "ac_cv_func_vfork=no"
2599fi
2600rm -f conftest*
2601fi
2602
2603if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
2604 echo "$ac_t""yes" 1>&6
2605 :
2606else
2607 echo "$ac_t""no" 1>&6
2608fi
2609
2610ac_cv_func_vfork_works=$ac_cv_func_vfork
2611else
2612 cat > conftest.$ac_ext <<EOF
6706f116 2613#line 2614 "configure"
0bc0cd11
JL
2614#include "confdefs.h"
2615/* Thanks to Paul Eggert for this test. */
2616#include <stdio.h>
2617#include <sys/types.h>
2618#include <sys/stat.h>
2619#ifdef HAVE_UNISTD_H
2620#include <unistd.h>
2621#endif
2622#ifdef HAVE_VFORK_H
2623#include <vfork.h>
2624#endif
2625/* On some sparc systems, changes by the child to local and incoming
2626 argument registers are propagated back to the parent.
2627 The compiler is told about this with #include <vfork.h>,
2628 but some compilers (e.g. gcc -O) don't grok <vfork.h>.
2629 Test for this by using a static variable whose address
2630 is put into a register that is clobbered by the vfork. */
2631static
2632#ifdef __cplusplus
2633sparc_address_test (int arg)
2634#else
2635sparc_address_test (arg) int arg;
2636#endif
2637{
2638 static pid_t child;
2639 if (!child) {
2640 child = vfork ();
2641 if (child < 0) {
2642 perror ("vfork");
2643 _exit(2);
2644 }
2645 if (!child) {
2646 arg = getpid();
2647 write(-1, "", 0);
2648 _exit (arg);
2649 }
2650 }
2651}
2652main() {
2653 pid_t parent = getpid ();
2654 pid_t child;
2655
2656 sparc_address_test ();
2657
2658 child = vfork ();
2659
2660 if (child == 0) {
2661 /* Here is another test for sparc vfork register problems.
2662 This test uses lots of local variables, at least
2663 as many local variables as main has allocated so far
2664 including compiler temporaries. 4 locals are enough for
2665 gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
2666 A buggy compiler should reuse the register of parent
2667 for one of the local variables, since it will think that
2668 parent can't possibly be used any more in this routine.
2669 Assigning to the local variable will thus munge parent
2670 in the parent process. */
2671 pid_t
2672 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
2673 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
2674 /* Convince the compiler that p..p7 are live; otherwise, it might
2675 use the same hardware register for all 8 local variables. */
2676 if (p != p1 || p != p2 || p != p3 || p != p4
2677 || p != p5 || p != p6 || p != p7)
2678 _exit(1);
2679
2680 /* On some systems (e.g. IRIX 3.3),
2681 vfork doesn't separate parent from child file descriptors.
2682 If the child closes a descriptor before it execs or exits,
2683 this munges the parent's descriptor as well.
2684 Test for this by closing stdout in the child. */
2685 _exit(close(fileno(stdout)) != 0);
2686 } else {
2687 int status;
2688 struct stat st;
2689
2690 while (wait(&status) != child)
2691 ;
2692 exit(
2693 /* Was there some problem with vforking? */
2694 child < 0
2695
2696 /* Did the child fail? (This shouldn't happen.) */
2697 || status
2698
2699 /* Did the vfork/compiler bug occur? */
2700 || parent != getpid()
2701
2702 /* Did the file descriptor bug occur? */
2703 || fstat(fileno(stdout), &st) != 0
2704 );
2705 }
2706}
2707EOF
6706f116 2708if { (eval echo configure:2709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
0bc0cd11
JL
2709then
2710 ac_cv_func_vfork_works=yes
2711else
2712 echo "configure: failed program was:" >&5
2713 cat conftest.$ac_ext >&5
2714 rm -fr conftest*
2715 ac_cv_func_vfork_works=no
2716fi
2717rm -fr conftest*
2718fi
2719
2720fi
2721
2722echo "$ac_t""$ac_cv_func_vfork_works" 1>&6
2723if test $ac_cv_func_vfork_works = no; then
2724 cat >> confdefs.h <<\EOF
2725#define vfork fork
2726EOF
2727
2728fi
2729
2730 if test $ac_cv_func_vfork_works = no; then
2731 LIBOBJS="$LIBOBJS vfork.o"
2732 fi
e490616e
ZW
2733 # We only need _doprnt if we might use it to implement v*printf.
2734 if test $ac_cv_func_vprintf != yes \
2735 || test $ac_cv_func_vfprintf != yes \
2736 || test $ac_cv_func_vsprintf != yes; then
2737 for ac_func in _doprnt
2738do
2739echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 2740echo "configure:2741: checking for $ac_func" >&5
e490616e
ZW
2741if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2742 echo $ac_n "(cached) $ac_c" 1>&6
2743else
2744 cat > conftest.$ac_ext <<EOF
6706f116 2745#line 2746 "configure"
e490616e
ZW
2746#include "confdefs.h"
2747/* System header to define __stub macros and hopefully few prototypes,
2748 which can conflict with char $ac_func(); below. */
2749#include <assert.h>
2750/* Override any gcc2 internal prototype to avoid an error. */
2751/* We use char because int might match the return type of a gcc2
2752 builtin and then its argument prototype would still apply. */
2753char $ac_func();
2754
2755int main() {
2756
2757/* The GNU C library defines this for functions which it implements
2758 to always fail with ENOSYS. Some functions are actually named
2759 something starting with __ and the normal name is an alias. */
2760#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2761choke me
2762#else
2763$ac_func();
2764#endif
2765
2766; return 0; }
2767EOF
6706f116 2768if { (eval echo configure:2769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
e490616e
ZW
2769 rm -rf conftest*
2770 eval "ac_cv_func_$ac_func=yes"
2771else
2772 echo "configure: failed program was:" >&5
2773 cat conftest.$ac_ext >&5
2774 rm -rf conftest*
2775 eval "ac_cv_func_$ac_func=no"
2776fi
2777rm -f conftest*
2778fi
2779
2780if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2781 echo "$ac_t""yes" 1>&6
2782 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2783 cat >> confdefs.h <<EOF
2784#define $ac_tr_func 1
2785EOF
2786
2787else
2788 echo "$ac_t""no" 1>&6
2789LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
2790fi
2791done
2792
2793
9ce3f7e5
DD
2794 else
2795 for ac_func in _doprnt
2796do
2797echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 2798echo "configure:2799: checking for $ac_func" >&5
9ce3f7e5
DD
2799if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2800 echo $ac_n "(cached) $ac_c" 1>&6
2801else
2802 cat > conftest.$ac_ext <<EOF
6706f116 2803#line 2804 "configure"
9ce3f7e5
DD
2804#include "confdefs.h"
2805/* System header to define __stub macros and hopefully few prototypes,
2806 which can conflict with char $ac_func(); below. */
2807#include <assert.h>
2808/* Override any gcc2 internal prototype to avoid an error. */
2809/* We use char because int might match the return type of a gcc2
2810 builtin and then its argument prototype would still apply. */
2811char $ac_func();
2812
2813int main() {
2814
2815/* The GNU C library defines this for functions which it implements
2816 to always fail with ENOSYS. Some functions are actually named
2817 something starting with __ and the normal name is an alias. */
2818#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2819choke me
2820#else
2821$ac_func();
2822#endif
2823
2824; return 0; }
2825EOF
6706f116 2826if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9ce3f7e5
DD
2827 rm -rf conftest*
2828 eval "ac_cv_func_$ac_func=yes"
2829else
2830 echo "configure: failed program was:" >&5
2831 cat conftest.$ac_ext >&5
2832 rm -rf conftest*
2833 eval "ac_cv_func_$ac_func=no"
2834fi
2835rm -f conftest*
2836fi
2837
2838if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2839 echo "$ac_t""yes" 1>&6
2840 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2841 cat >> confdefs.h <<EOF
2842#define $ac_tr_func 1
2843EOF
2844
2845else
2846 echo "$ac_t""no" 1>&6
2847fi
2848done
2849
e490616e
ZW
2850 fi
2851
0bc0cd11
JL
2852 for v in $vars; do
2853 echo $ac_n "checking for $v""... $ac_c" 1>&6
6706f116 2854echo "configure:2855: checking for $v" >&5
0bc0cd11
JL
2855 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then
2856 echo $ac_n "(cached) $ac_c" 1>&6
2857else
2858 cat > conftest.$ac_ext <<EOF
6706f116 2859#line 2860 "configure"
0bc0cd11
JL
2860#include "confdefs.h"
2861int *p;
2862int main() {
9f3dbd92 2863extern int $v []; p = $v;
0bc0cd11
JL
2864; return 0; }
2865EOF
6706f116 2866if { (eval echo configure:2867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
2867 rm -rf conftest*
2868 eval "libiberty_cv_var_$v=yes"
2869else
2870 echo "configure: failed program was:" >&5
2871 cat conftest.$ac_ext >&5
2872 rm -rf conftest*
2873 eval "libiberty_cv_var_$v=no"
2874fi
2875rm -f conftest*
2876fi
2877
2878 if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
2879 echo "$ac_t""yes" 1>&6
2880 n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2881 cat >> confdefs.h <<EOF
2882#define $n 1
2883EOF
2884
2885 else
2886 echo "$ac_t""no" 1>&6
2887 fi
2888 done
2889 for ac_func in $checkfuncs
2890do
2891echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 2892echo "configure:2893: checking for $ac_func" >&5
0bc0cd11
JL
2893if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2894 echo $ac_n "(cached) $ac_c" 1>&6
2895else
2896 cat > conftest.$ac_ext <<EOF
6706f116 2897#line 2898 "configure"
0bc0cd11
JL
2898#include "confdefs.h"
2899/* System header to define __stub macros and hopefully few prototypes,
2900 which can conflict with char $ac_func(); below. */
2901#include <assert.h>
2902/* Override any gcc2 internal prototype to avoid an error. */
2903/* We use char because int might match the return type of a gcc2
2904 builtin and then its argument prototype would still apply. */
2905char $ac_func();
2906
2907int main() {
2908
2909/* The GNU C library defines this for functions which it implements
2910 to always fail with ENOSYS. Some functions are actually named
2911 something starting with __ and the normal name is an alias. */
2912#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2913choke me
2914#else
2915$ac_func();
2916#endif
2917
2918; return 0; }
2919EOF
6706f116 2920if { (eval echo configure:2921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
0bc0cd11
JL
2921 rm -rf conftest*
2922 eval "ac_cv_func_$ac_func=yes"
2923else
2924 echo "configure: failed program was:" >&5
2925 cat conftest.$ac_ext >&5
2926 rm -rf conftest*
2927 eval "ac_cv_func_$ac_func=no"
2928fi
2929rm -f conftest*
2930fi
2931
2932if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2933 echo "$ac_t""yes" 1>&6
2934 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2935 cat >> confdefs.h <<EOF
2936#define $ac_tr_func 1
2937EOF
2938
2939else
2940 echo "$ac_t""no" 1>&6
2941fi
2942done
2943
2944fi
2945
6706f116 2946for ac_hdr in unistd.h
a9266bfa
KG
2947do
2948ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2949echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6706f116 2950echo "configure:2951: checking for $ac_hdr" >&5
a9266bfa
KG
2951if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2952 echo $ac_n "(cached) $ac_c" 1>&6
2953else
2954 cat > conftest.$ac_ext <<EOF
6706f116 2955#line 2956 "configure"
a9266bfa
KG
2956#include "confdefs.h"
2957#include <$ac_hdr>
2958EOF
2959ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6706f116 2960{ (eval echo configure:2961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
a9266bfa
KG
2961ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2962if test -z "$ac_err"; then
2963 rm -rf conftest*
2964 eval "ac_cv_header_$ac_safe=yes"
2965else
2966 echo "$ac_err" >&5
2967 echo "configure: failed program was:" >&5
2968 cat conftest.$ac_ext >&5
2969 rm -rf conftest*
2970 eval "ac_cv_header_$ac_safe=no"
2971fi
2972rm -f conftest*
2973fi
2974if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2975 echo "$ac_t""yes" 1>&6
2976 ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
2977 cat >> confdefs.h <<EOF
2978#define $ac_tr_hdr 1
2979EOF
2980
2981else
2982 echo "$ac_t""no" 1>&6
2983fi
2984done
2985
2986for ac_func in getpagesize
2987do
2988echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6706f116 2989echo "configure:2990: checking for $ac_func" >&5
a9266bfa
KG
2990if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2991 echo $ac_n "(cached) $ac_c" 1>&6
2992else
2993 cat > conftest.$ac_ext <<EOF
6706f116 2994#line 2995 "configure"
a9266bfa
KG
2995#include "confdefs.h"
2996/* System header to define __stub macros and hopefully few prototypes,
2997 which can conflict with char $ac_func(); below. */
2998#include <assert.h>
2999/* Override any gcc2 internal prototype to avoid an error. */
3000/* We use char because int might match the return type of a gcc2
3001 builtin and then its argument prototype would still apply. */
3002char $ac_func();
3003
3004int main() {
3005
3006/* The GNU C library defines this for functions which it implements
3007 to always fail with ENOSYS. Some functions are actually named
3008 something starting with __ and the normal name is an alias. */
3009#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3010choke me
3011#else
3012$ac_func();
3013#endif
3014
3015; return 0; }
3016EOF
6706f116 3017if { (eval echo configure:3018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
a9266bfa
KG
3018 rm -rf conftest*
3019 eval "ac_cv_func_$ac_func=yes"
3020else
3021 echo "configure: failed program was:" >&5
3022 cat conftest.$ac_ext >&5
3023 rm -rf conftest*
3024 eval "ac_cv_func_$ac_func=no"
3025fi
3026rm -f conftest*
3027fi
3028
3029if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3030 echo "$ac_t""yes" 1>&6
3031 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3032 cat >> confdefs.h <<EOF
3033#define $ac_tr_func 1
3034EOF
3035
3036else
3037 echo "$ac_t""no" 1>&6
3038fi
3039done
3040
3041echo $ac_n "checking for working mmap""... $ac_c" 1>&6
6706f116 3042echo "configure:3043: checking for working mmap" >&5
a9266bfa
KG
3043if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
3044 echo $ac_n "(cached) $ac_c" 1>&6
3045else
3046 if test "$cross_compiling" = yes; then
3047 ac_cv_func_mmap_fixed_mapped=no
3048else
3049 cat > conftest.$ac_ext <<EOF
6706f116 3050#line 3051 "configure"
a9266bfa
KG
3051#include "confdefs.h"
3052
3053/* Thanks to Mike Haertel and Jim Avera for this test.
3054 Here is a matrix of mmap possibilities:
3055 mmap private not fixed
3056 mmap private fixed at somewhere currently unmapped
3057 mmap private fixed at somewhere already mapped
3058 mmap shared not fixed
3059 mmap shared fixed at somewhere currently unmapped
3060 mmap shared fixed at somewhere already mapped
3061 For private mappings, we should verify that changes cannot be read()
3062 back from the file, nor mmap's back from the file at a different
3063 address. (There have been systems where private was not correctly
3064 implemented like the infamous i386 svr4.0, and systems where the
3065 VM page cache was not coherent with the filesystem buffer cache
3066 like early versions of FreeBSD and possibly contemporary NetBSD.)
3067 For shared mappings, we should conversely verify that changes get
3068 propogated back to all the places they're supposed to be.
3069
3070 Grep wants private fixed already mapped.
3071 The main things grep needs to know about mmap are:
3072 * does it exist and is it safe to write into the mmap'd area
3073 * how to use it (BSD variants) */
3074#include <sys/types.h>
3075#include <fcntl.h>
3076#include <sys/mman.h>
3077
3078/* This mess was copied from the GNU getpagesize.h. */
3079#ifndef HAVE_GETPAGESIZE
6706f116
AO
3080# ifdef HAVE_UNISTD_H
3081# include <unistd.h>
3082# endif
a9266bfa
KG
3083
3084/* Assume that all systems that can run configure have sys/param.h. */
3085# ifndef HAVE_SYS_PARAM_H
3086# define HAVE_SYS_PARAM_H 1
3087# endif
3088
3089# ifdef _SC_PAGESIZE
3090# define getpagesize() sysconf(_SC_PAGESIZE)
3091# else /* no _SC_PAGESIZE */
3092# ifdef HAVE_SYS_PARAM_H
3093# include <sys/param.h>
3094# ifdef EXEC_PAGESIZE
3095# define getpagesize() EXEC_PAGESIZE
3096# else /* no EXEC_PAGESIZE */
3097# ifdef NBPG
3098# define getpagesize() NBPG * CLSIZE
3099# ifndef CLSIZE
3100# define CLSIZE 1
3101# endif /* no CLSIZE */
3102# else /* no NBPG */
3103# ifdef NBPC
3104# define getpagesize() NBPC
3105# else /* no NBPC */
3106# ifdef PAGESIZE
3107# define getpagesize() PAGESIZE
3108# endif /* PAGESIZE */
3109# endif /* no NBPC */
3110# endif /* no NBPG */
3111# endif /* no EXEC_PAGESIZE */
3112# else /* no HAVE_SYS_PARAM_H */
3113# define getpagesize() 8192 /* punt totally */
3114# endif /* no HAVE_SYS_PARAM_H */
3115# endif /* no _SC_PAGESIZE */
3116
3117#endif /* no HAVE_GETPAGESIZE */
3118
3119#ifdef __cplusplus
3120extern "C" { void *malloc(unsigned); }
3121#else
3122char *malloc();
3123#endif
3124
3125int
3126main()
3127{
3128 char *data, *data2, *data3;
3129 int i, pagesize;
3130 int fd;
3131
3132 pagesize = getpagesize();
3133
3134 /*
3135 * First, make a file with some known garbage in it.
3136 */
dac45916 3137 data = malloc(pagesize);
a9266bfa
KG
3138 if (!data)
3139 exit(1);
3140 for (i = 0; i < pagesize; ++i)
3141 *(data + i) = rand();
3142 umask(0);
3143 fd = creat("conftestmmap", 0600);
3144 if (fd < 0)
3145 exit(1);
3146 if (write(fd, data, pagesize) != pagesize)
3147 exit(1);
3148 close(fd);
3149
3150 /*
3151 * Next, try to mmap the file at a fixed address which
3152 * already has something else allocated at it. If we can,
3153 * also make sure that we see the same garbage.
3154 */
3155 fd = open("conftestmmap", O_RDWR);
3156 if (fd < 0)
3157 exit(1);
dac45916 3158 data2 = malloc(2 * pagesize);
a9266bfa
KG
3159 if (!data2)
3160 exit(1);
3161 data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
3162 if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
3163 MAP_PRIVATE | MAP_FIXED, fd, 0L))
3164 exit(1);
3165 for (i = 0; i < pagesize; ++i)
3166 if (*(data + i) != *(data2 + i))
3167 exit(1);
3168
3169 /*
3170 * Finally, make sure that changes to the mapped area
3171 * do not percolate back to the file as seen by read().
3172 * (This is a bug on some variants of i386 svr4.0.)
3173 */
3174 for (i = 0; i < pagesize; ++i)
3175 *(data2 + i) = *(data2 + i) + 1;
dac45916 3176 data3 = malloc(pagesize);
a9266bfa
KG
3177 if (!data3)
3178 exit(1);
3179 if (read(fd, data3, pagesize) != pagesize)
3180 exit(1);
3181 for (i = 0; i < pagesize; ++i)
3182 if (*(data + i) != *(data3 + i))
3183 exit(1);
3184 close(fd);
3185 unlink("conftestmmap");
3186 exit(0);
3187}
3188
3189EOF
6706f116 3190if { (eval echo configure:3191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
a9266bfa
KG
3191then
3192 ac_cv_func_mmap_fixed_mapped=yes
3193else
3194 echo "configure: failed program was:" >&5
3195 cat conftest.$ac_ext >&5
3196 rm -fr conftest*
3197 ac_cv_func_mmap_fixed_mapped=no
3198fi
3199rm -fr conftest*
3200fi
3201
3202fi
3203
3204echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
3205if test $ac_cv_func_mmap_fixed_mapped = yes; then
3206 cat >> confdefs.h <<\EOF
3207#define HAVE_MMAP 1
3208EOF
3209
3210fi
3211
3212
3213echo $ac_n "checking for working strncmp""... $ac_c" 1>&6
6706f116 3214echo "configure:3215: checking for working strncmp" >&5
a9266bfa
KG
3215if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
3216 echo $ac_n "(cached) $ac_c" 1>&6
3217else
3218 if test "$cross_compiling" = yes; then
3219 ac_cv_func_strncmp_works=no
3220else
3221 cat > conftest.$ac_ext <<EOF
6706f116 3222#line 3223 "configure"
a9266bfa
KG
3223#include "confdefs.h"
3224
3225/* Test by Jim Wilson and Kaveh Ghazi.
3226 Check whether strncmp reads past the end of its string parameters. */
3227#include <sys/types.h>
3228
3229#ifdef HAVE_FCNTL_H
3230#include <fcntl.h>
3231#endif
3232
3233#ifdef HAVE_SYS_MMAN_H
3234#include <sys/mman.h>
3235#endif
3236
3237#ifndef MAP_ANON
3238#ifdef MAP_ANONYMOUS
3239#define MAP_ANON MAP_ANONYMOUS
3240#else
3241#define MAP_ANON MAP_FILE
3242#endif
3243#endif
3244
3245#ifndef MAP_FILE
3246#define MAP_FILE 0
3247#endif
3248#ifndef O_RDONLY
3249#define O_RDONLY 0
3250#endif
3251
3252#define MAP_LEN 0x10000
3253
3254main ()
3255{
3256#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
3257 char *p;
3258 int dev_zero;
3259
3260 dev_zero = open ("/dev/zero", O_RDONLY);
3261 if (dev_zero < 0)
3262 exit (1);
3263
3264 p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
3265 MAP_ANON|MAP_PRIVATE, dev_zero, 0);
a4219437
IR
3266 if (p == (char *)-1)
3267 p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
3268 MAP_ANON|MAP_PRIVATE, -1, 0);
a9266bfa
KG
3269 if (p == (char *)-1)
3270 exit (2);
3271 else
3272 {
3273 char *string = "__si_type_info";
3274 char *q = (char *) p + MAP_LEN - strlen (string) - 2;
3275 char *r = (char *) p + 0xe;
3276
3277 strcpy (q, string);
3278 strcpy (r, string);
3279 strncmp (r, q, 14);
3280 }
3281#endif /* HAVE_MMAP || HAVE_MMAP_ANYWHERE */
3282 exit (0);
3283}
3284
3285EOF
6706f116 3286if { (eval echo configure:3287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
a9266bfa
KG
3287then
3288 ac_cv_func_strncmp_works=yes
3289else
3290 echo "configure: failed program was:" >&5
3291 cat conftest.$ac_ext >&5
3292 rm -fr conftest*
3293 ac_cv_func_strncmp_works=no
3294fi
3295rm -fr conftest*
3296fi
3297
3298rm -f core core.* *.core
3299fi
3300
3301echo "$ac_t""$ac_cv_func_strncmp_works" 1>&6
3302if test $ac_cv_func_strncmp_works = no ; then
3303 LIBOBJS="$LIBOBJS strncmp.o"
3304fi
3305
3306
0bc0cd11
JL
3307# Install a library built with a cross compiler in $(tooldir) rather
3308# than $(libdir).
ca6b370d 3309if test -z "${with_cross_host}"; then
0bc0cd11
JL
3310 INSTALL_DEST=libdir
3311else
3312 INSTALL_DEST=tooldir
3313fi
3314
3315
3316# We need multilib support, but only if configuring for the target.
3317trap '' 1 2 15
3318cat > confcache <<\EOF
3319# This file is a shell script that caches the results of configure
3320# tests run on this system so they can be shared between configure
3321# scripts and configure runs. It is not useful on other systems.
3322# If it contains results you don't want to keep, you may remove or edit it.
3323#
3324# By default, configure uses ./config.cache as the cache file,
3325# creating it if it does not exist already. You can give configure
3326# the --cache-file=FILE option to use a different cache file; that is
3327# what configure does when it calls configure scripts in
3328# subdirectories, so they share the cache.
3329# Giving --cache-file=/dev/null disables caching, for debugging configure.
3330# config.status only pays attention to the cache file if you give it the
3331# --recheck option to rerun configure.
3332#
3333EOF
3334# The following way of writing the cache mishandles newlines in values,
3335# but we know of no workaround that is simple, portable, and efficient.
3336# So, don't put newlines in cache variables' values.
3337# Ultrix sh set writes to stderr and can't be redirected directly,
3338# and sets the high bit in the cache file unless we assign to the vars.
3339(set) 2>&1 |
687361c8 3340 case `(ac_space=' '; set | grep ac_space) 2>&1` in
0bc0cd11
JL
3341 *ac_space=\ *)
3342 # `set' does not quote correctly, so add quotes (double-quote substitution
3343 # turns \\\\ into \\, and sed turns \\ into \).
3344 sed -n \
3345 -e "s/'/'\\\\''/g" \
3346 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
3347 ;;
3348 *)
3349 # `set' quotes correctly as required by POSIX, so do not add quotes.
3350 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
3351 ;;
3352 esac >> confcache
3353if cmp -s $cache_file confcache; then
3354 :
3355else
3356 if test -w $cache_file; then
3357 echo "updating cache $cache_file"
3358 cat confcache > $cache_file
3359 else
3360 echo "not updating unwritable cache $cache_file"
3361 fi
3362fi
3363rm -f confcache
3364
3365trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
3366
3367test "x$prefix" = xNONE && prefix=$ac_default_prefix
3368# Let make expand exec_prefix.
3369test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
3370
3371# Any assignment to VPATH causes Sun make to only execute
3372# the first set of double-colon rules, so remove it if not needed.
3373# If there is a colon in the path, we need to keep it.
3374if test "x$srcdir" = x.; then
3375 ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
3376fi
3377
3378trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
3379
3380DEFS=-DHAVE_CONFIG_H
3381
3382# Without the "./", some shells look in PATH for config.status.
3383: ${CONFIG_STATUS=./config.status}
3384
3385echo creating $CONFIG_STATUS
3386rm -f $CONFIG_STATUS
3387cat > $CONFIG_STATUS <<EOF
3388#! /bin/sh
3389# Generated automatically by configure.
3390# Run this file to recreate the current configuration.
3391# This directory was configured as follows,
3392# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
3393#
3394# $0 $ac_configure_args
3395#
3396# Compiler output produced by configure, useful for debugging
3397# configure, is in ./config.log if it exists.
3398
3399ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
3400for ac_option
3401do
3402 case "\$ac_option" in
3403 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
3404 echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
3405 exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
3406 -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
687361c8 3407 echo "$CONFIG_STATUS generated by autoconf version 2.13"
0bc0cd11
JL
3408 exit 0 ;;
3409 -help | --help | --hel | --he | --h)
3410 echo "\$ac_cs_usage"; exit 0 ;;
3411 *) echo "\$ac_cs_usage"; exit 1 ;;
3412 esac
3413done
3414
3415ac_given_srcdir=$srcdir
3416ac_given_INSTALL="$INSTALL"
3417
7c72138a 3418trap 'rm -fr `echo "Makefile testsuite/Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
0bc0cd11
JL
3419EOF
3420cat >> $CONFIG_STATUS <<EOF
3421
3422# Protect against being on the right side of a sed subst in config.status.
3423sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
3424 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
3425$ac_vpsub
3426$extrasub
3427s%@SHELL@%$SHELL%g
3428s%@CFLAGS@%$CFLAGS%g
3429s%@CPPFLAGS@%$CPPFLAGS%g
3430s%@CXXFLAGS@%$CXXFLAGS%g
687361c8 3431s%@FFLAGS@%$FFLAGS%g
0bc0cd11
JL
3432s%@DEFS@%$DEFS%g
3433s%@LDFLAGS@%$LDFLAGS%g
3434s%@LIBS@%$LIBS%g
3435s%@exec_prefix@%$exec_prefix%g
3436s%@prefix@%$prefix%g
3437s%@program_transform_name@%$program_transform_name%g
3438s%@bindir@%$bindir%g
3439s%@sbindir@%$sbindir%g
3440s%@libexecdir@%$libexecdir%g
3441s%@datadir@%$datadir%g
3442s%@sysconfdir@%$sysconfdir%g
3443s%@sharedstatedir@%$sharedstatedir%g
3444s%@localstatedir@%$localstatedir%g
3445s%@libdir@%$libdir%g
3446s%@includedir@%$includedir%g
3447s%@oldincludedir@%$oldincludedir%g
3448s%@infodir@%$infodir%g
3449s%@mandir@%$mandir%g
aaa5f039
DD
3450s%@MAINT@%$MAINT%g
3451s%@NOTMAINT@%$NOTMAINT%g
3452s%@MAKEINFO@%$MAKEINFO%g
3453s%@BUILD_INFO@%$BUILD_INFO%g
3454s%@PERL@%$PERL%g
3455s%@HAVE_PERL@%$HAVE_PERL%g
0bc0cd11
JL
3456s%@host@%$host%g
3457s%@host_alias@%$host_alias%g
3458s%@host_cpu@%$host_cpu%g
3459s%@host_vendor@%$host_vendor%g
3460s%@host_os@%$host_os%g
3461s%@build@%$build%g
3462s%@build_alias@%$build_alias%g
3463s%@build_cpu@%$build_cpu%g
3464s%@build_vendor@%$build_vendor%g
3465s%@build_os@%$build_os%g
3466s%@AR@%$AR%g
3467s%@RANLIB@%$RANLIB%g
3468s%@CC@%$CC%g
d1209685 3469s%@ac_libiberty_warn_cflags@%$ac_libiberty_warn_cflags%g
0bc0cd11 3470s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
687361c8 3471s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
0bc0cd11
JL
3472s%@INSTALL_DATA@%$INSTALL_DATA%g
3473/@host_makefile_frag@/r $host_makefile_frag
3474s%@host_makefile_frag@%%g
3475s%@CPP@%$CPP%g
7c72138a 3476s%@CHECK@%$CHECK%g
48d7db63 3477s%@target_header_dir@%$target_header_dir%g
0bc0cd11 3478s%@LIBOBJS@%$LIBOBJS%g
0bc0cd11
JL
3479s%@INSTALL_DEST@%$INSTALL_DEST%g
3480
3481CEOF
3482EOF
3483
3484cat >> $CONFIG_STATUS <<\EOF
3485
3486# Split the substitutions into bite-sized pieces for seds with
3487# small command number limits, like on Digital OSF/1 and HP-UX.
3488ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
3489ac_file=1 # Number of current file.
3490ac_beg=1 # First line for current file.
3491ac_end=$ac_max_sed_cmds # Line after last line for current file.
3492ac_more_lines=:
3493ac_sed_cmds=""
3494while $ac_more_lines; do
3495 if test $ac_beg -gt 1; then
3496 sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
3497 else
3498 sed "${ac_end}q" conftest.subs > conftest.s$ac_file
3499 fi
3500 if test ! -s conftest.s$ac_file; then
3501 ac_more_lines=false
3502 rm -f conftest.s$ac_file
3503 else
3504 if test -z "$ac_sed_cmds"; then
3505 ac_sed_cmds="sed -f conftest.s$ac_file"
3506 else
3507 ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
3508 fi
3509 ac_file=`expr $ac_file + 1`
3510 ac_beg=$ac_end
3511 ac_end=`expr $ac_end + $ac_max_sed_cmds`
3512 fi
3513done
3514if test -z "$ac_sed_cmds"; then
3515 ac_sed_cmds=cat
3516fi
3517EOF
3518
3519cat >> $CONFIG_STATUS <<EOF
3520
7c72138a 3521CONFIG_FILES=\${CONFIG_FILES-"Makefile testsuite/Makefile"}
0bc0cd11
JL
3522EOF
3523cat >> $CONFIG_STATUS <<\EOF
3524for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
3525 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3526 case "$ac_file" in
3527 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3528 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3529 *) ac_file_in="${ac_file}.in" ;;
3530 esac
3531
3532 # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
3533
3534 # Remove last slash and all that follows it. Not all systems have dirname.
3535 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3536 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3537 # The file is in a subdirectory.
3538 test ! -d "$ac_dir" && mkdir "$ac_dir"
3539 ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
3540 # A "../" for each directory in $ac_dir_suffix.
3541 ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
3542 else
3543 ac_dir_suffix= ac_dots=
3544 fi
3545
3546 case "$ac_given_srcdir" in
3547 .) srcdir=.
3548 if test -z "$ac_dots"; then top_srcdir=.
3549 else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
3550 /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
3551 *) # Relative path.
3552 srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
3553 top_srcdir="$ac_dots$ac_given_srcdir" ;;
3554 esac
3555
3556 case "$ac_given_INSTALL" in
3557 [/$]*) INSTALL="$ac_given_INSTALL" ;;
3558 *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
3559 esac
3560
3561 echo creating "$ac_file"
3562 rm -f "$ac_file"
3563 configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
3564 case "$ac_file" in
3565 *Makefile*) ac_comsub="1i\\
3566# $configure_input" ;;
3567 *) ac_comsub= ;;
3568 esac
3569
3570 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3571 sed -e "$ac_comsub
3572s%@configure_input@%$configure_input%g
3573s%@srcdir@%$srcdir%g
3574s%@top_srcdir@%$top_srcdir%g
3575s%@INSTALL@%$INSTALL%g
3576" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
3577fi; done
3578rm -f conftest.s*
3579
3580# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
3581# NAME is the cpp macro being defined and VALUE is the value it is being given.
3582#
3583# ac_d sets the value in "#define NAME VALUE" lines.
3584ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
3585ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
3586ac_dC='\3'
3587ac_dD='%g'
3588# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
3589ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
3590ac_uB='\([ ]\)%\1#\2define\3'
3591ac_uC=' '
3592ac_uD='\4%g'
3593# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
3594ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
3595ac_eB='$%\1#\2define\3'
3596ac_eC=' '
3597ac_eD='%g'
3598
3599if test "${CONFIG_HEADERS+set}" != set; then
3600EOF
3601cat >> $CONFIG_STATUS <<EOF
3602 CONFIG_HEADERS="config.h:config.in"
3603EOF
3604cat >> $CONFIG_STATUS <<\EOF
3605fi
3606for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
3607 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
3608 case "$ac_file" in
3609 *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
3610 ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3611 *) ac_file_in="${ac_file}.in" ;;
3612 esac
3613
3614 echo creating $ac_file
3615
3616 rm -f conftest.frag conftest.in conftest.out
3617 ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
3618 cat $ac_file_inputs > conftest.in
3619
3620EOF
3621
3622# Transform confdefs.h into a sed script conftest.vals that substitutes
3623# the proper values into config.h.in to produce config.h. And first:
3624# Protect against being on the right side of a sed subst in config.status.
3625# Protect against being in an unquoted here document in config.status.
3626rm -f conftest.vals
3627cat > conftest.hdr <<\EOF
3628s/[\\&%]/\\&/g
3629s%[\\$`]%\\&%g
3630s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
3631s%ac_d%ac_u%gp
3632s%ac_u%ac_e%gp
3633EOF
3634sed -n -f conftest.hdr confdefs.h > conftest.vals
3635rm -f conftest.hdr
3636
3637# This sed command replaces #undef with comments. This is necessary, for
3638# example, in the case of _POSIX_SOURCE, which is predefined and required
3639# on some systems where configure will not decide to define it.
3640cat >> conftest.vals <<\EOF
3641s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
3642EOF
3643
3644# Break up conftest.vals because some shells have a limit on
3645# the size of here documents, and old seds have small limits too.
3646
3647rm -f conftest.tail
3648while :
3649do
3650 ac_lines=`grep -c . conftest.vals`
3651 # grep -c gives empty output for an empty file on some AIX systems.
3652 if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
3653 # Write a limited-size here document to conftest.frag.
3654 echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
3655 sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
3656 echo 'CEOF
3657 sed -f conftest.frag conftest.in > conftest.out
3658 rm -f conftest.in
3659 mv conftest.out conftest.in
3660' >> $CONFIG_STATUS
3661 sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
3662 rm -f conftest.vals
3663 mv conftest.tail conftest.vals
3664done
3665rm -f conftest.vals
3666
3667cat >> $CONFIG_STATUS <<\EOF
3668 rm -f conftest.frag conftest.h
3669 echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
3670 cat conftest.in >> conftest.h
3671 rm -f conftest.in
3672 if cmp -s $ac_file conftest.h 2>/dev/null; then
3673 echo "$ac_file is unchanged"
3674 rm -f conftest.h
3675 else
3676 # Remove last slash and all that follows it. Not all systems have dirname.
3677 ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
3678 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
3679 # The file is in a subdirectory.
3680 test ! -d "$ac_dir" && mkdir "$ac_dir"
3681 fi
3682 rm -f $ac_file
3683 mv conftest.h $ac_file
3684 fi
3685fi; done
3686
3687EOF
3688cat >> $CONFIG_STATUS <<EOF
3689srcdir=${srcdir}
3690host=${host}
3691target=${target}
3692with_target_subdir=${with_target_subdir}
cd862df8 3693with_build_subdir=${with_build_subdir}
0bc0cd11
JL
3694with_multisubdir=${with_multisubdir}
3695ac_configure_args="--enable-multilib ${ac_configure_args}"
3696CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
3697libiberty_topdir=${libiberty_topdir}
3698
3699EOF
3700cat >> $CONFIG_STATUS <<\EOF
3701test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
3702if test -n "$CONFIG_FILES"; then
cd862df8 3703 if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
0bc0cd11
JL
3704 # FIXME: We shouldn't need to set ac_file
3705 ac_file=Makefile
6706f116 3706 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
0bc0cd11
JL
3707 . ${libiberty_topdir}/config-ml.in
3708 fi
3709fi
3710exit 0
3711EOF
3712chmod +x $CONFIG_STATUS
3713rm -fr confdefs* $ac_clean_files
3714test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
3715