#!/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.

echo "**********************************************************"
echo "* ./configure actually messes stuff up, because it is so *"
echo "* old. If you know what you're doing, remove these lines *"
echo "* from the configure script and the next - otherwise,    *"
echo "* just use Makefile as-is.                               *"
echo "**********************************************************"
exit 0

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=Makefile.in

# 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="$*"


































for p in 'bison -y' byacc
do
if test -z "$YACC"; then
  # Extract the first word of `$p', so it can be a program name with args.
  set dummy $p; 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
      YACC="$p"
      break
    fi
  done
  IFS="$saveifs"
fi

test -n "$YACC" && test -n "$verbose" && echo "	setting YACC to $YACC"

test -n "$YACC" && break
done
test -n "$YACC" || YACC="yacc"

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

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

#if __GNUC__==2
  yes
#endif

EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "yes" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  CC="$CC -Wall -Wwrite-strings"

fi
rm -f conftest*

test -n "$GCC" && CC="$CC"
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"


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

#ifdef NeXT
  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 _NEXT_SOURCE"
echo "#define" _NEXT_SOURCE 1 >> confdefs.h
DEFS="$DEFS -D_NEXT_SOURCE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_NEXT_SOURCE\${SEDdB}_NEXT_SOURCE\${SEDdC}1\${SEDdD}
\${SEDuA}_NEXT_SOURCE\${SEDuB}_NEXT_SOURCE\${SEDuC}1\${SEDuD}
\${SEDeA}_NEXT_SOURCE\${SEDeB}_NEXT_SOURCE\${SEDeC}1\${SEDeD}
"
}

   
{
test -n "$verbose" && \
echo "	defining _POSIX_SOURCE"
echo "#define" _POSIX_SOURCE 1 >> confdefs.h
DEFS="$DEFS -D_POSIX_SOURCE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
\${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
\${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*


echo checking for the DEC Alpha running OSF/1
cat > conftest.c <<EOF
#include "confdefs.h"

#if defined(__osf__) && defined(__alpha) && !defined(__GNUC__)
  yes
#endif

EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "yes" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  CC="$CC -Olimit 2500"

fi
rm -f conftest*


echo checking for the SGI compiler
cat > conftest.c <<EOF
#include "confdefs.h"

#if defined(sgi) && !defined(__GNUC__)
  yes
#endif

EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "yes" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  CC="$CC -Olimit 2500"

fi
rm -f conftest*

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

#if defined(sgi)
  yes
#endif

EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "yes" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  CC="$CC -U__EXTENSIONS__"

fi
rm -f conftest*

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"
SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
\${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
\${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*


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"
SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
\${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
\${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
"
}

  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"
SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
\${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
\${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
"
}

  
{
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"
SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
\${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
\${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
"
}

  
{
test -n "$verbose" && \
echo "	defining _MINIX"
echo "#define" _MINIX 1 >> confdefs.h
DEFS="$DEFS -D_MINIX=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
\${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
\${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
"
}

fi

LIBS_save="${LIBS}"
LIBS="${LIBS} -lintl"
have_lib=""
echo checking for -lintl
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 -lintl"
else
   :; 
fi



echo checking for A/UX
cat > conftest.c <<EOF
#include "confdefs.h"

#if defined(AUX)
  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 _POSIX_SOURCE"
echo "#define" _POSIX_SOURCE 1 >> confdefs.h
DEFS="$DEFS -D_POSIX_SOURCE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
\${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
\${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*


echo checking for HP/UX
cat > conftest.c <<EOF
#include "confdefs.h"

#if defined(__hpux)
  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 _HPUX_SOURCE"
echo "#define" _HPUX_SOURCE 1 >> confdefs.h
DEFS="$DEFS -D_HPUX_SOURCE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}_HPUX_SOURCE\${SEDdB}_HPUX_SOURCE\${SEDdC}1\${SEDdD}
\${SEDuA}_HPUX_SOURCE\${SEDuB}_HPUX_SOURCE\${SEDuC}1\${SEDuD}
\${SEDeA}_HPUX_SOURCE\${SEDeB}_HPUX_SOURCE\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*


echo "checking that the C compiler handles important ANSI C constructs"
for opt in "" -Aa -Xa -ansi
do
SAVECC="$CC"
CC="$CC $opt"
cat > conftest.c <<EOF
#include "confdefs.h"

int main(int argc, char *argv) { void *ptr; exit(0); }

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  have_ansi=1
break

else
  CC="$SAVECC"
fi
rm -fr conftest*
done
if test -z "$have_ansi"; then
echo ""
echo "*** Sorry, but I can't figure out how to find an ANSI C compiler here."
echo "*** Compiling this program requires such a compiler."
exit 1
fi


if [ $GCC ]; then
echo "checking to see if we can use GNU C99 extensions"
SAVECC="$CC"
CC="$CC -std=gnu99"
cat > conftest.c <<EOF
#include "confdefs.h"

int main(int argc, char *argv) { exit(0); }

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  C99=1
break

else
  CC="$SAVECC"
fi

rm -fr conftest*
fi

echo checking for a working const keyword
cat << EOF > conftest.c
#ifdef __GNUC__
#define const __const__
#endif
int foo(const char *x) { return 17 + (x - x); }
int bar() { int x = foo("foo"); return x; }
EOF
if $CC -c conftest.c > conftest.out 2>&1; then
  if test -s conftest.out; then
    
{
test -n "$verbose" && \
echo "	defining" const to be empty
echo "#define" const  >> confdefs.h
DEFS="$DEFS -Dconst="
SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
\${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
\${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
"
}

  fi
else
  
{
test -n "$verbose" && \
echo "	defining" const to be empty
echo "#define" const  >> confdefs.h
DEFS="$DEFS -Dconst="
SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
\${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
\${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
"
}

fi
rm -f conftest*

CPP=""
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"


echo checking whether stdlib.h declares malloc and friends

pattern="[^_a-zA-Z0-9]malloc *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <stdlib.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  echo checking for malloc.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <malloc.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining NEED_MALLOC_H"
echo "#define" NEED_MALLOC_H 1 >> confdefs.h
DEFS="$DEFS -DNEED_MALLOC_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_MALLOC_H\${SEDdB}NEED_MALLOC_H\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_MALLOC_H\${SEDuB}NEED_MALLOC_H\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_MALLOC_H\${SEDeB}NEED_MALLOC_H\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*

fi
rm -f conftest*

echo checking for sys/bsdtypes.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/bsdtypes.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining NEED_BSDTYPES_H"
echo "#define" NEED_BSDTYPES_H 1 >> confdefs.h
DEFS="$DEFS -DNEED_BSDTYPES_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_BSDTYPES_H\${SEDdB}NEED_BSDTYPES_H\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_BSDTYPES_H\${SEDuB}NEED_BSDTYPES_H\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_BSDTYPES_H\${SEDeB}NEED_BSDTYPES_H\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*

echo checking for sys/select.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/select.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining NEED_SELECT_H"
echo "#define" NEED_SELECT_H 1 >> confdefs.h
DEFS="$DEFS -DNEED_SELECT_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_SELECT_H\${SEDdB}NEED_SELECT_H\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_SELECT_H\${SEDuB}NEED_SELECT_H\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_SELECT_H\${SEDeB}NEED_SELECT_H\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*

echo checking for memory.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <memory.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining NEED_MEMORY_H"
echo "#define" NEED_MEMORY_H 1 >> confdefs.h
DEFS="$DEFS -DNEED_MEMORY_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_MEMORY_H\${SEDdB}NEED_MEMORY_H\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_MEMORY_H\${SEDuB}NEED_MEMORY_H\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_MEMORY_H\${SEDeB}NEED_MEMORY_H\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*

echo checking for pid_t in sys/types.h
echo '#include "confdefs.h"
#include <sys/types.h>' > conftest.c
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "pid_t" conftest.out >/dev/null 2>&1; 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"
SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD}
\${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD}
\${SEDeA}pid_t\${SEDeB}pid_t\${SEDeC}int\${SEDeD}
"
}

fi
rm -f conftest*

echo checking for mode_t in sys/types.h
echo '#include "confdefs.h"
#include <sys/types.h>' > conftest.c
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "mode_t" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" mode_t to be int
echo "#define" mode_t int >> confdefs.h
DEFS="$DEFS -Dmode_t=int"
SEDDEFS="${SEDDEFS}\${SEDdA}mode_t\${SEDdB}mode_t\${SEDdC}int\${SEDdD}
\${SEDuA}mode_t\${SEDuB}mode_t\${SEDuC}int\${SEDuD}
\${SEDeA}mode_t\${SEDeB}mode_t\${SEDeC}int\${SEDeD}
"
}

fi
rm -f conftest*

echo checking for size_t in sys/types.h
echo '#include "confdefs.h"
#include <sys/types.h>' > conftest.c
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "size_t" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining" size_t to be unsigned
echo "#define" size_t unsigned >> confdefs.h
DEFS="$DEFS -Dsize_t=unsigned"
SEDDEFS="${SEDDEFS}\${SEDdA}size_t\${SEDdB}size_t\${SEDdC}unsigned\${SEDdD}
\${SEDuA}size_t\${SEDuB}size_t\${SEDuC}unsigned\${SEDuD}
\${SEDeA}size_t\${SEDeB}size_t\${SEDeC}unsigned\${SEDeD}
"
}

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"
SEDDEFS="${SEDDEFS}\${SEDdA}TM_IN_SYS_TIME\${SEDdB}TM_IN_SYS_TIME\${SEDdC}1\${SEDdD}
\${SEDuA}TM_IN_SYS_TIME\${SEDuB}TM_IN_SYS_TIME\${SEDuC}1\${SEDuD}
\${SEDeA}TM_IN_SYS_TIME\${SEDeB}TM_IN_SYS_TIME\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

decl='#include <sys/types.h>
'
case "$DEFS" in
  *TM_IN_SYS_TIME*) decl="$decl
#include <sys/time.h>
" ;;
  *) decl="$decl
#include <time.h>
" ;;
esac
echo checking for tm_zone in struct tm
cat > conftest.c <<EOF
#include "confdefs.h"
$decl
int main() { exit(0); }
int t() { struct tm tm; tm.tm_zone; }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_TM_ZONE"
echo "#define" HAVE_TM_ZONE 1 >> confdefs.h
DEFS="$DEFS -DHAVE_TM_ZONE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TM_ZONE\${SEDdB}HAVE_TM_ZONE\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_TM_ZONE\${SEDuB}HAVE_TM_ZONE\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_TM_ZONE\${SEDeB}HAVE_TM_ZONE\${SEDeC}1\${SEDeD}
"
}


else
  rm -rf conftest*
  no_tm_zone=1
fi
rm -f conftest*

if test -n "$no_tm_zone"; then
echo checking for tzname
cat > conftest.c <<EOF
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI.  */
extern char *tzname[]; /* RS6000 and others want it this way.  */
#endif
int main() { exit(0); }
int t() { atoi(*tzname); }
EOF
if eval $compile; then
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining HAVE_TZNAME"
echo "#define" HAVE_TZNAME 1 >> confdefs.h
DEFS="$DEFS -DHAVE_TZNAME=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TZNAME\${SEDdB}HAVE_TZNAME\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_TZNAME\${SEDuB}HAVE_TZNAME\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_TZNAME\${SEDeB}HAVE_TZNAME\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*

fi


for func in sqrt
do
    trfrom='[a-z]' trto='[A-Z]'
  var=HAVE_`echo $func | tr "$trfrom" "$trto"`
    echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}


else
  rm -rf conftest*
  SAVELIBS="$LIBS"
    for lib in -lm /lib/libm.a "-static -lm"
    do
      LIBS="$LIBS $lib"
      echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}

			 break

else
  rm -rf conftest*
  LIBS="$SAVELIBS"
fi
rm -f conftest*

    done
    
fi
rm -f conftest*

done


for func in mkfifo waitpid sigemptyset
do
    trfrom='[a-z]' trto='[A-Z]'
  var=HAVE_`echo $func | tr "$trfrom" "$trto"`
    echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}


else
  rm -rf conftest*
  SAVELIBS="$LIBS"
    for lib in -lposix /lib/libposix.a
    do
      LIBS="$LIBS $lib"
      echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}

			 break

else
  rm -rf conftest*
  LIBS="$SAVELIBS"
fi
rm -f conftest*

    done
    
fi
rm -f conftest*

done


for func in accept
do
    trfrom='[a-z]' trto='[A-Z]'
  var=HAVE_`echo $func | tr "$trfrom" "$trto"`
    echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}


else
  rm -rf conftest*
  SAVELIBS="$LIBS"
    for lib in "-lsocket -lnsl" -lsocket -linet
    do
      LIBS="$LIBS $lib"
      echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}

			 break

else
  rm -rf conftest*
  LIBS="$SAVELIBS"
fi
rm -f conftest*

    done
    
fi
rm -f conftest*

done


for func in t_open
do
    trfrom='[a-z]' trto='[A-Z]'
  var=HAVE_`echo $func | tr "$trfrom" "$trto"`
    echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}


else
  rm -rf conftest*
  SAVELIBS="$LIBS"
    for lib in -lnsl -lnsl_s
    do
      LIBS="$LIBS $lib"
      echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}

			 break

else
  rm -rf conftest*
  LIBS="$SAVELIBS"
fi
rm -f conftest*

    done
    
fi
rm -f conftest*

done


for func in crypt
do
    trfrom='[a-z]' trto='[A-Z]'
  var=HAVE_`echo $func | tr "$trfrom" "$trto"`
    echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}


else
  rm -rf conftest*
  SAVELIBS="$LIBS"
    for lib in -lcrypt -lcrypt_d
    do
      LIBS="$LIBS $lib"
      echo checking for $func
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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 $var"
echo "#define" $var 1 >> confdefs.h
DEFS="$DEFS -D$var=1"
SEDDEFS="${SEDDEFS}\${SEDdA}$var\${SEDdB}$var\${SEDdC}1\${SEDdD}
\${SEDuA}$var\${SEDuB}$var\${SEDuC}1\${SEDuD}
\${SEDeA}$var\${SEDeB}$var\${SEDeC}1\${SEDeD}
"
}

			 break

