configure revision 104834
160484Sobrien#! /bin/sh
260484Sobrien
360484Sobrien# Guess values for system-dependent variables and create Makefiles.
460484Sobrien# Generated automatically using autoconf version 2.13 
560484Sobrien# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
660484Sobrien#
760484Sobrien# This configure script is free software; the Free Software Foundation
860484Sobrien# gives unlimited permission to copy, distribute and modify it.
960484Sobrien
1060484Sobrien# Defaults:
1160484Sobrienac_help=
1260484Sobrienac_default_prefix=/usr/local
1360484Sobrien# Any additions from configure.in:
1460484Sobrienac_help="$ac_help
15104834Sobrien  --with-target-subdir=SUBDIR      Configuring in a subdirectory for target"
1660484Sobrienac_help="$ac_help
17104834Sobrien  --with-build-subdir=SUBDIR       Configuring in a subdirectory for build"
18104834Sobrienac_help="$ac_help
1960484Sobrien  --with-cross-host=HOST           Configuring with a cross compiler"
2060484Sobrienac_help="$ac_help
2160484Sobrien  --with-newlib                    Configuring with newlib"
2289857Sobrienac_help="$ac_help
2389857Sobrien  --enable-maintainer-mode
2489857Sobrien                          enable make rules and dependencies not useful
2589857Sobrien                          (and sometimes confusing) to the casual installer"
26104834Sobrienac_help="$ac_help
27104834Sobrien  --enable-install-libiberty       Install headers for end users"
2860484Sobrien
2960484Sobrien# Initialize some variables set by options.
3060484Sobrien# The variables have the same names as the options, with
3160484Sobrien# dashes changed to underlines.
3260484Sobrienbuild=NONE
3360484Sobriencache_file=./config.cache
3460484Sobrienexec_prefix=NONE
3560484Sobrienhost=NONE
3660484Sobrienno_create=
3760484Sobriennonopt=NONE
3860484Sobrienno_recursion=
3960484Sobrienprefix=NONE
4060484Sobrienprogram_prefix=NONE
4160484Sobrienprogram_suffix=NONE
4260484Sobrienprogram_transform_name=s,x,x,
4360484Sobriensilent=
4460484Sobriensite=
4560484Sobriensrcdir=
4660484Sobrientarget=NONE
4760484Sobrienverbose=
4860484Sobrienx_includes=NONE
4960484Sobrienx_libraries=NONE
5060484Sobrienbindir='${exec_prefix}/bin'
5160484Sobriensbindir='${exec_prefix}/sbin'
5260484Sobrienlibexecdir='${exec_prefix}/libexec'
5360484Sobriendatadir='${prefix}/share'
5460484Sobriensysconfdir='${prefix}/etc'
5560484Sobriensharedstatedir='${prefix}/com'
5660484Sobrienlocalstatedir='${prefix}/var'
5760484Sobrienlibdir='${exec_prefix}/lib'
5860484Sobrienincludedir='${prefix}/include'
5960484Sobrienoldincludedir='/usr/include'
6060484Sobrieninfodir='${prefix}/info'
6160484Sobrienmandir='${prefix}/man'
6260484Sobrien
6360484Sobrien# Initialize some other variables.
6460484Sobriensubdirs=
6560484SobrienMFLAGS= MAKEFLAGS=
6660484SobrienSHELL=${CONFIG_SHELL-/bin/sh}
6760484Sobrien# Maximum number of lines to put in a shell here document.
6860484Sobrienac_max_here_lines=12
6960484Sobrien
7060484Sobrienac_prev=
7160484Sobrienfor ac_option
7260484Sobriendo
7360484Sobrien
7460484Sobrien  # If the previous option needs an argument, assign it.
7560484Sobrien  if test -n "$ac_prev"; then
7660484Sobrien    eval "$ac_prev=\$ac_option"
7760484Sobrien    ac_prev=
7860484Sobrien    continue
7960484Sobrien  fi
8060484Sobrien
8160484Sobrien  case "$ac_option" in
8260484Sobrien  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
8360484Sobrien  *) ac_optarg= ;;
8460484Sobrien  esac
8560484Sobrien
8660484Sobrien  # Accept the important Cygnus configure options, so we can diagnose typos.
8760484Sobrien
8860484Sobrien  case "$ac_option" in
8960484Sobrien
9060484Sobrien  -bindir | --bindir | --bindi | --bind | --bin | --bi)
9160484Sobrien    ac_prev=bindir ;;
9260484Sobrien  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
9360484Sobrien    bindir="$ac_optarg" ;;
9460484Sobrien
9560484Sobrien  -build | --build | --buil | --bui | --bu)
9660484Sobrien    ac_prev=build ;;
9760484Sobrien  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
9860484Sobrien    build="$ac_optarg" ;;
9960484Sobrien
10060484Sobrien  -cache-file | --cache-file | --cache-fil | --cache-fi \
10160484Sobrien  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
10260484Sobrien    ac_prev=cache_file ;;
10360484Sobrien  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
10460484Sobrien  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
10560484Sobrien    cache_file="$ac_optarg" ;;
10660484Sobrien
10760484Sobrien  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
10860484Sobrien    ac_prev=datadir ;;
10960484Sobrien  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
11060484Sobrien  | --da=*)
11160484Sobrien    datadir="$ac_optarg" ;;
11260484Sobrien
11360484Sobrien  -disable-* | --disable-*)
11460484Sobrien    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
11560484Sobrien    # Reject names that are not valid shell variable names.
11660484Sobrien    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
11760484Sobrien      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
11860484Sobrien    fi
11960484Sobrien    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
12060484Sobrien    eval "enable_${ac_feature}=no" ;;
12160484Sobrien
12260484Sobrien  -enable-* | --enable-*)
12360484Sobrien    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
12460484Sobrien    # Reject names that are not valid shell variable names.
12560484Sobrien    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
12660484Sobrien      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
12760484Sobrien    fi
12860484Sobrien    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
12960484Sobrien    case "$ac_option" in
13060484Sobrien      *=*) ;;
13160484Sobrien      *) ac_optarg=yes ;;
13260484Sobrien    esac
13360484Sobrien    eval "enable_${ac_feature}='$ac_optarg'" ;;
13460484Sobrien
13560484Sobrien  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
13660484Sobrien  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
13760484Sobrien  | --exec | --exe | --ex)
13860484Sobrien    ac_prev=exec_prefix ;;
13960484Sobrien  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
14060484Sobrien  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
14160484Sobrien  | --exec=* | --exe=* | --ex=*)
14260484Sobrien    exec_prefix="$ac_optarg" ;;
14360484Sobrien
14460484Sobrien  -gas | --gas | --ga | --g)
14560484Sobrien    # Obsolete; use --with-gas.
14660484Sobrien    with_gas=yes ;;
14760484Sobrien
14860484Sobrien  -help | --help | --hel | --he)
14960484Sobrien    # Omit some internal or obsolete options to make the list less imposing.
15060484Sobrien    # This message is too long to be a string in the A/UX 3.1 sh.
15160484Sobrien    cat << EOF
15260484SobrienUsage: configure [options] [host]
15360484SobrienOptions: [defaults in brackets after descriptions]
15460484SobrienConfiguration:
15560484Sobrien  --cache-file=FILE       cache test results in FILE
15660484Sobrien  --help                  print this message
15760484Sobrien  --no-create             do not create output files
15860484Sobrien  --quiet, --silent       do not print \`checking...' messages
15960484Sobrien  --version               print the version of autoconf that created configure
16060484SobrienDirectory and file names:
16160484Sobrien  --prefix=PREFIX         install architecture-independent files in PREFIX
16260484Sobrien                          [$ac_default_prefix]
16360484Sobrien  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
16460484Sobrien                          [same as prefix]
16560484Sobrien  --bindir=DIR            user executables in DIR [EPREFIX/bin]
16660484Sobrien  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
16760484Sobrien  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
16860484Sobrien  --datadir=DIR           read-only architecture-independent data in DIR
16960484Sobrien                          [PREFIX/share]
17060484Sobrien  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
17160484Sobrien  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
17260484Sobrien                          [PREFIX/com]
17360484Sobrien  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
17460484Sobrien  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
17560484Sobrien  --includedir=DIR        C header files in DIR [PREFIX/include]
17660484Sobrien  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
17760484Sobrien  --infodir=DIR           info documentation in DIR [PREFIX/info]
17860484Sobrien  --mandir=DIR            man documentation in DIR [PREFIX/man]
17960484Sobrien  --srcdir=DIR            find the sources in DIR [configure dir or ..]
18060484Sobrien  --program-prefix=PREFIX prepend PREFIX to installed program names
18160484Sobrien  --program-suffix=SUFFIX append SUFFIX to installed program names
18260484Sobrien  --program-transform-name=PROGRAM
18360484Sobrien                          run sed PROGRAM on installed program names
18460484SobrienEOF
18560484Sobrien    cat << EOF
18660484SobrienHost type:
18760484Sobrien  --build=BUILD           configure for building on BUILD [BUILD=HOST]
18860484Sobrien  --host=HOST             configure for HOST [guessed]
18960484Sobrien  --target=TARGET         configure for TARGET [TARGET=HOST]
19060484SobrienFeatures and packages:
19160484Sobrien  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
19260484Sobrien  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
19360484Sobrien  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
19460484Sobrien  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
19560484Sobrien  --x-includes=DIR        X include files are in DIR
19660484Sobrien  --x-libraries=DIR       X library files are in DIR
19760484SobrienEOF
19860484Sobrien    if test -n "$ac_help"; then
19960484Sobrien      echo "--enable and --with options recognized:$ac_help"
20060484Sobrien    fi
20160484Sobrien    exit 0 ;;
20260484Sobrien
20360484Sobrien  -host | --host | --hos | --ho)
20460484Sobrien    ac_prev=host ;;
20560484Sobrien  -host=* | --host=* | --hos=* | --ho=*)
20660484Sobrien    host="$ac_optarg" ;;
20760484Sobrien
20860484Sobrien  -includedir | --includedir | --includedi | --included | --include \
20960484Sobrien  | --includ | --inclu | --incl | --inc)
21060484Sobrien    ac_prev=includedir ;;
21160484Sobrien  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
21260484Sobrien  | --includ=* | --inclu=* | --incl=* | --inc=*)
21360484Sobrien    includedir="$ac_optarg" ;;
21460484Sobrien
21560484Sobrien  -infodir | --infodir | --infodi | --infod | --info | --inf)
21660484Sobrien    ac_prev=infodir ;;
21760484Sobrien  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
21860484Sobrien    infodir="$ac_optarg" ;;
21960484Sobrien
22060484Sobrien  -libdir | --libdir | --libdi | --libd)
22160484Sobrien    ac_prev=libdir ;;
22260484Sobrien  -libdir=* | --libdir=* | --libdi=* | --libd=*)
22360484Sobrien    libdir="$ac_optarg" ;;
22460484Sobrien
22560484Sobrien  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
22660484Sobrien  | --libexe | --libex | --libe)
22760484Sobrien    ac_prev=libexecdir ;;
22860484Sobrien  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
22960484Sobrien  | --libexe=* | --libex=* | --libe=*)
23060484Sobrien    libexecdir="$ac_optarg" ;;
23160484Sobrien
23260484Sobrien  -localstatedir | --localstatedir | --localstatedi | --localstated \
23360484Sobrien  | --localstate | --localstat | --localsta | --localst \
23460484Sobrien  | --locals | --local | --loca | --loc | --lo)
23560484Sobrien    ac_prev=localstatedir ;;
23660484Sobrien  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
23760484Sobrien  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
23860484Sobrien  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
23960484Sobrien    localstatedir="$ac_optarg" ;;
24060484Sobrien
24160484Sobrien  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
24260484Sobrien    ac_prev=mandir ;;
24360484Sobrien  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
24460484Sobrien    mandir="$ac_optarg" ;;
24560484Sobrien
24660484Sobrien  -nfp | --nfp | --nf)
24760484Sobrien    # Obsolete; use --without-fp.
24860484Sobrien    with_fp=no ;;
24960484Sobrien
25060484Sobrien  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
25160484Sobrien  | --no-cr | --no-c)
25260484Sobrien    no_create=yes ;;
25360484Sobrien
25460484Sobrien  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
25560484Sobrien  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
25660484Sobrien    no_recursion=yes ;;
25760484Sobrien
25860484Sobrien  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
25960484Sobrien  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
26060484Sobrien  | --oldin | --oldi | --old | --ol | --o)
26160484Sobrien    ac_prev=oldincludedir ;;
26260484Sobrien  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
26360484Sobrien  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
26460484Sobrien  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
26560484Sobrien    oldincludedir="$ac_optarg" ;;
26660484Sobrien
26760484Sobrien  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
26860484Sobrien    ac_prev=prefix ;;
26960484Sobrien  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
27060484Sobrien    prefix="$ac_optarg" ;;
27160484Sobrien
27260484Sobrien  -program-prefix | --program-prefix | --program-prefi | --program-pref \
27360484Sobrien  | --program-pre | --program-pr | --program-p)
27460484Sobrien    ac_prev=program_prefix ;;
27560484Sobrien  -program-prefix=* | --program-prefix=* | --program-prefi=* \
27660484Sobrien  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
27760484Sobrien    program_prefix="$ac_optarg" ;;
27860484Sobrien
27960484Sobrien  -program-suffix | --program-suffix | --program-suffi | --program-suff \
28060484Sobrien  | --program-suf | --program-su | --program-s)
28160484Sobrien    ac_prev=program_suffix ;;
28260484Sobrien  -program-suffix=* | --program-suffix=* | --program-suffi=* \
28360484Sobrien  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
28460484Sobrien    program_suffix="$ac_optarg" ;;
28560484Sobrien
28660484Sobrien  -program-transform-name | --program-transform-name \
28760484Sobrien  | --program-transform-nam | --program-transform-na \
28860484Sobrien  | --program-transform-n | --program-transform- \
28960484Sobrien  | --program-transform | --program-transfor \
29060484Sobrien  | --program-transfo | --program-transf \
29160484Sobrien  | --program-trans | --program-tran \
29260484Sobrien  | --progr-tra | --program-tr | --program-t)
29360484Sobrien    ac_prev=program_transform_name ;;
29460484Sobrien  -program-transform-name=* | --program-transform-name=* \
29560484Sobrien  | --program-transform-nam=* | --program-transform-na=* \
29660484Sobrien  | --program-transform-n=* | --program-transform-=* \
29760484Sobrien  | --program-transform=* | --program-transfor=* \
29860484Sobrien  | --program-transfo=* | --program-transf=* \
29960484Sobrien  | --program-trans=* | --program-tran=* \
30060484Sobrien  | --progr-tra=* | --program-tr=* | --program-t=*)
30160484Sobrien    program_transform_name="$ac_optarg" ;;
30260484Sobrien
30360484Sobrien  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
30460484Sobrien  | -silent | --silent | --silen | --sile | --sil)
30560484Sobrien    silent=yes ;;
30660484Sobrien
30760484Sobrien  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
30860484Sobrien    ac_prev=sbindir ;;
30960484Sobrien  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
31060484Sobrien  | --sbi=* | --sb=*)
31160484Sobrien    sbindir="$ac_optarg" ;;
31260484Sobrien
31360484Sobrien  -sharedstatedir | --sharedstatedir | --sharedstatedi \
31460484Sobrien  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
31560484Sobrien  | --sharedst | --shareds | --shared | --share | --shar \
31660484Sobrien  | --sha | --sh)
31760484Sobrien    ac_prev=sharedstatedir ;;
31860484Sobrien  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
31960484Sobrien  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
32060484Sobrien  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
32160484Sobrien  | --sha=* | --sh=*)
32260484Sobrien    sharedstatedir="$ac_optarg" ;;
32360484Sobrien
32460484Sobrien  -site | --site | --sit)
32560484Sobrien    ac_prev=site ;;
32660484Sobrien  -site=* | --site=* | --sit=*)
32760484Sobrien    site="$ac_optarg" ;;
32860484Sobrien
32960484Sobrien  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
33060484Sobrien    ac_prev=srcdir ;;
33160484Sobrien  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
33260484Sobrien    srcdir="$ac_optarg" ;;
33360484Sobrien
33460484Sobrien  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
33560484Sobrien  | --syscon | --sysco | --sysc | --sys | --sy)
33660484Sobrien    ac_prev=sysconfdir ;;
33760484Sobrien  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
33860484Sobrien  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
33960484Sobrien    sysconfdir="$ac_optarg" ;;
34060484Sobrien
34160484Sobrien  -target | --target | --targe | --targ | --tar | --ta | --t)
34260484Sobrien    ac_prev=target ;;
34360484Sobrien  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
34460484Sobrien    target="$ac_optarg" ;;
34560484Sobrien
34660484Sobrien  -v | -verbose | --verbose | --verbos | --verbo | --verb)
34760484Sobrien    verbose=yes ;;
34860484Sobrien
34960484Sobrien  -version | --version | --versio | --versi | --vers)
35060484Sobrien    echo "configure generated by autoconf version 2.13"
35160484Sobrien    exit 0 ;;
35260484Sobrien
35360484Sobrien  -with-* | --with-*)
35460484Sobrien    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
35560484Sobrien    # Reject names that are not valid shell variable names.
35660484Sobrien    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
35760484Sobrien      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
35860484Sobrien    fi
35960484Sobrien    ac_package=`echo $ac_package| sed 's/-/_/g'`
36060484Sobrien    case "$ac_option" in
36160484Sobrien      *=*) ;;
36260484Sobrien      *) ac_optarg=yes ;;
36360484Sobrien    esac
36460484Sobrien    eval "with_${ac_package}='$ac_optarg'" ;;
36560484Sobrien
36660484Sobrien  -without-* | --without-*)
36760484Sobrien    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
36860484Sobrien    # Reject names that are not valid shell variable names.
36960484Sobrien    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
37060484Sobrien      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
37160484Sobrien    fi
37260484Sobrien    ac_package=`echo $ac_package| sed 's/-/_/g'`
37360484Sobrien    eval "with_${ac_package}=no" ;;
37460484Sobrien
37560484Sobrien  --x)
37660484Sobrien    # Obsolete; use --with-x.
37760484Sobrien    with_x=yes ;;
37860484Sobrien
37960484Sobrien  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
38060484Sobrien  | --x-incl | --x-inc | --x-in | --x-i)
38160484Sobrien    ac_prev=x_includes ;;
38260484Sobrien  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
38360484Sobrien  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
38460484Sobrien    x_includes="$ac_optarg" ;;
38560484Sobrien
38660484Sobrien  -x-libraries | --x-libraries | --x-librarie | --x-librari \
38760484Sobrien  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
38860484Sobrien    ac_prev=x_libraries ;;
38960484Sobrien  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
39060484Sobrien  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
39160484Sobrien    x_libraries="$ac_optarg" ;;
39260484Sobrien
39360484Sobrien  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
39460484Sobrien    ;;
39560484Sobrien
39660484Sobrien  *)
39760484Sobrien    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
39860484Sobrien      echo "configure: warning: $ac_option: invalid host type" 1>&2
39960484Sobrien    fi
40060484Sobrien    if test "x$nonopt" != xNONE; then
40160484Sobrien      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
40260484Sobrien    fi
40360484Sobrien    nonopt="$ac_option"
40460484Sobrien    ;;
40560484Sobrien
40660484Sobrien  esac
40760484Sobriendone
40860484Sobrien
40960484Sobrienif test -n "$ac_prev"; then
41060484Sobrien  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
41160484Sobrienfi
41260484Sobrien
41360484Sobrientrap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
41460484Sobrien
41560484Sobrien# File descriptor usage:
41660484Sobrien# 0 standard input
41760484Sobrien# 1 file creation
41860484Sobrien# 2 errors and warnings
41960484Sobrien# 3 some systems may open it to /dev/tty
42060484Sobrien# 4 used on the Kubota Titan
42160484Sobrien# 6 checking for... messages and results
42260484Sobrien# 5 compiler messages saved in config.log
42360484Sobrienif test "$silent" = yes; then
42460484Sobrien  exec 6>/dev/null
42560484Sobrienelse
42660484Sobrien  exec 6>&1
42760484Sobrienfi
42860484Sobrienexec 5>./config.log
42960484Sobrien
43060484Sobrienecho "\
43160484SobrienThis file contains any messages produced by compilers while
43260484Sobrienrunning configure, to aid debugging if configure makes a mistake.
43360484Sobrien" 1>&5
43460484Sobrien
43560484Sobrien# Strip out --no-create and --no-recursion so they do not pile up.
43660484Sobrien# Also quote any args containing shell metacharacters.
43760484Sobrienac_configure_args=
43860484Sobrienfor ac_arg
43960484Sobriendo
44060484Sobrien  case "$ac_arg" in
44160484Sobrien  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
44260484Sobrien  | --no-cr | --no-c) ;;
44360484Sobrien  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
44460484Sobrien  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
44560484Sobrien  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
44660484Sobrien  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
44760484Sobrien  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
44860484Sobrien  esac
44960484Sobriendone
45060484Sobrien
45160484Sobrien# NLS nuisances.
45260484Sobrien# Only set these to C if already set.  These must not be set unconditionally
45360484Sobrien# because not all systems understand e.g. LANG=C (notably SCO).
45460484Sobrien# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
45560484Sobrien# Non-C LC_CTYPE values break the ctype check.
45660484Sobrienif test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
45760484Sobrienif test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
45860484Sobrienif test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
45960484Sobrienif test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
46060484Sobrien
46160484Sobrien# confdefs.h avoids OS command line length limits that DEFS can exceed.
46260484Sobrienrm -rf conftest* confdefs.h
46360484Sobrien# AIX cpp loses on an empty file, so make sure it contains at least a newline.
46460484Sobrienecho > confdefs.h
46560484Sobrien
46660484Sobrien# A filename unique to this package, relative to the directory that
46760484Sobrien# configure is in, which we can look for to find out if srcdir is correct.
46860484Sobrienac_unique_file=pexecute.c
46960484Sobrien
47060484Sobrien# Find the source files, if location was not specified.
47160484Sobrienif test -z "$srcdir"; then
47260484Sobrien  ac_srcdir_defaulted=yes
47360484Sobrien  # Try the directory containing this script, then its parent.
47460484Sobrien  ac_prog=$0
47560484Sobrien  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
47660484Sobrien  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
47760484Sobrien  srcdir=$ac_confdir
47860484Sobrien  if test ! -r $srcdir/$ac_unique_file; then
47960484Sobrien    srcdir=..
48060484Sobrien  fi
48160484Sobrienelse
48260484Sobrien  ac_srcdir_defaulted=no
48360484Sobrienfi
48460484Sobrienif test ! -r $srcdir/$ac_unique_file; then
48560484Sobrien  if test "$ac_srcdir_defaulted" = yes; then
48660484Sobrien    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
48760484Sobrien  else
48860484Sobrien    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
48960484Sobrien  fi
49060484Sobrienfi
49160484Sobriensrcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
49260484Sobrien
49360484Sobrien# Prefer explicitly selected file to automatically selected ones.
49460484Sobrienif test -z "$CONFIG_SITE"; then
49560484Sobrien  if test "x$prefix" != xNONE; then
49660484Sobrien    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
49760484Sobrien  else
49860484Sobrien    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
49960484Sobrien  fi
50060484Sobrienfi
50160484Sobrienfor ac_site_file in $CONFIG_SITE; do
50260484Sobrien  if test -r "$ac_site_file"; then
50360484Sobrien    echo "loading site script $ac_site_file"
50460484Sobrien    . "$ac_site_file"
50560484Sobrien  fi
50660484Sobriendone
50760484Sobrien
50860484Sobrienif test -r "$cache_file"; then
50960484Sobrien  echo "loading cache $cache_file"
51060484Sobrien  . $cache_file
51160484Sobrienelse
51260484Sobrien  echo "creating cache $cache_file"
51360484Sobrien  > $cache_file
51460484Sobrienfi
51560484Sobrien
51660484Sobrienac_ext=c
51760484Sobrien# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
51860484Sobrienac_cpp='$CPP $CPPFLAGS'
51960484Sobrienac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
52060484Sobrienac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
52160484Sobriencross_compiling=$ac_cv_prog_cc_cross
52260484Sobrien
52360484Sobrienac_exeext=
52460484Sobrienac_objext=o
52560484Sobrienif (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
52660484Sobrien  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
52760484Sobrien  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
52860484Sobrien    ac_n= ac_c='
52960484Sobrien' ac_t='	'
53060484Sobrien  else
53160484Sobrien    ac_n=-n ac_c= ac_t=
53260484Sobrien  fi
53360484Sobrienelse
53460484Sobrien  ac_n= ac_c='\c' ac_t=
53560484Sobrienfi
53660484Sobrien
53760484Sobrien
53860484Sobrien
539104834Sobrien# This works around the fact that libtool configuration may change LD
540104834Sobrien# for this particular configuration, but some shells, instead of
541104834Sobrien# keeping the changes in LD private, export them just because LD is
542104834Sobrien# exported.  We don't use libtool yet, but some day we might, so...
543104834SobrienORIGINAL_LD_FOR_MULTILIBS=$LD
544104834Sobrien
54560484Sobrien# Check whether --with-target-subdir or --without-target-subdir was given.
54660484Sobrienif test "${with_target_subdir+set}" = set; then
54760484Sobrien  withval="$with_target_subdir"
54860484Sobrien  :
54960484Sobrienfi
55060484Sobrien
551104834Sobrien# Check whether --with-build-subdir or --without-build-subdir was given.
552104834Sobrienif test "${with_build_subdir+set}" = set; then
553104834Sobrien  withval="$with_build_subdir"
554104834Sobrien  :
555104834Sobrienfi
556104834Sobrien
55760484Sobrien# Check whether --with-cross-host or --without-cross-host was given.
55860484Sobrienif test "${with_cross_host+set}" = set; then
55960484Sobrien  withval="$with_cross_host"
56060484Sobrien  :
56160484Sobrienfi
56260484Sobrien
56360484Sobrien# Check whether --with-newlib or --without-newlib was given.
56460484Sobrienif test "${with_newlib+set}" = set; then
56560484Sobrien  withval="$with_newlib"
56660484Sobrien  :
56760484Sobrienfi
56860484Sobrien
56960484Sobrien
57060484Sobrienif test "${srcdir}" = "."; then
571104834Sobrien  if test -n "${with_build_subdir}"; then
572104834Sobrien    libiberty_topdir="${srcdir}/../.."
573104834Sobrien    with_target_subdir=
574104834Sobrien  elif test -z "${with_target_subdir}"; then
57560484Sobrien    libiberty_topdir="${srcdir}/.."
57660484Sobrien  else
57760484Sobrien    if test "${with_target_subdir}" != "."; then
57860484Sobrien      libiberty_topdir="${srcdir}/${with_multisrctop}../.."
57960484Sobrien    else
58060484Sobrien      libiberty_topdir="${srcdir}/${with_multisrctop}.."
58160484Sobrien    fi
58260484Sobrien  fi
58360484Sobrienelse
58460484Sobrien  libiberty_topdir="${srcdir}/.."
58560484Sobrienfi
58660484Sobrienac_aux_dir=
58760484Sobrienfor ac_dir in $libiberty_topdir $srcdir/$libiberty_topdir; do
58860484Sobrien  if test -f $ac_dir/install-sh; then
58960484Sobrien    ac_aux_dir=$ac_dir
59060484Sobrien    ac_install_sh="$ac_aux_dir/install-sh -c"
59160484Sobrien    break
59260484Sobrien  elif test -f $ac_dir/install.sh; then
59360484Sobrien    ac_aux_dir=$ac_dir
59460484Sobrien    ac_install_sh="$ac_aux_dir/install.sh -c"
59560484Sobrien    break
59660484Sobrien  fi
59760484Sobriendone
59860484Sobrienif test -z "$ac_aux_dir"; then
59960484Sobrien  { echo "configure: error: can not find install-sh or install.sh in $libiberty_topdir $srcdir/$libiberty_topdir" 1>&2; exit 1; }
60060484Sobrienfi
60160484Sobrienac_config_guess=$ac_aux_dir/config.guess
60260484Sobrienac_config_sub=$ac_aux_dir/config.sub
60360484Sobrienac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
60460484Sobrien
60560484Sobrien
60660484Sobrien
60789857Sobrienecho $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
608104834Sobrienecho "configure:609: checking whether to enable maintainer-specific portions of Makefiles" >&5
60989857Sobrien    # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
61089857Sobrienif test "${enable_maintainer_mode+set}" = set; then
61189857Sobrien  enableval="$enable_maintainer_mode"
61289857Sobrien  maintainer_mode=$enableval
61389857Sobrienelse
61489857Sobrien  maintainer_mode=no
61589857Sobrienfi
61689857Sobrien
61789857Sobrien
61889857Sobrienecho "$ac_t""$maintainer_mode" 1>&6
61989857Sobrien
62089857Sobrienif test "$maintainer_mode" = "yes"; then
62189857Sobrien  MAINT=''
62289857Sobrien  NOTMAINT='#'
62389857Sobrienelse
62489857Sobrien  MAINT='#'
62589857Sobrien  NOTMAINT=''
62689857Sobrienfi
62789857Sobrien
62889857Sobrien# Do we have a single-tree copy of texinfo?  Even if we do, we can't
62989857Sobrien# rely on it - libiberty is built before texinfo.
63089857Sobrien# Extract the first word of "makeinfo", so it can be a program name with args.
63189857Sobrienset dummy makeinfo; ac_word=$2
63289857Sobrienecho $ac_n "checking for $ac_word""... $ac_c" 1>&6
633104834Sobrienecho "configure:634: checking for $ac_word" >&5
63489857Sobrienif eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
63589857Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
63689857Sobrienelse
63789857Sobrien  if test -n "$MAKEINFO"; then
63889857Sobrien  ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test.
63989857Sobrienelse
64089857Sobrien  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
64189857Sobrien  ac_dummy="$PATH"
64289857Sobrien  for ac_dir in $ac_dummy; do
64389857Sobrien    test -z "$ac_dir" && ac_dir=.
64489857Sobrien    if test -f $ac_dir/$ac_word; then
64589857Sobrien      ac_cv_prog_MAKEINFO="makeinfo"
64689857Sobrien      break
64789857Sobrien    fi
64889857Sobrien  done
64989857Sobrien  IFS="$ac_save_ifs"
65089857Sobrienfi
65189857Sobrienfi
65289857SobrienMAKEINFO="$ac_cv_prog_MAKEINFO"
65389857Sobrienif test -n "$MAKEINFO"; then
65489857Sobrien  echo "$ac_t""$MAKEINFO" 1>&6
65589857Sobrienelse
65689857Sobrien  echo "$ac_t""no" 1>&6
65789857Sobrienfi
65889857Sobrien
65989857Sobrienif test "x$MAKEINFO" = "x"; then
66089857Sobrien    MAKEINFO="@echo makeinfo missing; true"
66189857Sobrien    BUILD_INFO=
66289857Sobrienelse
66389857Sobrien    BUILD_INFO=info
66489857Sobrien    case x"`$MAKEINFO --version | grep 'GNU texinfo'`" in
66589857Sobrien      x*\ [1-3].* )
66689857Sobrien	MAKEINFO="@echo $MAKEINFO is too old, 4.0 or newer required; true"
66789857Sobrien	BUILD_INFO=
66889857Sobrien	echo "configure: warning: 
66989857Sobrien*** Makeinfo is too old. Info documentation will not be built." 1>&2
67089857Sobrien	;;
67189857Sobrien    esac
67289857Sobrienfi
67389857Sobrien
67489857Sobrien
67589857Sobrien
67689857Sobrien# Extract the first word of "perl", so it can be a program name with args.
67789857Sobrienset dummy perl; ac_word=$2
67889857Sobrienecho $ac_n "checking for $ac_word""... $ac_c" 1>&6
679104834Sobrienecho "configure:680: checking for $ac_word" >&5
68089857Sobrienif eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
68189857Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
68289857Sobrienelse
68389857Sobrien  if test -n "$PERL"; then
68489857Sobrien  ac_cv_prog_PERL="$PERL" # Let the user override the test.
68589857Sobrienelse
68689857Sobrien  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
68789857Sobrien  ac_dummy="$PATH"
68889857Sobrien  for ac_dir in $ac_dummy; do
68989857Sobrien    test -z "$ac_dir" && ac_dir=.
69089857Sobrien    if test -f $ac_dir/$ac_word; then
69189857Sobrien      ac_cv_prog_PERL="perl"
69289857Sobrien      break
69389857Sobrien    fi
69489857Sobrien  done
69589857Sobrien  IFS="$ac_save_ifs"
69689857Sobrienfi
69789857Sobrienfi
69889857SobrienPERL="$ac_cv_prog_PERL"
69989857Sobrienif test -n "$PERL"; then
70089857Sobrien  echo "$ac_t""$PERL" 1>&6
70189857Sobrienelse
70289857Sobrien  echo "$ac_t""no" 1>&6
70389857Sobrienfi
70489857Sobrien
70589857Sobrienif test x"$PERL" = x""; then
70689857Sobrien  HAVE_PERL='#'
70789857Sobrienelse
70889857Sobrien  HAVE_PERL=''
70989857Sobrienfi
71089857Sobrien
71189857Sobrien
71289857Sobrien
71360484Sobrien# Make sure we can run config.sub.
71460484Sobrienif ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
71560484Sobrienelse { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
71660484Sobrienfi
71760484Sobrien
71860484Sobrienecho $ac_n "checking host system type""... $ac_c" 1>&6
719104834Sobrienecho "configure:720: checking host system type" >&5
72060484Sobrien
72160484Sobrienhost_alias=$host
72260484Sobriencase "$host_alias" in
72360484SobrienNONE)
72460484Sobrien  case $nonopt in
72560484Sobrien  NONE)
72660484Sobrien    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
72760484Sobrien    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
72860484Sobrien    fi ;;
72960484Sobrien  *) host_alias=$nonopt ;;
73060484Sobrien  esac ;;
73160484Sobrienesac
73260484Sobrien
73360484Sobrienhost=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
73460484Sobrienhost_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
73560484Sobrienhost_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
73660484Sobrienhost_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
73760484Sobrienecho "$ac_t""$host" 1>&6
73860484Sobrien
73960484Sobrien
74060484Sobrien
74160484Sobrienecho $ac_n "checking build system type""... $ac_c" 1>&6
742104834Sobrienecho "configure:743: checking build system type" >&5
74360484Sobrien
74460484Sobrienbuild_alias=$build
74560484Sobriencase "$build_alias" in
74660484SobrienNONE)
74760484Sobrien  case $nonopt in
74860484Sobrien  NONE) build_alias=$host_alias ;;
74960484Sobrien  *) build_alias=$nonopt ;;
75060484Sobrien  esac ;;
75160484Sobrienesac
75260484Sobrien
75360484Sobrienbuild=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
75460484Sobrienbuild_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
75560484Sobrienbuild_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
75660484Sobrienbuild_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
75760484Sobrienecho "$ac_t""$build" 1>&6
75860484Sobrien
75960484Sobrienif test $host != $build; then
76060484Sobrien  ac_tool_prefix=${host_alias}-
76160484Sobrienelse
76260484Sobrien  ac_tool_prefix=
76360484Sobrienfi
76460484Sobrien
76560484Sobrien# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
76660484Sobrienset dummy ${ac_tool_prefix}ar; ac_word=$2
76760484Sobrienecho $ac_n "checking for $ac_word""... $ac_c" 1>&6
768104834Sobrienecho "configure:769: checking for $ac_word" >&5
76960484Sobrienif eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
77060484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
77160484Sobrienelse
77260484Sobrien  if test -n "$AR"; then
77360484Sobrien  ac_cv_prog_AR="$AR" # Let the user override the test.
77460484Sobrienelse
77560484Sobrien  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
77660484Sobrien  ac_dummy="$PATH"
77760484Sobrien  for ac_dir in $ac_dummy; do
77860484Sobrien    test -z "$ac_dir" && ac_dir=.
77960484Sobrien    if test -f $ac_dir/$ac_word; then
78060484Sobrien      ac_cv_prog_AR="${ac_tool_prefix}ar"
78160484Sobrien      break
78260484Sobrien    fi
78360484Sobrien  done
78460484Sobrien  IFS="$ac_save_ifs"
78560484Sobrien  test -z "$ac_cv_prog_AR" && ac_cv_prog_AR="ar"
78660484Sobrienfi
78760484Sobrienfi
78860484SobrienAR="$ac_cv_prog_AR"
78960484Sobrienif test -n "$AR"; then
79060484Sobrien  echo "$ac_t""$AR" 1>&6
79160484Sobrienelse
79260484Sobrien  echo "$ac_t""no" 1>&6
79360484Sobrienfi
79460484Sobrien
79560484Sobrien
79660484Sobrien
79760484Sobrien# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
79860484Sobrienset dummy ${ac_tool_prefix}ranlib; ac_word=$2
79960484Sobrienecho $ac_n "checking for $ac_word""... $ac_c" 1>&6
800104834Sobrienecho "configure:801: checking for $ac_word" >&5
80160484Sobrienif eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
80260484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
80360484Sobrienelse
80460484Sobrien  if test -n "$RANLIB"; then
80560484Sobrien  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
80660484Sobrienelse
80760484Sobrien  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
80860484Sobrien  ac_dummy="$PATH"
80960484Sobrien  for ac_dir in $ac_dummy; do
81060484Sobrien    test -z "$ac_dir" && ac_dir=.
81160484Sobrien    if test -f $ac_dir/$ac_word; then
81260484Sobrien      ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
81360484Sobrien      break
81460484Sobrien    fi
81560484Sobrien  done
81660484Sobrien  IFS="$ac_save_ifs"
81760484Sobrienfi
81860484Sobrienfi
81960484SobrienRANLIB="$ac_cv_prog_RANLIB"
82060484Sobrienif test -n "$RANLIB"; then
82160484Sobrien  echo "$ac_t""$RANLIB" 1>&6
82260484Sobrienelse
82360484Sobrien  echo "$ac_t""no" 1>&6
82460484Sobrienfi
82560484Sobrien
82660484Sobrien
82760484Sobrienif test -z "$ac_cv_prog_RANLIB"; then
82860484Sobrienif test -n "$ac_tool_prefix"; then
82960484Sobrien  # Extract the first word of "ranlib", so it can be a program name with args.
83060484Sobrienset dummy ranlib; ac_word=$2
83160484Sobrienecho $ac_n "checking for $ac_word""... $ac_c" 1>&6
832104834Sobrienecho "configure:833: checking for $ac_word" >&5
83360484Sobrienif eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
83460484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
83560484Sobrienelse
83660484Sobrien  if test -n "$RANLIB"; then
83760484Sobrien  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
83860484Sobrienelse
83960484Sobrien  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
84060484Sobrien  ac_dummy="$PATH"
84160484Sobrien  for ac_dir in $ac_dummy; do
84260484Sobrien    test -z "$ac_dir" && ac_dir=.
84360484Sobrien    if test -f $ac_dir/$ac_word; then
84460484Sobrien      ac_cv_prog_RANLIB="ranlib"
84560484Sobrien      break
84660484Sobrien    fi
84760484Sobrien  done
84860484Sobrien  IFS="$ac_save_ifs"
84960484Sobrien  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
85060484Sobrienfi
85160484Sobrienfi
85260484SobrienRANLIB="$ac_cv_prog_RANLIB"
85360484Sobrienif test -n "$RANLIB"; then
85460484Sobrien  echo "$ac_t""$RANLIB" 1>&6
85560484Sobrienelse
85660484Sobrien  echo "$ac_t""no" 1>&6
85760484Sobrienfi
85860484Sobrien
85960484Sobrienelse
86060484Sobrien  RANLIB=":"
86160484Sobrienfi
86260484Sobrienfi
86360484Sobrien
86460484Sobrien
86560484Sobrien
86660484Sobrien# Extract the first word of "gcc", so it can be a program name with args.
86760484Sobrienset dummy gcc; ac_word=$2
86860484Sobrienecho $ac_n "checking for $ac_word""... $ac_c" 1>&6
869104834Sobrienecho "configure:870: checking for $ac_word" >&5
87060484Sobrienif eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
87160484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
87260484Sobrienelse
87360484Sobrien  if test -n "$CC"; then
87460484Sobrien  ac_cv_prog_CC="$CC" # Let the user override the test.
87560484Sobrienelse
87660484Sobrien  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
87760484Sobrien  ac_dummy="$PATH"
87860484Sobrien  for ac_dir in $ac_dummy; do
87960484Sobrien    test -z "$ac_dir" && ac_dir=.
88060484Sobrien    if test -f $ac_dir/$ac_word; then
88160484Sobrien      ac_cv_prog_CC="gcc"
88260484Sobrien      break
88360484Sobrien    fi
88460484Sobrien  done
88560484Sobrien  IFS="$ac_save_ifs"
88660484Sobrienfi
88760484Sobrienfi
88860484SobrienCC="$ac_cv_prog_CC"
88960484Sobrienif test -n "$CC"; then
89060484Sobrien  echo "$ac_t""$CC" 1>&6
89160484Sobrienelse
89260484Sobrien  echo "$ac_t""no" 1>&6
89360484Sobrienfi
89460484Sobrien
89560484Sobrienif test -z "$CC"; then
89660484Sobrien  # Extract the first word of "cc", so it can be a program name with args.
89760484Sobrienset dummy cc; ac_word=$2
89860484Sobrienecho $ac_n "checking for $ac_word""... $ac_c" 1>&6
899104834Sobrienecho "configure:900: checking for $ac_word" >&5
90060484Sobrienif eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
90160484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
90260484Sobrienelse
90360484Sobrien  if test -n "$CC"; then
90460484Sobrien  ac_cv_prog_CC="$CC" # Let the user override the test.
90560484Sobrienelse
90660484Sobrien  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
90760484Sobrien  ac_prog_rejected=no
90860484Sobrien  ac_dummy="$PATH"
90960484Sobrien  for ac_dir in $ac_dummy; do
91060484Sobrien    test -z "$ac_dir" && ac_dir=.
91160484Sobrien    if test -f $ac_dir/$ac_word; then
91260484Sobrien      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
91360484Sobrien        ac_prog_rejected=yes
91460484Sobrien	continue
91560484Sobrien      fi
91660484Sobrien      ac_cv_prog_CC="cc"
91760484Sobrien      break
91860484Sobrien    fi
91960484Sobrien  done
92060484Sobrien  IFS="$ac_save_ifs"
92160484Sobrienif test $ac_prog_rejected = yes; then
92260484Sobrien  # We found a bogon in the path, so make sure we never use it.
92360484Sobrien  set dummy $ac_cv_prog_CC
92460484Sobrien  shift
92560484Sobrien  if test $# -gt 0; then
92660484Sobrien    # We chose a different compiler from the bogus one.
92760484Sobrien    # However, it has the same basename, so the bogon will be chosen
92860484Sobrien    # first if we set CC to just the basename; use the full file name.
92960484Sobrien    shift
93060484Sobrien    set dummy "$ac_dir/$ac_word" "$@"
93160484Sobrien    shift
93260484Sobrien    ac_cv_prog_CC="$@"
93360484Sobrien  fi
93460484Sobrienfi
93560484Sobrienfi
93660484Sobrienfi
93760484SobrienCC="$ac_cv_prog_CC"
93860484Sobrienif test -n "$CC"; then
93960484Sobrien  echo "$ac_t""$CC" 1>&6
94060484Sobrienelse
94160484Sobrien  echo "$ac_t""no" 1>&6
94260484Sobrienfi
94360484Sobrien
94460484Sobrien  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
94560484Sobrienfi
94660484Sobrien
94760484Sobrienecho $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
948104834Sobrienecho "configure:949: checking whether we are using GNU C" >&5
94960484Sobrienif eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
95060484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
95160484Sobrienelse
95260484Sobrien  cat > conftest.c <<EOF
95360484Sobrien#ifdef __GNUC__
95460484Sobrien  yes;
95560484Sobrien#endif
95660484SobrienEOF
957104834Sobrienif { 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
95860484Sobrien  ac_cv_prog_gcc=yes
95960484Sobrienelse
96060484Sobrien  ac_cv_prog_gcc=no
96160484Sobrienfi
96260484Sobrienfi
96360484Sobrien
96460484Sobrienecho "$ac_t""$ac_cv_prog_gcc" 1>&6
96560484Sobrien
96660484Sobrienif test $ac_cv_prog_gcc = yes; then
96760484Sobrien  GCC=yes
96877298Sobrien  ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
96960484Sobrien  ac_test_CFLAGS="${CFLAGS+set}"
97060484Sobrien  ac_save_CFLAGS="$CFLAGS"
97160484Sobrien  CFLAGS=
97260484Sobrien  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
973104834Sobrienecho "configure:974: checking whether ${CC-cc} accepts -g" >&5
97460484Sobrienif eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
97560484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
97660484Sobrienelse
97760484Sobrien  echo 'void f(){}' > conftest.c
97860484Sobrienif test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
97960484Sobrien  ac_cv_prog_cc_g=yes
98060484Sobrienelse
98160484Sobrien  ac_cv_prog_cc_g=no
98260484Sobrienfi
98360484Sobrienrm -f conftest*
98460484Sobrien
98560484Sobrienfi
98660484Sobrien
98760484Sobrienecho "$ac_t""$ac_cv_prog_cc_g" 1>&6
98860484Sobrien  if test "$ac_test_CFLAGS" = set; then
98960484Sobrien    CFLAGS="$ac_save_CFLAGS"
99060484Sobrien  elif test $ac_cv_prog_cc_g = yes; then
99160484Sobrien    CFLAGS="-g -O2"
99260484Sobrien  else
99360484Sobrien    CFLAGS="-O2"
99460484Sobrien  fi
99560484Sobrienelse
99660484Sobrien  GCC=
99760484Sobrien  ac_libiberty_warn_cflags=
99860484Sobrien  test "${CFLAGS+set}" = set || CFLAGS="-g"
99960484Sobrienfi
100060484Sobrien
100160484Sobrien
100277298Sobrien
1003104834Sobrienif test "x$CC" != xcc; then
1004104834Sobrien  echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
1005104834Sobrienecho "configure:1006: checking whether $CC and cc understand -c and -o together" >&5
1006104834Sobrienelse
1007104834Sobrien  echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
1008104834Sobrienecho "configure:1009: checking whether cc understands -c and -o together" >&5
1009104834Sobrienfi
1010104834Sobrienset dummy $CC; ac_cc="`echo $2 |
1011104834Sobrien		       sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
1012104834Sobrienif eval "test \"`echo '$''{'ac_cv_prog_cc_${ac_cc}_c_o'+set}'`\" = set"; then
1013104834Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
1014104834Sobrienelse
1015104834Sobrien  echo 'foo(){}' > conftest.c
1016104834Sobrien# Make sure it works both with $CC and with simple cc.
1017104834Sobrien# We do the test twice because some compilers refuse to overwrite an
1018104834Sobrien# existing .o file with -o, though they will create one.
1019104834Sobrienac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
1020104834Sobrienif { (eval echo configure:1021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
1021104834Sobrien   test -f conftest.o && { (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
1022104834Sobrienthen
1023104834Sobrien  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
1024104834Sobrien  if test "x$CC" != xcc; then
1025104834Sobrien    # Test first that cc exists at all.
1026104834Sobrien    if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
1027104834Sobrien      ac_try='cc -c conftest.c -o conftest.o 1>&5'
1028104834Sobrien      if { (eval echo configure:1029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
1029104834Sobrien	 test -f conftest.o && { (eval echo configure:1030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
1030104834Sobrien      then
1031104834Sobrien        # cc works too.
1032104834Sobrien        :
1033104834Sobrien      else
1034104834Sobrien        # cc exists but doesn't like -o.
1035104834Sobrien        eval ac_cv_prog_cc_${ac_cc}_c_o=no
1036104834Sobrien      fi
1037104834Sobrien    fi
1038104834Sobrien  fi
1039104834Sobrienelse
1040104834Sobrien  eval ac_cv_prog_cc_${ac_cc}_c_o=no
1041104834Sobrienfi
1042104834Sobrienrm -f conftest*
1043104834Sobrien
1044104834Sobrienfi
1045104834Sobrienif eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
1046104834Sobrien  echo "$ac_t""yes" 1>&6
1047104834Sobrienelse
1048104834Sobrien  echo "$ac_t""no" 1>&6
1049104834Sobrien  cat >> confdefs.h <<\EOF
1050104834Sobrien#define NO_MINUS_C_MINUS_O 1
1051104834SobrienEOF
1052104834Sobrien
1053104834Sobrienfi
1054104834Sobrien
1055104834Sobrien# autoconf is lame and doesn't give us any substitution variable for this.
1056104834Sobrienif eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
1057104834Sobrien  NO_MINUS_C_MINUS_O=yes
1058104834Sobrienelse
1059104834Sobrien  OUTPUT_OPTION='-o $@'
1060104834Sobrienfi
1061104834Sobrien
1062104834Sobrien
1063104834Sobrien
106460484Sobrienecho $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
1065104834Sobrienecho "configure:1066: checking for POSIXized ISC" >&5
106660484Sobrienif test -d /etc/conf/kconfig.d &&
106760484Sobrien  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
106860484Sobrienthen
106960484Sobrien  echo "$ac_t""yes" 1>&6
107060484Sobrien  ISC=yes # If later tests want to check for ISC.
107160484Sobrien  cat >> confdefs.h <<\EOF
107260484Sobrien#define _POSIX_SOURCE 1
107360484SobrienEOF
107460484Sobrien
107560484Sobrien  if test "$GCC" = yes; then
107660484Sobrien    CC="$CC -posix"
107760484Sobrien  else
107860484Sobrien    CC="$CC -Xp"
107960484Sobrien  fi
108060484Sobrienelse
108160484Sobrien  echo "$ac_t""no" 1>&6
108260484Sobrien  ISC=
108360484Sobrienfi
108460484Sobrien
108577298Sobrienecho $ac_n "checking for working const""... $ac_c" 1>&6
1086104834Sobrienecho "configure:1087: checking for working const" >&5
108777298Sobrienif eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
108877298Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
108977298Sobrienelse
109077298Sobrien  cat > conftest.$ac_ext <<EOF
1091104834Sobrien#line 1092 "configure"
109277298Sobrien#include "confdefs.h"
109360484Sobrien
109477298Sobrienint main() {
109560484Sobrien
109677298Sobrien/* Ultrix mips cc rejects this.  */
109777298Sobrientypedef int charset[2]; const charset x;
109877298Sobrien/* SunOS 4.1.1 cc rejects this.  */
109977298Sobrienchar const *const *ccp;
110077298Sobrienchar **p;
110177298Sobrien/* NEC SVR4.0.2 mips cc rejects this.  */
110277298Sobrienstruct point {int x, y;};
110377298Sobrienstatic struct point const zero = {0,0};
110477298Sobrien/* AIX XL C 1.02.0.0 rejects this.
110577298Sobrien   It does not let you subtract one const X* pointer from another in an arm
110677298Sobrien   of an if-expression whose if-part is not a constant expression */
110777298Sobrienconst char *g = "string";
110877298Sobrienccp = &g + (g ? g-g : 0);
110977298Sobrien/* HPUX 7.0 cc rejects these. */
111077298Sobrien++ccp;
111177298Sobrienp = (char**) ccp;
111277298Sobrienccp = (char const *const *) p;
111377298Sobrien{ /* SCO 3.2v4 cc rejects this.  */
111477298Sobrien  char *t;
111577298Sobrien  char const *s = 0 ? (char *) 0 : (char const *) 0;
111660484Sobrien
111777298Sobrien  *t++ = 0;
111877298Sobrien}
111977298Sobrien{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
112077298Sobrien  int x[] = {25, 17};
112177298Sobrien  const int *foo = &x[0];
112277298Sobrien  ++foo;
112377298Sobrien}
112477298Sobrien{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
112577298Sobrien  typedef const int *iptr;
112677298Sobrien  iptr p = 0;
112777298Sobrien  ++p;
112877298Sobrien}
112977298Sobrien{ /* AIX XL C 1.02.0.0 rejects this saying
113077298Sobrien     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
113177298Sobrien  struct s { int j; const int *ap[3]; };
113277298Sobrien  struct s *b; b->j = 5;
113377298Sobrien}
113477298Sobrien{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
113577298Sobrien  const int foo = 10;
113677298Sobrien}
113760484Sobrien
113877298Sobrien; return 0; }
113977298SobrienEOF
1140104834Sobrienif { (eval echo configure:1141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
114177298Sobrien  rm -rf conftest*
114277298Sobrien  ac_cv_c_const=yes
114377298Sobrienelse
114477298Sobrien  echo "configure: failed program was:" >&5
114577298Sobrien  cat conftest.$ac_ext >&5
114677298Sobrien  rm -rf conftest*
114777298Sobrien  ac_cv_c_const=no
114877298Sobrienfi
114977298Sobrienrm -f conftest*
115077298Sobrienfi
115160484Sobrien
115277298Sobrienecho "$ac_t""$ac_cv_c_const" 1>&6
115377298Sobrienif test $ac_cv_c_const = no; then
115477298Sobrien  cat >> confdefs.h <<\EOF
115577298Sobrien#define const 
115677298SobrienEOF
115760484Sobrien
115877298Sobrienfi
115977298Sobrien
116077298Sobrienecho $ac_n "checking for inline""... $ac_c" 1>&6
1161104834Sobrienecho "configure:1162: checking for inline" >&5
116277298Sobrienif eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
116377298Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
116477298Sobrienelse
116577298Sobrien  ac_cv_c_inline=no
116677298Sobrienfor ac_kw in inline __inline__ __inline; do
116777298Sobrien  cat > conftest.$ac_ext <<EOF
1168104834Sobrien#line 1169 "configure"
116977298Sobrien#include "confdefs.h"
117077298Sobrien
117177298Sobrienint main() {
117277298Sobrien} $ac_kw foo() {
117377298Sobrien; return 0; }
117477298SobrienEOF
1175104834Sobrienif { (eval echo configure:1176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
117677298Sobrien  rm -rf conftest*
117777298Sobrien  ac_cv_c_inline=$ac_kw; break
117877298Sobrienelse
117977298Sobrien  echo "configure: failed program was:" >&5
118077298Sobrien  cat conftest.$ac_ext >&5
118177298Sobrienfi
118277298Sobrienrm -f conftest*
118377298Sobriendone
118477298Sobrien
118577298Sobrienfi
118677298Sobrien
118777298Sobrienecho "$ac_t""$ac_cv_c_inline" 1>&6
118877298Sobriencase "$ac_cv_c_inline" in
118977298Sobrien  inline | yes) ;;
119077298Sobrien  no) cat >> confdefs.h <<\EOF
119177298Sobrien#define inline 
119277298SobrienEOF
119377298Sobrien ;;
119477298Sobrien  *)  cat >> confdefs.h <<EOF
119577298Sobrien#define inline $ac_cv_c_inline
119677298SobrienEOF
119777298Sobrien ;;
119877298Sobrienesac
119977298Sobrien
120077298Sobrien
120177298Sobrien
120277298Sobrien
120377298Sobrien
120477298Sobrien
120577298Sobrien
120660484Sobrien# Find a good install program.  We prefer a C program (faster),
120760484Sobrien# so one script is as good as another.  But avoid the broken or
120860484Sobrien# incompatible versions:
120960484Sobrien# SysV /etc/install, /usr/sbin/install
121060484Sobrien# SunOS /usr/etc/install
121160484Sobrien# IRIX /sbin/install
121260484Sobrien# AIX /bin/install
121360484Sobrien# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
121460484Sobrien# AFS /usr/afsws/bin/install, which mishandles nonexistent args
121560484Sobrien# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
121660484Sobrien# ./install, which can be erroneously created by make from ./install.sh.
121760484Sobrienecho $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1218104834Sobrienecho "configure:1219: checking for a BSD compatible install" >&5
121960484Sobrienif test -z "$INSTALL"; then
122060484Sobrienif eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
122160484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
122260484Sobrienelse
122360484Sobrien    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
122460484Sobrien  for ac_dir in $PATH; do
122560484Sobrien    # Account for people who put trailing slashes in PATH elements.
122660484Sobrien    case "$ac_dir/" in
122760484Sobrien    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
122860484Sobrien    *)
122960484Sobrien      # OSF1 and SCO ODT 3.0 have their own names for install.
123060484Sobrien      # Don't use installbsd from OSF since it installs stuff as root
123160484Sobrien      # by default.
123260484Sobrien      for ac_prog in ginstall scoinst install; do
123360484Sobrien        if test -f $ac_dir/$ac_prog; then
123460484Sobrien	  if test $ac_prog = install &&
123560484Sobrien            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
123660484Sobrien	    # AIX install.  It has an incompatible calling convention.
123760484Sobrien	    :
123860484Sobrien	  else
123960484Sobrien	    ac_cv_path_install="$ac_dir/$ac_prog -c"
124060484Sobrien	    break 2
124160484Sobrien	  fi
124260484Sobrien	fi
124360484Sobrien      done
124460484Sobrien      ;;
124560484Sobrien    esac
124660484Sobrien  done
124760484Sobrien  IFS="$ac_save_IFS"
124860484Sobrien
124960484Sobrienfi
125060484Sobrien  if test "${ac_cv_path_install+set}" = set; then
125160484Sobrien    INSTALL="$ac_cv_path_install"
125260484Sobrien  else
125360484Sobrien    # As a last resort, use the slow shell script.  We don't cache a
125460484Sobrien    # path for INSTALL within a source directory, because that will
125560484Sobrien    # break other packages using the cache if that directory is
125660484Sobrien    # removed, or if the path is relative.
125760484Sobrien    INSTALL="$ac_install_sh"
125860484Sobrien  fi
125960484Sobrienfi
126060484Sobrienecho "$ac_t""$INSTALL" 1>&6
126160484Sobrien
126260484Sobrien# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
126360484Sobrien# It thinks the first close brace ends the variable substitution.
126460484Sobrientest -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
126560484Sobrien
126660484Sobrientest -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
126760484Sobrien
126860484Sobrientest -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
126960484Sobrien
127060484Sobrien
127160484Sobrien. ${srcdir}/config.table
127260484Sobrienhost_makefile_frag=${frag}
127360484Sobrien
127460484Sobrien
127560484Sobrien# It's OK to check for header files.  Although the compiler may not be
127660484Sobrien# able to link anything, it had better be able to at least compile
127760484Sobrien# something.
127860484Sobrienecho $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1279104834Sobrienecho "configure:1280: checking how to run the C preprocessor" >&5
128060484Sobrien# On Suns, sometimes $CPP names a directory.
128160484Sobrienif test -n "$CPP" && test -d "$CPP"; then
128260484Sobrien  CPP=
128360484Sobrienfi
128460484Sobrienif test -z "$CPP"; then
128560484Sobrienif eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
128660484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
128760484Sobrienelse
128860484Sobrien    # This must be in double quotes, not single quotes, because CPP may get
128960484Sobrien  # substituted into the Makefile and "${CC-cc}" will confuse make.
129060484Sobrien  CPP="${CC-cc} -E"
129160484Sobrien  # On the NeXT, cc -E runs the code through the compiler's parser,
129260484Sobrien  # not just through cpp.
129360484Sobrien  cat > conftest.$ac_ext <<EOF
1294104834Sobrien#line 1295 "configure"
129560484Sobrien#include "confdefs.h"
129660484Sobrien#include <assert.h>
129760484SobrienSyntax Error
129860484SobrienEOF
129960484Sobrienac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1300104834Sobrien{ (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
130160484Sobrienac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
130260484Sobrienif test -z "$ac_err"; then
130360484Sobrien  :
130460484Sobrienelse
130560484Sobrien  echo "$ac_err" >&5
130660484Sobrien  echo "configure: failed program was:" >&5
130760484Sobrien  cat conftest.$ac_ext >&5
130860484Sobrien  rm -rf conftest*
130960484Sobrien  CPP="${CC-cc} -E -traditional-cpp"
131060484Sobrien  cat > conftest.$ac_ext <<EOF
1311104834Sobrien#line 1312 "configure"
131260484Sobrien#include "confdefs.h"
131360484Sobrien#include <assert.h>
131460484SobrienSyntax Error
131560484SobrienEOF
131660484Sobrienac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1317104834Sobrien{ (eval echo configure:1318: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
131860484Sobrienac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
131960484Sobrienif test -z "$ac_err"; then
132060484Sobrien  :
132160484Sobrienelse
132260484Sobrien  echo "$ac_err" >&5
132360484Sobrien  echo "configure: failed program was:" >&5
132460484Sobrien  cat conftest.$ac_ext >&5
132560484Sobrien  rm -rf conftest*
132660484Sobrien  CPP="${CC-cc} -nologo -E"
132760484Sobrien  cat > conftest.$ac_ext <<EOF
1328104834Sobrien#line 1329 "configure"
132960484Sobrien#include "confdefs.h"
133060484Sobrien#include <assert.h>
133160484SobrienSyntax Error
133260484SobrienEOF
133360484Sobrienac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1334104834Sobrien{ (eval echo configure:1335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
133560484Sobrienac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
133660484Sobrienif test -z "$ac_err"; then
133760484Sobrien  :
133860484Sobrienelse
133960484Sobrien  echo "$ac_err" >&5
134060484Sobrien  echo "configure: failed program was:" >&5
134160484Sobrien  cat conftest.$ac_ext >&5
134260484Sobrien  rm -rf conftest*
134360484Sobrien  CPP=/lib/cpp
134460484Sobrienfi
134560484Sobrienrm -f conftest*
134660484Sobrienfi
134760484Sobrienrm -f conftest*
134860484Sobrienfi
134960484Sobrienrm -f conftest*
135060484Sobrien  ac_cv_prog_CPP="$CPP"
135160484Sobrienfi
135260484Sobrien  CPP="$ac_cv_prog_CPP"
135360484Sobrienelse
135460484Sobrien  ac_cv_prog_CPP="$CPP"
135560484Sobrienfi
135660484Sobrienecho "$ac_t""$CPP" 1>&6
135760484Sobrien
135889857Sobrienfor 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
135960484Sobriendo
136060484Sobrienac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
136160484Sobrienecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1362104834Sobrienecho "configure:1363: checking for $ac_hdr" >&5
136360484Sobrienif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
136460484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
136560484Sobrienelse
136660484Sobrien  cat > conftest.$ac_ext <<EOF
1367104834Sobrien#line 1368 "configure"
136860484Sobrien#include "confdefs.h"
136960484Sobrien#include <$ac_hdr>
137060484SobrienEOF
137160484Sobrienac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1372104834Sobrien{ (eval echo configure:1373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
137360484Sobrienac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
137460484Sobrienif test -z "$ac_err"; then
137560484Sobrien  rm -rf conftest*
137660484Sobrien  eval "ac_cv_header_$ac_safe=yes"
137760484Sobrienelse
137860484Sobrien  echo "$ac_err" >&5
137960484Sobrien  echo "configure: failed program was:" >&5
138060484Sobrien  cat conftest.$ac_ext >&5
138160484Sobrien  rm -rf conftest*
138260484Sobrien  eval "ac_cv_header_$ac_safe=no"
138360484Sobrienfi
138460484Sobrienrm -f conftest*
138560484Sobrienfi
138660484Sobrienif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
138760484Sobrien  echo "$ac_t""yes" 1>&6
138860484Sobrien    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
138960484Sobrien  cat >> confdefs.h <<EOF
139060484Sobrien#define $ac_tr_hdr 1
139160484SobrienEOF
139260484Sobrien 
139360484Sobrienelse
139460484Sobrien  echo "$ac_t""no" 1>&6
139560484Sobrienfi
139660484Sobriendone
139760484Sobrien
139860484Sobrienecho $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
1399104834Sobrienecho "configure:1400: checking for sys/wait.h that is POSIX.1 compatible" >&5
140060484Sobrienif eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
140160484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
140260484Sobrienelse
140360484Sobrien  cat > conftest.$ac_ext <<EOF
1404104834Sobrien#line 1405 "configure"
140560484Sobrien#include "confdefs.h"
140660484Sobrien#include <sys/types.h>
140760484Sobrien#include <sys/wait.h>
140860484Sobrien#ifndef WEXITSTATUS
140960484Sobrien#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
141060484Sobrien#endif
141160484Sobrien#ifndef WIFEXITED
141260484Sobrien#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
141360484Sobrien#endif
141460484Sobrienint main() {
141560484Sobrienint s;
141660484Sobrienwait (&s);
141760484Sobriens = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
141860484Sobrien; return 0; }
141960484SobrienEOF
1420104834Sobrienif { (eval echo configure:1421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
142160484Sobrien  rm -rf conftest*
142260484Sobrien  ac_cv_header_sys_wait_h=yes
142360484Sobrienelse
142460484Sobrien  echo "configure: failed program was:" >&5
142560484Sobrien  cat conftest.$ac_ext >&5
142660484Sobrien  rm -rf conftest*
142760484Sobrien  ac_cv_header_sys_wait_h=no
142860484Sobrienfi
142960484Sobrienrm -f conftest*
143060484Sobrienfi
143160484Sobrien
143260484Sobrienecho "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
143360484Sobrienif test $ac_cv_header_sys_wait_h = yes; then
143460484Sobrien  cat >> confdefs.h <<\EOF
143560484Sobrien#define HAVE_SYS_WAIT_H 1
143660484SobrienEOF
143760484Sobrien
143860484Sobrienfi
143960484Sobrien
144077298Sobrienecho $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1441104834Sobrienecho "configure:1442: checking whether time.h and sys/time.h may both be included" >&5
144277298Sobrienif eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
144377298Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
144477298Sobrienelse
144577298Sobrien  cat > conftest.$ac_ext <<EOF
1446104834Sobrien#line 1447 "configure"
144777298Sobrien#include "confdefs.h"
144877298Sobrien#include <sys/types.h>
144977298Sobrien#include <sys/time.h>
145077298Sobrien#include <time.h>
145177298Sobrienint main() {
145277298Sobrienstruct tm *tp;
145377298Sobrien; return 0; }
145477298SobrienEOF
1455104834Sobrienif { (eval echo configure:1456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
145677298Sobrien  rm -rf conftest*
145777298Sobrien  ac_cv_header_time=yes
145877298Sobrienelse
145977298Sobrien  echo "configure: failed program was:" >&5
146077298Sobrien  cat conftest.$ac_ext >&5
146177298Sobrien  rm -rf conftest*
146277298Sobrien  ac_cv_header_time=no
146377298Sobrienfi
146477298Sobrienrm -f conftest*
146577298Sobrienfi
146660484Sobrien
146777298Sobrienecho "$ac_t""$ac_cv_header_time" 1>&6
146877298Sobrienif test $ac_cv_header_time = yes; then
146977298Sobrien  cat >> confdefs.h <<\EOF
147077298Sobrien#define TIME_WITH_SYS_TIME 1
147177298SobrienEOF
147277298Sobrien
147377298Sobrienfi
147477298Sobrien
147577298Sobrien
147677298Sobrienecho $ac_n "checking whether errno must be declared""... $ac_c" 1>&6
1477104834Sobrienecho "configure:1478: checking whether errno must be declared" >&5
147877298Sobrienif eval "test \"`echo '$''{'libiberty_cv_declare_errno'+set}'`\" = set"; then
147977298Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
148077298Sobrienelse
148177298Sobrien  cat > conftest.$ac_ext <<EOF
1482104834Sobrien#line 1483 "configure"
148377298Sobrien#include "confdefs.h"
148477298Sobrien#include <errno.h>
148577298Sobrienint main() {
148677298Sobrienint x = errno;
148777298Sobrien; return 0; }
148877298SobrienEOF
1489104834Sobrienif { (eval echo configure:1490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
149077298Sobrien  rm -rf conftest*
149177298Sobrien  libiberty_cv_declare_errno=no
149277298Sobrienelse
149377298Sobrien  echo "configure: failed program was:" >&5
149477298Sobrien  cat conftest.$ac_ext >&5
149577298Sobrien  rm -rf conftest*
149677298Sobrien  libiberty_cv_declare_errno=yes
149777298Sobrienfi
149877298Sobrienrm -f conftest*
149977298Sobrienfi
150077298Sobrien
150177298Sobrienecho "$ac_t""$libiberty_cv_declare_errno" 1>&6
150277298Sobrienif test $libiberty_cv_declare_errno = yes
150377298Sobrienthen cat >> confdefs.h <<\EOF
150477298Sobrien#define NEED_DECLARATION_ERRNO 1
150577298SobrienEOF
150677298Sobrien
150777298Sobrienfi
150877298Sobrien
150977298Sobrien
151089857Sobrienecho $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
1511104834Sobrienecho "configure:1512: checking for ANSI C header files" >&5
151289857Sobrienif eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
151389857Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
151489857Sobrienelse
151589857Sobrien  cat > conftest.$ac_ext <<EOF
1516104834Sobrien#line 1517 "configure"
151789857Sobrien#include "confdefs.h"
151889857Sobrien#include <stdlib.h>
151989857Sobrien#include <stdarg.h>
152089857Sobrien#include <string.h>
152189857Sobrien#include <float.h>
152289857SobrienEOF
152389857Sobrienac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1524104834Sobrien{ (eval echo configure:1525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
152589857Sobrienac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
152689857Sobrienif test -z "$ac_err"; then
152789857Sobrien  rm -rf conftest*
152889857Sobrien  ac_cv_header_stdc=yes
152989857Sobrienelse
153089857Sobrien  echo "$ac_err" >&5
153189857Sobrien  echo "configure: failed program was:" >&5
153289857Sobrien  cat conftest.$ac_ext >&5
153389857Sobrien  rm -rf conftest*
153489857Sobrien  ac_cv_header_stdc=no
153589857Sobrienfi
153689857Sobrienrm -f conftest*
153789857Sobrien
153889857Sobrienif test $ac_cv_header_stdc = yes; then
153989857Sobrien  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
154089857Sobriencat > conftest.$ac_ext <<EOF
1541104834Sobrien#line 1542 "configure"
154289857Sobrien#include "confdefs.h"
154389857Sobrien#include <string.h>
154489857SobrienEOF
154589857Sobrienif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
154689857Sobrien  egrep "memchr" >/dev/null 2>&1; then
154789857Sobrien  :
154889857Sobrienelse
154989857Sobrien  rm -rf conftest*
155089857Sobrien  ac_cv_header_stdc=no
155189857Sobrienfi
155289857Sobrienrm -f conftest*
155389857Sobrien
155489857Sobrienfi
155589857Sobrien
155689857Sobrienif test $ac_cv_header_stdc = yes; then
155789857Sobrien  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
155889857Sobriencat > conftest.$ac_ext <<EOF
1559104834Sobrien#line 1560 "configure"
156089857Sobrien#include "confdefs.h"
156189857Sobrien#include <stdlib.h>
156289857SobrienEOF
156389857Sobrienif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
156489857Sobrien  egrep "free" >/dev/null 2>&1; then
156589857Sobrien  :
156689857Sobrienelse
156789857Sobrien  rm -rf conftest*
156889857Sobrien  ac_cv_header_stdc=no
156989857Sobrienfi
157089857Sobrienrm -f conftest*
157189857Sobrien
157289857Sobrienfi
157389857Sobrien
157489857Sobrienif test $ac_cv_header_stdc = yes; then
157589857Sobrien  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
157689857Sobrienif test "$cross_compiling" = yes; then
157789857Sobrien  :
157889857Sobrienelse
157989857Sobrien  cat > conftest.$ac_ext <<EOF
1580104834Sobrien#line 1581 "configure"
158189857Sobrien#include "confdefs.h"
158289857Sobrien#include <ctype.h>
158389857Sobrien#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
158489857Sobrien#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
158589857Sobrien#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
158689857Sobrienint main () { int i; for (i = 0; i < 256; i++)
158789857Sobrienif (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
158889857Sobrienexit (0); }
158989857Sobrien
159089857SobrienEOF
1591104834Sobrienif { (eval echo configure:1592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
159289857Sobrienthen
159389857Sobrien  :
159489857Sobrienelse
159589857Sobrien  echo "configure: failed program was:" >&5
159689857Sobrien  cat conftest.$ac_ext >&5
159789857Sobrien  rm -fr conftest*
159889857Sobrien  ac_cv_header_stdc=no
159989857Sobrienfi
160089857Sobrienrm -fr conftest*
160189857Sobrienfi
160289857Sobrien
160389857Sobrienfi
160489857Sobrienfi
160589857Sobrien
160689857Sobrienecho "$ac_t""$ac_cv_header_stdc" 1>&6
160789857Sobrienif test $ac_cv_header_stdc = yes; then
160889857Sobrien  cat >> confdefs.h <<\EOF
160989857Sobrien#define STDC_HEADERS 1
161089857SobrienEOF
161189857Sobrien
161289857Sobrienfi
161389857Sobrien
161489857Sobrienecho $ac_n "checking for uintptr_t""... $ac_c" 1>&6
1615104834Sobrienecho "configure:1616: checking for uintptr_t" >&5
161689857Sobrienif eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then
161789857Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
161889857Sobrienelse
161989857Sobrien  cat > conftest.$ac_ext <<EOF
1620104834Sobrien#line 1621 "configure"
162189857Sobrien#include "confdefs.h"
162289857Sobrien#include <sys/types.h>
162389857Sobrien#if STDC_HEADERS
162489857Sobrien#include <stdlib.h>
162589857Sobrien#include <stddef.h>
162689857Sobrien#endif
162789857SobrienEOF
162889857Sobrienif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
162989857Sobrien  egrep "(^|[^a-zA-Z_0-9])uintptr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
163089857Sobrien  rm -rf conftest*
163189857Sobrien  ac_cv_type_uintptr_t=yes
163289857Sobrienelse
163389857Sobrien  rm -rf conftest*
163489857Sobrien  ac_cv_type_uintptr_t=no
163589857Sobrienfi
163689857Sobrienrm -f conftest*
163789857Sobrien
163889857Sobrienfi
163989857Sobrienecho "$ac_t""$ac_cv_type_uintptr_t" 1>&6
164089857Sobrienif test $ac_cv_type_uintptr_t = no; then
164189857Sobrien  cat >> confdefs.h <<\EOF
164289857Sobrien#define uintptr_t unsigned long
164389857SobrienEOF
164489857Sobrien
164589857Sobrienfi
164689857Sobrien
164789857Sobrien
164889857Sobrienif test $ac_cv_type_uintptr_t = yes
164989857Sobrienthen
165089857Sobrien  cat >> confdefs.h <<\EOF
165189857Sobrien#define HAVE_UINTPTR_T 1
165289857SobrienEOF
165389857Sobrien
165489857Sobrienfi
165589857Sobrien
1656104834Sobrienecho $ac_n "checking for pid_t""... $ac_c" 1>&6
1657104834Sobrienecho "configure:1658: checking for pid_t" >&5
1658104834Sobrienif eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
1659104834Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
1660104834Sobrienelse
1661104834Sobrien  cat > conftest.$ac_ext <<EOF
1662104834Sobrien#line 1663 "configure"
1663104834Sobrien#include "confdefs.h"
1664104834Sobrien#include <sys/types.h>
1665104834Sobrien#if STDC_HEADERS
1666104834Sobrien#include <stdlib.h>
1667104834Sobrien#include <stddef.h>
1668104834Sobrien#endif
1669104834SobrienEOF
1670104834Sobrienif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1671104834Sobrien  egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
1672104834Sobrien  rm -rf conftest*
1673104834Sobrien  ac_cv_type_pid_t=yes
1674104834Sobrienelse
1675104834Sobrien  rm -rf conftest*
1676104834Sobrien  ac_cv_type_pid_t=no
1677104834Sobrienfi
1678104834Sobrienrm -f conftest*
1679104834Sobrien
1680104834Sobrienfi
1681104834Sobrienecho "$ac_t""$ac_cv_type_pid_t" 1>&6
1682104834Sobrienif test $ac_cv_type_pid_t = no; then
1683104834Sobrien  cat >> confdefs.h <<\EOF
1684104834Sobrien#define pid_t int
1685104834SobrienEOF
1686104834Sobrien
1687104834Sobrienfi
1688104834Sobrien
1689104834Sobrien
169060484Sobrien# This is the list of functions which libiberty will provide if they
169160484Sobrien# are not available on the host.
169260484Sobrien
169360484Sobrienfuncs="asprintf"
169460484Sobrienfuncs="$funcs atexit"
169560484Sobrienfuncs="$funcs basename"
169660484Sobrienfuncs="$funcs bcmp"
169760484Sobrienfuncs="$funcs bcopy"
169877298Sobrienfuncs="$funcs bsearch"
169960484Sobrienfuncs="$funcs bzero"
170060484Sobrienfuncs="$funcs calloc"
170160484Sobrienfuncs="$funcs clock"
170289857Sobrienfuncs="$funcs ffs"
170360484Sobrienfuncs="$funcs getcwd"
170460484Sobrienfuncs="$funcs getpagesize"
170560484Sobrienfuncs="$funcs index"
170660484Sobrienfuncs="$funcs insque"
170760484Sobrienfuncs="$funcs memchr"
170860484Sobrienfuncs="$funcs memcmp"
170960484Sobrienfuncs="$funcs memcpy"
171060484Sobrienfuncs="$funcs memmove"
171160484Sobrienfuncs="$funcs memset"
171260484Sobrienfuncs="$funcs mkstemps"
171360484Sobrienfuncs="$funcs putenv"
171460484Sobrienfuncs="$funcs random"
171560484Sobrienfuncs="$funcs rename"
171660484Sobrienfuncs="$funcs rindex"
171760484Sobrienfuncs="$funcs setenv"
171860484Sobrienfuncs="$funcs sigsetmask"
171960484Sobrienfuncs="$funcs strcasecmp"
172060484Sobrienfuncs="$funcs strchr"
172160484Sobrienfuncs="$funcs strdup"
172260484Sobrienfuncs="$funcs strncasecmp"
172360484Sobrienfuncs="$funcs strrchr"
172460484Sobrienfuncs="$funcs strstr"
172560484Sobrienfuncs="$funcs strtod"
172660484Sobrienfuncs="$funcs strtol"
172760484Sobrienfuncs="$funcs strtoul"
172860484Sobrienfuncs="$funcs tmpnam"
172960484Sobrienfuncs="$funcs vasprintf"
173060484Sobrienfuncs="$funcs vfprintf"
173160484Sobrienfuncs="$funcs vprintf"
173260484Sobrienfuncs="$funcs vsprintf"
173360484Sobrienfuncs="$funcs waitpid"
173460484Sobrien
173560484Sobrien# Also in the old function.def file: alloca, vfork, getopt.
173660484Sobrien
173760484Sobrienvars="sys_errlist sys_nerr sys_siglist"
173860484Sobrien
173960484Sobriencheckfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk gettimeofday"
174060484Sobrien
174160484Sobrien# These are neither executed nor required, but they help keep
174260484Sobrien# autoheader happy without adding a bunch of text to acconfig.h.
174360484Sobrienif test "x" = "y"; then
174477298Sobrien  for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock
174560484Sobriendo
174660484Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
1747104834Sobrienecho "configure:1748: checking for $ac_func" >&5
174860484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
174960484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
175060484Sobrienelse
175160484Sobrien  cat > conftest.$ac_ext <<EOF
1752104834Sobrien#line 1753 "configure"
175360484Sobrien#include "confdefs.h"
175460484Sobrien/* System header to define __stub macros and hopefully few prototypes,
175560484Sobrien    which can conflict with char $ac_func(); below.  */
175660484Sobrien#include <assert.h>
175760484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
175860484Sobrien/* We use char because int might match the return type of a gcc2
175960484Sobrien    builtin and then its argument prototype would still apply.  */
176060484Sobrienchar $ac_func();
176160484Sobrien
176260484Sobrienint main() {
176360484Sobrien
176460484Sobrien/* The GNU C library defines this for functions which it implements
176560484Sobrien    to always fail with ENOSYS.  Some functions are actually named
176660484Sobrien    something starting with __ and the normal name is an alias.  */
176760484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
176860484Sobrienchoke me
176960484Sobrien#else
177060484Sobrien$ac_func();
177160484Sobrien#endif
177260484Sobrien
177360484Sobrien; return 0; }
177460484SobrienEOF
1775104834Sobrienif { (eval echo configure:1776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
177660484Sobrien  rm -rf conftest*
177760484Sobrien  eval "ac_cv_func_$ac_func=yes"
177860484Sobrienelse
177960484Sobrien  echo "configure: failed program was:" >&5
178060484Sobrien  cat conftest.$ac_ext >&5
178160484Sobrien  rm -rf conftest*
178260484Sobrien  eval "ac_cv_func_$ac_func=no"
178360484Sobrienfi
178460484Sobrienrm -f conftest*
178560484Sobrienfi
178660484Sobrien
178760484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
178860484Sobrien  echo "$ac_t""yes" 1>&6
178960484Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
179060484Sobrien  cat >> confdefs.h <<EOF
179160484Sobrien#define $ac_tr_func 1
179260484SobrienEOF
179360484Sobrien 
179460484Sobrienelse
179560484Sobrien  echo "$ac_t""no" 1>&6
179660484Sobrienfi
179760484Sobriendone
179860484Sobrien
179977298Sobrien  for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy
180060484Sobriendo
180160484Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
1802104834Sobrienecho "configure:1803: checking for $ac_func" >&5
180360484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
180460484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
180560484Sobrienelse
180660484Sobrien  cat > conftest.$ac_ext <<EOF
1807104834Sobrien#line 1808 "configure"
180860484Sobrien#include "confdefs.h"
180960484Sobrien/* System header to define __stub macros and hopefully few prototypes,
181060484Sobrien    which can conflict with char $ac_func(); below.  */
181160484Sobrien#include <assert.h>
181260484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
181360484Sobrien/* We use char because int might match the return type of a gcc2
181460484Sobrien    builtin and then its argument prototype would still apply.  */
181560484Sobrienchar $ac_func();
181660484Sobrien
181760484Sobrienint main() {
181860484Sobrien
181960484Sobrien/* The GNU C library defines this for functions which it implements
182060484Sobrien    to always fail with ENOSYS.  Some functions are actually named
182160484Sobrien    something starting with __ and the normal name is an alias.  */
182260484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
182360484Sobrienchoke me
182460484Sobrien#else
182560484Sobrien$ac_func();
182660484Sobrien#endif
182760484Sobrien
182860484Sobrien; return 0; }
182960484SobrienEOF
1830104834Sobrienif { (eval echo configure:1831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
183160484Sobrien  rm -rf conftest*
183260484Sobrien  eval "ac_cv_func_$ac_func=yes"
183360484Sobrienelse
183460484Sobrien  echo "configure: failed program was:" >&5
183560484Sobrien  cat conftest.$ac_ext >&5
183660484Sobrien  rm -rf conftest*
183760484Sobrien  eval "ac_cv_func_$ac_func=no"
183860484Sobrienfi
183960484Sobrienrm -f conftest*
184060484Sobrienfi
184160484Sobrien
184260484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
184360484Sobrien  echo "$ac_t""yes" 1>&6
184460484Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
184560484Sobrien  cat >> confdefs.h <<EOF
184660484Sobrien#define $ac_tr_func 1
184760484SobrienEOF
184860484Sobrien 
184960484Sobrienelse
185060484Sobrien  echo "$ac_t""no" 1>&6
185160484Sobrienfi
185260484Sobriendone
185360484Sobrien
185477298Sobrien  for ac_func in memmove memset putenv random rename rindex sigsetmask
185560484Sobriendo
185660484Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
1857104834Sobrienecho "configure:1858: checking for $ac_func" >&5
185860484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
185960484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
186060484Sobrienelse
186160484Sobrien  cat > conftest.$ac_ext <<EOF
1862104834Sobrien#line 1863 "configure"
186360484Sobrien#include "confdefs.h"
186460484Sobrien/* System header to define __stub macros and hopefully few prototypes,
186560484Sobrien    which can conflict with char $ac_func(); below.  */
186660484Sobrien#include <assert.h>
186760484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
186860484Sobrien/* We use char because int might match the return type of a gcc2
186960484Sobrien    builtin and then its argument prototype would still apply.  */
187060484Sobrienchar $ac_func();
187160484Sobrien
187260484Sobrienint main() {
187360484Sobrien
187460484Sobrien/* The GNU C library defines this for functions which it implements
187560484Sobrien    to always fail with ENOSYS.  Some functions are actually named
187660484Sobrien    something starting with __ and the normal name is an alias.  */
187760484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
187860484Sobrienchoke me
187960484Sobrien#else
188060484Sobrien$ac_func();
188160484Sobrien#endif
188260484Sobrien
188360484Sobrien; return 0; }
188460484SobrienEOF
1885104834Sobrienif { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
188660484Sobrien  rm -rf conftest*
188760484Sobrien  eval "ac_cv_func_$ac_func=yes"
188860484Sobrienelse
188960484Sobrien  echo "configure: failed program was:" >&5
189060484Sobrien  cat conftest.$ac_ext >&5
189160484Sobrien  rm -rf conftest*
189260484Sobrien  eval "ac_cv_func_$ac_func=no"
189360484Sobrienfi
189460484Sobrienrm -f conftest*
189560484Sobrienfi
189660484Sobrien
189760484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
189860484Sobrien  echo "$ac_t""yes" 1>&6
189960484Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
190060484Sobrien  cat >> confdefs.h <<EOF
190160484Sobrien#define $ac_tr_func 1
190260484SobrienEOF
190360484Sobrien 
190460484Sobrienelse
190560484Sobrien  echo "$ac_t""no" 1>&6
190660484Sobrienfi
190760484Sobriendone
190860484Sobrien
190977298Sobrien  for ac_func in strcasecmp setenv strchr strdup strncasecmp strrchr strstr
191060484Sobriendo
191160484Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
1912104834Sobrienecho "configure:1913: checking for $ac_func" >&5
191360484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
191460484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
191560484Sobrienelse
191660484Sobrien  cat > conftest.$ac_ext <<EOF
1917104834Sobrien#line 1918 "configure"
191860484Sobrien#include "confdefs.h"
191960484Sobrien/* System header to define __stub macros and hopefully few prototypes,
192060484Sobrien    which can conflict with char $ac_func(); below.  */
192160484Sobrien#include <assert.h>
192260484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
192360484Sobrien/* We use char because int might match the return type of a gcc2
192460484Sobrien    builtin and then its argument prototype would still apply.  */
192560484Sobrienchar $ac_func();
192660484Sobrien
192760484Sobrienint main() {
192860484Sobrien
192960484Sobrien/* The GNU C library defines this for functions which it implements
193060484Sobrien    to always fail with ENOSYS.  Some functions are actually named
193160484Sobrien    something starting with __ and the normal name is an alias.  */
193260484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
193360484Sobrienchoke me
193460484Sobrien#else
193560484Sobrien$ac_func();
193660484Sobrien#endif
193760484Sobrien
193860484Sobrien; return 0; }
193960484SobrienEOF
1940104834Sobrienif { (eval echo configure:1941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
194160484Sobrien  rm -rf conftest*
194260484Sobrien  eval "ac_cv_func_$ac_func=yes"
194360484Sobrienelse
194460484Sobrien  echo "configure: failed program was:" >&5
194560484Sobrien  cat conftest.$ac_ext >&5
194660484Sobrien  rm -rf conftest*
194760484Sobrien  eval "ac_cv_func_$ac_func=no"
194860484Sobrienfi
194960484Sobrienrm -f conftest*
195060484Sobrienfi
195160484Sobrien
195260484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
195360484Sobrien  echo "$ac_t""yes" 1>&6
195460484Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
195560484Sobrien  cat >> confdefs.h <<EOF
195660484Sobrien#define $ac_tr_func 1
195760484SobrienEOF
195860484Sobrien 
195960484Sobrienelse
196060484Sobrien  echo "$ac_t""no" 1>&6
196160484Sobrienfi
196260484Sobriendone
196360484Sobrien
196477298Sobrien  for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf
196560484Sobriendo
196660484Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
1967104834Sobrienecho "configure:1968: checking for $ac_func" >&5
196860484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
196960484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
197060484Sobrienelse
197160484Sobrien  cat > conftest.$ac_ext <<EOF
1972104834Sobrien#line 1973 "configure"
197360484Sobrien#include "confdefs.h"
197460484Sobrien/* System header to define __stub macros and hopefully few prototypes,
197560484Sobrien    which can conflict with char $ac_func(); below.  */
197660484Sobrien#include <assert.h>
197760484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
197860484Sobrien/* We use char because int might match the return type of a gcc2
197960484Sobrien    builtin and then its argument prototype would still apply.  */
198060484Sobrienchar $ac_func();
198160484Sobrien
198260484Sobrienint main() {
198360484Sobrien
198460484Sobrien/* The GNU C library defines this for functions which it implements
198560484Sobrien    to always fail with ENOSYS.  Some functions are actually named
198660484Sobrien    something starting with __ and the normal name is an alias.  */
198760484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
198860484Sobrienchoke me
198960484Sobrien#else
199060484Sobrien$ac_func();
199160484Sobrien#endif
199260484Sobrien
199360484Sobrien; return 0; }
199460484SobrienEOF
1995104834Sobrienif { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
199660484Sobrien  rm -rf conftest*
199760484Sobrien  eval "ac_cv_func_$ac_func=yes"
199860484Sobrienelse
199960484Sobrien  echo "configure: failed program was:" >&5
200060484Sobrien  cat conftest.$ac_ext >&5
200160484Sobrien  rm -rf conftest*
200260484Sobrien  eval "ac_cv_func_$ac_func=no"
200360484Sobrienfi
200460484Sobrienrm -f conftest*
200560484Sobrienfi
200660484Sobrien
200760484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
200860484Sobrien  echo "$ac_t""yes" 1>&6
200960484Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
201060484Sobrien  cat >> confdefs.h <<EOF
201160484Sobrien#define $ac_tr_func 1
201260484SobrienEOF
201360484Sobrien 
201460484Sobrienelse
201560484Sobrien  echo "$ac_t""no" 1>&6
201660484Sobrienfi
201760484Sobriendone
201860484Sobrien
201977298Sobrien  for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal
202060484Sobriendo
202160484Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
2022104834Sobrienecho "configure:2023: checking for $ac_func" >&5
202360484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
202460484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
202560484Sobrienelse
202660484Sobrien  cat > conftest.$ac_ext <<EOF
2027104834Sobrien#line 2028 "configure"
202860484Sobrien#include "confdefs.h"
202960484Sobrien/* System header to define __stub macros and hopefully few prototypes,
203060484Sobrien    which can conflict with char $ac_func(); below.  */
203160484Sobrien#include <assert.h>
203260484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
203360484Sobrien/* We use char because int might match the return type of a gcc2
203460484Sobrien    builtin and then its argument prototype would still apply.  */
203560484Sobrienchar $ac_func();
203660484Sobrien
203760484Sobrienint main() {
203860484Sobrien
203960484Sobrien/* The GNU C library defines this for functions which it implements
204060484Sobrien    to always fail with ENOSYS.  Some functions are actually named
204160484Sobrien    something starting with __ and the normal name is an alias.  */
204260484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
204360484Sobrienchoke me
204460484Sobrien#else
204560484Sobrien$ac_func();
204660484Sobrien#endif
204760484Sobrien
204860484Sobrien; return 0; }
204960484SobrienEOF
2050104834Sobrienif { (eval echo configure:2051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
205160484Sobrien  rm -rf conftest*
205260484Sobrien  eval "ac_cv_func_$ac_func=yes"
205360484Sobrienelse
205460484Sobrien  echo "configure: failed program was:" >&5
205560484Sobrien  cat conftest.$ac_ext >&5
205660484Sobrien  rm -rf conftest*
205760484Sobrien  eval "ac_cv_func_$ac_func=no"
205860484Sobrienfi
205960484Sobrienrm -f conftest*
206060484Sobrienfi
206160484Sobrien
206260484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
206360484Sobrien  echo "$ac_t""yes" 1>&6
206460484Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
206560484Sobrien  cat >> confdefs.h <<EOF
206660484Sobrien#define $ac_tr_func 1
206760484SobrienEOF
206860484Sobrien 
206960484Sobrienelse
207060484Sobrien  echo "$ac_t""no" 1>&6
207160484Sobrienfi
207260484Sobriendone
207360484Sobrien
207489857Sobrien  for ac_func in sysconf times sbrk gettimeofday ffs
207560484Sobriendo
207660484Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
2077104834Sobrienecho "configure:2078: checking for $ac_func" >&5
207860484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
207960484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
208060484Sobrienelse
208160484Sobrien  cat > conftest.$ac_ext <<EOF
2082104834Sobrien#line 2083 "configure"
208360484Sobrien#include "confdefs.h"
208460484Sobrien/* System header to define __stub macros and hopefully few prototypes,
208560484Sobrien    which can conflict with char $ac_func(); below.  */
208660484Sobrien#include <assert.h>
208760484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
208860484Sobrien/* We use char because int might match the return type of a gcc2
208960484Sobrien    builtin and then its argument prototype would still apply.  */
209060484Sobrienchar $ac_func();
209160484Sobrien
209260484Sobrienint main() {
209360484Sobrien
209460484Sobrien/* The GNU C library defines this for functions which it implements
209560484Sobrien    to always fail with ENOSYS.  Some functions are actually named
209660484Sobrien    something starting with __ and the normal name is an alias.  */
209760484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
209860484Sobrienchoke me
209960484Sobrien#else
210060484Sobrien$ac_func();
210160484Sobrien#endif
210260484Sobrien
210360484Sobrien; return 0; }
210460484SobrienEOF
2105104834Sobrienif { (eval echo configure:2106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
210660484Sobrien  rm -rf conftest*
210760484Sobrien  eval "ac_cv_func_$ac_func=yes"
210860484Sobrienelse
210960484Sobrien  echo "configure: failed program was:" >&5
211060484Sobrien  cat conftest.$ac_ext >&5
211160484Sobrien  rm -rf conftest*
211260484Sobrien  eval "ac_cv_func_$ac_func=no"
211360484Sobrienfi
211460484Sobrienrm -f conftest*
211560484Sobrienfi
211660484Sobrien
211760484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
211860484Sobrien  echo "$ac_t""yes" 1>&6
211960484Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
212060484Sobrien  cat >> confdefs.h <<EOF
212160484Sobrien#define $ac_tr_func 1
212260484SobrienEOF
212360484Sobrien 
212460484Sobrienelse
212560484Sobrien  echo "$ac_t""no" 1>&6
212660484Sobrienfi
212760484Sobriendone
212860484Sobrien
212977298Sobrien  cat >> confdefs.h <<\EOF
213077298Sobrien#define HAVE_SYS_ERRLIST 1
213177298SobrienEOF
213277298Sobrien
213377298Sobrien  cat >> confdefs.h <<\EOF
213477298Sobrien#define HAVE_SYS_NERR 1
213577298SobrienEOF
213677298Sobrien
213777298Sobrien  cat >> confdefs.h <<\EOF
213877298Sobrien#define HAVE_SYS_SIGLIST 1
213977298SobrienEOF
214077298Sobrien
214160484Sobrienfi
214260484Sobrien
214360484Sobrien# For each of these functions, if the host does not provide the
214460484Sobrien# function we want to put FN.o in LIBOBJS, and if the host does
214589857Sobrien# provide the function, we want to define HAVE_FN in config.h.
214660484Sobrien
214760484Sobriensetobjs=
214860484SobrienCHECK=
2149104834Sobrientarget_header_dir=
215060484Sobrienif test -n "${with_target_subdir}"; then
215160484Sobrien
215260484Sobrien  # We are being configured as a target library.  AC_REPLACE_FUNCS
215360484Sobrien  # may not work correctly, because the compiler may not be able to
215460484Sobrien  # link executables.  Note that we may still be being configured
215560484Sobrien  # native.
215660484Sobrien
215760484Sobrien  # If we are being configured for newlib, we know which functions
215860484Sobrien  # newlib provide and which ones we will be expected to provide.
215960484Sobrien
216060484Sobrien  if test "x${with_newlib}" = "xyes"; then
216160484Sobrien    LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
216260484Sobrien
216360484Sobrien    for f in $funcs; do
216460484Sobrien      case "$f" in
216560484Sobrien	asprintf | basename | insque | random | strdup | vasprintf)
216660484Sobrien	  ;;
216760484Sobrien	*)
216860484Sobrien	  n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
216960484Sobrien	  cat >> confdefs.h <<EOF
217060484Sobrien#define $n 1
217160484SobrienEOF
217260484Sobrien
217360484Sobrien	  ;;
217460484Sobrien      esac
217560484Sobrien    done
217660484Sobrien
217760484Sobrien    # newlib doesnt provide any of the variables in $vars, so we
217860484Sobrien    # dont have to check them here.
217960484Sobrien
218060484Sobrien    # Of the functions in $checkfuncs, newlib only has strerror.
218160484Sobrien    cat >> confdefs.h <<\EOF
218260484Sobrien#define HAVE_STRERROR 1
218360484SobrienEOF
218460484Sobrien
218560484Sobrien
218660484Sobrien    setobjs=yes
218760484Sobrien
218860484Sobrien  fi
218960484Sobrien
2190104834Sobrien  # We may wish to install the target headers somewhere.
2191104834Sobrien  # Check whether --enable-install-libiberty or --disable-install-libiberty was given.
2192104834Sobrienif test "${enable_install_libiberty+set}" = set; then
2193104834Sobrien  enableval="$enable_install_libiberty"
2194104834Sobrien  enable_install_libiberty=$enableval
219560484Sobrienelse
2196104834Sobrien  enable_install_libiberty=no
2197104834Sobrienfi
2198104834Sobrien  
2199104834Sobrien  # Option parsed, now set things appropriately.
2200104834Sobrien  case x"$enable_install_libiberty" in
2201104834Sobrien    xyes|x)
2202104834Sobrien      target_header_dir=libiberty
2203104834Sobrien      ;;
2204104834Sobrien    xno)   
2205104834Sobrien      target_header_dir=
2206104834Sobrien      ;;
2207104834Sobrien    *) 
2208104834Sobrien      # This could be sanity-checked in various ways...
2209104834Sobrien      target_header_dir="${enable_install_libiberty}"
2210104834Sobrien      ;;
2211104834Sobrien  esac
221260484Sobrien
2213104834Sobrien
2214104834Sobrienelse
2215104834Sobrien
221660484Sobrien   # Not a target library, so we set things up to run the test suite.
221760484Sobrien   CHECK=check-cplus-dem
221860484Sobrien
221960484Sobrienfi
222060484Sobrien
222160484Sobrien
222260484Sobrien
2223104834Sobrien
222489857Sobriencase "${host}" in
222591041Sobrien  *-*-cygwin* | *-*-mingw*)
222689857Sobrien    cat >> confdefs.h <<\EOF
222789857Sobrien#define HAVE_SYS_ERRLIST 1
222889857SobrienEOF
222989857Sobrien
223089857Sobrien    cat >> confdefs.h <<\EOF
223189857Sobrien#define HAVE_SYS_NERR 1
223289857SobrienEOF
223389857Sobrien
223489857Sobrien    ;;
223589857Sobrienesac
223689857Sobrien
223760484Sobrienif test -z "${setobjs}"; then
223860484Sobrien  case "${host}" in
223960484Sobrien
224060484Sobrien  *-*-vxworks*)
224160484Sobrien    # Handle VxWorks configuration specially, since on VxWorks the
224260484Sobrien    # libraries are actually on the target board, not in the file
224360484Sobrien    # system.
224460484Sobrien    LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
224560484Sobrien    LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
224660484Sobrien    for f in $funcs; do
224760484Sobrien      case "$f" in
224860484Sobrien	basename | getpagesize | insque | random | strcasecmp)
224960484Sobrien	  ;;
225060484Sobrien	strncasecmp | strdup | vfork | waitpid | vasprintf)
225160484Sobrien	  ;;
225260484Sobrien	*)
225360484Sobrien	  n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
225460484Sobrien	  cat >> confdefs.h <<EOF
225560484Sobrien#define $n 1
225660484SobrienEOF
225760484Sobrien
225860484Sobrien	  ;;
225960484Sobrien      esac
226060484Sobrien    done
226160484Sobrien
226260484Sobrien    # VxWorks doesn't provide any of the variables in $vars, so we
226360484Sobrien    # don't have to check them here.
226460484Sobrien
226560484Sobrien    # Of the functions in $checkfuncs, VxWorks only has strerror.
226660484Sobrien    cat >> confdefs.h <<\EOF
226760484Sobrien#define HAVE_STRERROR 1
226860484SobrienEOF
226960484Sobrien
227060484Sobrien
227160484Sobrien    setobjs=yes
227260484Sobrien    ;;
227360484Sobrien
227460484Sobrien  esac
227560484Sobrienfi
227660484Sobrien
227760484Sobrienif test -z "${setobjs}"; then
227860484Sobrien
227960484Sobrien  case "${host}" in
228060484Sobrien
228160484Sobrien  *-*-cygwin*)
228260484Sobrien    # The Cygwin library actually uses a couple of files from
228360484Sobrien    # libiberty when it is built.  If we are building a native
228460484Sobrien    # Cygwin, and we run the tests, we will appear to have these
228560484Sobrien    # files.  However, when we go on to build winsup, we will wind up
228660484Sobrien    # with a library which does not have the files, since they should
228760484Sobrien    # have come from libiberty.
228860484Sobrien
228960484Sobrien    # We handle this by removing the functions the winsup library
229060484Sobrien    # provides from our shell variables, so that they appear to be
229160484Sobrien    # missing.
229260484Sobrien
229377298Sobrien    # DJ - only if we're *building* cygwin, not just building *with* cygwin
229477298Sobrien  
229577298Sobrien    if test -n "${with_target_subdir}"
229677298Sobrien    then
229777298Sobrien      funcs="`echo $funcs | sed -e 's/random//'`"
229877298Sobrien      LIBOBJS="$LIBOBJS random.o"
229977298Sobrien      vars="`echo $vars | sed -e 's/sys_siglist//'`"
230077298Sobrien      checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
230177298Sobrien    fi
230260484Sobrien    ;;
230360484Sobrien
230460484Sobrien  *-*-mingw32*)
230560484Sobrien    # Under mingw32, sys_nerr and sys_errlist exist, but they are
230660484Sobrien    # macros, so the test below won't find them.
230777298Sobrien    libiberty_cv_var_sys_nerr=yes
230877298Sobrien    libiberty_cv_var_sys_errlist=yes
230960484Sobrien    ;;
231060484Sobrien
231160484Sobrien  *-*-uwin*)
231260484Sobrien    # Under some versions of uwin, vfork is notoriously buggy and the test 
231360484Sobrien    # can hang configure; on other versions, vfork exists just as a stub.
231460484Sobrien    # FIXME: This should be removed once vfork in uwin's runtime is fixed.
231560484Sobrien    ac_cv_func_vfork_works=no
231660484Sobrien    # Under uwin 2.0+, sys_nerr and sys_errlist exist, but they are
231760484Sobrien    # macros (actually, these are imported from a DLL, but the end effect 
231860484Sobrien    # is the same), so the test below won't find them.
231977298Sobrien    libiberty_cv_var_sys_nerr=yes
232077298Sobrien    libiberty_cv_var_sys_errlist=yes
232160484Sobrien    ;;
232260484Sobrien
232389857Sobrien  *-*-*vms*)
232489857Sobrien    # Under VMS, vfork works very different than on Unix. The standard test 
232589857Sobrien    # won't work, and it isn't easily adaptable. It makes more sense to
232689857Sobrien    # just force it.
232789857Sobrien    ac_cv_func_vfork_works=yes
232889857Sobrien    ;;
232989857Sobrien
233060484Sobrien  esac
233160484Sobrien
233260484Sobrien  # We haven't set the list of objects yet.  Use the standard autoconf
233360484Sobrien  # tests.  This will only work if the compiler works.
233460484Sobrien  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2335104834Sobrienecho "configure:2336: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
233660484Sobrien
233760484Sobrienac_ext=c
233860484Sobrien# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
233960484Sobrienac_cpp='$CPP $CPPFLAGS'
234060484Sobrienac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
234160484Sobrienac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
234260484Sobriencross_compiling=$ac_cv_prog_cc_cross
234360484Sobrien
234460484Sobriencat > conftest.$ac_ext << EOF
234560484Sobrien
2346104834Sobrien#line 2347 "configure"
234760484Sobrien#include "confdefs.h"
234860484Sobrien
234960484Sobrienmain(){return(0);}
235060484SobrienEOF
2351104834Sobrienif { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
235260484Sobrien  ac_cv_prog_cc_works=yes
235360484Sobrien  # If we can't run a trivial program, we are probably using a cross compiler.
235460484Sobrien  if (./conftest; exit) 2>/dev/null; then
235560484Sobrien    ac_cv_prog_cc_cross=no
235660484Sobrien  else
235760484Sobrien    ac_cv_prog_cc_cross=yes
235860484Sobrien  fi
235960484Sobrienelse
236060484Sobrien  echo "configure: failed program was:" >&5
236160484Sobrien  cat conftest.$ac_ext >&5
236260484Sobrien  ac_cv_prog_cc_works=no
236360484Sobrienfi
236460484Sobrienrm -fr conftest*
236560484Sobrienac_ext=c
236660484Sobrien# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
236760484Sobrienac_cpp='$CPP $CPPFLAGS'
236860484Sobrienac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
236960484Sobrienac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
237060484Sobriencross_compiling=$ac_cv_prog_cc_cross
237160484Sobrien
237260484Sobrienecho "$ac_t""$ac_cv_prog_cc_works" 1>&6
237360484Sobrienif test $ac_cv_prog_cc_works = no; then
237460484Sobrien  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
237560484Sobrienfi
237660484Sobrienecho $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2377104834Sobrienecho "configure:2378: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
237860484Sobrienecho "$ac_t""$ac_cv_prog_cc_cross" 1>&6
237960484Sobriencross_compiling=$ac_cv_prog_cc_cross
238060484Sobrien
238160484Sobrien  for ac_func in $funcs
238260484Sobriendo
238360484Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
2384104834Sobrienecho "configure:2385: checking for $ac_func" >&5
238560484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
238660484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
238760484Sobrienelse
238860484Sobrien  cat > conftest.$ac_ext <<EOF
2389104834Sobrien#line 2390 "configure"
239060484Sobrien#include "confdefs.h"
239160484Sobrien/* System header to define __stub macros and hopefully few prototypes,
239260484Sobrien    which can conflict with char $ac_func(); below.  */
239360484Sobrien#include <assert.h>
239460484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
239560484Sobrien/* We use char because int might match the return type of a gcc2
239660484Sobrien    builtin and then its argument prototype would still apply.  */
239760484Sobrienchar $ac_func();
239860484Sobrien
239960484Sobrienint main() {
240060484Sobrien
240160484Sobrien/* The GNU C library defines this for functions which it implements
240260484Sobrien    to always fail with ENOSYS.  Some functions are actually named
240360484Sobrien    something starting with __ and the normal name is an alias.  */
240460484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
240560484Sobrienchoke me
240660484Sobrien#else
240760484Sobrien$ac_func();
240860484Sobrien#endif
240960484Sobrien
241060484Sobrien; return 0; }
241160484SobrienEOF
2412104834Sobrienif { (eval echo configure:2413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
241360484Sobrien  rm -rf conftest*
241460484Sobrien  eval "ac_cv_func_$ac_func=yes"
241560484Sobrienelse
241660484Sobrien  echo "configure: failed program was:" >&5
241760484Sobrien  cat conftest.$ac_ext >&5
241860484Sobrien  rm -rf conftest*
241960484Sobrien  eval "ac_cv_func_$ac_func=no"
242060484Sobrienfi
242160484Sobrienrm -f conftest*
242260484Sobrienfi
242360484Sobrien
242460484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
242560484Sobrien  echo "$ac_t""yes" 1>&6
242660484Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
242760484Sobrien  cat >> confdefs.h <<EOF
242860484Sobrien#define $ac_tr_func 1
242960484SobrienEOF
243060484Sobrien 
243160484Sobrienelse
243260484Sobrien  echo "$ac_t""no" 1>&6
243360484SobrienLIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
243460484Sobrienfi
243560484Sobriendone
243660484Sobrien
243760484Sobrien
243889857Sobrien  echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
2439104834Sobrienecho "configure:2440: checking whether alloca needs Cray hooks" >&5
244060484Sobrienif eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
244160484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
244260484Sobrienelse
244360484Sobrien  cat > conftest.$ac_ext <<EOF
2444104834Sobrien#line 2445 "configure"
244560484Sobrien#include "confdefs.h"
244660484Sobrien#if defined(CRAY) && ! defined(CRAY2)
244760484Sobrienwebecray
244860484Sobrien#else
244960484Sobrienwenotbecray
245060484Sobrien#endif
245160484Sobrien
245260484SobrienEOF
245360484Sobrienif (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
245460484Sobrien  egrep "webecray" >/dev/null 2>&1; then
245560484Sobrien  rm -rf conftest*
245660484Sobrien  ac_cv_os_cray=yes
245760484Sobrienelse
245860484Sobrien  rm -rf conftest*
245960484Sobrien  ac_cv_os_cray=no
246060484Sobrienfi
246160484Sobrienrm -f conftest*
246260484Sobrien
246360484Sobrienfi
246460484Sobrien
246560484Sobrienecho "$ac_t""$ac_cv_os_cray" 1>&6
246660484Sobrienif test $ac_cv_os_cray = yes; then
246789857Sobrien  for ac_func in _getb67 GETB67 getb67; do
246889857Sobrien    echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2469104834Sobrienecho "configure:2470: checking for $ac_func" >&5
247060484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
247160484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
247260484Sobrienelse
247360484Sobrien  cat > conftest.$ac_ext <<EOF
2474104834Sobrien#line 2475 "configure"
247560484Sobrien#include "confdefs.h"
247660484Sobrien/* System header to define __stub macros and hopefully few prototypes,
247760484Sobrien    which can conflict with char $ac_func(); below.  */
247860484Sobrien#include <assert.h>
247960484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
248060484Sobrien/* We use char because int might match the return type of a gcc2
248160484Sobrien    builtin and then its argument prototype would still apply.  */
248260484Sobrienchar $ac_func();
248360484Sobrien
248460484Sobrienint main() {
248560484Sobrien
248660484Sobrien/* The GNU C library defines this for functions which it implements
248760484Sobrien    to always fail with ENOSYS.  Some functions are actually named
248860484Sobrien    something starting with __ and the normal name is an alias.  */
248960484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
249060484Sobrienchoke me
249160484Sobrien#else
249260484Sobrien$ac_func();
249360484Sobrien#endif
249460484Sobrien
249560484Sobrien; return 0; }
249660484SobrienEOF
2497104834Sobrienif { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
249860484Sobrien  rm -rf conftest*
249960484Sobrien  eval "ac_cv_func_$ac_func=yes"
250060484Sobrienelse
250160484Sobrien  echo "configure: failed program was:" >&5
250260484Sobrien  cat conftest.$ac_ext >&5
250360484Sobrien  rm -rf conftest*
250460484Sobrien  eval "ac_cv_func_$ac_func=no"
250560484Sobrienfi
250660484Sobrienrm -f conftest*
250760484Sobrienfi
250860484Sobrien
250960484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
251060484Sobrien  echo "$ac_t""yes" 1>&6
251160484Sobrien  cat >> confdefs.h <<EOF
251260484Sobrien#define CRAY_STACKSEG_END $ac_func
251360484SobrienEOF
251460484Sobrien  break
251560484Sobrienelse
251660484Sobrien  echo "$ac_t""no" 1>&6
251760484Sobrienfi
251860484Sobrien
251989857Sobrien  done
252060484Sobrienfi
252160484Sobrien
252260484Sobrienecho $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
2523104834Sobrienecho "configure:2524: checking stack direction for C alloca" >&5
252460484Sobrienif eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
252560484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
252660484Sobrienelse
252760484Sobrien  if test "$cross_compiling" = yes; then
252860484Sobrien  ac_cv_c_stack_direction=0
252960484Sobrienelse
253060484Sobrien  cat > conftest.$ac_ext <<EOF
2531104834Sobrien#line 2532 "configure"
253260484Sobrien#include "confdefs.h"
253360484Sobrienfind_stack_direction ()
253460484Sobrien{
253560484Sobrien  static char *addr = 0;
253660484Sobrien  auto char dummy;
253760484Sobrien  if (addr == 0)
253860484Sobrien    {
253960484Sobrien      addr = &dummy;
254060484Sobrien      return find_stack_direction ();
254160484Sobrien    }
254260484Sobrien  else
254360484Sobrien    return (&dummy > addr) ? 1 : -1;
254460484Sobrien}
254560484Sobrienmain ()
254660484Sobrien{
254760484Sobrien  exit (find_stack_direction() < 0);
254860484Sobrien}
254960484SobrienEOF
2550104834Sobrienif { (eval echo configure:2551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
255160484Sobrienthen
255260484Sobrien  ac_cv_c_stack_direction=1
255360484Sobrienelse
255460484Sobrien  echo "configure: failed program was:" >&5
255560484Sobrien  cat conftest.$ac_ext >&5
255660484Sobrien  rm -fr conftest*
255760484Sobrien  ac_cv_c_stack_direction=-1
255860484Sobrienfi
255960484Sobrienrm -fr conftest*
256060484Sobrienfi
256160484Sobrien
256260484Sobrienfi
256360484Sobrien
256460484Sobrienecho "$ac_t""$ac_cv_c_stack_direction" 1>&6
256560484Sobriencat >> confdefs.h <<EOF
256660484Sobrien#define STACK_DIRECTION $ac_cv_c_stack_direction
256760484SobrienEOF
256860484Sobrien
256960484Sobrien
2570104834Sobrien  ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
257160484Sobrienecho $ac_n "checking for vfork.h""... $ac_c" 1>&6
2572104834Sobrienecho "configure:2573: checking for vfork.h" >&5
257360484Sobrienif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
257460484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
257560484Sobrienelse
257660484Sobrien  cat > conftest.$ac_ext <<EOF
2577104834Sobrien#line 2578 "configure"
257860484Sobrien#include "confdefs.h"
257960484Sobrien#include <vfork.h>
258060484SobrienEOF
258160484Sobrienac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2582104834Sobrien{ (eval echo configure:2583: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
258360484Sobrienac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
258460484Sobrienif test -z "$ac_err"; then
258560484Sobrien  rm -rf conftest*
258660484Sobrien  eval "ac_cv_header_$ac_safe=yes"
258760484Sobrienelse
258860484Sobrien  echo "$ac_err" >&5
258960484Sobrien  echo "configure: failed program was:" >&5
259060484Sobrien  cat conftest.$ac_ext >&5
259160484Sobrien  rm -rf conftest*
259260484Sobrien  eval "ac_cv_header_$ac_safe=no"
259360484Sobrienfi
259460484Sobrienrm -f conftest*
259560484Sobrienfi
259660484Sobrienif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
259760484Sobrien  echo "$ac_t""yes" 1>&6
259860484Sobrien  cat >> confdefs.h <<\EOF
259960484Sobrien#define HAVE_VFORK_H 1
260060484SobrienEOF
260160484Sobrien
260260484Sobrienelse
260360484Sobrien  echo "$ac_t""no" 1>&6
260460484Sobrienfi
260560484Sobrien
260660484Sobrienecho $ac_n "checking for working vfork""... $ac_c" 1>&6
2607104834Sobrienecho "configure:2608: checking for working vfork" >&5
260860484Sobrienif eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
260960484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
261060484Sobrienelse
261160484Sobrien  if test "$cross_compiling" = yes; then
261260484Sobrien  echo $ac_n "checking for vfork""... $ac_c" 1>&6
2613104834Sobrienecho "configure:2614: checking for vfork" >&5
261460484Sobrienif eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
261560484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
261660484Sobrienelse
261760484Sobrien  cat > conftest.$ac_ext <<EOF
2618104834Sobrien#line 2619 "configure"
261960484Sobrien#include "confdefs.h"
262060484Sobrien/* System header to define __stub macros and hopefully few prototypes,
262160484Sobrien    which can conflict with char vfork(); below.  */
262260484Sobrien#include <assert.h>
262360484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
262460484Sobrien/* We use char because int might match the return type of a gcc2
262560484Sobrien    builtin and then its argument prototype would still apply.  */
262660484Sobrienchar vfork();
262760484Sobrien
262860484Sobrienint main() {
262960484Sobrien
263060484Sobrien/* The GNU C library defines this for functions which it implements
263160484Sobrien    to always fail with ENOSYS.  Some functions are actually named
263260484Sobrien    something starting with __ and the normal name is an alias.  */
263360484Sobrien#if defined (__stub_vfork) || defined (__stub___vfork)
263460484Sobrienchoke me
263560484Sobrien#else
263660484Sobrienvfork();
263760484Sobrien#endif
263860484Sobrien
263960484Sobrien; return 0; }
264060484SobrienEOF
2641104834Sobrienif { (eval echo configure:2642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
264260484Sobrien  rm -rf conftest*
264360484Sobrien  eval "ac_cv_func_vfork=yes"
264460484Sobrienelse
264560484Sobrien  echo "configure: failed program was:" >&5
264660484Sobrien  cat conftest.$ac_ext >&5
264760484Sobrien  rm -rf conftest*
264860484Sobrien  eval "ac_cv_func_vfork=no"
264960484Sobrienfi
265060484Sobrienrm -f conftest*
265160484Sobrienfi
265260484Sobrien
265360484Sobrienif eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then
265460484Sobrien  echo "$ac_t""yes" 1>&6
265560484Sobrien  :
265660484Sobrienelse
265760484Sobrien  echo "$ac_t""no" 1>&6
265860484Sobrienfi
265960484Sobrien
266060484Sobrienac_cv_func_vfork_works=$ac_cv_func_vfork
266160484Sobrienelse
266260484Sobrien  cat > conftest.$ac_ext <<EOF
2663104834Sobrien#line 2664 "configure"
266460484Sobrien#include "confdefs.h"
266560484Sobrien/* Thanks to Paul Eggert for this test.  */
266660484Sobrien#include <stdio.h>
266760484Sobrien#include <sys/types.h>
266860484Sobrien#include <sys/stat.h>
266960484Sobrien#ifdef HAVE_UNISTD_H
267060484Sobrien#include <unistd.h>
267160484Sobrien#endif
267260484Sobrien#ifdef HAVE_VFORK_H
267360484Sobrien#include <vfork.h>
267460484Sobrien#endif
267560484Sobrien/* On some sparc systems, changes by the child to local and incoming
267660484Sobrien   argument registers are propagated back to the parent.
267760484Sobrien   The compiler is told about this with #include <vfork.h>,
267860484Sobrien   but some compilers (e.g. gcc -O) don't grok <vfork.h>.
267960484Sobrien   Test for this by using a static variable whose address
268060484Sobrien   is put into a register that is clobbered by the vfork.  */
268160484Sobrienstatic
268260484Sobrien#ifdef __cplusplus
268360484Sobriensparc_address_test (int arg)
268460484Sobrien#else
268560484Sobriensparc_address_test (arg) int arg;
268660484Sobrien#endif
268760484Sobrien{
268860484Sobrien  static pid_t child;
268960484Sobrien  if (!child) {
269060484Sobrien    child = vfork ();
269160484Sobrien    if (child < 0) {
269260484Sobrien      perror ("vfork");
269360484Sobrien      _exit(2);
269460484Sobrien    }
269560484Sobrien    if (!child) {
269660484Sobrien      arg = getpid();
269760484Sobrien      write(-1, "", 0);
269860484Sobrien      _exit (arg);
269960484Sobrien    }
270060484Sobrien  }
270160484Sobrien}
270260484Sobrienmain() {
270360484Sobrien  pid_t parent = getpid ();
270460484Sobrien  pid_t child;
270560484Sobrien
270660484Sobrien  sparc_address_test ();
270760484Sobrien
270860484Sobrien  child = vfork ();
270960484Sobrien
271060484Sobrien  if (child == 0) {
271160484Sobrien    /* Here is another test for sparc vfork register problems.
271260484Sobrien       This test uses lots of local variables, at least
271360484Sobrien       as many local variables as main has allocated so far
271460484Sobrien       including compiler temporaries.  4 locals are enough for
271560484Sobrien       gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
271660484Sobrien       A buggy compiler should reuse the register of parent
271760484Sobrien       for one of the local variables, since it will think that
271860484Sobrien       parent can't possibly be used any more in this routine.
271960484Sobrien       Assigning to the local variable will thus munge parent
272060484Sobrien       in the parent process.  */
272160484Sobrien    pid_t
272260484Sobrien      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
272360484Sobrien      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
272460484Sobrien    /* Convince the compiler that p..p7 are live; otherwise, it might
272560484Sobrien       use the same hardware register for all 8 local variables.  */
272660484Sobrien    if (p != p1 || p != p2 || p != p3 || p != p4
272760484Sobrien	|| p != p5 || p != p6 || p != p7)
272860484Sobrien      _exit(1);
272960484Sobrien
273060484Sobrien    /* On some systems (e.g. IRIX 3.3),
273160484Sobrien       vfork doesn't separate parent from child file descriptors.
273260484Sobrien       If the child closes a descriptor before it execs or exits,
273360484Sobrien       this munges the parent's descriptor as well.
273460484Sobrien       Test for this by closing stdout in the child.  */
273560484Sobrien    _exit(close(fileno(stdout)) != 0);
273660484Sobrien  } else {
273760484Sobrien    int status;
273860484Sobrien    struct stat st;
273960484Sobrien
274060484Sobrien    while (wait(&status) != child)
274160484Sobrien      ;
274260484Sobrien    exit(
274360484Sobrien	 /* Was there some problem with vforking?  */
274460484Sobrien	 child < 0
274560484Sobrien
274660484Sobrien	 /* Did the child fail?  (This shouldn't happen.)  */
274760484Sobrien	 || status
274860484Sobrien
274960484Sobrien	 /* Did the vfork/compiler bug occur?  */
275060484Sobrien	 || parent != getpid()
275160484Sobrien
275260484Sobrien	 /* Did the file descriptor bug occur?  */
275360484Sobrien	 || fstat(fileno(stdout), &st) != 0
275460484Sobrien	 );
275560484Sobrien  }
275660484Sobrien}
275760484SobrienEOF
2758104834Sobrienif { (eval echo configure:2759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
275960484Sobrienthen
276060484Sobrien  ac_cv_func_vfork_works=yes
276160484Sobrienelse
276260484Sobrien  echo "configure: failed program was:" >&5
276360484Sobrien  cat conftest.$ac_ext >&5
276460484Sobrien  rm -fr conftest*
276560484Sobrien  ac_cv_func_vfork_works=no
276660484Sobrienfi
276760484Sobrienrm -fr conftest*
276860484Sobrienfi
276960484Sobrien
277060484Sobrienfi
277160484Sobrien
277260484Sobrienecho "$ac_t""$ac_cv_func_vfork_works" 1>&6
277360484Sobrienif test $ac_cv_func_vfork_works = no; then
277460484Sobrien  cat >> confdefs.h <<\EOF
277560484Sobrien#define vfork fork
277660484SobrienEOF
277760484Sobrien
277860484Sobrienfi
277960484Sobrien
278060484Sobrien  if test $ac_cv_func_vfork_works = no; then
278160484Sobrien    LIBOBJS="$LIBOBJS vfork.o"
278260484Sobrien  fi
278389857Sobrien  # We only need _doprnt if we might use it to implement v*printf.
278489857Sobrien  if test $ac_cv_func_vprintf != yes \
278589857Sobrien     || test $ac_cv_func_vfprintf != yes \
278689857Sobrien     || test $ac_cv_func_vsprintf != yes; then
278789857Sobrien    for ac_func in _doprnt
278889857Sobriendo
278989857Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
2790104834Sobrienecho "configure:2791: checking for $ac_func" >&5
279189857Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
279289857Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
279389857Sobrienelse
279489857Sobrien  cat > conftest.$ac_ext <<EOF
2795104834Sobrien#line 2796 "configure"
279689857Sobrien#include "confdefs.h"
279789857Sobrien/* System header to define __stub macros and hopefully few prototypes,
279889857Sobrien    which can conflict with char $ac_func(); below.  */
279989857Sobrien#include <assert.h>
280089857Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
280189857Sobrien/* We use char because int might match the return type of a gcc2
280289857Sobrien    builtin and then its argument prototype would still apply.  */
280389857Sobrienchar $ac_func();
280489857Sobrien
280589857Sobrienint main() {
280689857Sobrien
280789857Sobrien/* The GNU C library defines this for functions which it implements
280889857Sobrien    to always fail with ENOSYS.  Some functions are actually named
280989857Sobrien    something starting with __ and the normal name is an alias.  */
281089857Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
281189857Sobrienchoke me
281289857Sobrien#else
281389857Sobrien$ac_func();
281489857Sobrien#endif
281589857Sobrien
281689857Sobrien; return 0; }
281789857SobrienEOF
2818104834Sobrienif { (eval echo configure:2819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
281989857Sobrien  rm -rf conftest*
282089857Sobrien  eval "ac_cv_func_$ac_func=yes"
282189857Sobrienelse
282289857Sobrien  echo "configure: failed program was:" >&5
282389857Sobrien  cat conftest.$ac_ext >&5
282489857Sobrien  rm -rf conftest*
282589857Sobrien  eval "ac_cv_func_$ac_func=no"
282689857Sobrienfi
282789857Sobrienrm -f conftest*
282889857Sobrienfi
282989857Sobrien
283089857Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
283189857Sobrien  echo "$ac_t""yes" 1>&6
283289857Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
283389857Sobrien  cat >> confdefs.h <<EOF
283489857Sobrien#define $ac_tr_func 1
283589857SobrienEOF
283689857Sobrien 
283789857Sobrienelse
283889857Sobrien  echo "$ac_t""no" 1>&6
283989857SobrienLIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
284089857Sobrienfi
284189857Sobriendone
284289857Sobrien
284389857Sobrien
284489857Sobrien  else
284589857Sobrien    for ac_func in _doprnt
284689857Sobriendo
284789857Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
2848104834Sobrienecho "configure:2849: checking for $ac_func" >&5
284989857Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
285089857Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
285189857Sobrienelse
285289857Sobrien  cat > conftest.$ac_ext <<EOF
2853104834Sobrien#line 2854 "configure"
285489857Sobrien#include "confdefs.h"
285589857Sobrien/* System header to define __stub macros and hopefully few prototypes,
285689857Sobrien    which can conflict with char $ac_func(); below.  */
285789857Sobrien#include <assert.h>
285889857Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
285989857Sobrien/* We use char because int might match the return type of a gcc2
286089857Sobrien    builtin and then its argument prototype would still apply.  */
286189857Sobrienchar $ac_func();
286289857Sobrien
286389857Sobrienint main() {
286489857Sobrien
286589857Sobrien/* The GNU C library defines this for functions which it implements
286689857Sobrien    to always fail with ENOSYS.  Some functions are actually named
286789857Sobrien    something starting with __ and the normal name is an alias.  */
286889857Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
286989857Sobrienchoke me
287089857Sobrien#else
287189857Sobrien$ac_func();
287289857Sobrien#endif
287389857Sobrien
287489857Sobrien; return 0; }
287589857SobrienEOF
2876104834Sobrienif { (eval echo configure:2877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
287789857Sobrien  rm -rf conftest*
287889857Sobrien  eval "ac_cv_func_$ac_func=yes"
287989857Sobrienelse
288089857Sobrien  echo "configure: failed program was:" >&5
288189857Sobrien  cat conftest.$ac_ext >&5
288289857Sobrien  rm -rf conftest*
288389857Sobrien  eval "ac_cv_func_$ac_func=no"
288489857Sobrienfi
288589857Sobrienrm -f conftest*
288689857Sobrienfi
288789857Sobrien
288889857Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
288989857Sobrien  echo "$ac_t""yes" 1>&6
289089857Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
289189857Sobrien  cat >> confdefs.h <<EOF
289289857Sobrien#define $ac_tr_func 1
289389857SobrienEOF
289489857Sobrien 
289589857Sobrienelse
289689857Sobrien  echo "$ac_t""no" 1>&6
289789857Sobrienfi
289889857Sobriendone
289989857Sobrien
290089857Sobrien  fi
290189857Sobrien
290260484Sobrien  for v in $vars; do
290360484Sobrien    echo $ac_n "checking for $v""... $ac_c" 1>&6
2904104834Sobrienecho "configure:2905: checking for $v" >&5
290560484Sobrien    if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then
290660484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
290760484Sobrienelse
290860484Sobrien  cat > conftest.$ac_ext <<EOF
2909104834Sobrien#line 2910 "configure"
291060484Sobrien#include "confdefs.h"
291160484Sobrienint *p;
291260484Sobrienint main() {
2913104834Sobrienextern int $v []; p = $v;
291460484Sobrien; return 0; }
291560484SobrienEOF
2916104834Sobrienif { (eval echo configure:2917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
291760484Sobrien  rm -rf conftest*
291860484Sobrien  eval "libiberty_cv_var_$v=yes"
291960484Sobrienelse
292060484Sobrien  echo "configure: failed program was:" >&5
292160484Sobrien  cat conftest.$ac_ext >&5
292260484Sobrien  rm -rf conftest*
292360484Sobrien  eval "libiberty_cv_var_$v=no"
292460484Sobrienfi
292560484Sobrienrm -f conftest*
292660484Sobrienfi
292760484Sobrien
292860484Sobrien    if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
292960484Sobrien      echo "$ac_t""yes" 1>&6
293060484Sobrien      n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
293160484Sobrien      cat >> confdefs.h <<EOF
293260484Sobrien#define $n 1
293360484SobrienEOF
293460484Sobrien
293560484Sobrien    else
293660484Sobrien      echo "$ac_t""no" 1>&6
293760484Sobrien    fi
293860484Sobrien  done
293960484Sobrien  for ac_func in $checkfuncs
294060484Sobriendo
294160484Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
2942104834Sobrienecho "configure:2943: checking for $ac_func" >&5
294360484Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
294460484Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
294560484Sobrienelse
294660484Sobrien  cat > conftest.$ac_ext <<EOF
2947104834Sobrien#line 2948 "configure"
294860484Sobrien#include "confdefs.h"
294960484Sobrien/* System header to define __stub macros and hopefully few prototypes,
295060484Sobrien    which can conflict with char $ac_func(); below.  */
295160484Sobrien#include <assert.h>
295260484Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
295360484Sobrien/* We use char because int might match the return type of a gcc2
295460484Sobrien    builtin and then its argument prototype would still apply.  */
295560484Sobrienchar $ac_func();
295660484Sobrien
295760484Sobrienint main() {
295860484Sobrien
295960484Sobrien/* The GNU C library defines this for functions which it implements
296060484Sobrien    to always fail with ENOSYS.  Some functions are actually named
296160484Sobrien    something starting with __ and the normal name is an alias.  */
296260484Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
296360484Sobrienchoke me
296460484Sobrien#else
296560484Sobrien$ac_func();
296660484Sobrien#endif
296760484Sobrien
296860484Sobrien; return 0; }
296960484SobrienEOF
2970104834Sobrienif { (eval echo configure:2971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
297160484Sobrien  rm -rf conftest*
297260484Sobrien  eval "ac_cv_func_$ac_func=yes"
297360484Sobrienelse
297460484Sobrien  echo "configure: failed program was:" >&5
297560484Sobrien  cat conftest.$ac_ext >&5
297660484Sobrien  rm -rf conftest*
297760484Sobrien  eval "ac_cv_func_$ac_func=no"
297860484Sobrienfi
297960484Sobrienrm -f conftest*
298060484Sobrienfi
298160484Sobrien
298260484Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
298360484Sobrien  echo "$ac_t""yes" 1>&6
298460484Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
298560484Sobrien  cat >> confdefs.h <<EOF
298660484Sobrien#define $ac_tr_func 1
298760484SobrienEOF
298860484Sobrien 
298960484Sobrienelse
299060484Sobrien  echo "$ac_t""no" 1>&6
299160484Sobrienfi
299260484Sobriendone
299360484Sobrien
299460484Sobrienfi
299560484Sobrien
299689857Sobrienfor ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
299777298Sobriendo
299877298Sobrienac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
299977298Sobrienecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3000104834Sobrienecho "configure:3001: checking for $ac_hdr" >&5
300177298Sobrienif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
300277298Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
300377298Sobrienelse
300477298Sobrien  cat > conftest.$ac_ext <<EOF
3005104834Sobrien#line 3006 "configure"
300677298Sobrien#include "confdefs.h"
300777298Sobrien#include <$ac_hdr>
300877298SobrienEOF
300977298Sobrienac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3010104834Sobrien{ (eval echo configure:3011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
301177298Sobrienac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
301277298Sobrienif test -z "$ac_err"; then
301377298Sobrien  rm -rf conftest*
301477298Sobrien  eval "ac_cv_header_$ac_safe=yes"
301577298Sobrienelse
301677298Sobrien  echo "$ac_err" >&5
301777298Sobrien  echo "configure: failed program was:" >&5
301877298Sobrien  cat conftest.$ac_ext >&5
301977298Sobrien  rm -rf conftest*
302077298Sobrien  eval "ac_cv_header_$ac_safe=no"
302177298Sobrienfi
302277298Sobrienrm -f conftest*
302377298Sobrienfi
302477298Sobrienif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
302577298Sobrien  echo "$ac_t""yes" 1>&6
302677298Sobrien    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
302777298Sobrien  cat >> confdefs.h <<EOF
302877298Sobrien#define $ac_tr_hdr 1
302977298SobrienEOF
303077298Sobrien 
303177298Sobrienelse
303277298Sobrien  echo "$ac_t""no" 1>&6
303377298Sobrienfi
303477298Sobriendone
303577298Sobrien
303677298Sobrienfor ac_func in getpagesize
303777298Sobriendo
303877298Sobrienecho $ac_n "checking for $ac_func""... $ac_c" 1>&6
3039104834Sobrienecho "configure:3040: checking for $ac_func" >&5
304077298Sobrienif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
304177298Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
304277298Sobrienelse
304377298Sobrien  cat > conftest.$ac_ext <<EOF
3044104834Sobrien#line 3045 "configure"
304577298Sobrien#include "confdefs.h"
304677298Sobrien/* System header to define __stub macros and hopefully few prototypes,
304777298Sobrien    which can conflict with char $ac_func(); below.  */
304877298Sobrien#include <assert.h>
304977298Sobrien/* Override any gcc2 internal prototype to avoid an error.  */
305077298Sobrien/* We use char because int might match the return type of a gcc2
305177298Sobrien    builtin and then its argument prototype would still apply.  */
305277298Sobrienchar $ac_func();
305377298Sobrien
305477298Sobrienint main() {
305577298Sobrien
305677298Sobrien/* The GNU C library defines this for functions which it implements
305777298Sobrien    to always fail with ENOSYS.  Some functions are actually named
305877298Sobrien    something starting with __ and the normal name is an alias.  */
305977298Sobrien#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
306077298Sobrienchoke me
306177298Sobrien#else
306277298Sobrien$ac_func();
306377298Sobrien#endif
306477298Sobrien
306577298Sobrien; return 0; }
306677298SobrienEOF
3067104834Sobrienif { (eval echo configure:3068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
306877298Sobrien  rm -rf conftest*
306977298Sobrien  eval "ac_cv_func_$ac_func=yes"
307077298Sobrienelse
307177298Sobrien  echo "configure: failed program was:" >&5
307277298Sobrien  cat conftest.$ac_ext >&5
307377298Sobrien  rm -rf conftest*
307477298Sobrien  eval "ac_cv_func_$ac_func=no"
307577298Sobrienfi
307677298Sobrienrm -f conftest*
307777298Sobrienfi
307877298Sobrien
307977298Sobrienif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
308077298Sobrien  echo "$ac_t""yes" 1>&6
308177298Sobrien    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
308277298Sobrien  cat >> confdefs.h <<EOF
308377298Sobrien#define $ac_tr_func 1
308477298SobrienEOF
308577298Sobrien 
308677298Sobrienelse
308777298Sobrien  echo "$ac_t""no" 1>&6
308877298Sobrienfi
308977298Sobriendone
309077298Sobrien
309177298Sobrienecho $ac_n "checking for working mmap""... $ac_c" 1>&6
3092104834Sobrienecho "configure:3093: checking for working mmap" >&5
309377298Sobrienif eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
309477298Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
309577298Sobrienelse
309677298Sobrien  if test "$cross_compiling" = yes; then
309777298Sobrien  ac_cv_func_mmap_fixed_mapped=no
309877298Sobrienelse
309977298Sobrien  cat > conftest.$ac_ext <<EOF
3100104834Sobrien#line 3101 "configure"
310177298Sobrien#include "confdefs.h"
310277298Sobrien
310377298Sobrien/* Thanks to Mike Haertel and Jim Avera for this test.
310477298Sobrien   Here is a matrix of mmap possibilities:
310577298Sobrien	mmap private not fixed
310677298Sobrien	mmap private fixed at somewhere currently unmapped
310777298Sobrien	mmap private fixed at somewhere already mapped
310877298Sobrien	mmap shared not fixed
310977298Sobrien	mmap shared fixed at somewhere currently unmapped
311077298Sobrien	mmap shared fixed at somewhere already mapped
311177298Sobrien   For private mappings, we should verify that changes cannot be read()
311277298Sobrien   back from the file, nor mmap's back from the file at a different
311377298Sobrien   address.  (There have been systems where private was not correctly
311477298Sobrien   implemented like the infamous i386 svr4.0, and systems where the
311577298Sobrien   VM page cache was not coherent with the filesystem buffer cache
311677298Sobrien   like early versions of FreeBSD and possibly contemporary NetBSD.)
311777298Sobrien   For shared mappings, we should conversely verify that changes get
311877298Sobrien   propogated back to all the places they're supposed to be.
311977298Sobrien
312077298Sobrien   Grep wants private fixed already mapped.
312177298Sobrien   The main things grep needs to know about mmap are:
312277298Sobrien   * does it exist and is it safe to write into the mmap'd area
312377298Sobrien   * how to use it (BSD variants)  */
312477298Sobrien#include <sys/types.h>
312577298Sobrien#include <fcntl.h>
312677298Sobrien#include <sys/mman.h>
312777298Sobrien
312889857Sobrien#if HAVE_SYS_TYPES_H
312989857Sobrien# include <sys/types.h>
313089857Sobrien#endif
313189857Sobrien
313289857Sobrien#if HAVE_STDLIB_H
313389857Sobrien# include <stdlib.h>
313489857Sobrien#endif
313589857Sobrien
313689857Sobrien#if HAVE_SYS_STAT_H
313789857Sobrien# include <sys/stat.h>
313889857Sobrien#endif
313989857Sobrien
314089857Sobrien#if HAVE_UNISTD_H
314189857Sobrien# include <unistd.h>
314289857Sobrien#endif
314389857Sobrien
314477298Sobrien/* This mess was copied from the GNU getpagesize.h.  */
314577298Sobrien#ifndef HAVE_GETPAGESIZE
314677298Sobrien
314777298Sobrien/* Assume that all systems that can run configure have sys/param.h.  */
314877298Sobrien# ifndef HAVE_SYS_PARAM_H
314977298Sobrien#  define HAVE_SYS_PARAM_H 1
315077298Sobrien# endif
315177298Sobrien
315277298Sobrien# ifdef _SC_PAGESIZE
315377298Sobrien#  define getpagesize() sysconf(_SC_PAGESIZE)
315477298Sobrien# else /* no _SC_PAGESIZE */
315577298Sobrien#  ifdef HAVE_SYS_PARAM_H
315677298Sobrien#   include <sys/param.h>
315777298Sobrien#   ifdef EXEC_PAGESIZE
315877298Sobrien#    define getpagesize() EXEC_PAGESIZE
315977298Sobrien#   else /* no EXEC_PAGESIZE */
316077298Sobrien#    ifdef NBPG
316177298Sobrien#     define getpagesize() NBPG * CLSIZE
316277298Sobrien#     ifndef CLSIZE
316377298Sobrien#      define CLSIZE 1
316477298Sobrien#     endif /* no CLSIZE */
316577298Sobrien#    else /* no NBPG */
316677298Sobrien#     ifdef NBPC
316777298Sobrien#      define getpagesize() NBPC
316877298Sobrien#     else /* no NBPC */
316977298Sobrien#      ifdef PAGESIZE
317077298Sobrien#       define getpagesize() PAGESIZE
317177298Sobrien#      endif /* PAGESIZE */
317277298Sobrien#     endif /* no NBPC */
317377298Sobrien#    endif /* no NBPG */
317477298Sobrien#   endif /* no EXEC_PAGESIZE */
317577298Sobrien#  else /* no HAVE_SYS_PARAM_H */
317677298Sobrien#   define getpagesize() 8192	/* punt totally */
317777298Sobrien#  endif /* no HAVE_SYS_PARAM_H */
317877298Sobrien# endif /* no _SC_PAGESIZE */
317977298Sobrien
318077298Sobrien#endif /* no HAVE_GETPAGESIZE */
318177298Sobrien
318277298Sobrien#ifdef __cplusplus
318377298Sobrienextern "C" { void *malloc(unsigned); }
318477298Sobrien#else
318577298Sobrienchar *malloc();
318677298Sobrien#endif
318777298Sobrien
318877298Sobrienint
318977298Sobrienmain()
319077298Sobrien{
319177298Sobrien	char *data, *data2, *data3;
319277298Sobrien	int i, pagesize;
319377298Sobrien	int fd;
319477298Sobrien
319577298Sobrien	pagesize = getpagesize();
319677298Sobrien
319777298Sobrien	/*
319877298Sobrien	 * First, make a file with some known garbage in it.
319977298Sobrien	 */
320077298Sobrien	data = malloc(pagesize);
320177298Sobrien	if (!data)
320277298Sobrien		exit(1);
320377298Sobrien	for (i = 0; i < pagesize; ++i)
320477298Sobrien		*(data + i) = rand();
320577298Sobrien	umask(0);
320677298Sobrien	fd = creat("conftestmmap", 0600);
320777298Sobrien	if (fd < 0)
320877298Sobrien		exit(1);
320977298Sobrien	if (write(fd, data, pagesize) != pagesize)
321077298Sobrien		exit(1);
321177298Sobrien	close(fd);
321277298Sobrien
321377298Sobrien	/*
321477298Sobrien	 * Next, try to mmap the file at a fixed address which
321577298Sobrien	 * already has something else allocated at it.  If we can,
321677298Sobrien	 * also make sure that we see the same garbage.
321777298Sobrien	 */
321877298Sobrien	fd = open("conftestmmap", O_RDWR);
321977298Sobrien	if (fd < 0)
322077298Sobrien		exit(1);
322177298Sobrien	data2 = malloc(2 * pagesize);
322277298Sobrien	if (!data2)
322377298Sobrien		exit(1);
322477298Sobrien	data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
322577298Sobrien	if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE,
322677298Sobrien	    MAP_PRIVATE | MAP_FIXED, fd, 0L))
322777298Sobrien		exit(1);
322877298Sobrien	for (i = 0; i < pagesize; ++i)
322977298Sobrien		if (*(data + i) != *(data2 + i))
323077298Sobrien			exit(1);
323177298Sobrien
323277298Sobrien	/*
323377298Sobrien	 * Finally, make sure that changes to the mapped area
323477298Sobrien	 * do not percolate back to the file as seen by read().
323577298Sobrien	 * (This is a bug on some variants of i386 svr4.0.)
323677298Sobrien	 */
323777298Sobrien	for (i = 0; i < pagesize; ++i)
323877298Sobrien		*(data2 + i) = *(data2 + i) + 1;
323977298Sobrien	data3 = malloc(pagesize);
324077298Sobrien	if (!data3)
324177298Sobrien		exit(1);
324277298Sobrien	if (read(fd, data3, pagesize) != pagesize)
324377298Sobrien		exit(1);
324477298Sobrien	for (i = 0; i < pagesize; ++i)
324577298Sobrien		if (*(data + i) != *(data3 + i))
324677298Sobrien			exit(1);
324777298Sobrien	close(fd);
324877298Sobrien	unlink("conftestmmap");
324977298Sobrien	exit(0);
325077298Sobrien}
325177298Sobrien
325277298SobrienEOF
3253104834Sobrienif { (eval echo configure:3254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
325477298Sobrienthen
325577298Sobrien  ac_cv_func_mmap_fixed_mapped=yes
325677298Sobrienelse
325777298Sobrien  echo "configure: failed program was:" >&5
325877298Sobrien  cat conftest.$ac_ext >&5
325977298Sobrien  rm -fr conftest*
326077298Sobrien  ac_cv_func_mmap_fixed_mapped=no
326177298Sobrienfi
326277298Sobrienrm -fr conftest*
326377298Sobrienfi
326477298Sobrien
326577298Sobrienfi
326677298Sobrien
326777298Sobrienecho "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6
326877298Sobrienif test $ac_cv_func_mmap_fixed_mapped = yes; then
326977298Sobrien  cat >> confdefs.h <<\EOF
327077298Sobrien#define HAVE_MMAP 1
327177298SobrienEOF
327277298Sobrien
327377298Sobrienfi
327477298Sobrien
327577298Sobrien
327677298Sobrienecho $ac_n "checking for working strncmp""... $ac_c" 1>&6
3277104834Sobrienecho "configure:3278: checking for working strncmp" >&5
327877298Sobrienif eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then
327977298Sobrien  echo $ac_n "(cached) $ac_c" 1>&6
328077298Sobrienelse
328177298Sobrien  if test "$cross_compiling" = yes; then
328277298Sobrien  ac_cv_func_strncmp_works=no
328377298Sobrienelse
328477298Sobrien  cat > conftest.$ac_ext <<EOF
3285104834Sobrien#line 3286 "configure"
328677298Sobrien#include "confdefs.h"
328777298Sobrien
328877298Sobrien/* Test by Jim Wilson and Kaveh Ghazi.
328977298Sobrien   Check whether strncmp reads past the end of its string parameters. */
329077298Sobrien#include <sys/types.h>
329177298Sobrien
329277298Sobrien#ifdef HAVE_FCNTL_H
329377298Sobrien#include <fcntl.h>
329477298Sobrien#endif
329577298Sobrien
329677298Sobrien#ifdef HAVE_SYS_MMAN_H
329777298Sobrien#include <sys/mman.h>
329877298Sobrien#endif
329977298Sobrien
330077298Sobrien#ifndef MAP_ANON
330177298Sobrien#ifdef MAP_ANONYMOUS
330277298Sobrien#define MAP_ANON MAP_ANONYMOUS
330377298Sobrien#else
330477298Sobrien#define MAP_ANON MAP_FILE
330577298Sobrien#endif
330677298Sobrien#endif
330777298Sobrien
330877298Sobrien#ifndef MAP_FILE
330977298Sobrien#define MAP_FILE 0
331077298Sobrien#endif
331177298Sobrien#ifndef O_RDONLY
331277298Sobrien#define O_RDONLY 0
331377298Sobrien#endif
331477298Sobrien
331577298Sobrien#define MAP_LEN 0x10000
331677298Sobrien
331777298Sobrienmain ()
331877298Sobrien{
331977298Sobrien#if defined(HAVE_MMAP) || defined(HAVE_MMAP_ANYWHERE)
332077298Sobrien  char *p;
332177298Sobrien  int dev_zero;
332277298Sobrien
332377298Sobrien  dev_zero = open ("/dev/zero", O_RDONLY);
332477298Sobrien  if (dev_zero < 0)
332577298Sobrien    exit (1);
332677298Sobrien  
332777298Sobrien  p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
332877298Sobrien		     MAP_ANON|MAP_PRIVATE, dev_zero, 0);
332977298Sobrien  if (p == (char *)-1)
333089857Sobrien    p = (char *) mmap (0, MAP_LEN, PROT_READ|PROT_WRITE,
333189857Sobrien		       MAP_ANON|MAP_PRIVATE, -1, 0);
333289857Sobrien  if (p == (char *)-1)
333377298Sobrien    exit (2);
333477298Sobrien  else
333577298Sobrien    {
333677298Sobrien      char *string = "__si_type_info";
333777298Sobrien      char *q = (char *) p + MAP_LEN - strlen (string) - 2;
333877298Sobrien      char *r = (char *) p + 0xe;
333977298Sobrien
334077298Sobrien      strcpy (q, string);
334177298Sobrien      strcpy (r, string);
334277298Sobrien      strncmp (r, q, 14);
334377298Sobrien    }
334477298Sobrien#endif /* HAVE_MMAP || HAVE_MMAP_ANYWHERE */
334577298Sobrien  exit (0);
334677298Sobrien}
334777298Sobrien
334877298SobrienEOF
3349104834Sobrienif { (eval echo configure:3350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
335077298Sobrienthen
335177298Sobrien  ac_cv_func_strncmp_works=yes
335277298Sobrienelse
335377298Sobrien  echo "configure: failed program was:" >&5
335477298Sobrien  cat conftest.$ac_ext >&5
335577298Sobrien  rm -fr conftest*
335677298Sobrien  ac_cv_func_strncmp_works=no
335777298Sobrienfi
335877298Sobrienrm -fr conftest*
335977298Sobrienfi
336077298Sobrien
336177298Sobrienrm -f core core.* *.core
336277298Sobrienfi
336377298Sobrien
336477298Sobrienecho "$ac_t""$ac_cv_func_strncmp_works" 1>&6
336577298Sobrienif test $ac_cv_func_strncmp_works = no ; then
336677298Sobrien  LIBOBJS="$LIBOBJS strncmp.o"
336777298Sobrienfi
336877298Sobrien
336977298Sobrien
337060484Sobrien# Install a library built with a cross compiler in $(tooldir) rather
337160484Sobrien# than $(libdir).
337260484Sobrienif test -z "${with_cross_host}"; then
337360484Sobrien  INSTALL_DEST=libdir
337460484Sobrienelse
337560484Sobrien  INSTALL_DEST=tooldir
337660484Sobrienfi
337760484Sobrien
337860484Sobrien
337960484Sobrien# We need multilib support, but only if configuring for the target.
338060484Sobrientrap '' 1 2 15
338160484Sobriencat > confcache <<\EOF
338260484Sobrien# This file is a shell script that caches the results of configure
338360484Sobrien# tests run on this system so they can be shared between configure
338460484Sobrien# scripts and configure runs.  It is not useful on other systems.
338560484Sobrien# If it contains results you don't want to keep, you may remove or edit it.
338660484Sobrien#
338760484Sobrien# By default, configure uses ./config.cache as the cache file,
338860484Sobrien# creating it if it does not exist already.  You can give configure
338960484Sobrien# the --cache-file=FILE option to use a different cache file; that is
339060484Sobrien# what configure does when it calls configure scripts in
339160484Sobrien# subdirectories, so they share the cache.
339260484Sobrien# Giving --cache-file=/dev/null disables caching, for debugging configure.
339360484Sobrien# config.status only pays attention to the cache file if you give it the
339460484Sobrien# --recheck option to rerun configure.
339560484Sobrien#
339660484SobrienEOF
339760484Sobrien# The following way of writing the cache mishandles newlines in values,
339860484Sobrien# but we know of no workaround that is simple, portable, and efficient.
339960484Sobrien# So, don't put newlines in cache variables' values.
340060484Sobrien# Ultrix sh set writes to stderr and can't be redirected directly,
340160484Sobrien# and sets the high bit in the cache file unless we assign to the vars.
340260484Sobrien(set) 2>&1 |
340360484Sobrien  case `(ac_space=' '; set | grep ac_space) 2>&1` in
340460484Sobrien  *ac_space=\ *)
340560484Sobrien    # `set' does not quote correctly, so add quotes (double-quote substitution
340660484Sobrien    # turns \\\\ into \\, and sed turns \\ into \).
340760484Sobrien    sed -n \
340860484Sobrien      -e "s/'/'\\\\''/g" \
340960484Sobrien      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
341060484Sobrien    ;;
341160484Sobrien  *)
341260484Sobrien    # `set' quotes correctly as required by POSIX, so do not add quotes.
341360484Sobrien    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
341460484Sobrien    ;;
341560484Sobrien  esac >> confcache
341660484Sobrienif cmp -s $cache_file confcache; then
341760484Sobrien  :
341860484Sobrienelse
341960484Sobrien  if test -w $cache_file; then
342060484Sobrien    echo "updating cache $cache_file"
342160484Sobrien    cat confcache > $cache_file
342260484Sobrien  else
342360484Sobrien    echo "not updating unwritable cache $cache_file"
342460484Sobrien  fi
342560484Sobrienfi
342660484Sobrienrm -f confcache
342760484Sobrien
342860484Sobrientrap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
342960484Sobrien
343060484Sobrientest "x$prefix" = xNONE && prefix=$ac_default_prefix
343160484Sobrien# Let make expand exec_prefix.
343260484Sobrientest "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
343360484Sobrien
343460484Sobrien# Any assignment to VPATH causes Sun make to only execute
343560484Sobrien# the first set of double-colon rules, so remove it if not needed.
343660484Sobrien# If there is a colon in the path, we need to keep it.
343760484Sobrienif test "x$srcdir" = x.; then
343860484Sobrien  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
343960484Sobrienfi
344060484Sobrien
344160484Sobrientrap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
344260484Sobrien
344360484SobrienDEFS=-DHAVE_CONFIG_H
344460484Sobrien
344560484Sobrien# Without the "./", some shells look in PATH for config.status.
344660484Sobrien: ${CONFIG_STATUS=./config.status}
344760484Sobrien
344860484Sobrienecho creating $CONFIG_STATUS
344960484Sobrienrm -f $CONFIG_STATUS
345060484Sobriencat > $CONFIG_STATUS <<EOF
345160484Sobrien#! /bin/sh
345260484Sobrien# Generated automatically by configure.
345360484Sobrien# Run this file to recreate the current configuration.
345460484Sobrien# This directory was configured as follows,
345560484Sobrien# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
345660484Sobrien#
345760484Sobrien# $0 $ac_configure_args
345860484Sobrien#
345960484Sobrien# Compiler output produced by configure, useful for debugging
346060484Sobrien# configure, is in ./config.log if it exists.
346160484Sobrien
346260484Sobrienac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
346360484Sobrienfor ac_option
346460484Sobriendo
346560484Sobrien  case "\$ac_option" in
346660484Sobrien  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
346760484Sobrien    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
346860484Sobrien    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
346960484Sobrien  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
347060484Sobrien    echo "$CONFIG_STATUS generated by autoconf version 2.13"
347160484Sobrien    exit 0 ;;
347260484Sobrien  -help | --help | --hel | --he | --h)
347360484Sobrien    echo "\$ac_cs_usage"; exit 0 ;;
347460484Sobrien  *) echo "\$ac_cs_usage"; exit 1 ;;
347560484Sobrien  esac
347660484Sobriendone
347760484Sobrien
347860484Sobrienac_given_srcdir=$srcdir
347960484Sobrienac_given_INSTALL="$INSTALL"
348060484Sobrien
348160484Sobrientrap 'rm -fr `echo "Makefile testsuite/Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
348260484SobrienEOF
348360484Sobriencat >> $CONFIG_STATUS <<EOF
348460484Sobrien
348560484Sobrien# Protect against being on the right side of a sed subst in config.status.
348660484Sobriensed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
348760484Sobrien s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
348860484Sobrien$ac_vpsub
348960484Sobrien$extrasub
349060484Sobriens%@SHELL@%$SHELL%g
349160484Sobriens%@CFLAGS@%$CFLAGS%g
349260484Sobriens%@CPPFLAGS@%$CPPFLAGS%g
349360484Sobriens%@CXXFLAGS@%$CXXFLAGS%g
349460484Sobriens%@FFLAGS@%$FFLAGS%g
349560484Sobriens%@DEFS@%$DEFS%g
349660484Sobriens%@LDFLAGS@%$LDFLAGS%g
349760484Sobriens%@LIBS@%$LIBS%g
349860484Sobriens%@exec_prefix@%$exec_prefix%g
349960484Sobriens%@prefix@%$prefix%g
350060484Sobriens%@program_transform_name@%$program_transform_name%g
350160484Sobriens%@bindir@%$bindir%g
350260484Sobriens%@sbindir@%$sbindir%g
350360484Sobriens%@libexecdir@%$libexecdir%g
350460484Sobriens%@datadir@%$datadir%g
350560484Sobriens%@sysconfdir@%$sysconfdir%g
350660484Sobriens%@sharedstatedir@%$sharedstatedir%g
350760484Sobriens%@localstatedir@%$localstatedir%g
350860484Sobriens%@libdir@%$libdir%g
350960484Sobriens%@includedir@%$includedir%g
351060484Sobriens%@oldincludedir@%$oldincludedir%g
351160484Sobriens%@infodir@%$infodir%g
351260484Sobriens%@mandir@%$mandir%g
351389857Sobriens%@MAINT@%$MAINT%g
351489857Sobriens%@NOTMAINT@%$NOTMAINT%g
351589857Sobriens%@MAKEINFO@%$MAKEINFO%g
351689857Sobriens%@BUILD_INFO@%$BUILD_INFO%g
351789857Sobriens%@PERL@%$PERL%g
351889857Sobriens%@HAVE_PERL@%$HAVE_PERL%g
351960484Sobriens%@host@%$host%g
352060484Sobriens%@host_alias@%$host_alias%g
352160484Sobriens%@host_cpu@%$host_cpu%g
352260484Sobriens%@host_vendor@%$host_vendor%g
352360484Sobriens%@host_os@%$host_os%g
352460484Sobriens%@build@%$build%g
352560484Sobriens%@build_alias@%$build_alias%g
352660484Sobriens%@build_cpu@%$build_cpu%g
352760484Sobriens%@build_vendor@%$build_vendor%g
352860484Sobriens%@build_os@%$build_os%g
352960484Sobriens%@AR@%$AR%g
353060484Sobriens%@RANLIB@%$RANLIB%g
353177298Sobriens%@CC@%$CC%g
353260484Sobriens%@ac_libiberty_warn_cflags@%$ac_libiberty_warn_cflags%g
3533104834Sobriens%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
3534104834Sobriens%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
353560484Sobriens%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
353660484Sobriens%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
353760484Sobriens%@INSTALL_DATA@%$INSTALL_DATA%g
353860484Sobrien/@host_makefile_frag@/r $host_makefile_frag
353960484Sobriens%@host_makefile_frag@%%g
354060484Sobriens%@CPP@%$CPP%g
354160484Sobriens%@CHECK@%$CHECK%g
3542104834Sobriens%@target_header_dir@%$target_header_dir%g
354360484Sobriens%@LIBOBJS@%$LIBOBJS%g
354460484Sobriens%@INSTALL_DEST@%$INSTALL_DEST%g
354560484Sobrien
354660484SobrienCEOF
354760484SobrienEOF
354860484Sobrien
354960484Sobriencat >> $CONFIG_STATUS <<\EOF
355060484Sobrien
355160484Sobrien# Split the substitutions into bite-sized pieces for seds with
355260484Sobrien# small command number limits, like on Digital OSF/1 and HP-UX.
355360484Sobrienac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
355460484Sobrienac_file=1 # Number of current file.
355560484Sobrienac_beg=1 # First line for current file.
355660484Sobrienac_end=$ac_max_sed_cmds # Line after last line for current file.
355760484Sobrienac_more_lines=:
355860484Sobrienac_sed_cmds=""
355960484Sobrienwhile $ac_more_lines; do
356060484Sobrien  if test $ac_beg -gt 1; then
356160484Sobrien    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
356260484Sobrien  else
356360484Sobrien    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
356460484Sobrien  fi
356560484Sobrien  if test ! -s conftest.s$ac_file; then
356660484Sobrien    ac_more_lines=false
356760484Sobrien    rm -f conftest.s$ac_file
356860484Sobrien  else
356960484Sobrien    if test -z "$ac_sed_cmds"; then
357060484Sobrien      ac_sed_cmds="sed -f conftest.s$ac_file"
357160484Sobrien    else
357260484Sobrien      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
357360484Sobrien    fi
357460484Sobrien    ac_file=`expr $ac_file + 1`
357560484Sobrien    ac_beg=$ac_end
357660484Sobrien    ac_end=`expr $ac_end + $ac_max_sed_cmds`
357760484Sobrien  fi
357860484Sobriendone
357960484Sobrienif test -z "$ac_sed_cmds"; then
358060484Sobrien  ac_sed_cmds=cat
358160484Sobrienfi
358260484SobrienEOF
358360484Sobrien
358460484Sobriencat >> $CONFIG_STATUS <<EOF
358560484Sobrien
358660484SobrienCONFIG_FILES=\${CONFIG_FILES-"Makefile testsuite/Makefile"}
358760484SobrienEOF
358860484Sobriencat >> $CONFIG_STATUS <<\EOF
358960484Sobrienfor ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
359060484Sobrien  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
359160484Sobrien  case "$ac_file" in
359260484Sobrien  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
359360484Sobrien       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
359460484Sobrien  *) ac_file_in="${ac_file}.in" ;;
359560484Sobrien  esac
359660484Sobrien
359760484Sobrien  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
359860484Sobrien
359960484Sobrien  # Remove last slash and all that follows it.  Not all systems have dirname.
360060484Sobrien  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
360160484Sobrien  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
360260484Sobrien    # The file is in a subdirectory.
360360484Sobrien    test ! -d "$ac_dir" && mkdir "$ac_dir"
360460484Sobrien    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
360560484Sobrien    # A "../" for each directory in $ac_dir_suffix.
360660484Sobrien    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
360760484Sobrien  else
360860484Sobrien    ac_dir_suffix= ac_dots=
360960484Sobrien  fi
361060484Sobrien
361160484Sobrien  case "$ac_given_srcdir" in
361260484Sobrien  .)  srcdir=.
361360484Sobrien      if test -z "$ac_dots"; then top_srcdir=.
361460484Sobrien      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
361560484Sobrien  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
361660484Sobrien  *) # Relative path.
361760484Sobrien    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
361860484Sobrien    top_srcdir="$ac_dots$ac_given_srcdir" ;;
361960484Sobrien  esac
362060484Sobrien
362160484Sobrien  case "$ac_given_INSTALL" in
362260484Sobrien  [/$]*) INSTALL="$ac_given_INSTALL" ;;
362360484Sobrien  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
362460484Sobrien  esac
362560484Sobrien
362660484Sobrien  echo creating "$ac_file"
362760484Sobrien  rm -f "$ac_file"
362860484Sobrien  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
362960484Sobrien  case "$ac_file" in
363060484Sobrien  *Makefile*) ac_comsub="1i\\
363160484Sobrien# $configure_input" ;;
363260484Sobrien  *) ac_comsub= ;;
363360484Sobrien  esac
363460484Sobrien
363560484Sobrien  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
363660484Sobrien  sed -e "$ac_comsub
363760484Sobriens%@configure_input@%$configure_input%g
363860484Sobriens%@srcdir@%$srcdir%g
363960484Sobriens%@top_srcdir@%$top_srcdir%g
364060484Sobriens%@INSTALL@%$INSTALL%g
364160484Sobrien" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
364260484Sobrienfi; done
364360484Sobrienrm -f conftest.s*
364460484Sobrien
364560484Sobrien# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
364660484Sobrien# NAME is the cpp macro being defined and VALUE is the value it is being given.
364760484Sobrien#
364860484Sobrien# ac_d sets the value in "#define NAME VALUE" lines.
364960484Sobrienac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
365060484Sobrienac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
365160484Sobrienac_dC='\3'
365260484Sobrienac_dD='%g'
365360484Sobrien# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
365460484Sobrienac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
365560484Sobrienac_uB='\([ 	]\)%\1#\2define\3'
365660484Sobrienac_uC=' '
365760484Sobrienac_uD='\4%g'
365860484Sobrien# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
365960484Sobrienac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
366060484Sobrienac_eB='$%\1#\2define\3'
366160484Sobrienac_eC=' '
366260484Sobrienac_eD='%g'
366360484Sobrien
366460484Sobrienif test "${CONFIG_HEADERS+set}" != set; then
366560484SobrienEOF
366660484Sobriencat >> $CONFIG_STATUS <<EOF
366760484Sobrien  CONFIG_HEADERS="config.h:config.in"
366860484SobrienEOF
366960484Sobriencat >> $CONFIG_STATUS <<\EOF
367060484Sobrienfi
367160484Sobrienfor ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
367260484Sobrien  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
367360484Sobrien  case "$ac_file" in
367460484Sobrien  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
367560484Sobrien       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
367660484Sobrien  *) ac_file_in="${ac_file}.in" ;;
367760484Sobrien  esac
367860484Sobrien
367960484Sobrien  echo creating $ac_file
368060484Sobrien
368160484Sobrien  rm -f conftest.frag conftest.in conftest.out
368260484Sobrien  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
368360484Sobrien  cat $ac_file_inputs > conftest.in
368460484Sobrien
368560484SobrienEOF
368660484Sobrien
368760484Sobrien# Transform confdefs.h into a sed script conftest.vals that substitutes
368860484Sobrien# the proper values into config.h.in to produce config.h.  And first:
368960484Sobrien# Protect against being on the right side of a sed subst in config.status.
369060484Sobrien# Protect against being in an unquoted here document in config.status.
369160484Sobrienrm -f conftest.vals
369260484Sobriencat > conftest.hdr <<\EOF
369360484Sobriens/[\\&%]/\\&/g
369460484Sobriens%[\\$`]%\\&%g
369560484Sobriens%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
369660484Sobriens%ac_d%ac_u%gp
369760484Sobriens%ac_u%ac_e%gp
369860484SobrienEOF
369960484Sobriensed -n -f conftest.hdr confdefs.h > conftest.vals
370060484Sobrienrm -f conftest.hdr
370160484Sobrien
370260484Sobrien# This sed command replaces #undef with comments.  This is necessary, for
370360484Sobrien# example, in the case of _POSIX_SOURCE, which is predefined and required
370460484Sobrien# on some systems where configure will not decide to define it.
370560484Sobriencat >> conftest.vals <<\EOF
370660484Sobriens%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
370760484SobrienEOF
370860484Sobrien
370960484Sobrien# Break up conftest.vals because some shells have a limit on
371060484Sobrien# the size of here documents, and old seds have small limits too.
371160484Sobrien
371260484Sobrienrm -f conftest.tail
371360484Sobrienwhile :
371460484Sobriendo
371560484Sobrien  ac_lines=`grep -c . conftest.vals`
371660484Sobrien  # grep -c gives empty output for an empty file on some AIX systems.
371760484Sobrien  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
371860484Sobrien  # Write a limited-size here document to conftest.frag.
371960484Sobrien  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
372060484Sobrien  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
372160484Sobrien  echo 'CEOF
372260484Sobrien  sed -f conftest.frag conftest.in > conftest.out
372360484Sobrien  rm -f conftest.in
372460484Sobrien  mv conftest.out conftest.in
372560484Sobrien' >> $CONFIG_STATUS
372660484Sobrien  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
372760484Sobrien  rm -f conftest.vals
372860484Sobrien  mv conftest.tail conftest.vals
372960484Sobriendone
373060484Sobrienrm -f conftest.vals
373160484Sobrien
373260484Sobriencat >> $CONFIG_STATUS <<\EOF
373360484Sobrien  rm -f conftest.frag conftest.h
373460484Sobrien  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
373560484Sobrien  cat conftest.in >> conftest.h
373660484Sobrien  rm -f conftest.in
373760484Sobrien  if cmp -s $ac_file conftest.h 2>/dev/null; then
373860484Sobrien    echo "$ac_file is unchanged"
373960484Sobrien    rm -f conftest.h
374060484Sobrien  else
374160484Sobrien    # Remove last slash and all that follows it.  Not all systems have dirname.
374260484Sobrien      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
374360484Sobrien      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
374460484Sobrien      # The file is in a subdirectory.
374560484Sobrien      test ! -d "$ac_dir" && mkdir "$ac_dir"
374660484Sobrien    fi
374760484Sobrien    rm -f $ac_file
374860484Sobrien    mv conftest.h $ac_file
374960484Sobrien  fi
375060484Sobrienfi; done
375160484Sobrien
375260484SobrienEOF
375360484Sobriencat >> $CONFIG_STATUS <<EOF
375460484Sobriensrcdir=${srcdir}
375560484Sobrienhost=${host}
375660484Sobrientarget=${target}
375760484Sobrienwith_target_subdir=${with_target_subdir}
3758104834Sobrienwith_build_subdir=${with_build_subdir}
375960484Sobrienwith_multisubdir=${with_multisubdir}
376060484Sobrienac_configure_args="--enable-multilib ${ac_configure_args}"
376160484SobrienCONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
376260484Sobrienlibiberty_topdir=${libiberty_topdir}
376360484Sobrien
376460484SobrienEOF
376560484Sobriencat >> $CONFIG_STATUS <<\EOF
376660484Sobrientest -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
376760484Sobrienif test -n "$CONFIG_FILES"; then
3768104834Sobrien  if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
376960484Sobrien    # FIXME: We shouldn't need to set ac_file
377060484Sobrien    ac_file=Makefile
3771104834Sobrien    LD="${ORIGINAL_LD_FOR_MULTILIBS}"
377260484Sobrien    . ${libiberty_topdir}/config-ml.in
377360484Sobrien  fi
377460484Sobrienfi
377560484Sobrienexit 0
377660484SobrienEOF
377760484Sobrienchmod +x $CONFIG_STATUS
377860484Sobrienrm -fr confdefs* $ac_clean_files
377960484Sobrientest "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
378060484Sobrien
3781