dmuck0.15-beta/docs/muf/
dmuck0.15-beta/game/
dmuck0.15-beta/game/logs/
dmuck0.15-beta/game/muf/
dmuck0.15-beta/game/muf/text/
#!/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] [--no-create]
#        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
# Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
# --with-PACKAGE 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, also recognize exact --exec_prefix.
     -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
	exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
     -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
	next_exec_prefix=yes ;;

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

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

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

     -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
        no_create=1 ;;

     -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 's/-*with-//'`
       # Delete all the valid chars; see if any are left.
       if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
         echo "configure: $package: invalid package name" >&2; exit 1
       fi
       eval "with_`echo $package|sed s/-/_/g`=1" ;;

     *) ;;
    esac
  fi
done

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

rm -f conftest*
compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
math_compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS -lm>/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=interface.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


if test -z "$CC"; then
  echo checking for gcc
  saveifs="$IFS"; IFS="${IFS}:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test -f $dir/gcc; then
      CC="gcc"
      break
    fi
  done
  IFS="$saveifs"
fi
test -z "$CC" && CC="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
  CPP='${CC-cc} -E'
  cat > conftest.c <<EOF
#include <stdio.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
  :
else
  CPP=/lib/cpp
fi
rm -f conftest*
fi

echo checking for ANSI C header files
cat > conftest.c <<EOF
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
  # SunOS string.h does not declare mem*, contrary to ANSI.
echo '#include <string.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "memchr" conftest.out >/dev/null 2>&1; then
  # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
cat > conftest.c <<EOF
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }

EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  DEFS="$DEFS -DSTDC_HEADERS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
\${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
\${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
fi
rm -f conftest*

fi
rm -f conftest*

echo checking for unistd.h
cat > conftest.c <<EOF
#include <unistd.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
  DEFS="$DEFS -DHAVE_UNISTD_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNISTD_H\${SEDdB}HAVE_UNISTD_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_UNISTD_H\${SEDuB}HAVE_UNISTD_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_UNISTD_H\${SEDeB}HAVE_UNISTD_H\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

echo checking whether string.h declares mem functions
echo '#include <string.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "memchr" conftest.out >/dev/null 2>&1; then
  :
else 
  echo checking for memory.h
cat > conftest.c <<EOF
#include <memory.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
  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*

fi
rm -f conftest*


for hdr in errno.h malloc.h sys/socketvar.h
do
trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
echo checking for ${hdr}
cat > conftest.c <<EOF
#include <${hdr}>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
  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

echo checking for variable length local character buffers
cat > conftest.c <<EOF
#include <stdio.h>
int x=4096;
main() { exit(0); }
t() { char tmp[x]; }
EOF
if eval $compile; then
  :
else
  DEFS="$DEFS -DHAVE_VAR_LOCAL_VAR=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VAR_LOCAL_VAR\${SEDdB}HAVE_VAR_LOCAL_VAR\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_VAR_LOCAL_VAR\${SEDuB}HAVE_VAR_LOCAL_VAR\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_VAR_LOCAL_VAR\${SEDeB}HAVE_VAR_LOCAL_VAR\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

echo checking for time.h / sys/time.h conflicts
cat > conftest.c <<EOF
#include <time.h>
#include <sys/time.h>
main() { exit(0); } 
t() { struct tm tms; }
EOF
if eval $compile; then
  :
else
  DEFS="$DEFS -DTIME_H_BRAINDAMAGE=1"
SEDDEFS="${SEDDEFS}\${SEDdA}TIME_H_BRAINDAMAGE\${SEDdB}TIME_H_BRAINDAMAGE\${SEDdC}1\${SEDdD}
\${SEDuA}TIME_H_BRAINDAMAGE\${SEDuB}TIME_H_BRAINDAMAGE\${SEDuC}1\${SEDuD}
\${SEDeA}TIME_H_BRAINDAMAGE\${SEDeB}TIME_H_BRAINDAMAGE\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for BSD string and memory functions
cat > conftest.c <<EOF
#include <strings.h>
main() { exit(0); } 
t() { rindex(0, 0); bzero(0, 0); }
EOF
if eval $compile; then
  :
else
  DEFS="$DEFS -DUSG=1"
SEDDEFS="${SEDDEFS}\${SEDdA}USG\${SEDdB}USG\${SEDdC}1\${SEDdD}
\${SEDuA}USG\${SEDuB}USG\${SEDuC}1\${SEDuD}
\${SEDeA}USG\${SEDeB}USG\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

echo checking for vfork.h
cat > conftest.c <<EOF
#include <vfork.h>
EOF
err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
if test -z "$err"; then
  DEFS="$DEFS -DHAVE_VFORK_H=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VFORK_H\${SEDdB}HAVE_VFORK_H\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_VFORK_H\${SEDuB}HAVE_VFORK_H\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_VFORK_H\${SEDeB}HAVE_VFORK_H\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

echo checking for working vfork
cat > conftest.c <<EOF
/* Thanks to Paul Eggert for this test.  */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_VFORK_H
#include <vfork.h>
#endif
main() {
  pid_t parent = getpid();
  pid_t child = vfork();

  if (child == 0) {
    /* On sparc systems, changes by the child to local and incoming
       argument registers are propagated back to the parent.
       The compiler is told about this with #include <vfork.h>,
       but some compilers (e.g. gcc -O) don't grok <vfork.h>.
       Test for this by using lots of local variables, at least
       as many local variables as main has allocated so far
       including compiler temporaries.  4 locals are enough for
       gcc 1.40.3 on a sparc, but we use 8 to be safe.
       A buggy compiler should reuse the register of parent
       for one of the local variables, since it will think that
       parent can't possibly be used any more in this routine.
       Assigning to the local variable will thus munge parent
       in the parent process.  */
    pid_t
      p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
      p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
    /* Convince the compiler that p..p7 are live; otherwise, it might
       use the same hardware register for all 8 local variables.  */
    if (p != p1 || p != p2 || p != p3 || p != p4
	|| p != p5 || p != p6 || p != p7)
      _exit(1);

    /* On some systems (e.g. IRIX 3.3),
       vfork doesn't separate parent from child file descriptors.
       If the child closes a descriptor before it execs or exits,
       this munges the parent's descriptor as well.
       Test for this by closing stdout in the child.  */
    _exit(close(fileno(stdout)) != 0);
  } else {
    int status;
    struct stat st;

    while (wait(&status) != child)
      ;
    exit(
	 /* Was there some problem with vforking?  */
	 child < 0

	 /* Did the child fail?  (This shouldn't happen.)  */
	 || status

	 /* Did the vfork/compiler bug occur?  */
	 || parent != getpid()

	 /* Did the file descriptor bug occur?  */
	 || fstat(fileno(stdout), &st) != 0
	 );
  }
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  :
else
  DEFS="$DEFS -Dvfork=fork"
SEDDEFS="${SEDDEFS}\${SEDdA}vfork\${SEDdB}vfork\${SEDdC}fork\${SEDdD}
\${SEDuA}vfork\${SEDuB}vfork\${SEDuC}fork\${SEDuD}
\${SEDeA}vfork\${SEDeB}vfork\${SEDeC}fork\${SEDeD}
"
fi
rm -f conftest*

echo checking for vprintf
cat > conftest.c <<EOF

main() { exit(0); } 
t() { vprintf(); }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE_VPRINTF=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_VPRINTF\${SEDdB}HAVE_VPRINTF\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_VPRINTF\${SEDuB}HAVE_VPRINTF\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_VPRINTF\${SEDeB}HAVE_VPRINTF\${SEDeC}1\${SEDeD}
"
else
  vprintf_missing=1
fi
rm -f conftest*

if test -n "$vprintf_missing"; then
echo checking for _doprnt
cat > conftest.c <<EOF

main() { exit(0); } 
t() { _doprnt(); }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE_DOPRNT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DOPRNT\${SEDdB}HAVE_DOPRNT\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_DOPRNT\${SEDuB}HAVE_DOPRNT\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_DOPRNT\${SEDeB}HAVE_DOPRNT\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

fi

for func in setrlimit getrusage timelocal mktime srandom drand48 strftime
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); } 
t() { 
#ifdef __stub_${func}
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  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*
#endif
done

for func in getpagesize getdtablesize
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); } 
t() { 
#ifdef __stub_${func}
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $compile; then
  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*
#endif
done

for func in cbrt asinh remainder lgamma erfc y1 j1 fabs isnormal issubnormal finite isinf isnan
do
trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
echo checking for ${func}
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); } 
t() { 
#ifdef __stub_${func}
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char ${func}(); ${func}();
#endif
 }
EOF
if eval $math_compile; then
  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*
#endif
done

echo checking for return type of signal handlers
cat > conftest.c <<EOF
#include <sys/types.h>
#include <signal.h>
#ifdef signal
#undef signal
#endif
extern void (*signal ()) ();
main() { exit(0); } 
t() { int i; }
EOF
if eval $compile; then
  DEFS="$DEFS -DRETSIGTYPE=void"
SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
\${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
\${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
"
else
  DEFS="$DEFS -DRETSIGTYPE=int"
SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
\${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
\${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
"
fi
rm -f conftest*


echo checking for struct sigcontext argument in signal handlers
cat > conftest.c <<EOF
#include <sys/signal.h>
main() { exit(0); } 
t() { struct sigcontext scp; }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE_STRUCT_SIGCONTEXT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_STRUCT_SIGCONTEXT\${SEDdB}HAVE_STRUCT_SIGCONTEXT\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_STRUCT_SIGCONTEXT\${SEDuB}HAVE_STRUCT_SIGCONTEXT\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_STRUCT_SIGCONTEXT\${SEDeB}HAVE_STRUCT_SIGCONTEXT\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for wait3 that fills in rusage
cat > conftest.c <<EOF
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <stdio.h>
/* HP-UX has wait3 but does not fill in rusage.  */
main() {
  struct rusage r;
  int i;
  r.ru_nvcsw = 0;
  switch (fork()) {
  case 0: /* Child.  */
    sleep(1); /* Give up the CPU.  */
    _exit(0);
  case -1: _exit(0); /* What can we do?  */
  default: /* Parent.  */
    wait3(&i, 0, &r);
    exit(r.ru_nvcsw == 0);
  }
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  DEFS="$DEFS -DHAVE_WAIT3=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_WAIT3\${SEDdB}HAVE_WAIT3\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_WAIT3\${SEDuB}HAVE_WAIT3\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_WAIT3\${SEDeB}HAVE_WAIT3\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

echo checking for struct tm in time.h
cat > conftest.c <<EOF
#include <sys/types.h>
#include <time.h>
main() { exit(0); } 
t() { struct tm *tp; }
EOF
if eval $compile; then
  :
else
  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
$decl
main() { exit(0); } 
t() { struct tm tm; tm.tm_zone; }
EOF
if eval $compile; then
  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
  no_tm_zone=1
fi
rm -f conftest*

if test -n "$no_tm_zone"; then
echo checking for tzname
cat > conftest.c <<EOF
#include <time.h>
#ifndef tzname /* For SGI.  */
changequote(,)dnl
extern char *tzname[]; /* RS6000 and others want it this way.  */
changequote([,])dnl
#endif
main() { exit(0); } 
t() { atoi(*tzname); }
EOF
if eval $compile; then
  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

echo checking for pid_t in sys/types.h
echo '#include <sys/types.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  :
else 
  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 union wait
cat > conftest.c <<EOF
#include <sys/wait.h>
main() { exit(0); } 
t() { union wait stat; }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE_UNION_WAIT=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNION_WAIT\${SEDdB}HAVE_UNION_WAIT\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_UNION_WAIT\${SEDuB}HAVE_UNION_WAIT\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_UNION_WAIT\${SEDeB}HAVE_UNION_WAIT\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for vsprintf dcl
echo '#include <stdio.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "vsprintf" conftest.out >/dev/null 2>&1; then
  :
else 
  DEFS="$DEFS -DNEED_VSPRINTF_DCL=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_VSPRINTF_DCL\${SEDdB}NEED_VSPRINTF_DCL\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_VSPRINTF_DCL\${SEDuB}NEED_VSPRINTF_DCL\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_VSPRINTF_DCL\${SEDeB}NEED_VSPRINTF_DCL\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for sprintf dcl
echo '#include <stdio.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "\<sprintf|\<*sprintf" conftest.out >/dev/null 2>&1; then
  :
else 
  DEFS="$DEFS -DNEED_SPRINTF_DCL=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_SPRINTF_DCL\${SEDdB}NEED_SPRINTF_DCL\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_SPRINTF_DCL\${SEDuB}NEED_SPRINTF_DCL\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_SPRINTF_DCL\${SEDeB}NEED_SPRINTF_DCL\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

echo checking for extended stdio dcls
echo '#include <stdio.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "fread" conftest.out >/dev/null 2>&1; then
  DEFS="$DEFS -DEXTENDED_STDIO_DCLS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}EXTENDED_STDIO_DCLS\${SEDdB}EXTENDED_STDIO_DCLS\${SEDdC}1\${SEDdD}
\${SEDuA}EXTENDED_STDIO_DCLS\${SEDuB}EXTENDED_STDIO_DCLS\${SEDuC}1\${SEDuD}
\${SEDeA}EXTENDED_STDIO_DCLS\${SEDeB}EXTENDED_STDIO_DCLS\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for extended socket dcls
echo '#include <sys/socket.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "setsockopt" conftest.out >/dev/null 2>&1; then
  DEFS="$DEFS -DEXTENDED_SOCKET_DCLS=1"
SEDDEFS="${SEDDEFS}\${SEDdA}EXTENDED_SOCKET_DCLS\${SEDdB}EXTENDED_SOCKET_DCLS\${SEDdC}1\${SEDdD}
\${SEDuA}EXTENDED_SOCKET_DCLS\${SEDuB}EXTENDED_SOCKET_DCLS\${SEDuC}1\${SEDuD}
\${SEDeA}EXTENDED_SOCKET_DCLS\${SEDeB}EXTENDED_SOCKET_DCLS\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo checking for sys_siglist
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); } 
t() { 
#ifdef __stub_sys_siglist
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char sys_siglist(); sys_siglist();
#endif
 }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE_SYS_SIGLIST=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SYS_SIGLIST\${SEDdB}HAVE_SYS_SIGLIST\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_SYS_SIGLIST\${SEDuB}HAVE_SYS_SIGLIST\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_SYS_SIGLIST\${SEDeB}HAVE_SYS_SIGLIST\${SEDeC}1\${SEDeD}
"
else
  siglist_missing=1
fi
rm -f conftest*
#endif

if test -n "$siglist_missing"; then
echo checking for _sys_siglist
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); } 
t() { 
#ifdef __stub__sys_siglist
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char _sys_siglist(); _sys_siglist();
#endif
 }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE__SYS_SIGLIST=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE__SYS_SIGLIST\${SEDdB}HAVE__SYS_SIGLIST\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE__SYS_SIGLIST\${SEDuB}HAVE__SYS_SIGLIST\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE__SYS_SIGLIST\${SEDeB}HAVE__SYS_SIGLIST\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif

fi

case "$DEFS" in
*HAVE_SYS_SIGLIST*)
echo checking for sys_siglist dcl
echo '#include <signal.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "sys_siglist" conftest.out >/dev/null 2>&1; then
  :
else 
  DEFS="$DEFS -DNEED_SYS_SIGLIST_DCL=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_SYS_SIGLIST_DCL\${SEDdB}NEED_SYS_SIGLIST_DCL\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_SYS_SIGLIST_DCL\${SEDuB}NEED_SYS_SIGLIST_DCL\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_SYS_SIGLIST_DCL\${SEDeB}NEED_SYS_SIGLIST_DCL\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
 ;;
*)
case "$DEFS" in
*HAVE__SYS_SIGLIST*)
echo '#include <signal.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "_sys_siglist" conftest.out >/dev/null 2>&1; then
  :
else 
  DEFS="$DEFS -DNEED__SYS_SIGLIST_DCL=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED__SYS_SIGLIST_DCL\${SEDdB}NEED__SYS_SIGLIST_DCL\${SEDdC}1\${SEDdD}
\${SEDuA}NEED__SYS_SIGLIST_DCL\${SEDuB}NEED__SYS_SIGLIST_DCL\${SEDuC}1\${SEDuD}
\${SEDeA}NEED__SYS_SIGLIST_DCL\${SEDeB}NEED__SYS_SIGLIST_DCL\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
 ;;
esac ;;
esac

case "$DEFS" in
*HAVE_ERRNO_H*)
DEFS="$DEFS -DNEED_SYS_ERRLIST_DCL=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_SYS_ERRLIST_DCL\${SEDdB}NEED_SYS_ERRLIST_DCL\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_SYS_ERRLIST_DCL\${SEDuB}NEED_SYS_ERRLIST_DCL\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_SYS_ERRLIST_DCL\${SEDeB}NEED_SYS_ERRLIST_DCL\${SEDeC}1\${SEDeD}
" ;;
*)
echo checking for sys_errlist dcl
echo '#include <errno.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "sys_errlist" conftest.out >/dev/null 2>&1; then
  :
else 
  DEFS="$DEFS -DNEED_SYS_ERRLIST_DCL=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_SYS_ERRLIST_DCL\${SEDdB}NEED_SYS_ERRLIST_DCL\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_SYS_ERRLIST_DCL\${SEDuB}NEED_SYS_ERRLIST_DCL\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_SYS_ERRLIST_DCL\${SEDeB}NEED_SYS_ERRLIST_DCL\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
 ;;
esac
echo checking for perror dcl
echo '#include <errno.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "perror" conftest.out >/dev/null 2>&1; then
  :
else 
  DEFS="$DEFS -DNEED_PERROR_DCL=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_PERROR_DCL\${SEDdB}NEED_PERROR_DCL\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_PERROR_DCL\${SEDuB}NEED_PERROR_DCL\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_PERROR_DCL\${SEDeB}NEED_PERROR_DCL\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

echo checking for getrusage dcl
echo '#include <sys/resource.h>' > conftest.c
eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
if egrep "getrusage" conftest.out >/dev/null 2>&1; then
  :
else 
  DEFS="$DEFS -DNEED_GETRUSAGE_DCL=1"
SEDDEFS="${SEDDEFS}\${SEDdA}NEED_GETRUSAGE_DCL\${SEDdB}NEED_GETRUSAGE_DCL\${SEDdC}1\${SEDdD}
\${SEDuA}NEED_GETRUSAGE_DCL\${SEDuB}NEED_GETRUSAGE_DCL\${SEDuC}1\${SEDuD}
\${SEDeA}NEED_GETRUSAGE_DCL\${SEDeB}NEED_GETRUSAGE_DCL\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

prog='/* Ultrix mips cc rejects this.  */
typedef int charset[2]; const charset x;
/* SunOS 4.1.1 cc rejects this. */
char const *const *p;
char **p2;
/* HPUX 7.0 cc rejects these. */
++p;
p2 = (char const* const*) p;'
echo checking for working const
cat > conftest.c <<EOF

main() { exit(0); } 
t() { $prog }
EOF
if eval $compile; then
  :
else
  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*

echo checking for unsigned characters
cat > conftest.c <<EOF
/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
#if !__STDC__
#define volatile
#endif
main() {
#ifdef __CHAR_UNSIGNED__
  exit(1); /* No need to redefine it.  */
#else
  volatile char c = 255; exit(c < 0);
#endif
}
EOF
eval $compile
if test -s conftest && (./conftest; exit) 2>/dev/null; then
  DEFS="$DEFS -D__CHAR_UNSIGNED__=1"
SEDDEFS="${SEDDEFS}\${SEDdA}__CHAR_UNSIGNED__\${SEDdB}__CHAR_UNSIGNED__\${SEDdC}1\${SEDdD}
\${SEDuA}__CHAR_UNSIGNED__\${SEDuB}__CHAR_UNSIGNED__\${SEDuC}1\${SEDuD}
\${SEDeA}__CHAR_UNSIGNED__\${SEDeB}__CHAR_UNSIGNED__\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*

if test -n "$GCC"; then
echo checking for inline
cat > conftest.c <<EOF

main() { exit(0); } 
t() { } inline foo() { }
EOF
if eval $compile; then
  :
else
  DEFS="$DEFS -Dinline=__inline"
SEDDEFS="${SEDDEFS}\${SEDdA}inline\${SEDdB}inline\${SEDdC}__inline\${SEDdD}
\${SEDuA}inline\${SEDuB}inline\${SEDuC}__inline\${SEDuD}
\${SEDeA}inline\${SEDeB}inline\${SEDeC}__inline\${SEDeD}
"
fi
rm -f conftest*

fi

echo checking for linger
cat > conftest.c <<EOF
#include <sys/socket.h>
main() { exit(0); } 
t() { struct linger ling; ling.l_onoff = 1; }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE_LINGER=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LINGER\${SEDdB}HAVE_LINGER\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LINGER\${SEDuB}HAVE_LINGER\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LINGER\${SEDeB}HAVE_LINGER\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
echo "checking for ndbm routines in libc:"
LIBS_predbm="$LIBS"
echo checking for dbm_close
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); } 
t() { 
#ifdef __stub_dbm_close
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char dbm_close(); dbm_close();
#endif
 }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE_NDBM=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_NDBM\${SEDdB}HAVE_NDBM\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_NDBM\${SEDuB}HAVE_NDBM\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_NDBM\${SEDeB}HAVE_NDBM\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif

case "$DEFS" in
    *HAVE_NDBM*)
	;;
    *)
	libname=`echo "ndbm" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
