#!/bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf.
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.

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

# This program 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 General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
#        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
# Ignores all args except --srcdir, --prefix, --exec-prefix, and
# --with-PACKAGE[=VALUE] unless this script has special code to handle it.

for arg
do
  # Handle --exec-prefix with a space before the argument.
  if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  # Handle --host with a space before the argument.
  elif test x$next_host = xyes; then next_host=
  # Handle --prefix with a space before the argument.
  elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  # Handle --srcdir with a space before the argument.
  elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  else
    case $arg in
     # For backward compatibility, recognize -exec-prefix and --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=yes ;;

     -gas | --gas | --ga | --g) ;;

     -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
     -host | --host | --hos | --ho | --h)
	next_host=yes ;;

     -nfp | --nfp | --nf) ;;

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

     -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
	srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
	next_srcdir=yes ;;

     -with-* | --with-*)
       package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
       # Reject names that aren't valid shell variable names.
       if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
         echo "configure: $package: invalid package name" >&2; exit 1
       fi
       package=`echo $package| sed 's/-/_/g'`
       case "$arg" in
         *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
         *) val=1 ;;
       esac
       eval "with_$package='$val'" ;;

     -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
       verbose=yes ;;

     *) ;;
    esac
  fi
done

trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
trap 'rm -f confdefs*' 0

# 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

rm -f conftest* confdefs.h
# AIX cpp loses on an empty file, so make sure it contains at least a newline.
echo > confdefs.h
compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'

# 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.
unique_file=pagercico.c

# Find the source files, if location was not specified.
if test -z "$srcdir"; then
  srcdirdefaulted=yes
  # Try the directory containing this script, then `..'.
  prog=$0
  confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  test "X$confdir" = "X$prog" && confdir=.
  srcdir=$confdir
  if test ! -r $srcdir/$unique_file; then
    srcdir=..
  fi
fi
if test ! -r $srcdir/$unique_file; then
  if test x$srcdirdefaulted = xyes; then
    echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  else
    echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  fi
  exit 1
fi
# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
# But we can't avoid them for `..', to make subdirectories work.
case $srcdir in
  .|/*|~*) ;;
  *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
esac


# Save the original args to write them into config.status later.
configure_args="$*"

if test -z "$CC"; then
  # Extract the first word of `gcc', so it can be a program name with args.
  set dummy gcc; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      CC="gcc"
      break
    fi
  done
  IFS="$saveifs"
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*

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.c <<EOF
#include "confdefs.h"
#include <stdio.h>
Syntax Error
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  :
else
  rm -rf conftest*
  CPP=/lib/cpp
fi
rm -f conftest*
fi
test ".${verbose}" != "." && echo "	setting CPP to $CPP"

if test -n "$GCC"; then
  echo checking whether -traditional is needed
  pattern="Autoconf.*'x'"
  prog='#include <sgtty.h>
Autoconf TIOCGETP'
  cat > conftest.c <<EOF
#include "confdefs.h"
$prog
EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  need_trad=1

fi
rm -f conftest*


  if test -z "$need_trad"; then
    prog='#include <termio.h>
Autoconf TCGETA'
    cat > conftest.c <<EOF
#include "confdefs.h"
$prog
EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  need_trad=1

fi
rm -f conftest*

  fi
  test -n "$need_trad" && CC="$CC -traditional"
fi

# 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'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
# anyway.  Sigh.
if test "z${INSTALL}" = "z" ; then
  echo checking for install
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    case $dir in
    /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
    *)
      if test -f $dir/installbsd; then
	INSTALL="$dir/installbsd -c" # OSF1
	INSTALL_PROGRAM='$(INSTALL)'
	INSTALL_DATA='$(INSTALL) -m 644'
	break
      fi
      if test -f $dir/install; then
	if grep dspmsg $dir/install >/dev/null 2>&1; then
	  : # AIX
	else
	  INSTALL="$dir/install -c"
	  INSTALL_PROGRAM='$(INSTALL)'
	  INSTALL_DATA='$(INSTALL) -m 644'
	  break
	fi
      fi
      ;;
    esac
  done
  IFS="$saveifs"
fi
INSTALL=${INSTALL-cp}
test -n "$verbose" && echo "	setting INSTALL to $INSTALL"
INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
test -n "$verbose" && echo "	setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
test -n "$verbose" && echo "	setting INSTALL_DATA to $INSTALL_DATA"

AR=${AR-ar}

if test -z "$RANLIB"; then
  # Extract the first word of `ranlib', so it can be a program name with args.
  set dummy ranlib; word=$2
  echo checking for $word
  IFS="${IFS= 	}"; saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/$word; then
      RANLIB="ranlib"
      break
    fi
  done
  IFS="$saveifs"
fi
test -z "$RANLIB" && RANLIB=":"
test -n "$RANLIB" && test -n "$verbose" && echo "	setting RANLIB to $RANLIB"

echo checking for POSIXized ISC
if test -d /etc/conf/kconfig.d &&
  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
  ISC=1 # If later tests want to check for ISC.
  
{
test -n "$verbose" && \
echo "	defining _POSIX_SOURCE"
echo "#define" _POSIX_SOURCE 1 >> confdefs.h
DEFS="$DEFS -D_POSIX_SOURCE=1"
}

  if test -n "$GCC"; then
    CC="$CC -posix"
  else
    CC="$CC -Xp"
  fi
fi

echo checking for minix/config.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <minix/config.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  MINIX=1

fi
rm -f conftest*

# The Minix shell can't assign to the same variable on the same line!
if test -n "$MINIX"; then
  
{
test -n "$verbose" && \
echo "	defining _POSIX_SOURCE"
echo "#define" _POSIX_SOURCE 1 >> confdefs.h
DEFS="$DEFS -D_POSIX_SOURCE=1"
}

  
{
test -n "$verbose" && \
echo "	defining" _POSIX_1_SOURCE to be 2
echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
DEFS="$DEFS -D_POSIX_1_SOURCE=2"
}

  
{
test -n "$verbose" && \
echo "	defining _MINIX"
echo "#define" _MINIX 1 >> confdefs.h
DEFS="$DEFS -D_MINIX=1"
}

fi

echo checking for AIX
cat > conftest.c <<EOF
#include "confdefs.h"
#ifdef _AIX
  yes
#endif

EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "yes" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining _ALL_SOURCE"
echo "#define" _ALL_SOURCE 1 >> confdefs.h
DEFS="$DEFS -D_ALL_SOURCE=1"
}


fi
rm -f conftest*


LIBS_save="${LIBS}"
LIBS="${LIBS} -lseq"
have_lib=""
echo checking for -lseq
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  rm -rf conftest*
  have_lib="1"

fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIBS="$LIBS -lseq"
else
   :; 
fi


LIBS_save="${LIBS}"
LIBS="${LIBS} -lsun"
have_lib=""
echo checking for -lsun
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { main(); }
EOF
if eval $compile; then
  rm -rf conftest*
  have_lib="1"

fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
   :; LIBS="$LIBS -lsun"
else
   :; 
fi


echo checking whether cross-compiling
# If we cannot run a trivial program, we must be cross compiling.
cat > conftest.c <<EOF
#include "confdefs.h"
main(){exit(0);}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  :
else
  cross_compiling=1
fi
rm -fr conftest*

prog='/* Ultrix mips cc rejects this.  */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this.  */
char const *const *ccp;
char **p;
/* AIX XL C 1.02.0.0 rejects this.
   It does not let you subtract one const X* pointer from another in an arm
   of an if-expression whose if-part is not a constant expression */
