#! /bin/sh

# Configuration script for the GNU C Library.
# DO NOT EDIT!  This script is generated from configure.in; edit that instead.

# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
# This file is part of the GNU C Library.

# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.

# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.

# You should have received a copy of the GNU Library General Public
# License along with the GNU C Library; see the file COPYING.LIB.  If
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
# Cambridge, MA 02139, USA.

#
#	Configure the GNU C Library.
#

prog="`basename $0`"

# All the standard GNU configure options are accepted but only
# --nfp, --with-gnu-ld, and --with-gnu-as are meaningful.
nfp=
gnu_ld=
gnu_as=
prefix=
exec_prefix=
verbose=

next=
lose=
for arg in $*; do
  if [ x$next != x ]; then
    eval "$next=\$arg"
    next=
  else
    case $arg in
    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
       srcdir=`echo $arg | sed 's/-*s[a-z]*=//'`
       ;;
    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
       next=srcdir
       ;;
    -target | --target | --targe | --targ | --tar | --ta | --t)
       next=target
       ;;
    -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
       target=`echo $arg | sed 's/-*t[a-z]*=//'`
       ;; 

    -with-gnu-ld | --with-gnu-ld | --with-gnu-l)
       gnu_ld=--with-gnu-ld
       ;;

    -gas | --gas | --ga | --g | -with-gnu-as | --with-gnu-as | -with-gnu-a)
       gnu_as=--with-gnu-as
       ;;

    -nfp | --nfp | --nf | --n)
       nfp=--nfp
       ;;

    -with-* | --with-*)
      # For `--with-foo=bar', do "with_foo='bar'".
      # For `--with-fnord', do "with_fnord=yes".
      # These variables may be examined by sysdep configure fragments.
      eval `echo "$arg" | sed '{s/^-*//;s/-/_/g
s/^\([^=]*\)=\(.*\)$/\1='\''\2'\''/;s/^\([^=]*\)$/\1=yes/;}'`
      ;;

    -x | --x)
      ;; # ignored

    # For backward compatibility, also recognize exact --exec_prefix.
    -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
       exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'`
       ;;
    -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
       next=exec_prefix
       ;;

    -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
       prefix=`echo $arg | sed 's/[-a-z_]*=//'`
       ;;
    -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
       next=prefix
       ;;

    -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
      # Autoconf-generated code below will test this.
      verbose=yes
      ;;

    -*)
       echo "Invalid option \`$arg'" 1>&2
       lose=yes
       ;;
    *)
       if [ ! "$target" ]; then
	 target=$arg
       else
	 lose=yes
       fi
       ;;
    esac
  fi
done

# NEXT will be set iff we have seen an option that wants an arg, but no arg.
if [ "$next" ]; then
  echo "$0: the \`--${next}' option requires an argument" >&2
  lose=yes
fi


trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
trap 'rm -fr confdefs* $ac_clean_files' 0

# Save the original args if we used an alternate arg parser.
ac_configure_temp="${configure_args-$*}"
# Strip out --no-create and --norecursion so they don't pile up.
configure_args=
for ac_arg in $ac_configure_temp; do
  case "$ac_arg" in
  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  | --no-cr | --no-c) ;;
  -norecursion | --norecursion | --norecursio | --norecursi \
  | --norecurs | --norecur | --norecu | --norec | --nore | --nor) ;;
  *) configure_args="$configure_args $ac_arg" ;;
  esac
done

# NLS nuisances.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
if test "${LC_ALL+set}" = 'set'; then LC_ALL=C; export LC_ALL; fi
if test "${LANG+set}"   = 'set'; then LANG=C;   export LANG;   fi

# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -rf conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h

# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=features.h

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  ac_srcdir_defaulted=yes
  # Try the directory containing this script, then `..'.
  ac_prog=$0
  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  srcdir=$ac_confdir
  if test ! -r $srcdir/$ac_unique_file; then
    srcdir=..
  fi
fi
if test ! -r $srcdir/$ac_unique_file; then
  if test x$ac_srcdir_defaulted = xyes; then
    echo "configure: can not find sources in ${ac_confdir} or .." >&2; exit 1
  else
    echo "configure: can not find sources in ${srcdir}" >&2; exit 1
  fi
fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='${CPP}'
ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'


ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='${CPP}'
ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'



# Decanonicalize srcdir so we can tell when we are configuring in srcdir.
if [ "`(cd ${srcdir}; pwd)`" = "`pwd`" ]; then
  srcdir=.
fi

if [ ! "$target" ]; then
  target=`$srcdir/config.guess`
  test -n "$target" && echo "No target given; guessing target is ${target}."
