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