const char *g = "string";
ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++ccp;
p = (char**) ccp;
ccp = (char const *const *) p;
{ /* SCO 3.2v4 cc rejects this.  */
  char *t;
  char const *s = 0 ? (char *) 0 : (char const *) 0;

  *t++ = 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  int x[] = {25,17};
  const int *foo = &x[0];
  ++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  typedef const int *iptr;
  iptr p = 0;
  ++p;
}
{ /* AIX XL C 1.02.0.0 rejects this saying
     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  struct s { int j; const int *ap[3]; };
  struct s *b; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  const int foo = 10;
}'
echo checking for lack of working const
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { $prog }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" const to be empty
echo "#define" const  >> confdefs.h
DEFS="$DEFS -Dconst="
}

fi
rm -f conftest*

echo checking for prototypes
cat > conftest.c <<EOF
#include "confdefs.h"
extern int foo (short);
int foo(short i) { return i; }
int main() { exit(0); }
int t() { int i; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_PROTOTYPES"
echo "#define" HAVE_PROTOTYPES 1 >> confdefs.h
DEFS="$DEFS -DHAVE_PROTOTYPES=1"
}


fi
rm -f conftest*

CFLAGS=${CFLAGS--g}
echo "checking if \`#!' works in shell scripts"
echo '#!/bin/cat
exit 69
' > conftest
chmod u+x conftest
(SHELL=/bin/sh; export SHELL; ./conftest > /dev/null)
if test $? -ne 69; then
   :; POUNDBANG=yes
else
   :; POUNDBANG=no
fi
rm -f conftest


echo checking for echo program
if (PATH= echo test) 2>/dev/null | grep test >/dev/null 2>&1; then
 
{
test -n "$verbose" && \
echo "	defining" ECHO_PROGRAM to be \"echo\"
echo "#define" ECHO_PROGRAM \"echo\" >> confdefs.h
DEFS="$DEFS -DECHO_PROGRAM=\"echo\""
}

elif test -s /bin/echo; then
 
{
test -n "$verbose" && \
echo "	defining" ECHO_PROGRAM to be \"/bin/echo\"
echo "#define" ECHO_PROGRAM \"/bin/echo\" >> confdefs.h
DEFS="$DEFS -DECHO_PROGRAM=\"/bin/echo\""
}

fi
echo checking for ln -s
rm -f conftestdata
if ln -s X conftestdata 2>/dev/null
then
  rm -f conftestdata
  LN_S="ln -s"
else
  LN_S=ln
fi


for hdr in stddef.h stdarg.h string.h strings.h unistd.h stdlib.h
do
trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
echo checking for ${hdr}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <${hdr}>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining ${trhdr}"
echo "#define" ${trhdr} 1 >> confdefs.h
DEFS="$DEFS -D${trhdr}=1"
}


fi
rm -f conftest*
done

for hdr in limits.h time.h sys/wait.h sys/ioctl.h memory.h
do
trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
echo checking for ${hdr}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <${hdr}>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining ${trhdr}"
echo "#define" ${trhdr} 1 >> confdefs.h
DEFS="$DEFS -D${trhdr}=1"
}


fi
rm -f conftest*
done

for hdr in fcntl.h sys/file.h sys/time.h sys/times.h libc.h
do
trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
echo checking for ${hdr}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <${hdr}>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining ${trhdr}"
echo "#define" ${trhdr} 1 >> confdefs.h
DEFS="$DEFS -D${trhdr}=1"
}


fi
rm -f conftest*
done

for hdr in sysexits.h poll.h tiuser.h xti.h sys/tli.h stropts.h ftw.h
do
trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
echo checking for ${hdr}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <${hdr}>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining ${trhdr}"
echo "#define" ${trhdr} 1 >> confdefs.h
DEFS="$DEFS -D${trhdr}=1"
}


fi
rm -f conftest*
done

for hdr in glob.h sys/param.h sys/types.tcp.h
do
trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
echo checking for ${hdr}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <${hdr}>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining ${trhdr}"
echo "#define" ${trhdr} 1 >> confdefs.h
DEFS="$DEFS -D${trhdr}=1"
}


fi
rm -f conftest*
done

# Under Next 3.2 <dirent.h> apparently does not define struct dirent
# by default.
echo checking for dirent.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <dirent.h>
int main() { exit(0); }
int t() { struct dirent s; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_DIRENT_H"
echo "#define" HAVE_DIRENT_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_DIRENT_H=1"
}


fi
rm -f conftest*

# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
# by default.
echo checking for utime.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#if HAVE_TIME_H
#include <time.h>
#endif
#include <utime.h>
int main() { exit(0); }
int t() { struct utimbuf s; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_UTIME_H"
echo "#define" HAVE_UTIME_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_UTIME_H=1"
}


fi
rm -f conftest*

echo checking for sys/select.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/select.h>
#include <sys/time.h>
int main() { exit(0); }
int t() { int i; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_SYS_SELECT_H"
echo "#define" HAVE_SYS_SELECT_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_SYS_SELECT_H=1"
}


fi
rm -f conftest*

echo checking for major, minor and makedev header
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
int main() { exit(0); }
int t() { return makedev(0, 0); }
EOF
if eval $compile; then
  rm -rf conftest*
  makedev=1

fi
rm -f conftest*

if test -z "$makedev"; then
echo checking for sys/mkdev.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/mkdev.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining MAJOR_IN_MKDEV"
echo "#define" MAJOR_IN_MKDEV 1 >> confdefs.h
DEFS="$DEFS -DMAJOR_IN_MKDEV=1"
}
 makedev=1

fi
rm -f conftest*

fi
if test -z "$makedev"; then
echo checking for sys/sysmacros.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/sysmacros.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining MAJOR_IN_SYSMACROS"
echo "#define" MAJOR_IN_SYSMACROS 1 >> confdefs.h
DEFS="$DEFS -DMAJOR_IN_SYSMACROS=1"
}


fi
rm -f conftest*

fi

echo checking for return type of signal handlers
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern void (*signal ()) ();
int main() { exit(0); }
int t() { int i; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" RETSIGTYPE to be void
echo "#define" RETSIGTYPE void >> confdefs.h
DEFS="$DEFS -DRETSIGTYPE=void"
}


else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" RETSIGTYPE to be int
echo "#define" RETSIGTYPE int >> confdefs.h
DEFS="$DEFS -DRETSIGTYPE=int"
}

fi
rm -f conftest*


echo checking for broken stat file mode macros
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
#ifdef S_ISBLK
#if S_ISBLK (S_IFDIR)
You lose.
#endif
#ifdef S_IFCHR
#if S_ISBLK (S_IFCHR)
You lose.
#endif
#endif /* S_IFCHR */
#endif /* S_ISBLK */
#ifdef S_ISLNK
#if S_ISLNK (S_IFREG)
You lose.
#endif
#endif /* S_ISLNK */
#ifdef S_ISSOCK
#if S_ISSOCK (S_IFREG)
You lose.
#endif
#endif /* S_ISSOCK */

EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "You lose" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining STAT_MACROS_BROKEN"
echo "#define" STAT_MACROS_BROKEN 1 >> confdefs.h
DEFS="$DEFS -DSTAT_MACROS_BROKEN=1"
}