fi

if [ "$lose" = yes -o ! "$target" ]; then
  echo "\
Usage: $prog [--srcdir=DIR] [--prefix=DIR] [--exec-prefix=DIR]
	     [--nfp] [--with-gnu-ld] [--with-gnu-as] TARGET" >&2
  if [ -r config.status ]; then
    cat config.status >&2
  fi
  exit 1
fi

# Done parsing the arguments.

# This will get text that should go into config.make.
config_vars=

# Check for a --with-gmp argument and set gmp-srcdir in config.make.
case "$with_gmp" in
yes) echo "$prog: --with-gmp requires an argument; use --with-gmp=DIRECTORY"
     exit 1 ;;
'') ;;
*) config_vars="$config_vars
gmp-srcdir = $with_gmp" ;;
esac

# Canonicalize the configuration name.
config=`$srcdir/config.sub $target`
if [ ! "$config" ]; then
  # config.sub has written an error message.
  exit 1
fi

sysdep_dir=$srcdir/sysdeps

# machine-vendor-os
eval "`echo $config | \
       sed 's/^\(.*\)-\(.*\)-\(.*\)$/\
config_machine=\1 config_vendor=\2 config_os=\3/'`"

# We keep the original values in `$config_*' and never modify them, so we
# can write them unchanged into config.make.  Everything else uses
# $machine, $vendor, and $os, and changes them whenever convenient.
machine=$config_machine
vendor=$config_vendor
os=$config_os

# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"

# Expand the configuration machine name into a subdirectory by architecture
# type and particular chip.
case "$machine" in
i[345]86)
  machine=i386/$machine ;;
sparc[6789])
  machine=sparc/$machine ;;
m68k)
  machine=m68k/m68020 ;;
m680?0)
  machine=m68k/$machine ;;
m88k)
  machine=m88k/m88100 ;;
m88???)
  machine=m88k/$machine ;;
mips|r2000)
  machine=mips/r3000 ;;
r[34]000)
  machine=mips/$machine ;;
esac

case "$os" in
gnu*)
  base_os=mach/hurd ;;
netbsd* | 386bsd*)
  base_os=unix/bsd/bsd4.4 ;;
osf1* | sunos* | ultrix* | newsos* | dynix* | *bsd*)
  base_os=unix/bsd ;;
linux* | sysv* | isc* | esix* | sco* | minix* | irix4*)
  base_os=unix/sysv ;;
solaris[2-9]*)
  base_os=unix/sysv/sysv4 ;;
none)
  base_os=standalone ;;
esac

case "$os:$base_os" in
gnu* | linux* | bsd4.4* | *:bsd4.4)
  gnu_ld=--with-gnu-ld
  gnu_as=--with-gnu-as
esac

# For sunos4.1.1, try sunos4.1.1, then sunos4.1, then sunos4, then sunos.
tail=$os
ostry=$os
while o=`echo $tail | sed 's/\.[^.]*$//'`; [ $o != $tail ]; do
  ostry="$ostry /$o"
  tail=$o
done  
o=`echo $tail | sed 's/[0-9]*$//'`
if [ $o != $tail ]; then
  ostry="$ostry /$o"
fi

# For unix/sysv/sysv4, try unix/sysv/sysv4, then unix/sysv, then unix.
base=
tail=$base_os
while b=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$b" ]; do
  set $b
  base="$base /$1"
  tail="$2"
done

# For sparc/sparc9, try sparc/sparc9 and then sparc.
mach=
tail=$machine
while m=`echo $tail | sed 's@^\(.*\)/\([^/]*\)$@& \1@'`; [ "$m" ]; do
  set $m
  mach="$mach /$1"
  tail="$2"
done

# Find what sysdep directories exist.
sysnames=
for b in $base ''; do
  for v in /$vendor ''; do
    for o in /$ostry ''; do
      for m in $mach ''; do
        if [ -d $sysdep_dir$b$v$o$m ]; then
          sysnames="$sysnames $b$v$o$m"
	  [ "$o" -o "$b" ] && os_used=t
	  [ "$m" ] && machine_used=t
	fi
      done
    done
  done
done

if [ ! "$os_used" -a "$os" != none ]; then
  echo Operating system $os is not supported. >&2
  exit 1
fi
if [ ! "$machine_used" -a "$machine" != none ]; then
  echo The $machine is not supported. >&2
  exit 1
fi

# We have now validated the configuration.

PWD=`pwd`
echo Configuring the GNU C library in $PWD
echo on `(hostname || uname -n) 2>/dev/null | sed 1q` for ${config}.

