OSDN Git Service

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