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