dnl Process this file with autoconf to produce a configure script.
AC_INIT(capi20.c)
AC_PREFIX_DEFAULT(/usr)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL

I4LCONFDIR=${I4LCONFDIR:-"/etc/isdn"}
I4LVERSION=${I4LVERSION:-"?.?"}
CONFIG_DATADIR=${CONFIG_DATADIR:-"/usr/lib/isdn"}
CONFIG_MANDIR=`eval echo ${CONFIG_MANDIR:-"/usr/man"}`
CONFIG_SBINDIR=`eval echo ${CONFIG_SBINDIR:-"/sbin"}`
CONFIG_KERNELDIR=`eval echo ${CONFIG_KERNELDIR:-"/usr/src/linux"}`

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h)
dnl Check for kernel stuff
AC_FIND_KERNEL
AC_CHECK_FILES($CONFIG_KERNELDIR/include/linux/capi.h $CONFIG_KERNELDIR/include/linux/kernelcapi.h,,
	AC_MSG_ERROR("Missing $ac_hdr. Kernel source installed?"))

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_CHECK_FUNCS(select)

AC_SUBST(INSTALL)
AC_SUBST(I4LVERSION)
AC_SUBST(CONFIG_SBINDIR)
AC_SUBST(CONFIG_DATADIR)
AC_SUBST(CONFIG_MANDIR)
AC_SUBST(CONFIG_KERNELDIR)
AC_OUTPUT(Makefile)