fi
rm -f conftest*

echo checking for whether time.h and sys/time.h may both be included
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
int main() { exit(0); }
int t() { struct tm *tp; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining TIME_WITH_SYS_TIME"
echo "#define" TIME_WITH_SYS_TIME 1 >> confdefs.h
DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
}


fi
rm -f conftest*

echo checking for struct tm in time.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
int main() { exit(0); }
int t() { struct tm *tp; tp->tm_sec; }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining TM_IN_SYS_TIME"
echo "#define" TM_IN_SYS_TIME 1 >> confdefs.h
DEFS="$DEFS -DTM_IN_SYS_TIME=1"
}

fi
rm -f conftest*

echo checking for termios.h and sys/ioctl.h being included together
cat > conftest.c <<EOF
#include "confdefs.h"
#include <termios.h>
#include <sys/ioctl.h>
int main() { exit(0); }
int t() { int i; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_TERMIOS_AND_SYS_IOCTL_H"
echo "#define" HAVE_TERMIOS_AND_SYS_IOCTL_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_TERMIOS_AND_SYS_IOCTL_H=1"
}


fi
rm -f conftest*

echo checking for CBREAK
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sgtty.h>
int main() { exit(0); }
int t() { int i = CBREAK; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_CBREAK"
echo "#define" HAVE_CBREAK 1 >> confdefs.h
DEFS="$DEFS -DHAVE_CBREAK=1"
}


