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