:
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically by autoconf.
# Copyright (C) 1991 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] [TARGET]
# All args except --srcdir=DIR are ignored.

trap 'rm -f conftest conftest.c; exit 1' 1 3 15

set +u # Make sure unset variables are ok.

for arg in $*; do
  # Handle --srcdir with a space before the argument.
  if test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  # Handle --host with a space before the argument.
  elif test x$next_host = xyes; then next_host=
  else
    case $arg in
     +srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
	srcdir=`echo $arg | sed 's/[+-]s[a-z]*=//'` ;;
     +srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
	next_srcdir=yes ;;
     +host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
     +host | --host | --hos | --ho | --h)
	next_host=yes ;;
     +gas | --gas | --ga | --g) ;;
     +nfp | --nfp | --nf | --n) ;;
     *) ;;
    esac
  fi
done

INCLUDEDIR=${INCLUDEDIR-/usr/include}

rm -f conftest conftest.c
compile='$CC $DEFS 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=uucico.c

# Makefile rules whose targets are searched for in VPATH need to use $<.
# However, old makes do not support it, so we use a combination
# construction in Makefile.in: `$file<'.
# If srcdir is `.', we use sed to change that to `file' for old makes.
# Otherwise, we use sed to change it to `$<'.
# vpsub is the sed program, which changes `$file<' to one or the other.
vpsub='s,\$\([-./a-zA-Z0-9_][-./a-zA-Z0-9_]*\)<,\1,g'
# Find the source files, if location was not specified.
if test x$srcdir = x; then
  srcdirdefaulted=yes; srcdir=.
  if test ! -r $unique_file; then srcdir=`pwd`/..; fi
fi
if test $srcdir != .; then
  VPATH='VPATH = $(srcdir)'
  vpsub='s,\$\([-./a-zA-Z0-9_][-./a-zA-Z0-9_]*\)<,\$<,g'
fi

if test ! -r $srcdir/$unique_file; then
  if test x$srcdirdefaulted = xyes; then
    echo "configure: Can not find sources in \`.' or \`..'." 1>&2
  else
    echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  fi
  exit 1
fi

# The Bourne shell writes "command not found" to /dev/tty, so if we get
# a usage message on stderr, we have the program.
#
# ksh and zsh write "command not found" to stderr, but test -n does not
# want any output if there is no program.  So we use the `type' builtin
# instead for them (and bash).
if test "$RANDOM" = "$RANDOM"; then
  checkfor='test -n "`$checkprog $checkargs 2>&1`"'
else
  checkfor='type $checkprog >/dev/null'
fi


exec 6>conf.h
trap 'rm -f conftest conftest.c conf.h; exit 1' 1 3 15
echo 1>&6 "/* conf.h */"

echo 1>&6 "/* Configuration header file for Taylor UUCP.
   Generated on `date`.  */
"
echo checking for install
# Make sure to not get the incompatible SysV /etc/install.
if test -z "$INSTALL" || test -z "$INSTALLDATA"; then
  saveifs="$IFS"; IFS="$IFS:"
  for dir in $PATH; do
    test -z "$dir" && dir=.
    if test $dir != /etc && test -f $dir/install; then
      test -z "$INSTALL" && INSTALL="$dir/install -c"
      test -z "$INSTALLDATA" && INSTALLDATA="$dir/install -c -m 644"
      break
    fi
  done
  IFS="$saveifs"
fi
INSTALL=${INSTALL-cp}
INSTALLDATA=${INSTALLDATA-cp}

echo checking for gcc
checkprog=gcc checkargs=''
test -z "$CC" && eval $checkfor && CC='gcc -O'
CC=${CC-cc}

if test "${CC}" = "gcc -O"; then CFLAGS="-Wall -Wshadow -Wwrite-strings -g"; else CFLAGS="-g"; fi
echo checking for mail program
HDRDEFS="${HDRDEFS}/\* Set MAIL_PROGRAM to a program which takes a user name as an argument
   and accepts a mail message to send to that user on stdin.  \*/
#define MAIL_PROGRAM `if test -s /usr/ucb/mail; then echo '"/usr/ucb/mail"'; else if test -s /bin/mail; then echo '"/bin/mail"'; else echo 'undefined'; fi; fi`
";
echo checking for echo program
HDRDEFS="${HDRDEFS}/\* Set ECHO_PROGRAM to a program which echoes its arguments; if echo
   is a shell builtin you can just use \"echo\".  \*/