LIBS_save="${LIBS}"
LIBS="${LIBS} -l${libname}"
have_lib=""
echo checking for -lndbm
cat > conftest.c <<EOF

main() { exit(0); } 
t() { main(); }
EOF
if eval $compile; then
  have_lib="1"
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
      deflibname=`echo "${libname}" | tr '[a-z]' '[A-Z]'`
      DEFS="$DEFS -DHAVE_LIB${deflibname}=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIB${deflibname}\${SEDdB}HAVE_LIB${deflibname}\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LIB${deflibname}\${SEDuB}HAVE_LIB${deflibname}\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LIB${deflibname}\${SEDeB}HAVE_LIB${deflibname}\${SEDeC}1\${SEDeD}
"
   LIBS="${LIBS} -l${libname}"
fi

	case "$DEFS" in
	    *HAVE_LIBNDBM*)
		DEFS="$DEFS -DHAVE_NDBM=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_NDBM\${SEDdB}HAVE_NDBM\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_NDBM\${SEDuB}HAVE_NDBM\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_NDBM\${SEDeB}HAVE_NDBM\${SEDeC}1\${SEDeD}
" ;;
	    *)
		libname=`echo "dbm" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
LIBS_save="${LIBS}"
LIBS="${LIBS} -l${libname}"
have_lib=""
echo checking for -ldbm
cat > conftest.c <<EOF

main() { exit(0); } 
t() { main(); }
EOF
if eval $compile; then
  have_lib="1"
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
      deflibname=`echo "${libname}" | tr '[a-z]' '[A-Z]'`
      DEFS="$DEFS -DHAVE_LIB${deflibname}=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIB${deflibname}\${SEDdB}HAVE_LIB${deflibname}\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LIB${deflibname}\${SEDuB}HAVE_LIB${deflibname}\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LIB${deflibname}\${SEDeB}HAVE_LIB${deflibname}\${SEDeC}1\${SEDeD}
"
   LIBS="${LIBS} -l${libname}"
fi

		case "$DEFS" in
		    *HAVE_LIBDBM*)
			echo "checking for ndbm routines in libdbm:"
			echo checking for dbm_close
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); } 
t() { 
#ifdef __stub_dbm_close
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char dbm_close(); dbm_close();
#endif
 }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE_NDBM=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_NDBM\${SEDdB}HAVE_NDBM\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_NDBM\${SEDuB}HAVE_NDBM\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_NDBM\${SEDeB}HAVE_NDBM\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif

			case "$DEFS" in
			    *HAVE_NDBM*)
				;;
			    *)
				LIBS_withdbm="$LIBS"
				LIBS="$LIBS_predbm"
				libname=`echo "sdbm" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