# Remove the leading slashes.
sysnames="`echo $sysnames | sed -e 's@^/@@' -e 's@ /@ @g'`"

# Prepend the machine's FPU directory unless --nfp.
if [ ! "$nfp" ]; then
  fpu_dirs=
  for m in $mach; do
    if [ -d $sysdep_dir$m/fpu ]; then
      fpu_dirs="$fpu_dirs $m/fpu"
    fi
  done
  sysnames="`echo $fpu_dirs | sed -e 's,^/,,' -e 's, /,,g'` $sysnames"
fi

# Expand the list of system names into a full list of directories
# from each element's parent name and Implies file (if present).
set $sysnames
while [ $# -gt 0 ]; do
  name=$1
  shift

  if [ -f $sysdep_dir/$name/Implies ]; then
    # Collect more names from the `Implies' file (removing comments).
    implied="`sed 's/#.*$//' < $sysdep_dir/$name/Implies`"
    for x in $implied; do
      test -d $sysdep_dir/$x || echo "Warning: $name implies nonexistent $x">&2
    done
  else
    implied=
  fi

  # Add NAME to the list of names.
  names="$names $name"

  # Find the parent of NAME, using the empty string if it has none.
  parent="`echo $name | sed -n -e '/\//!q' -e 's=/[^/]*$==p'`"

  # Add the names implied by NAME, and NAME's parent (if it has one), to
  # the list of names to be processed (the argument list).  We prepend the
  # implied names to the list and append the parent.  We want implied
  # directories to come before further directories inferred from the
  # configuration components; this ensures that for sysv4, unix/common
  # (implied by unix/sysv/sysv4) comes before unix/sysv (in ostry (here $*)
  # after sysv4).
  sysnames="`echo $implied $* $parent`"
  if [ "$sysnames" != "" ]; then
    set $sysnames
  fi
done

# Add the default directories.
names="$names generic stub"

# Now uniquize the list.
seen=
sysnames=
for name in $names; do
  if echo "$seen" | fgrep -x $name >/dev/null; then
    # Already in the list.
    true;
  else
    # A new one.
    if [ "$seen" = "" ]; then
      seen="$name" sysnames="$name"
    else
      seen="$seen
$name"
      sysnames="$sysnames $name"
    fi
  fi
done

echo Using system-dependent files from directories:
for dir in $sysnames; do echo "	$dir"; done


# Make sure to not get the incompatible SysV /etc/install and
# /usr/sbin/install, which might be in PATH before a BSD-like install,
# or the SunOS /usr/etc/install directory, or the AIX /bin/install,
# or the AFS install, which mishandles nonexistent args, or
# /usr/ucb/install on SVR4, which tries to use the nonexistent group
# `staff', or /sbin/install on IRIX which has incompatible command-line
# syntax.  Sigh.
#
#     On most BSDish systems install is in /usr/bin, not /usr/ucb
#     anyway.
# This turns out not to be true, so the mere pathname isn't an indication
# of whether the program works.  What we really need is a set of tests for
# the install program to see if it actually works in all the required ways.
#
# Avoid using ./install, which might have been erroneously created
# by make from ./install.sh.
if test -z "${INSTALL}"; then
  test -n "$silent" || echo "checking for a BSD compatible install"
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in $PATH; do
    case "$ac_dir" in
    ''|.|/etc|/sbin|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
    *)
      # OSF1 and SCO ODT 3.0 have their own names for install.
      for ac_prog in installbsd scoinst install; do
        if test -f $ac_dir/$ac_prog; then
	  if test $ac_prog = install &&
            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
	    # AIX install.  It has an incompatible calling convention.
	    # OSF/1 installbsd also uses dspmsg, but is usable.
	    :
	  else
	    INSTALL="$ac_dir/$ac_prog -c"
	    break 2
	  fi
	fi
      done
      ;;
    esac
  done
  IFS="$ac_save_ifs"
fi

if test -z "$INSTALL"; then
  # As a last resort, use the slow shell script.
  for ac_dir in ${srcdir} ${srcdir}/.. ${srcdir}/../..; do
    if test -f $ac_dir/install.sh; then
      INSTALL="$ac_dir/install.sh -c"; break
    fi
  done
fi
if test -z "$INSTALL"; then
  echo "configure: can not find install.sh in ${srcdir} or ${srcdir}/.. or ${srcdir}/../.." >&2; exit 1
fi
test -n "$verbose" && echo "	setting INSTALL to $INSTALL"

