dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/monix.c)

AM_INIT_AUTOMAKE(ax25spyd, 0.23)
AM_CONFIG_HEADER(config.h)

AC_PREFIX_DEFAULT(/usr)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/ioctl.h sys/time.h syslog.h unistd.h)

AC_CHECK_HEADERS(ncurses.h)

AC_CHECK_HEADERS(netax25/axlib.h netax25/axconfig.h)
AC_CHECK_HEADERS(ax25/axutils.h)
AC_CHECK_HEADERS(netax25/ax25.h)

AC_ARG_WITH(ax25-utils,
	[  --with-ax25-utils  path to ax25-utilities],
        [
	    AC_MSG_RESULT(ax25-utilities in $withval .)
	    CCFLAGS="$CCFLAGS -I$withval/lib"
	    all_includes="$all_includes -I$withval/lib"
	    LIBS="$LIBS -L$withval/lib"
	    #all_libraries="$all_libraries -L$withval/lib"
	 ])
	 

dnl Checks for libraries.

AC_CHECK_LIB(ncurses,initscr)

AC_CHECK_LIB(ax25,daemon_start,, AC_MSG_ERROR([libax25.a is missing.
use ./configure --with-ax25-utils=<installation-directory> or install the
ax25-utils-devel package.]))

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

dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(gethostname select socket strerror strstr)

AC_OUTPUT(Makefile src/Makefile doc/Makefile examples/Makefile)