else
  rm -rf conftest*
  LIBS="$SAVELIBS"
fi
rm -f conftest*

    done
    
fi
rm -f conftest*

done

for hdr in unistd.h sys/cdefs.h stdlib.h tiuser.h machine/endian.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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
\${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
\${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*
done

for func in remove rename poll select strerror strftime strtoul matherr
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*
done

for func in random lrand48 wait3 wait2 sigsetmask sigprocmask sigrelse
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include "confdefs.h"
#include <assert.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"
SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
\${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
\${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*
done


trfrom='[a-z]' trto='[A-Z]'
for func in tolower
do
echo "checking whether $func is declared in ctype.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <ctype.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in fcntl
do
echo "checking whether $func is declared in fcntl.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <fcntl.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in htonl
do
echo "checking whether $func is declared in netinet/in.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <netinet/in.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in ioctl
do
echo "checking whether $func is declared in sys/ioctl.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/ioctl.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in poll
do
echo "checking whether $func is declared in poll.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <poll.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in kill sigemptyset sigprocmask sigrelse
do
echo "checking whether $func is declared in signal.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <signal.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in accept bind shutdown
do
echo "checking whether $func is declared in sys/socket.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/socket.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in fstat
do
echo "checking whether $func is declared in sys/stat.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/stat.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in fclose perror remove vfprintf vfscanf
do
echo "checking whether $func is declared in stdio.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <stdio.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in random srandom strtod strtol strtoul
do
echo "checking whether $func is declared in stdlib.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <stdlib.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in bzero memcpy memset strerror
do
echo "checking whether $func is declared in string.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <string.h>
#if NEED_MEMORY_H
#include <memory.h>
#endif


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done

echo checking for bzero being declared in stdlib.h

pattern="[^_a-zA-Z0-9]bzero *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <stdlib.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining BZERO_IN_STDLIB_H"
echo "#define" BZERO_IN_STDLIB_H 1 >> confdefs.h
DEFS="$DEFS -DBZERO_IN_STDLIB_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}BZERO_IN_STDLIB_H\${SEDdB}BZERO_IN_STDLIB_H\${SEDdC}1\${SEDdD}
\${SEDuA}BZERO_IN_STDLIB_H\${SEDuB}BZERO_IN_STDLIB_H\${SEDuC}1\${SEDuD}
\${SEDeA}BZERO_IN_STDLIB_H\${SEDeB}BZERO_IN_STDLIB_H\${SEDeC}1\${SEDeD}
"
}


fi
rm -f conftest*


trfrom='[a-z]' trto='[A-Z]'
for func in getitimer setitimer select
do
echo "checking whether $func is declared in sys/time.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/time.h>
#if NEED_SELECT_H
#include <sys/types.h>
#include <sys/select.h>
#endif


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in strftime time
do
echo "checking whether $func is declared in time.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <time.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for var in tzname
do
echo "checking whether $var is declared in time.h"

pattern="[^_a-zA-Z0-9]$var"
cat > conftest.c <<EOF
#include "confdefs.h"

#include <time.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $var | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $var | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $var | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in t_open
do
echo "checking whether $func is declared in tiuser.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <tiuser.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for var in t_errlist
do
echo "checking whether $var is declared in tiuser.h"

pattern="[^_a-zA-Z0-9]$var"
cat > conftest.c <<EOF
#include "confdefs.h"

#include <tiuser.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $var | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $var | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $var | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $var | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in fork
do
echo "checking whether $func is declared in unistd.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <unistd.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done


trfrom='[a-z]' trto='[A-Z]'
for func in waitpid
do
echo "checking whether $func is declared in sys/wait.h"

pattern="[^_a-zA-Z0-9]$func *\("
cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/wait.h>


EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "$pattern" conftest.out >/dev/null 2>&1; then
  :
else
  rm -rf conftest*
  {
test -n "$verbose" && \
echo "	defining NDECL_`echo $func | tr "$trfrom" "$trto"`"
echo "#define" NDECL_`echo $func | tr "$trfrom" "$trto"` 1 >> confdefs.h
DEFS="$DEFS -DNDECL_`echo $func | tr "$trfrom" "$trto"`=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDdC}1\${SEDdD}
\${SEDuA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDuC}1\${SEDuD}
\${SEDeA}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeB}NDECL_`echo $func | tr "$trfrom" "$trto"`\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

done



trfrom='[a-z]./' trto='[A-Z]__'
echo checking for self-sufficiency of arpa/inet.h
cat > conftest.c <<EOF
#include "confdefs.h"

#include <arpa/inet.h>
struct in_addr foo;

int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining `echo arpa/inet.h | tr "$trfrom" "$trto"`_NEEDS_HELP"
echo "#define" `echo arpa/inet.h | tr "$trfrom" "$trto"`_NEEDS_HELP 1 >> confdefs.h
DEFS="$DEFS -D`echo arpa/inet.h | tr "$trfrom" "$trto"`_NEEDS_HELP=1"
SEDDEFS="${SEDDEFS}\${SEDdA}`echo arpa/inet.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdB}`echo arpa/inet.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdC}1\${SEDdD}
\${SEDuA}`echo arpa/inet.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuB}`echo arpa/inet.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuC}1\${SEDuD}
\${SEDeA}`echo arpa/inet.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeB}`echo arpa/inet.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*



trfrom='[a-z]./' trto='[A-Z]__'
echo checking for self-sufficiency of signal.h
cat > conftest.c <<EOF
#include "confdefs.h"

#include <signal.h>


int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining `echo signal.h | tr "$trfrom" "$trto"`_NEEDS_HELP"
echo "#define" `echo signal.h | tr "$trfrom" "$trto"`_NEEDS_HELP 1 >> confdefs.h
DEFS="$DEFS -D`echo signal.h | tr "$trfrom" "$trto"`_NEEDS_HELP=1"
SEDDEFS="${SEDDEFS}\${SEDdA}`echo signal.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdB}`echo signal.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdC}1\${SEDdD}
\${SEDuA}`echo signal.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuB}`echo signal.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuC}1\${SEDuD}
\${SEDeA}`echo signal.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeB}`echo signal.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*



trfrom='[a-z]./' trto='[A-Z]__'
echo checking for self-sufficiency of sys/socket.h
cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/socket.h>


int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining `echo sys/socket.h | tr "$trfrom" "$trto"`_NEEDS_HELP"
echo "#define" `echo sys/socket.h | tr "$trfrom" "$trto"`_NEEDS_HELP 1 >> confdefs.h
DEFS="$DEFS -D`echo sys/socket.h | tr "$trfrom" "$trto"`_NEEDS_HELP=1"
SEDDEFS="${SEDDEFS}\${SEDdA}`echo sys/socket.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdB}`echo sys/socket.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdC}1\${SEDdD}
\${SEDuA}`echo sys/socket.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuB}`echo sys/socket.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuC}1\${SEDuD}
\${SEDeA}`echo sys/socket.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeB}`echo sys/socket.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*



