dnl
dnl RCSid:
dnl	$Id: configure.in,v 1.7 1996/09/06 13:27:24 sjg Exp $
dnl
dnl Process this file with autoconf to produce a configure script
dnl
AC_INIT(Makefile.inc.in)
AC_CONFIG_HEADER(config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
dnl A hack to turn on warning messages for gcc - Warn-flags is not in
dnl the distribution since not everyone wants to see this stuff.
dnl (Warn-flags contains: -Wall)
if test X"$GCC" = Xyes && test -f $srcdir/Warn-flags; then
  CFLAGS="${CFLAGS+$CFLAGS }`cat $srcdir/Warn-flags`"
fi
AC_PROG_INSTALL

dnl Check for OS problems
AC_AIX
AC_MINIX
AC_ISC_POSIX

dnl
dnl If LDSTATIC set in environment, pass it on to the Makefile and use it when
dnl doing compile checks to ensure we are checking the right thing.
AC_SUBST(LDSTATIC)LDSTATIC=${LDSTATIC-}
test X"$LDSTATIC" != X && LDFLAGS="${LDFLAGS+$LDFLAGS }$LDSTATIC"
dnl
dnl Executable suffix - normally empty; .exe on os2.
AC_SUBST(ac_exe_suffix)dnl

dnl
AC_C_CROSS
dnl

dnl Checks for libraries.
dnl AC_CHECK_LIB(snmp2, snmp_open)

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_DIRENT
AC_CHECK_HEADERS(fcntl.h paths.h sys/time.h syslog.h unistd.h \
	stddef.h stdlib.h string.h memory.h \
	limits.h paths.h \
	sys/stdtypes.h sys/param.h sys/resource.h values.h ulimit.h \
	sys/select.h sys/timeb.h sys/tty.h snmp.h snmp/snmp.h sys/sockio.h )
AC_HEADER_TIME

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME

dnl Checks for library functions.
AC_FUNC_GETMNTENT
AC_FUNC_MEMCMP
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_FUNC_VFORK
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(mkdir putenv select socket \
	strcspn strdup strerror strspn strstr \
	atexit on_exit daemon flock getwd killpg nice setrlimit \
	strcasecmp tcsetpgrp ulimit waitpid memmove \
	popen getdtablesize setsid bzero bcmp bcopy \
	warnx fgetln cgetcap tcgetattr getenv setenv herror \
	sigvec sigsetmask sigaction mktime \
	getopt
	)
AC_CHECK_FUNC(vsnprintf,,LIBS="${LIBS} -lcompat"; DEFS="${DEFS} -DHAVE_VSNPRINTF")
AC_CHECK_FUNCS(sigsetjmp _setjmp, break)
AC_FUNC_MMAP
AC_FUNC_WAIT3
AC_FUNC_STRFTIME
dnl
dnl Structures
dnl
AC_HEADER_STAT
AC_STRUCT_ST_RDEV
dnl
dnl
dnl Take replace value of LDSTATIC in LDFLAGS with reference to make variable
if test X"$LDSTATIC" != X; then
  LDFLAGS=`echo -- "$LDFLAGS" | sed -e s/^-- //' -e 's?$LDSTATIC?\$(LDSTATIC)?'`
fi
dnl
AC_OUTPUT(Makefile.inc)
