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