dnl Process this file with autoconf to produce a configure script.
AC_INIT(imon.c)
AC_CONFIG_HEADER(config.h)
AC_PREFIX_DEFAULT(/usr)

dnl Checks for programs.
AC_PROG_INSTALL
AC_PROG_CC

dnl Checks for libraries.
AC_CHECK_LIB(ncurses, newpad,,
	AC_CHECK_LIB(curses, newpad,,
		AC_MSG_ERROR("Missing ncurses library")))

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h unistd.h)
AC_CHECK_HEADERS(ncurses.h,,
	AC_CHECK_HEADERS(ncurses/curses.h,,
		AC_CHECK_HEADERS(curses/ncurses.h,,
			AC_CHECK_HEADERS(curses.h,,
				AC_MSG_ERROR("Missing \(n\)curses.h")))))

dnl Check for linux/isdn.h, give up if not found.
AC_CHECK_HEADER(linux/isdn.h,,AC_MSG_ERROR("Missing linux/isdn.h. Kernel source installed?"))

dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_TIME
AC_STRUCT_TM

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(select)

AC_SUBST(INSTALL)
AC_OUTPUT(Makefile)
