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