trfrom='[a-z]./' trto='[A-Z]__'
echo checking for self-sufficiency of sys/stat.h
cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/stat.h>


int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining `echo sys/stat.h | tr "$trfrom" "$trto"`_NEEDS_HELP"
echo "#define" `echo sys/stat.h | tr "$trfrom" "$trto"`_NEEDS_HELP 1 >> confdefs.h
DEFS="$DEFS -D`echo sys/stat.h | tr "$trfrom" "$trto"`_NEEDS_HELP=1"
SEDDEFS="${SEDDEFS}\${SEDdA}`echo sys/stat.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdB}`echo sys/stat.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdC}1\${SEDdD}
\${SEDuA}`echo sys/stat.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuB}`echo sys/stat.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuC}1\${SEDuD}
\${SEDeA}`echo sys/stat.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeB}`echo sys/stat.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*



trfrom='[a-z]./' trto='[A-Z]__'
echo checking for self-sufficiency of time.h
cat > conftest.c <<EOF
#include "confdefs.h"

#include <time.h>


int main() { exit(0); }
int t() {  }
EOF
if eval $compile; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining `echo time.h | tr "$trfrom" "$trto"`_NEEDS_HELP"
echo "#define" `echo time.h | tr "$trfrom" "$trto"`_NEEDS_HELP 1 >> confdefs.h
DEFS="$DEFS -D`echo time.h | tr "$trfrom" "$trto"`_NEEDS_HELP=1"
SEDDEFS="${SEDDEFS}\${SEDdA}`echo time.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdB}`echo time.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDdC}1\${SEDdD}
\${SEDuA}`echo time.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuB}`echo time.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDuC}1\${SEDuD}
\${SEDeA}`echo time.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeB}`echo time.h | tr "$trfrom" "$trto"`_NEEDS_HELP\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*



echo checking for string.h declaring some functions incorrectly
echo "
#include <sys/types.h>
#include <string.h>
#if NEED_MEMORY_H
#include <memory.h>
#endif
" > conftest.c
$CC $DEFS conftest.c -o conftest $LIBS > conftest.out 2>&1
if grep "conflicting types for built-in function" conftest.out >/dev/null; then
  
{
test -n "$verbose" && \
echo "	defining USE_OWN_STRING_H"
echo "#define" USE_OWN_STRING_H 1 >> confdefs.h
DEFS="$DEFS -DUSE_OWN_STRING_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USE_OWN_STRING_H\${SEDdB}USE_OWN_STRING_H\${SEDdC}1\${SEDdD}
\${SEDuA}USE_OWN_STRING_H\${SEDuB}USE_OWN_STRING_H\${SEDuC}1\${SEDuD}
\${SEDeA}USE_OWN_STRING_H\${SEDeB}USE_OWN_STRING_H\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

echo "checking for incompatibility between <sys/ioctl.h> and <stropts.h>"
cat > conftest.c <<EOF
#include "confdefs.h"

#include <sys/ioctl.h>
#include <stropts.h>

EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  :
else
  rm -rf conftest*
  
{
test -n "$verbose" && \
echo "	defining UNDEF_IO_IN_STROPTS_H"
echo "#define" UNDEF_IO_IN_STROPTS_H 1 >> confdefs.h
DEFS="$DEFS -DUNDEF_IO_IN_STROPTS_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}UNDEF_IO_IN_STROPTS_H\${SEDdB}UNDEF_IO_IN_STROPTS_H\${SEDdC}1\${SEDdD}
\${SEDuA}UNDEF_IO_IN_STROPTS_H\${SEDuB}UNDEF_IO_IN_STROPTS_H\${SEDuC}1\${SEDuD}
\${SEDeA}UNDEF_IO_IN_STROPTS_H\${SEDeB}UNDEF_IO_IN_STROPTS_H\${SEDeC}1\${SEDeD}
"
}

fi
rm -f conftest*

echo "checking whether or not fstat() can tell how much data is in a FIFO"
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
main()
{
#ifdef NeXT
/* The NeXT claims to have FIFOs, but using them panics the kernel... */
  exit(-1);
#endif
  int	rfd, wfd, result; struct stat st;
  unlink("/tmp/conftest-fifo");
  result = (mknod("/tmp/conftest-fifo", 0666 | S_IFIFO, 0) < 0
	    || (rfd = open("/tmp/conftest-fifo", O_RDONLY | O_NDELAY)) < 0
	    || (wfd = open("/tmp/conftest-fifo", O_WRONLY)) < 0
	    || write(wfd, "foo", 3) != 3
	    || fstat(rfd, &st) < 0
	    || st.st_size != 3);
  unlink("/tmp/conftest-fifo");
  exit(result);
}

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  
{
test -n "$verbose" && \
echo "	defining FSTAT_WORKS_ON_FIFOS"
echo "#define" FSTAT_WORKS_ON_FIFOS 1 >> confdefs.h
DEFS="$DEFS -DFSTAT_WORKS_ON_FIFOS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}FSTAT_WORKS_ON_FIFOS\${SEDdB}FSTAT_WORKS_ON_FIFOS\${SEDdC}1\${SEDdD}
\${SEDuA}FSTAT_WORKS_ON_FIFOS\${SEDuB}FSTAT_WORKS_ON_FIFOS\${SEDuC}1\${SEDuD}
\${SEDeA}FSTAT_WORKS_ON_FIFOS\${SEDeB}FSTAT_WORKS_ON_FIFOS\${SEDeC}1\${SEDeD}
"
}


fi
rm -fr conftest*

echo "checking whether or not select() can be used on FIFOs"
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifndef FD_ZERO
#define	NFDBITS		(sizeof(fd_set)*8)
#define	FD_ZERO(p)	bzero((char *)(p), sizeof(*(p)))
#define	FD_SET(n, p)	((p)->fds_bits[0] |= (1L<<((n)%NFDBITS)))
#define	FD_ISSET(n, p)	((p)->fds_bits[0] &  (1L<<((n)%NFDBITS)))
#endif /* FD_ZERO */
main()
{
#ifdef NeXT
/* The NeXT claims to have FIFOs, but using them panics the kernel... */
  exit(-1);
#endif
  int	rfd, wfd, result; fd_set input; struct timeval tv;
  tv.tv_sec = 2;
  tv.tv_usec = 0;
  unlink("/tmp/conftest-fifo");
  result = (mknod("/tmp/conftest-fifo", 0666 | S_IFIFO, 0) < 0
	    || (rfd = open("/tmp/conftest-fifo", O_RDONLY | O_NDELAY)) < 0
	    || (wfd = open("/tmp/conftest-fifo", O_WRONLY)) < 0
	    || (FD_ZERO(&input), FD_SET(rfd, &input),
		select(rfd + 1, &input, 0, 0, &tv) != 0)
	    || write(wfd, "foo", 3) != 3
	    || (FD_ZERO(&input), FD_SET(rfd, &input),
		select(rfd + 1, &input, 0, 0, &tv) != 1)
	    || !FD_ISSET(rfd, &input));
  unlink("/tmp/conftest-fifo");
  exit(result);
}

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  
{
test -n "$verbose" && \
echo "	defining SELECT_WORKS_ON_FIFOS"
echo "#define" SELECT_WORKS_ON_FIFOS 1 >> confdefs.h
DEFS="$DEFS -DSELECT_WORKS_ON_FIFOS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}SELECT_WORKS_ON_FIFOS\${SEDdB}SELECT_WORKS_ON_FIFOS\${SEDdC}1\${SEDdD}
\${SEDuA}SELECT_WORKS_ON_FIFOS\${SEDuB}SELECT_WORKS_ON_FIFOS\${SEDuC}1\${SEDuD}
\${SEDeA}SELECT_WORKS_ON_FIFOS\${SEDeB}SELECT_WORKS_ON_FIFOS\${SEDeC}1\${SEDeD}
"
}


fi
rm -fr conftest*

echo "checking whether or not poll() can be used on FIFOs"
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <poll.h>
#include <sys/stat.h>
#include <fcntl.h>
main()
{
  int	rfd, wfd, result; struct pollfd fds[1];
  unlink("/tmp/conftest-fifo");
  result = (mknod("/tmp/conftest-fifo", 0666 | S_IFIFO, 0) < 0
	    || (rfd = open("/tmp/conftest-fifo", O_RDONLY | O_NDELAY)) < 0
	    || (wfd = open("/tmp/conftest-fifo", O_WRONLY)) < 0
	    || write(wfd, "foo", 3) != 3
	    || (fds[0].fd = rfd, fds[0].events = POLLIN, poll(fds, 1, 1) != 1)
	    || (fds[0].revents & POLLIN) == 0);
  unlink("/tmp/conftest-fifo");
  exit(result);
}

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  
{
test -n "$verbose" && \
echo "	defining POLL_WORKS_ON_FIFOS"
echo "#define" POLL_WORKS_ON_FIFOS 1 >> confdefs.h
DEFS="$DEFS -DPOLL_WORKS_ON_FIFOS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}POLL_WORKS_ON_FIFOS\${SEDdB}POLL_WORKS_ON_FIFOS\${SEDdC}1\${SEDdD}
\${SEDuA}POLL_WORKS_ON_FIFOS\${SEDuB}POLL_WORKS_ON_FIFOS\${SEDuC}1\${SEDuD}
\${SEDeA}POLL_WORKS_ON_FIFOS\${SEDeB}POLL_WORKS_ON_FIFOS\${SEDeC}1\${SEDeD}
"
}


fi
rm -fr conftest*

echo checking whether POSIX-style non-blocking I/O works
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
handler(int sig) { }
main ()
{ /* Testing a POSIX feature, so assume FIFOs */
#ifdef NeXT
/* The NeXT claims to have FIFOs, but using them panics the kernel... */
  exit(-1);
#endif
  int	rfd, wfd, flags, result; char buffer[10];
  unlink("/tmp/conftest-fifo");
  signal(SIGALRM, handler);
  result = (mknod("/tmp/conftest-fifo", 0666 | S_IFIFO, 0) < 0
	    || (rfd = open("/tmp/conftest-fifo", O_RDONLY | O_NONBLOCK)) < 0
	    || (wfd = open("/tmp/conftest-fifo", O_WRONLY)) < 0
	    || (flags = fcntl(rfd, F_GETFL, 0)) < 0
	    || fcntl(rfd, F_SETFL, flags | O_NONBLOCK) < 0
	    || (alarm(3), read(rfd, buffer, 10) >= 0)
	    || (alarm(0), errno != EAGAIN));
  unlink("/tmp/conftest-fifo");
  exit(result);
}

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  
{
test -n "$verbose" && \
echo "	defining POSIX_NONBLOCKING_WORKS"
echo "#define" POSIX_NONBLOCKING_WORKS 1 >> confdefs.h
DEFS="$DEFS -DPOSIX_NONBLOCKING_WORKS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}POSIX_NONBLOCKING_WORKS\${SEDdB}POSIX_NONBLOCKING_WORKS\${SEDdC}1\${SEDdD}
\${SEDuA}POSIX_NONBLOCKING_WORKS\${SEDuB}POSIX_NONBLOCKING_WORKS\${SEDuC}1\${SEDuD}
\${SEDeA}POSIX_NONBLOCKING_WORKS\${SEDeB}POSIX_NONBLOCKING_WORKS\${SEDeC}1\${SEDeD}
"
}


fi
rm -fr conftest*

echo checking which MOO networking configurations are likely to work...

NETWORK_CONFIGURATIONS="NP_SINGLE"

echo checking for sys/socket.h
cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/socket.h>
EOF
err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
if test -z "$err"; then
  rm -rf conftest*
  
	
    NETWORK_CONFIGURATIONS="$NETWORK_CONFIGURATIONS NS_BSD/NP_LOCAL"
	if test -z "$have_telnet"; then
  # Extract the first word of `telnet', so it can be a program name with args.
  set dummy telnet; 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
      have_telnet="yes"
      break
    fi
  done
  IFS="$saveifs"