# Use test -z because SunOS4 sh mishandles ${INSTALL_PROGRAM-'${INSTALL}'}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -n "$verbose" && echo "	setting INSTALL_PROGRAM to $INSTALL_PROGRAM"

test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
test -n "$verbose" && echo "	setting INSTALL_DATA to $INSTALL_DATA"

if [ "$INSTALL" = "${srcdir}/install.sh" ]; then
  # The makefiles need to use a different form to find it in $srcdir.
  INSTALL='$(..)./install.sh'
fi
if test -z "$RANLIB"; then
  # Extract the first word of `ranlib', so it can be a program name with args.
  set ac_dummy ranlib; ac_word=$2
  test -n "$silent" || echo "checking for $ac_word"
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      RANLIB="ranlib"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
test -z "$RANLIB" && RANLIB=":"
test -n "$RANLIB" && test -n "$verbose" && echo "	setting RANLIB to $RANLIB"


if test -z "$CC"; then
  # Extract the first word of `gcc', so it can be a program name with args.
  set ac_dummy gcc; ac_word=$2
  test -n "$silent" || echo "checking for $ac_word"
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  for ac_dir in $PATH; do
    test -z "$ac_dir" && ac_dir=.
    if test -f $ac_dir/$ac_word; then
      CC="gcc"
      break
    fi
  done
  IFS="$ac_save_ifs"
fi
test -z "$CC" && CC="cc"
test -n "$CC" && test -n "$verbose" && echo "	setting CC to $CC"

# Find out if we are using GNU C, under whatever name.
cat > conftest.c <<EOF
#ifdef __GNUC__
  yes
#endif
EOF
${CC-cc} -E conftest.c > conftest.out 2>&1
if egrep yes conftest.out >/dev/null 2>&1; then
  GCC=1 # For later tests.
fi
rm -f conftest*

test -n "$silent" || echo "checking how to run the C preprocessor"
if test -z "$CPP"; then
  # This must be in double quotes, not single quotes, because CPP may get
  # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  # make.  It must be expanded now.
  CPP="${CC-cc} -E"
  cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <stdio.h>
Syntax Error
EOF
# Some shells (Coherent) do redirections in the wrong order, so need
# the parens.
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  :
else
  rm -rf conftest*
  CPP="${CC-cc} -E -traditional-cpp"
  cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#include <stdio.h>
Syntax Error
EOF
# Some shells (Coherent) do redirections in the wrong order, so need
# the parens.
ac_err=`eval "($ac_cpp conftest.${ac_ext} >/dev/null) 2>&1"`
if test -z "$ac_err"; then
  :
else
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
rm -f conftest*
fi
test -n "$verbose" && echo "	setting CPP to $CPP"


echo checking for signed size_t type
echo '#include <stddef.h>
FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
eval "$CPP conftest.c 2>/dev/null" \
| grep '^FOOBAR.*unsigned.*FOOBAR$' >/dev/null \
|| {
    DEFS="$DEFS -U__SIZE_TYPE__ -D__SIZE_TYPE__=unsigned"
  (echo '#undef __SIZE_TYPE__';
   echo '#define __SIZE_TYPE__ unsigned') >> confdefs.h
  test -n "$verbose" && echo '	using unsigned int for size_t'
}
rm -f conftest*

test -n "$silent" || echo "checking for libc-friendly stddef.h"
cat > conftest.${ac_ext} <<EOF
#include "confdefs.h"
#define __need_size_t
#define __need_wchar_t
#include <stddef.h>
#define __need_NULL
#include <stddef.h>
int main() { return 0; }
int t() { size_t size; wchar_t wchar;
#ifdef offsetof
#error stddef.h ignored __need_*
#endif
if (&size == NULL || &wchar == NULL) abort ();; return 0; }
EOF
if eval $ac_compile; then
  rm -rf conftest*
  config_vars="$config_vars
stddef.h = # The installed <stddef.h> seems to be libc-friendly."
test -n "$verbose" && echo '	installed stddef.h looks friendly'

fi
rm -f conftest*



echo 'checking for need to use -P to assemble .S files'
cat > conftest.S <<EOF
#include "confdefs.h"
/* Nothing whatsoever.  */
EOF
${CC-cc} $CFLAGS -c conftest.S 2>/dev/null || {
  config_vars="$config_vars
asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
  test -n "$verbose" && echo '	using -P flag'
}
rm -f conftest*

# Iterate over all the sysdep directories we will use, running their
# configure fragments, and looking for a uname implementation.
uname=
for dir in $sysnames; do
  if test -r $sysdep_dir/$dir/configure; then
    echo running configure fragment for $dir
    . $sysdep_dir/$dir/configure
  fi
  test ! "$uname" && \
  test -r $sysdep_dir/$dir/uname.c -o -r $sysdep_dir/$dir/uname.S && uname=$dir