fi
rm -f conftest*

echo checking for pid_t in sys/types.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
int main() { exit(0); }
int t() { pid_t x; }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" PID_T to be int
echo "#define" PID_T int >> confdefs.h
DEFS="$DEFS -DPID_T=int"
}

fi
rm -f conftest*

echo checking for uid_t in sys/types.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
int main() { exit(0); }
int t() { uid_t x; }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" UID_T to be int
echo "#define" UID_T int >> confdefs.h
DEFS="$DEFS -DUID_T=int"
}

fi
rm -f conftest*

echo checking for gid_t in sys/types.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
int main() { exit(0); }
int t() { gid_t x; }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" GID_T to be int
echo "#define" GID_T int >> confdefs.h
DEFS="$DEFS -DGID_T=int"
}

fi
rm -f conftest*

echo checking for off_t in sys/types.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
int main() { exit(0); }
int t() { off_t x; }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" OFF_T to be long
echo "#define" OFF_T long >> confdefs.h
DEFS="$DEFS -DOFF_T=long"
}

fi
rm -f conftest*

echo checking for sig_atomic_t in signal.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <signal.h>
int main() { exit(0); }
int t() { sig_atomic_t x; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_SIG_ATOMIC_T_IN_SIGNAL_H"
echo "#define" HAVE_SIG_ATOMIC_T_IN_SIGNAL_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_SIG_ATOMIC_T_IN_SIGNAL_H=1"
}


fi
rm -f conftest*

echo checking for sig_atomic_t in sys/types.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
int main() { exit(0); }
int t() { sig_atomic_t x; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_SIG_ATOMIC_T_IN_TYPES_H"
echo "#define" HAVE_SIG_ATOMIC_T_IN_TYPES_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_SIG_ATOMIC_T_IN_TYPES_H=1"
}


fi
rm -f conftest*

case $DEFS in
*HAVE_STDDEF_H*)
  echo checking for size_t in stddef.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <stddef.h>
int main() { exit(0); }
int t() { size_t x; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_SIZE_T_IN_STDDEF_H"
echo "#define" HAVE_SIZE_T_IN_STDDEF_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_SIZE_T_IN_STDDEF_H=1"
}


fi
rm -f conftest*
 ;;
esac
echo checking for size_t in sys/types.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
int main() { exit(0); }
int t() { size_t x; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_SIZE_T_IN_TYPES_H"
echo "#define" HAVE_SIZE_T_IN_TYPES_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_SIZE_T_IN_TYPES_H=1"
}


fi
rm -f conftest*

echo checking for time_t in time.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <time.h>
int main() { exit(0); }
int t() { time_t i; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_TIME_T_IN_TIME_H"
echo "#define" HAVE_TIME_T_IN_TIME_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_TIME_T_IN_TIME_H=1"
}


fi
rm -f conftest*

echo checking for time_t in sys/types.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
int main() { exit(0); }
int t() { time_t i; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_TIME_T_IN_TYPES_H"
echo "#define" HAVE_TIME_T_IN_TYPES_H 1 >> confdefs.h
DEFS="$DEFS -DHAVE_TIME_T_IN_TYPES_H=1"
}


fi
rm -f conftest*

echo checking for void
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { extern void foo (); (void) exit (0); }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_VOID"
echo "#define" HAVE_VOID 1 >> confdefs.h
DEFS="$DEFS -DHAVE_VOID=1"
}


fi
rm -f conftest*

echo checking for unsigned char
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { unsigned char i = (unsigned char) -1; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_UNSIGNED_CHAR"
echo "#define" HAVE_UNSIGNED_CHAR 1 >> confdefs.h
DEFS="$DEFS -DHAVE_UNSIGNED_CHAR=1"
}


fi
rm -f conftest*

echo checking for errno
cat > conftest.c <<EOF
#include "confdefs.h"
#include <errno.h>
int main() { exit(0); }
int t() { int i = errno; errno = 1; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_ERRNO_DECLARATION"
echo "#define" HAVE_ERRNO_DECLARATION 1 >> confdefs.h
DEFS="$DEFS -DHAVE_ERRNO_DECLARATION=1"
}


fi
rm -f conftest*

echo checking for TXADDCD
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/ioctl.h>
int main() { exit(0); }
int t() { int i = (int) TXADDCD; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_TXADDCD"
echo "#define" HAVE_TXADDCD 1 >> confdefs.h
DEFS="$DEFS -DHAVE_TXADDCD=1"
}


fi
rm -f conftest*


for func in memset memcmp memchr memcpy bcopy bcmp bzero
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

for func in strchr strrchr index rindex strerror strtol strtoul strstr
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

for func in strdup strcasecmp strncasecmp stricmp strnicmp
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

for func in bsearch vfprintf
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