#define ECHO_PROGRAM `if test -s /bin/echo; then echo '"/bin/echo"'; else echo '"echo"'; fi`
";
echo checking for pwd program
HDRDEFS="${HDRDEFS}/\* Set PWD_PROGRAM to a program which prints the name of the current
   working directory; this is used only on old systems.  \*/
#define PWD_PROGRAM `if test -s /bin/pwd; then echo '"/bin/pwd"'; else echo 'undefined'; fi`
";
for hdr in string.h strings.h unistd.h stdlib.h limits.h time.h
do
havehdr=HAVE_`echo ${hdr} | tr "[a-z]./" "[A-Z]__"`
echo checking for ${hdr}
HDRDEFS="${HDRDEFS}/\* Set ${havehdr} to 1 if you have <${hdr}>.  \*/
#define ${havehdr} `if test -f $INCLUDEDIR/${hdr}; then echo 1; else echo 0; fi`
";
done

for hdr in sys/wait.h sys/ioctl.h dirent.h memory.h sys/param.h
do
havehdr=HAVE_`echo ${hdr} | tr "[a-z]./" "[A-Z]__"`
echo checking for ${hdr}
HDRDEFS="${HDRDEFS}/\* Set ${havehdr} to 1 if you have <${hdr}>.  \*/
#define ${havehdr} `if test -f $INCLUDEDIR/${hdr}; then echo 1; else echo 0; fi`
";
done

for hdr in utime.h fcntl.h sys/file.h libc.h sysexits.h
do
havehdr=HAVE_`echo ${hdr} | tr "[a-z]./" "[A-Z]__"`
echo checking for ${hdr}
HDRDEFS="${HDRDEFS}/\* Set ${havehdr} to 1 if you have <${hdr}>.  \*/
#define ${havehdr} `if test -f $INCLUDEDIR/${hdr}; then echo 1; else echo 0; fi`
";
done

echo checking for signal handler type
pattern='void[ 	]*(\*signal[ 	]*('
HDRDEFS="${HDRDEFS}/\* Set SIGtype to the return type of signal handlers.  \*/
#define SIGtype `if grep "$pattern" $INCLUDEDIR/signal.h >/dev/null 2>&1 ||
     grep "$pattern" $INCLUDEDIR/sys/signal.h >/dev/null 2>&1; then
    echo void
  else
    echo int
  fi`
";

echo checking for time_t in time.h
echo "#include <time.h>
main() { exit(0); } t() { time_t i; }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Define HAVE_TIME_T if time_t is defined in <time.h>.  \*/
#define HAVE_TIME_T `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c

echo checking for time_t in sys/types.h
echo "#include <sys/types.h>
main() { exit(0); } t() { time_t i; }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_SYS_TIME_T to 1 if time_t is defined in <sys/types.h>.  \*/
#define HAVE_SYS_TIME_T `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c