LIBS_save="${LIBS}"
LIBS="${LIBS} -l${libname}"
have_lib=""
echo checking for -lsdbm
cat > conftest.c <<EOF

main() { exit(0); } 
t() { main(); }
EOF
if eval $compile; then
  have_lib="1"
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
      deflibname=`echo "${libname}" | tr '[a-z]' '[A-Z]'`
      DEFS="$DEFS -DHAVE_LIB${deflibname}=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIB${deflibname}\${SEDdB}HAVE_LIB${deflibname}\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LIB${deflibname}\${SEDuB}HAVE_LIB${deflibname}\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LIB${deflibname}\${SEDeB}HAVE_LIB${deflibname}\${SEDeC}1\${SEDeD}
"
   LIBS="${LIBS} -l${libname}"
fi

				case "$DEFS" in
				    *HAVE_SDBM*)
					DEFS="$DEFS -DHAVE_NDBM=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_NDBM\${SEDdB}HAVE_NDBM\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_NDBM\${SEDuB}HAVE_NDBM\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_NDBM\${SEDeB}HAVE_NDBM\${SEDeC}1\${SEDeD}
" ;;
				    *)
					LIBS="$LIBS_withdbm" ;;
				esac ;;
			esac ;;
		esac ;;
	esac ;;
esac

