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