dnl Process this file with autoconf to produce a configure script.
AC_INIT(capifax.c)
AM_INIT_AUTOMAKE(capifax, 1.0)
AC_PREFIX_DEFAULT(/usr)

CONFIG_SBINDIR=${CONFIG_SBINDIR:-"/sbin"}
CONFIG_MANDIR=${CONFIG_MANDIR:-"/usr/man"}
#MANDATE=`grep CHECKIN isdnctrl.man.in | awk '{print $4}'`

dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_CC

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/ioctl.h unistd.h capi20.h)

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Optional sbin directory
AC_ARG_WITH(sbin,
	[  --with-sbin=DIR         Set dir where binary is istalled. [/sbin]],
	CONFIG_SBINDIR="${withval}"
	AC_DEFINE(CONFIG_SBINDIR,"${withval}"),
)

dnl Optional man directory
AC_ARG_WITH(man,
	[  --with-man=DIR          Set manpage dir. [/usr/man]],
	CONFIG_MANDIR="${withval}"
	AC_DEFINE(CONFIG_MANDIR,"${withval}"),
)

AC_SUBST(INSTALL)
AC_SUBST(CONFIG_SBINDIR)
AC_SUBST(CONFIG_MANDIR)
AM_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile)