done

# If we will use the generic uname implementation, we must figure out what
# it will say by examining the system, and write the results in config-name.h.
if [ "$uname" = generic ]; then

  echo trying to guess OS release and version for uname

  kernel_release=
  kernel_version=

  if [ ! "$release" -o ! "$version" ]; then
    if [ -r /vmunix ]; then
      kernel_id=`strings /vmunix | grep UNIX`
    elif [ -r /dynix ]; then
      kernel_id=`strings /dynix | grep DYNIX`
    else
      kernel_id=
    fi
    if [ "$kernel_id" ]; then
      kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
      kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
    fi
  fi

  sysname=`echo $os | sed 's/[0-9.]*$//'`
  if [ $sysname != $os ]; then
    config_release=`echo $os | sed s/$sysname//`
  fi

  if [ "$release" ]; then
    # All is well.
    true
  elif [ x`echo "$config_release" | sed "s/^$kernel_release//"` \
	 != x$config_release ]; then
    # The configuration release is a substring of the kernel release.
    release=$kernel_release
  elif [ x$config_release != x ]; then
    release=$config_release
  elif [ x$kernel_release != x ]; then
    release=$kernel_release
  else
    cat <<END
I don't know what release of $sysname you are using.  Please enter the
release number now.  This information is used only for the \`uname' function,
so it is not critical.
END
    read release
    if [ ! "$release" ]; then
      release=unknown
    fi
  fi

  if [ "$version" ]; then
    # All is well.
    true
  elif [ ! "$kernel_version" ]; then
    cat <<END
I don't know what version of $sysname $release you are using.  Please enter
the version number now.  This information is used only for the uname
function, so it is not critical.
END
    read version
    if [ ! "$version" ]; then
      version=unknown
    fi
  else
    version=$kernel_version
  fi

  cat > config-name.h <<END
/* This file was generated automatically by configure.  Do not edit.
   This is used by the generic uname function.  */
#define UNAME_SYSNAME "${sysname}"
#define UNAME_RELEASE "${release}"
#define UNAME_VERSION "${version}"
#define UNAME_MACHINE "${config_machine}-${config_vendor}"
END

  system_name="$sysname $release version $version on $vendor $machine"
else
  # Not generic uname.  We don't need config-name.h at all.
  system_name=$config
fi

if [ "$gnu_ld" ]; then
  DEFS="$DEFS -DHAVE_GNU_LD"
fi
if [ "$gnu_as" ]; then
  DEFS="$DEFS -DHAVE_GNU_AS"
fi

(
  echo '# This file was generated automatically by configure.  Do not edit.'
  echo '# Put configuration parameters in configparms instead.'
  echo "config-machine = ${config_machine}"
  echo "config-vendor = ${config_vendor}"
  echo "config-os = ${config_os}"
  echo "config-sysdirs = ${sysnames}"
  if [ "$prefix" ]; then
    echo "prefix = ${prefix}"
  fi
  if [ "$exec_prefix" ]; then
    echo "exec_prefix = ${exec_prefix}"
  fi
  echo "config-defines = ${DEFS}"
  for var in INSTALL INSTALL_PROGRAM INSTALL_DATA RANLIB; do
    eval "echo \"${var} = \${$var}\""
  done
  echo "$config_vars"
) > config.make
echo "Wrote config.make in $PWD."

if [ $srcdir != . ]; then
  if [ $srcdir = .. ]; then
    cwd=`pwd`
    objdir=`basename $cwd`
  else
    objdir=`pwd`
  fi
  cat > Makefile <<END
# This file was generated automatically by configure.  Do not edit.
srcdir = $srcdir

all .DEFAULT:
	\$(MAKE) -C \$(srcdir) objdir=\`pwd\` \$@
END

echo "Wrote Makefile in $PWD."
fi

cat > config.status <<END
#!/bin/sh
# This file was generated automatically by configure.  Do not edit.
# The GNU C library was configured in $PWD for
# $system_name as follows:
release=$release version=$version $0 $configure_args \$*
END
chmod a+x config.status
echo "Wrote config.status in $PWD."

exit 0
s%@INSTALL@%$INSTALL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@RANLIB@%$RANLIB%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
INSTALL='$INSTALL'
INSTALL_PROGRAM='$INSTALL_PROGRAM'
INSTALL_DATA='$INSTALL_DATA'
RANLIB='$RANLIB'
CC='$CC'
CPP='$CPP'