echo checking for time.h and sys/time.h being included together
echo "#include <sys/time.h>
#include <time.h>
main () { exit (0); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_SYS_TIME_AND_TIME_H to 1 if <time.h> and <sys/time.h> can both
   be included in a single source file.  \*/
#define HAVE_SYS_TIME_AND_TIME_H `(if test -f $INCLUDEDIR/time.h -a -f $INCLUDEDIR/sys/time.h -a -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
echo checking for termios.h and sys/ioctl.h being included together
echo "#include <termios.h>
#include <sys/ioctl.h>
main () { exit (0); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_TERMIOS_AND_SYS_IOCTL_H to 1 if <termios.h> and <sys/ioctl.h>
   can both be included in a single source file.  \*/
#define HAVE_TERMIOS_AND_SYS_IOCTL_H `(if test -f $INCLUDEDIR/termios.h -a -f $INCLUDEDIR/sys/ioctl.h -a -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
echo checking for CBREAK
echo "#include <sgtty.h>
main() { exit(0); } t() { int i = CBREAK; }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* HAVE_CBREAK is just used if you don't set one of the terminal driver
   options in policy.h.  \*/
#define HAVE_CBREAK `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c

HDRDEFS="${HDRDEFS}/\* If pid_t is not defined in <sys/types.h>, give it a definition here.  \*/
";echo checking for pid_t in sys/types.h
echo "#include <sys/types.h>
main() { exit(0); } t() { pid_t x; }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
else
  HDRDEFS="${HDRDEFS}#define pid_t int
";
fi
rm -f conftest conftest.c

HDRDEFS="${HDRDEFS}/\* If uid_t is not defined in <sys/types.h>, give it a definition here.  \*/
";echo checking for uid_t in sys/types.h
echo "#include <sys/types.h>
main() { exit(0); } t() { uid_t x; }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
else
  HDRDEFS="${HDRDEFS}#define uid_t int
"; HDRDEFS="${HDRDEFS}#define gid_t int
";
fi
rm -f conftest conftest.c

HDRDEFS="${HDRDEFS}/\* If gid_t is not defined in <sys/types.h>, give it a definition here.  \*/
";
echo checking for gid_t in sys/types.h
echo "#include <sys/types.h>
main() { exit(0); } t() { gid_t x; }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
else
  HDRDEFS="${HDRDEFS}#define gid_t int
";
fi
rm -f conftest conftest.c
HDRDEFS="${HDRDEFS}/\* If off_t is not defined in <sys/types.h>, give it a definition here.  \*/
";
echo checking for off_t in sys/types.h
echo "#include <sys/types.h>
main() { exit(0); } t() { off_t x; }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
else
  HDRDEFS="${HDRDEFS}#define off_t long
";
fi
rm -f conftest conftest.c
echo checking for sig_atomic_t in signal.h
echo "#include <signal.h>
main() { exit(0); } t() { sig_atomic_t x; }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_SIG_ATOMIC_T_IN_SIGNAL_H if sig_atomic_t is defined in
   <signal.h> as required by ANSI C.  \*/
#define HAVE_SIG_ATOMIC_T_IN_SIGNAL_H `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c

echo checking for sig_atomic_t in sys/types.h
echo "#include <sys/types.h>
main() { exit(0); } t() { sig_atomic_t x; }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_SIG_ATOMIC_T_IN_TYPES_H if sig_atomic_t is defined in
   <sys/types.h>.  \*/
#define HAVE_SIG_ATOMIC_T_IN_TYPES_H `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c

HDRDEFS="${HDRDEFS}/\* If sig_atomic_t is not defined in <signal.h> or <sys/types.h>, you can
   give it a definition here.  \*/
";
echo checking how to get filesystem info
HDRDEFS="${HDRDEFS}/\* Define one of the following:
   FS_STATVFS for statvfs
   FS_USG_STATFS for the four argument statfs
   FS_MNTENT for the two argument statfs with 1K blocks and no f_fsize field
   FS_GETMNT for statfs with fd_req field
   FS_STATFS for statfs with f_fsize field
   FS_USTAT for ustat with 512 byte blocks.  \*/
";
if test -f $INCLUDEDIR/sys/statvfs.h -a -f $INCLUDEDIR/sys/fstyp.h; then
  HDRDEFS="${HDRDEFS}#define FS_STATVFS 
";
elif test -f $INCLUDEDIR/sys/statfs.h -a -f $INCLUDEDIR/sys/fstyp.h; then
  HDRDEFS="${HDRDEFS}#define FS_USG_STATFS 
";
elif test -f $INCLUDEDIR/mntent.h; then
  HDRDEFS="${HDRDEFS}#define FS_MNTENT 
";
elif test -f $INCLUDEDIR/sys/mount.h -a -f $INCLUDEDIR/sys/fs_types.h; then
  HDRDEFS="${HDRDEFS}#define FS_GETMNT 
";
elif grep MOUNT_UFS $INCLUDEDIR/sys/mount.h >/dev/null 2>&1; then
  HDRDEFS="${HDRDEFS}#define FS_STATFS 
";
else
  echo checking for ustat
echo "
main() { exit(0); } t() { ustat(); }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then
  HDRDEFS="${HDRDEFS}#define FS_USTAT 
";
fi
rm -f conftest conftest.c

fi
echo checking for void
echo "void main() { (void) exit (0); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_VOID to 1 if the compiler supports the type void.  \*/
#define HAVE_VOID `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest.c conftest
echo checking for unsigned char
echo "main () { unsigned char i = (unsigned char) -1; exit (0); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_UNSIGNED_CHAR to 1 if the compiler supports the type unsigned
   char.  \*/
#define HAVE_UNSIGNED_CHAR `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest.c conftest
echo checking for "int.*errno" in "errno.h"
HDRDEFS="${HDRDEFS}/\* Set HAVE_ERRNO_DECLARATION to 1 if errno is declared in <errno.h>.  \*/
#define HAVE_ERRNO_DECLARATION `if grep 'int.*errno' $INCLUDEDIR/errno.h >/dev/null 2>&1; then echo 1; else echo 0; fi`
";
echo checking for combined use of O_NONBLOCK and O_NDELAY
echo "#include <fcntl.h>
#ifndef O_NDELAY
#ifdef FNDELAY
#define O_NDELAY FNDELAY
#else
#define O_NDELAY 0
#endif
#endif
#ifndef O_NONBLOCK
#ifdef FNBLOCK
#define O_NONBLOCK FNBLOCK
#else
#define O_NONBLOCK 0
#endif
#endif
main () { exit (fcntl (open ("'"conftest.c"'", O_RDONLY),
		       F_SETFL,
		       O_NONBLOCK | O_NDELAY)); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set COMBINED_UNBLOCK to 1 if O_NONBLOCK and O_NDELAY can both be
   specified at once on a file descriptor.  \*/
#define COMBINED_UNBLOCK `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
echo checking for alloca
echo "#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#ifdef sparc
#include <alloca.h>
#else
#ifdef _AIX
 #pragma alloca
#else
char *alloca ();
#endif
#endif
#endif
main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
eval $compile
if test -s conftest && ./conftest 2>/dev/null; then :
else
  alloca_missing=1
fi
rm -f conftest conftest.c

if test -n "$alloca_missing"; then
  if test -f /usr/ucblib/libucb.a
  then LIBS="$LIBS -L/usr/ucblib -lucb" # SVR4
  elif test -f /lib/libPW.a
  then LIBS="$LIBS -lPW" # SVR2 and SVR3
  else ALLOCA=alloca.o
  fi
fi

for func in vfprintf remove strdup strstr strcasecmp stricmp strlwr
do
havefunc=HAVE_`echo ${func} | tr "[a-z]" "[A-Z]"`
echo checking for ${func}
echo "main() { exit (0); } t() { ${func}(); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set ${havefunc} to 1 if you have ${func}.  \*/
#define ${havefunc} `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
done

for func in strerror memset memcmp memchr memcpy memmove bcopy bcmp bzero
do
havefunc=HAVE_`echo ${func} | tr "[a-z]" "[A-Z]"`
echo checking for ${func}
echo "main() { exit (0); } t() { ${func}(); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set ${havefunc} to 1 if you have ${func}.  \*/
#define ${havefunc} `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
done


for func in strchr strrchr index rindex strtol bsearch getgrent
do
havefunc=HAVE_`echo ${func} | tr "[a-z]" "[A-Z]"`
echo checking for ${func}
echo "main() { exit (0); } t() { ${func}(); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set ${havefunc} to 1 if you have ${func}.  \*/
#define ${havefunc} `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
done

for func in gethostname uname napms nap usleep poll select
do
havefunc=HAVE_`echo ${func} | tr "[a-z]" "[A-Z]"`
echo checking for ${func}
echo "main() { exit (0); } t() { ${func}(); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set ${havefunc} to 1 if you have ${func}.  \*/
#define ${havefunc} `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
done

for func in sigsetjmp setret getcwd getwd waitpid wait4 socket
do
havefunc=HAVE_`echo ${func} | tr "[a-z]" "[A-Z]"`
echo checking for ${func}
echo "main() { exit (0); } t() { ${func}(); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set ${havefunc} to 1 if you have ${func}.  \*/
#define ${havefunc} `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
done

for func in getdtablesize sysconf setsid setpgrp sigaction sigvec
do
havefunc=HAVE_`echo ${func} | tr "[a-z]" "[A-Z]"`
echo checking for ${func}
echo "main() { exit (0); } t() { ${func}(); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set ${havefunc} to 1 if you have ${func}.  \*/
#define ${havefunc} `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
done

for func in sigset sighold sigprocmask sigblock
do
havefunc=HAVE_`echo ${func} | tr "[a-z]" "[A-Z]"`
echo checking for ${func}
echo "main() { exit (0); } t() { ${func}(); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set ${havefunc} to 1 if you have ${func}.  \*/
#define ${havefunc} `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
done

for func in ftruncate ltrunc rename opendir dup2 gettimeofday ftime times
do
havefunc=HAVE_`echo ${func} | tr "[a-z]" "[A-Z]"`
echo checking for ${func}
echo "main() { exit (0); } t() { ${func}(); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set ${havefunc} to 1 if you have ${func}.  \*/
#define ${havefunc} `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
done

echo checking whether times can be declared as returning long
echo "#include <sys/times.h>
extern long times (); main() { exit (0); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set TIMES_DECLARATION_OK to 1 if times can be safely declared as
   returning long.  \*/
#define TIMES_DECLARATION_OK `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
echo checking for BSD setpgrp
echo "`if test -f $INCLUDEDIR/unistd.h; then echo '#include <unistd.h>'; fi`
main() { exit(0); } t() { getpgrp (0); setpgrp (0, 0); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_BSD_PGRP to 1 if you can compile getpgrp with 1 argument
   and setpgrp with 2 arguments rather than none.  \*/
#define HAVE_BSD_PGRP `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c

echo checking for mkdir
echo "main() { exit (0); } t() { mkdir(); }" > conftest.c
eval $compile
havemkdir=`(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
HDRDEFS="${HDRDEFS}/\* Set HAVE_MKDIR to 1 if you have mkdir.  If you don't have it, set 
   MKDIR_PROGRAM to the name of the program which will create a directory
   named on the command line.  \*/
#define HAVE_MKDIR ${havemkdir}
";
if test "${havemkdir}" = "1"
then
 UUDIR='# '
else
 UUDIR=
 HDRDEFS="${HDRDEFS}#define MKDIR_PROGRAM `if test -f /bin/mkdir; then echo '"/bin/mkdir"'; else echo 'undefined'; fi`
";
fi
rm -f conftest conftest.c
echo checking for union wait
echo "#include <sys/wait.h>
main() { exit(0); } t() { union wait u; wait (&u); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_UNION_WAIT to 1 if union wait is defined in <sys/wait.h>.  \*/
#define HAVE_UNION_WAIT `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c

HDRDEFS="${HDRDEFS}/\* Define UTIME_NULL_MISSING if utime with a NULL second argument does not
   set the file times to the current time.  \*/
";
echo checking utime with null argument
rm -f uttest; > uttest
# Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
echo '#include <sys/types.h>
#include <sys/stat.h>
main() {
struct stat s, t;
exit(!(stat ("uttest", &s) == 0 && utime("uttest", (long *)0) == 0
&& stat("uttest", &t) == 0 && t.st_mtime >= s.st_mtime
&& t.st_mtime - s.st_mtime < 120));
}' > conftest.c
eval $compile
./conftest || HDRDEFS="${HDRDEFS}#define UTIME_NULL_MISSING 
";
rm -f conftest conftest.c uttest core

echo checking for long file names
(echo "1" > 123456789012345) 2>/dev/null
(echo "2" > 123456789012346) 2>/dev/null
long=`cat 123456789012345 2>/dev/null`
HDRDEFS="${HDRDEFS}/\* Set HAVE_LONG_NAMES to 1 if the system supports long file names.  \*/
#define HAVE_LONG_NAMES `if test -f 123456789012345 -a "${long}" = "1"; then echo 1; else echo 0; fi 2>/dev/null`
";
rm -f 123456789012345 123456789012346 2>/dev/null
echo checking for restartable system calls
echo "#include <signal.h>
ucatch (isig) { }
main () { int i = fork ();
 if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
 signal (SIGINT, ucatch);
 exit (wait (&i) == -1); }" > conftest.c
eval $compile
HDRDEFS="${HDRDEFS}/\* Set HAVE_RESTARTABLE_SYSCALLS to 1 if system calls are restarted after
   interrupts (this is ignored if HAVE_SIGACTION is 1).  \*/
#define HAVE_RESTARTABLE_SYSCALLS `(if test -s conftest && ./conftest 2>/dev/null; then echo 1; else echo 0; fi) 2>/dev/null`
";
rm -f conftest conftest.c
trap 'for dir in .; do rm -f $dir/Makefile; done; rm -f config.status conf.h; exit 1' 1 3 15

for dir in .; do
  test -d $dir || mkdir $dir
  echo creating $dir/Makefile
  echo '# Generated automatically from Makefile.in by configure.' > $dir/Makefile
  sed -e "
$vpsub
s,@srcdir@,$srcdir,
s,@VPATH@,$VPATH,
s,@DEFS@,$DEFS,
s,@LIBS@,$LIBS,
s,@INSTALL@,$INSTALL,
s,@INSTALLDATA@,$INSTALLDATA,
s,@CC@,$CC,
s,@CFLAGS@,$CFLAGS,
s,@ALLOCA@,$ALLOCA,
s,@UUDIR@,$UUDIR,
" $srcdir/$dir/Makefile.in >> $dir/Makefile
done

echo creating conf.h
echo "/\* conf.h \*/" > conf.h
echo $HDRDEFS >> conf.h

echo creating config.status
echo DEFS=\"$DEFS\" > config.status
echo LIBS=\"$LIBS\" >> config.status
echo INSTALL=\"$INSTALL\" >> config.status
echo INSTALLDATA=\"$INSTALLDATA\" >> config.status
echo CC=\"$CC\" >> config.status
echo CFLAGS=\"$CFLAGS\" >> config.status
echo ALLOCA=\"$ALLOCA\" >> config.status
echo UUDIR=\"$UUDIR\" >> config.status