case "$DEFS" in
*HAVE_NDBM*)
;;
*)
LIBS="$LIBS_predbm"
echo checking for dbm routines in libc
echo checking for dbmclose
cat > conftest.c <<EOF
#include <stdio.h>
main() { exit(0); } 
t() { 
#ifdef __stub_dbmclose
choke me
#else
/* Override any gcc2 internal prototype to avoid an error.  */
extern char dbmclose(); dbmclose();
#endif
 }
EOF
if eval $compile; then
  DEFS="$DEFS -DHAVE_DBM=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DBM\${SEDdB}HAVE_DBM\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_DBM\${SEDuB}HAVE_DBM\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_DBM\${SEDeB}HAVE_DBM\${SEDeC}1\${SEDeD}
"
fi
rm -f conftest*
#endif

case "$DEFS" in
*HAVE_DBM*)
;;
*)
case "$DEFS" in
*HAVE_LIBDBM*)
DEFS="$DEFS -DHAVE_DBM=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_DBM\${SEDdB}HAVE_DBM\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_DBM\${SEDuB}HAVE_DBM\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_DBM\${SEDeB}HAVE_DBM\${SEDeC}1\${SEDeD}
"
LIBS="$LIBS_withdbm" ;;
esac ;;
esac
case "$DEFS" in
*HAVE_DBM*)
;;
*)
LIBOBJS="$LIBOBJS myndbm.o" ;;
esac ;;
esac