for func in remove ftruncate ltrunc rename opendir dup2 waitpid wait4
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

for func in sigsetjmp setret sigaction sigvec sigset
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

for func in sigprocmask sigblock sighold getdtablesize sysconf
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

for func in setpgrp setsid setreuid gethostname uname
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

for func in gettimeofday ftw glob dev_info
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

SAVELIBS="$LIBS"
LIBS=`echo $LIBS | sed 's/-linet//'`
for func in getline
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

LIBS="$SAVELIBS"
echo checking for ftime
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_ftime) || defined (__stub___ftime)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ftime(); ftime();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  if test -n "$cross_compiling"
then
  
{
test -n "$verbose" && \
echo "	defining HAVE_FTIME"
echo "#define" HAVE_FTIME 1 >> confdefs.h
DEFS="$DEFS -DHAVE_FTIME=1"
}

else
cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/types.h>
#include <sys/timeb.h>
main ()
{
  struct timeb s, slast;
  int c = 0;
  ftime (&slast);
  while (c < 10)
    {
      ftime (&s);
      if (s.time < slast.time
	  || (s.time == slast.time && s.millitm < slast.millitm))
	exit (1);
      if (s.time != slast.time)
	++c;
      slast.time = s.time;
      slast.millitm = s.millitm;
    }
  exit (0);
}

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  
{
test -n "$verbose" && \
echo "	defining HAVE_FTIME"
echo "#define" HAVE_FTIME 1 >> confdefs.h
DEFS="$DEFS -DHAVE_FTIME=1"
}


else
  echo 1>&2 "Your ftime seems to be buggy"
fi
fi
rm -fr conftest*

fi
rm -f conftest*

for func in times
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

for func in napms nap usleep poll select
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

case $DEFS in
*HAVE_NAPMS*) ;;
*HAVE_NAP*)  ;;
*HAVE_USLEEP*) ;;
*HAVE_POLL*) ;;
*HAVE_SELECT*) ;;
*) echo 1>&2 'WARNING: No way to sleep for less than one second'
   echo 1>&2 '         \p in chat scripts will sleep for a full second'
   ;;
esac
for func in getgrent
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

trfrom='[a-z]' trto='[A-Z]'
for i in socket t_open; do
  def=HAVE_`echo $i|tr "$trfrom" "$trto"`
  echo checking for $i
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_$i) || defined (__stub___$i)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char $i(); $i();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining $def"
echo "#define" $def 1 >> confdefs.h
DEFS="$DEFS -D$def=1"
}


else
  rm -rf conftest*
  missing=1
fi
rm -f conftest*
  for lib in "-lsocket" "-lnsl" "-lsocket -lnsl" "-lxti"; do
    if test -n "$missing"; then
      case $LIBS in
      *${lib}*) ;;
      *)
	SAVELIBS="$LIBS"
	LIBS="$LIBS $lib"
	missing=
	echo checking for $i with $lib
cat > conftest.c <<EOF
#include "confdefs.h"

int main() { exit(0); }
int t() { extern char $i(); $i(); }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining $def"
echo "#define" $def 1 >> confdefs.h
DEFS="$DEFS -D$def=1"
}


else
  rm -rf conftest*
  missing=1; LIBS="$SAVELIBS"
fi
rm -f conftest*
	;;
      esac
    fi
  done
done
for func in getcwd getwd
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

case $DEFS in
*HAVE_GETCWD*) ;;
*HAVE_GETWD*) ;;
*) UNIXOBJS="$UNIXOBJS getcwd.o"
   if test -s /bin/pwd; then
     
{
test -n "$verbose" && \
echo "	defining" PWD_PROGRAM to be \"/bin/pwd\"
echo "#define" PWD_PROGRAM \"/bin/pwd\" >> confdefs.h
DEFS="$DEFS -DPWD_PROGRAM=\"/bin/pwd\""
}

   fi ;;
esac
for func in rmdir
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_${func}) || defined (__stub___${func})
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining ${trfunc}"
echo "#define" ${trfunc} 1 >> confdefs.h
DEFS="$DEFS -D${trfunc}=1"
}


fi
rm -f conftest*
done

case $DEFS in
*HAVE_RMDIR*) ;;
*) UNIXOBJS="$UNIXOBJS rmdir.o"
   if test -s /bin/rmdir; then
     
{
test -n "$verbose" && \
echo "	defining" RMDIR_PROGRAM to be \"/bin/rmdir\"
echo "#define" RMDIR_PROGRAM \"/bin/rmdir\" >> confdefs.h
DEFS="$DEFS -DRMDIR_PROGRAM=\"/bin/rmdir\""
}

   fi ;;