fi
test -z "$have_telnet" && have_telnet="no"
test -n "$have_telnet" && test -n "$verbose" && echo "	setting have_telnet to $have_telnet"

        test x$have_telnet = xyes && 
    NETWORK_CONFIGURATIONS="$NETWORK_CONFIGURATIONS NS_BSD/NP_TCP"

fi
rm -f conftest*

cat > conftest.c <<EOF
#include "confdefs.h"
#include <sys/stat.h>
#if defined(S_IFIFO) && !defined(NeXT) && \
    (SELECT_WORKS_ON_FIFOS || POLL_WORKS_ON_FIFOS || FSTAT_WORKS_ON_FIFOS)
	yes-there-are-FIFOs
#endif

EOF
eval "$CPP conftest.c > conftest.out 2>&1"
if egrep "yes-there-are-FIFOs" conftest.out >/dev/null 2>&1; then
  rm -rf conftest*
  
    NETWORK_CONFIGURATIONS="$NETWORK_CONFIGURATIONS NS_SYSV/NP_LOCAL"

fi
rm -f conftest*

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

#if HAVE_TIUSER_H && HAVE_T_OPEN && HAVE_POLL
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 -r /dev/tcp && 
    NETWORK_CONFIGURATIONS="$NETWORK_CONFIGURATIONS NS_SYSV/NP_TCP"

