source: branches/libc-0.6/src/gcc/libiberty/configure

Last change on this file was 1394, checked in by bird, 21 years ago

#1040: Joined the GCC 3.3.3 with the trunk.

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