esac
case $DEFS in
*HAVE_BSEARCH*) ;;
*) LIBOBJS="$LIBOBJS bsrch.o" ;;
esac
case $DEFS in
*HAVE_BZERO*) ;;
*HAVE_MEMSET*) ;;
*) LIBOBJS="$LIBOBJS bzero.o" ;;
esac
case $DEFS in
*HAVE_GETLINE*) ;;
*) LIBOBJS="$LIBOBJS getlin.o" ;;
esac
case $DEFS in
*HAVE_MEMCHR*) ;;
*) LIBOBJS="$LIBOBJS memchr.o" ;;
esac
case $DEFS in
*HAVE_MEMCMP*) ;;
*HAVE_BCMP*) ;;
*) LIBOBJS="$LIBOBJS memcmp.o" ;;
esac
case $DEFS in
*HAVE_MEMCPY*) ;;
*HAVE_BCOPY*) ;;
*) LIBOBJS="$LIBOBJS memcpy.o" ;;
esac
case $DEFS in
*HAVE_STRCASECMP*) ;;
*HAVE_STRICMP*) ;;
*) LIBOBJS="$LIBOBJS strcas.o" ;;
esac
case $DEFS in
*HAVE_STRCHR*) ;;
*HAVE_INDEX*) ;;
*) LIBOBJS="$LIBOBJS strchr.o" ;;
esac
case $DEFS in
*HAVE_STRDUP*) ;;
*) LIBOBJS="$LIBOBJS strdup.o" ;;
esac
case $DEFS in
*HAVE_STRNCASECMP*) ;;
*HAVE_STRNICMP*) ;;
*) LIBOBJS="$LIBOBJS strncs.o" ;;
esac
case $DEFS in
*HAVE_STRRCHR*) ;;
*HAVE_RINDEX*) ;;
*) LIBOBJS="$LIBOBJS strrch.o" ;;
esac
case $DEFS in
*HAVE_STRSTR*) ;;
*) LIBOBJS="$LIBOBJS strstr.o" ;;
esac
case $DEFS in
*HAVE_STRTOL*) ;;
*) LIBOBJS="$LIBOBJS strtol.o" ;;
esac
case $DEFS in
*HAVE_STRTOUL*) ;;
*) LIBOBJS="$LIBOBJS strtou.o" ;;
esac
case $DEFS in
*HAVE_OPENDIR*) ;;
*) UNIXOBJS="$UNIXOBJS dirent.o" ;;
esac
case $DEFS in
*HAVE_DUP2*) ;;
*) UNIXOBJS="$UNIXOBJS dup2.o" ;;
esac
case $DEFS in
*HAVE_FTW=*) ;;
*) UNIXOBJS="$UNIXOBJS ftw.o" ;;
esac
case $DEFS in
*HAVE_REMOVE*) ;;
*) UNIXOBJS="$UNIXOBJS remove.o" ;;
esac
case $DEFS in
*HAVE_RENAME*) ;;
*) UNIXOBJS="$UNIXOBJS rename.o" ;;
esac
case $DEFS in
*HAVE_STRERROR*) ;;
*) UNIXOBJS="$UNIXOBJS strerr.o" ;;
esac

case $DEFS in
*HAVE_SIGVEC*)
  echo checking for sv_flags
cat > conftest.c <<EOF
#include "confdefs.h"
#include <signal.h>
int main() { exit(0); }
int t() { struct sigvec s; s.sv_flags = 0; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_SIGVEC_SV_FLAGS"
echo "#define" HAVE_SIGVEC_SV_FLAGS 1 >> confdefs.h
DEFS="$DEFS -DHAVE_SIGVEC_SV_FLAGS=1"
}


fi
rm -f conftest*
 ;;
esac
echo checking how to get filesystem space usage
# SVR4
echo checking for sys/statvfs.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/statvfs.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  echo checking for statvfs
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_statvfs) || defined (__stub___statvfs)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char statvfs(); statvfs();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining STAT_STATVFS"
echo "#define" STAT_STATVFS 1 >> confdefs.h
DEFS="$DEFS -DSTAT_STATVFS=1"
}
 space=1

fi
rm -f conftest*


fi
rm -f conftest*

if test -z "$space"; then
  echo checking for statfs
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_statfs) || defined (__stub___statfs)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char statfs(); statfs();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
      # AIX
    echo '#include "confdefs.h"
#include <sys/statfs.h>' > conftest.c
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "f_nlsdirtype" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining STAT_STATFS2_BSIZE"
echo "#define" STAT_STATFS2_BSIZE 1 >> confdefs.h
DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1"
}
 space=1

fi
rm -f conftest*

    if test -z "$space"; then
      # SVR3
      echo checking for sys/statfs.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/statfs.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining STAT_STATFS4"
echo "#define" STAT_STATFS4 1 >> confdefs.h
DEFS="$DEFS -DSTAT_STATFS4=1"
}
 space=1

fi
rm -f conftest*

    fi
    if test -z "$space"; then
      # 4.3BSD
      echo checking for sys/vfs.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/vfs.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining STAT_STATFS2_BSIZE"
echo "#define" STAT_STATFS2_BSIZE 1 >> confdefs.h
DEFS="$DEFS -DSTAT_STATFS2_BSIZE=1"
}
 space=1

fi
rm -f conftest*

    fi
    if test -z "$space"; then
      # 4.4BSD
      cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/mount.h>
#ifdef MOUNT_UFS
found_mount_ufs
#endif
EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "found_mount_ufs" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining STAT_STATFS2_FSIZE"
echo "#define" STAT_STATFS2_FSIZE 1 >> confdefs.h
DEFS="$DEFS -DSTAT_STATFS2_FSIZE=1"
}
 space=1

fi
rm -f conftest*

    fi
    if test -z "$space"; then
      # Ultrix
      echo checking for sys/mount.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/mount.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining STAT_STATFS2_FS_DATA"
echo "#define" STAT_STATFS2_FS_DATA 1 >> confdefs.h
DEFS="$DEFS -DSTAT_STATFS2_FS_DATA=1"
}
 space=1

fi
rm -f conftest*

    fi
  

fi
rm -f conftest*
fi
if test -z "$space"; then
  # AIX PS/2
  echo checking for sys/dustat.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/dustat.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  echo checking for dustat
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_dustat) || defined (__stub___dustat)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char dustat(); dustat();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining STAT_DUSTAT"
echo "#define" STAT_DUSTAT 1 >> confdefs.h
DEFS="$DEFS -DSTAT_DUSTAT=1"
}
 space=1

fi
rm -f conftest*


fi
rm -f conftest*

fi
if test -z "$space"; then
  echo checking for ustat
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_ustat) || defined (__stub___ustat)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ustat(); ustat();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining STAT_USTAT"
echo "#define" STAT_USTAT 1 >> confdefs.h
DEFS="$DEFS -DSTAT_USTAT=1"
}
 space=1

fi
rm -f conftest*

fi
if test -z "$space"; then
  # QNX
  echo checking for disk_space
cat > conftest.c <<EOF
#include "confdefs.h"
#include <ctype.h>
int main() { exit(0); }
int t() { 
/* The GNU C library defines this for functions which it implements
    to always fail with ENOSYS.  Some functions are actually named
    something starting with __ and the normal name is an alias.  */
#if defined (__stub_disk_space) || defined (__stub___disk_space)
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char disk_space(); disk_space();
#endif
 }
EOF
if eval $compile; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining STAT_DISK_SPACE"
echo "#define" STAT_DISK_SPACE 1 >> confdefs.h
DEFS="$DEFS -DSTAT_DISK_SPACE=1"
}
 space=1

fi
rm -f conftest*

fi

trfrom='[a-z]' trto='[A-Z]'
echo checking for times declared as "long"
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#ifdef HAVE_LIBC_H
#include <libc.h>
#endif
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
extern long times ();
int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining `echo times | tr "$trfrom" "$trto"`_DECLARATION_OK"
echo "#define" `echo times | tr "$trfrom" "$trto"`_DECLARATION_OK 1 >> confdefs.h
DEFS="$DEFS -D`echo times | tr "$trfrom" "$trto"`_DECLARATION_OK=1"
}


fi
rm -f conftest*

trfrom='[a-z]' trto='[A-Z]'
echo checking for getpwnam declared as "struct passwd *"
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#ifdef HAVE_LIBC_H
#include <libc.h>
#endif
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
extern struct passwd * getpwnam ();
int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining `echo getpwnam | tr "$trfrom" "$trto"`_DECLARATION_OK"
echo "#define" `echo getpwnam | tr "$trfrom" "$trto"`_DECLARATION_OK 1 >> confdefs.h
DEFS="$DEFS -D`echo getpwnam | tr "$trfrom" "$trto"`_DECLARATION_OK=1"
}


fi
rm -f conftest*

trfrom='[a-z]' trto='[A-Z]'
echo checking for getpwuid declared as "struct passwd *"
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#ifdef HAVE_LIBC_H
#include <libc.h>
#endif
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
extern struct passwd * getpwuid ();
int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining `echo getpwuid | tr "$trfrom" "$trto"`_DECLARATION_OK"
echo "#define" `echo getpwuid | tr "$trfrom" "$trto"`_DECLARATION_OK 1 >> confdefs.h
DEFS="$DEFS -D`echo getpwuid | tr "$trfrom" "$trto"`_DECLARATION_OK=1"
}


fi
rm -f conftest*

trfrom='[a-z]' trto='[A-Z]'
echo checking for getgrent declared as "struct group *"
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#ifdef HAVE_LIBC_H
#include <libc.h>
#endif
#ifdef HAVE_SYS_TIMES_H
#include <sys/times.h>
#endif
extern struct group * getgrent ();
int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining `echo getgrent | tr "$trfrom" "$trto"`_DECLARATION_OK"
echo "#define" `echo getgrent | tr "$trfrom" "$trto"`_DECLARATION_OK 1 >> confdefs.h
DEFS="$DEFS -D`echo getgrent | tr "$trfrom" "$trto"`_DECLARATION_OK=1"
}


fi
rm -f conftest*

echo checking for BSD setpgrp
cat > conftest.c <<EOF
#include "confdefs.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
int main() { exit(0); }
int t() { getpgrp (0); setpgrp (0, 0); }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_BSD_PGRP"
echo "#define" HAVE_BSD_PGRP 1 >> confdefs.h
DEFS="$DEFS -DHAVE_BSD_PGRP=1"
}


fi
rm -f conftest*

echo checking for union wait
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/wait.h>
#ifndef WIFEXITED
#define WIFEXITED(u) ((u).w_termsig == 0)
#endif
int main() { exit(0); }
int t() { union wait u; if (WIFEXITED (u)) wait (&u); }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_UNION_WAIT"
echo "#define" HAVE_UNION_WAIT 1 >> confdefs.h
DEFS="$DEFS -DHAVE_UNION_WAIT=1"
}


fi
rm -f conftest*

if test -n "$cross_compiling"; then
 
{
test -n "$verbose" && \
echo "	defining" HAVE_LONG_FILE_NAMES to be 0
echo "#define" HAVE_LONG_FILE_NAMES 0 >> confdefs.h
DEFS="$DEFS -DHAVE_LONG_FILE_NAMES=0"
}

 
{
test -n "$verbose" && \
echo "	defining" HAVE_RESTARTABLE_SYSCALLS to be -1
echo "#define" HAVE_RESTARTABLE_SYSCALLS -1 >> confdefs.h
DEFS="$DEFS -DHAVE_RESTARTABLE_SYSCALLS=-1"
}

else
 echo checking for restartable system calls
cat > conftest.c <<EOF
#include "confdefs.h"
/* Exit 0 (true) if wait returns something other than -1,
   i.e. the pid of the child, which means that wait was restarted
   after getting the signal.  */
#include <sys/types.h>
#include <signal.h>
ucatch (isig) { }
main () {
  int i = fork (), status;
  if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
  signal (SIGINT, ucatch);
  status = wait(&i);
  if (status == -1) wait(&i);
  exit (status == -1);
}

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  
{
test -n "$verbose" && \
echo "	defining HAVE_RESTARTABLE_SYSCALLS"
echo "#define" HAVE_RESTARTABLE_SYSCALLS 1 >> confdefs.h
DEFS="$DEFS -DHAVE_RESTARTABLE_SYSCALLS=1"
}


fi
rm -fr conftest*

 echo checking for long file names
some_dir_failed=false
# Test for long file names in all the places we know might matter:
#      .		the current directory, where building will happen
#      /tmp		where it might want to write temporary files
#      /var/tmp		likewise
#      /usr/tmp		likewise
#      $prefix/lib	where we will be installing things
#      $exec_prefix/lib	likewise
# eval it to expand exec_prefix.
for dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` ; do
  test -d $dir || continue
  test -w $dir || continue # It's less confusing to not echo anything here.
  (echo 1 > $dir/conftest9012345) 2>/dev/null
  (echo 2 > $dir/conftest9012346) 2>/dev/null
  val=`cat $dir/conftest9012345 2>/dev/null`
  test -f $dir/conftest9012345 && test "$val" = 1 || some_dir_failed=true
  rm -f $dir/conftest9012345 $dir/conftest9012346 2> /dev/null
done
$some_dir_failed || 
{
test -n "$verbose" && \
echo "	defining HAVE_LONG_FILE_NAMES"
echo "#define" HAVE_LONG_FILE_NAMES 1 >> confdefs.h
DEFS="$DEFS -DHAVE_LONG_FILE_NAMES=1"
}


fi
# Set default prefixes.
if test -n "$prefix"; then
  test -z "$exec_prefix" && exec_prefix='${prefix}'
  prsub="s%^prefix\\([ 	]*\\)=\\([ 	]*\\).*$%prefix\\1=\\2$prefix%"
fi
if test -n "$exec_prefix"; then
  prsub="$prsub
s%^exec_prefix\\([ 	]*\\)=\\([ 	]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
fi
# Quote sed substitution magic chars in DEFS.
cat >conftest.def <<EOF
$DEFS
EOF
escape_ampersand_and_backslash='s%[&\\]%\\&%g'
DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
rm -f conftest.def
# Substitute for predefined variables.

trap 'rm -f config.status; exit 1' 1 3 15
echo creating config.status
rm -f config.status
cat > config.status <<EOF
#!/bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows,
# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
#
# $0 $configure_args

for arg
do
  case "\$arg" in
    -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
    exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
    *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  esac
done

trap 'rm -f Makefile; exit 1' 1 3 15
CC='$CC'
CPP='$CPP'
INSTALL='$INSTALL'
INSTALL_PROGRAM='$INSTALL_PROGRAM'
INSTALL_DATA='$INSTALL_DATA'
AR='$AR'
RANLIB='$RANLIB'
CFLAGS='$CFLAGS'
LDFLAGS='$LDFLAGS'
POUNDBANG='$POUNDBANG'
LN_S='$LN_S'
LIBOBJS='$LIBOBJS'
UNIXOBJS='$UNIXOBJS'
LIBS='$LIBS'
srcdir='$srcdir'
DEFS='$DEFS'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
extrasub='$extrasub'
EOF
cat >> config.status <<\EOF

top_srcdir=$srcdir

CONFIG_FILES=${CONFIG_FILES-"Makefile"}
for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  srcdir=$top_srcdir
  # Remove last slash and all that follows it.  Not all systems have dirname.
  dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  if test "$dir" != "$file"; then
    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
    test ! -d $dir && mkdir $dir
  fi
  echo creating $file
  rm -f $file
  echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  sed -e "
$prsub
$extrasub
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@INSTALL@%$INSTALL%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@AR@%$AR%g
s%@RANLIB@%$RANLIB%g
s%@CFLAGS@%$CFLAGS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@POUNDBANG@%$POUNDBANG%g
s%@LN_S@%$LN_S%g
s%@LIBOBJS@%$LIBOBJS%g
s%@UNIXOBJS@%$UNIXOBJS%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%$DEFS%
" $top_srcdir/${file}.in >> $file
fi; done


exit 0
EOF
chmod +x config.status
${CONFIG_SHELL-/bin/sh} config.status