libname=`echo "resolv" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
LIBS_save="${LIBS}"
LIBS="${LIBS} -l${libname}"
have_lib=""
echo checking for -lresolv
cat > conftest.c <<EOF

main() { exit(0); } 
t() { main(); }
EOF
if eval $compile; then
  have_lib="1"
fi
rm -f conftest*
LIBS="${LIBS_save}"
if test -n "${have_lib}"; then
      deflibname=`echo "${libname}" | tr '[a-z]' '[A-Z]'`
      DEFS="$DEFS -DHAVE_LIB${deflibname}=1"
SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_LIB${deflibname}\${SEDdB}HAVE_LIB${deflibname}\${SEDdC}1\${SEDdD}
\${SEDuA}HAVE_LIB${deflibname}\${SEDuB}HAVE_LIB${deflibname}\${SEDuC}1\${SEDuD}
\${SEDeA}HAVE_LIB${deflibname}\${SEDeB}HAVE_LIB${deflibname}\${SEDeC}1\${SEDeD}
"
   LIBS="${LIBS} -l${libname}"
fi


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

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`:
#
# $0 $*

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

trap 'rm -f Makefile autoconf.h conftest*; exit 1' 1 3 15
CC='$CC'
CPP='$CPP'
LIBOBJS='$LIBOBJS'
LIBS='$LIBS'
srcdir='$srcdir'
prefix='$prefix'
exec_prefix='$exec_prefix'
prsub='$prsub'
EOF
cat >> config.status <<\EOF

top_srcdir=$srcdir
for file in .. Makefile; do if [ "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
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@LIBOBJS@%$LIBOBJS%g
s%@LIBS@%$LIBS%g
s%@srcdir@%$srcdir%g
s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
fi; done

echo creating autoconf.h
# 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
cat > conftest.sed <<CONFEOF
EOF
# Turn off quoting long enough to insert the sed commands.
cat >> config.status <<EOF
$SEDDEFS
EOF
cat >> config.status <<\EOF
CONFEOF
rm -f conftest.h
# Break up the sed commands because old seds have small limits.
cp $top_srcdir/autoconf.h.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 40q conftest.sed > conftest.s1 # Like head -40.
  sed 1,40d conftest.sed > conftest.s2 # Like tail +41.
  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 "/* autoconf.h.  Generated automatically by configure.  */" > conftest.h
cat conftest.h1 >> conftest.h
rm -f conftest.h1
if cmp -s autoconf.h conftest.h 2>/dev/null; then
  # The file exists and we would not be changing it.
  rm -f conftest.h
else
  rm -f autoconf.h
  mv conftest.h autoconf.h
fi

EOF
chmod +x config.status
test -n "$no_create" || ./config.status