dnl Process this file with autoconf to produce a configure script.
AC_INIT(../src/sendfile.c)
AM_CONFIG_HEADER(../src/config.h)

dnl Set this for automake
PACKAGE=sendfile
AC_SUBST(PACKAGE)
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")

VERSION=2.1b
AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")

REVISION=20080616
AC_SUBST(REVISION)
AC_DEFINE_UNQUOTED(REVISION, "$REVISION")

AC_CANONICAL_SYSTEM

dnl SYSTEM="$build_alias"
dnl AC_SUBST(SYSTEM)
dnl AC_DEFINE_UNQUOTED(SYSTEM, "$SYSTEM")

dnl Checks for programs.
AC_PROG_CC
dnl AM_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

AC_ARG_PROGRAM

dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(stdlib.h stddef.h unistd.h stdarg.h getopt.h string.h fcntl.h paths.h sys/time.h sys/statvfs.h)

dnl Checks for libraries.
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(readline, readline, , , -ltermcap -L/usr/lib/termcap)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_BLKSIZE
AC_HEADER_TIME
AC_STRUCT_TM

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_TYPE_SIGNAL
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS(gethostname gettimeofday mkdir socket uname strerror)
AC_CHECK_FUNCS(snprintf)

AC_OUTPUT()
dnl AC_OUTPUT([Makefile src/Makefile doc/Makefile])