fi
rm -f conftest*


echo "----------------------------------------------------------------------"
echo "| The following networking configurations will probably work on your"
echo "| system; any configuration *not* listed here almost certainly will"
echo "| *not* work on your system:"
echo "|"
echo "|   $NETWORK_CONFIGURATIONS"
echo "----------------------------------------------------------------------"

# 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 -fr Makefile config.h conftest*; exit 1' 1 3 15
YACC='$YACC'
CC='$CC'
CPP='$CPP'
have_telnet='$have_telnet'
LIBS='$LIBS'
srcdir='$srcdir'
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%@YACC@%$YACC%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@have_telnet@%$have_telnet%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
fi; done

CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
echo creating $file

# These sed commands are put into SEDDEFS when defining a macro.
# They are broken into pieces to make the sed script easier to manage.
# They are passed to sed as "A NAME B NAME C VALUE D", where NAME
# is the cpp macro being defined and VALUE is the value it is being given.
# Each defining turns into a single global substitution command.
#
# SEDd sets the value in "#define NAME VALUE" lines.
SEDdA='s@^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
SEDdB='\([ 	][ 	]*\)[^ 	]*@\1#\2'
SEDdC='\3'
SEDdD='@g'
# SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
SEDuA='s@^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
SEDuB='\([ 	]\)@\1#\2define\3'
SEDuC=' '
SEDuD='\4@g'
# SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
SEDeA='s@^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
SEDeB='$@\1#\2define\3'
SEDeC=' '
SEDeD='@g'
rm -f conftest.sed
EOF
# Turn off quoting long enough to insert the sed commands.
rm -f conftest.sh
cat > conftest.sh <<EOF
$SEDDEFS
EOF

# Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
# on the size of here documents.

# Maximum number of lines to put in a single here document.
maxshlines=9

while :
do
  # wc gives bogus results for an empty file on some systems.
  lines=`grep -c . conftest.sh`
  if test -z "$lines" || test "$lines" -eq 0; then break; fi
  rm -f conftest.s1 conftest.s2
  sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  # Write a limited-size here document to append to conftest.sed.
  echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  cat conftest.s1 >> config.status
  echo 'CONFEOF' >> config.status
  rm -f conftest.s1 conftest.sh
  mv conftest.s2 conftest.sh
done
rm -f conftest.sh

# Now back to your regularly scheduled config.status.
cat >> config.status <<\EOF
# This sed command replaces #undef's with comments.  This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it in
# config.h.
cat >> conftest.sed <<\CONFEOF
s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
CONFEOF
rm -f conftest.h
# Break up the sed commands because old seds have small limits.
maxsedlines=20
cp $top_srcdir/$file.in conftest.h1
while :
do
  lines=`grep -c . conftest.sed`
  if test -z "$lines" || test "$lines" -eq 0; then break; fi
  rm -f conftest.s1 conftest.s2 conftest.h2
  sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  sed -f conftest.s1 < conftest.h1 > conftest.h2
  rm -f conftest.s1 conftest.h1 conftest.sed
  mv conftest.h2 conftest.h1
  mv conftest.s2 conftest.sed
done
rm -f conftest.sed conftest.h
echo "/* $file.  Generated automatically by configure.  */" > conftest.h
cat conftest.h1 >> conftest.h
rm -f conftest.h1
if cmp -s $file conftest.h 2>/dev/null; then
  # The file exists and we would not be changing it.
  echo "$file is unchanged"
  rm -f conftest.h
else
  rm -f $file
  mv conftest.h $file
fi
fi; done



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


# $Log: configure,v $
# Revision 1.5  2009/10/15 23:05:05  blacklite
# add a big ol warning and exit to configure
#
# Revision 1.4  2009/03/08 12:41:31  blacklite
# Added HASH data type, yield keyword, MEMORY_TRACE, vfscanf(),
# extra myrealloc() and memcpy() tricks for lists, Valgrind
# support for str_intern.c, etc. See ChangeLog.txt.
#
# Revision 1.3  2007/09/12 07:33:29  spunky
# This is a working version of the current HellMOO server
#
# Revision 1.1.1.1  1997/03/03 03:45:05  nop
# LambdaMOO 1.8.0p5
#
# Revision 2.8  1996/03/19  07:16:46  pavel
# Added one more option for trying to enable ANSI C compilation.
# Release 1.8.0p2.
#
# Revision 2.7  1996/03/10  01:21:41  pavel
# Increased DEC Alpha -Olimit to 2500 from 1000.  Release 1.8.0.
#
# Revision 2.6  1996/02/11  00:43:22  pavel
# Added check for matherr().  Release 1.8.0beta2.
#
# Revision 2.5  1996/02/08  07:22:30  pavel
# Added checks for SGI machines and for strtod() being undeclared.  Updated
# copyright notice for 1996.  Release 1.8.0beta1.
#
# Revision 2.4  1996/01/11  07:47:54  pavel
# Added a handy form-feed between the macro definitions and the main script,
# to make it easier to navigate with Emacs.  Release 1.8.0alpha5.
#
# Revision 2.3  1995/12/31  03:17:07  pavel
# Added test for <sys/stat.h> needing help.  Release 1.8.0alpha4.
#
# Revision 2.2  1995/12/28  00:49:41  pavel
# On NeXT, we now define _POSIX_SOURCE too.  Release 1.8.0alpha3.
#
# Revision 2.1  1995/12/11  08:05:45  pavel
# Added support for finding `crypt()' in `-lcrypt'.  Release 1.8.0alpha2.
#
# Revision 2.0  1995/11/30  05:09:41  pavel
# New baseline version, corresponding to release 1.8.0alpha1.
#
# Revision 1.5  1992/10/28  01:56:41  pavel
# Fixed NDECL test to look for `vfprintf' instead of the unused `vprintf'...
#
# Revision 1.4  1992/10/23  23:13:18  pavel
# Added copyright notice.
#
# Revision 1.3  1992/10/23  19:23:52  pavel
# Added MOO_AUX, MOO_MALLOC_H, MOO_FUNC_DECL_CHECK.
# Generalized MOO_HAVE_FUNC_LIBS to take multiple function names.
# Refined MOO_CONST to check for warnings about `reserved' keywords.
# Added MOO_NDECL_FUNCS checks for sigemptyset, perror, remove, vprintf,
# bzero, memset, fork, fstat, and waitpid.
# Simplified test for conflicting built-in function declarations.
# Added SELECT_WORKS_ON_FIFOS and POSIX_NONBLOCKING_WORKS tests.
#
# Revision 1.2  1992/10/21  03:09:41  pavel
# Added this log.

# Local Variables:
# mode: c
# End:
