dnl Process this file with autoconf to produce a configure script.
AC_INIT(bnc.c)
AC_CONFIG_HEADER(config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_ISC_POSIX
AC_AIX


dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(sys/time.h unistd.h sys/select.h)

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_LIB(socket, select, LIBS="$LIBS -lsocket",)
AC_CHECK_LIB(nsl, select, LIBS="$LIBS -lnsl",)
AC_CHECK_LIB(resolv, gethostbyname, LIBS="$LIBS -lresolv",)
AC_CHECK_LIB(gnumalloc, malloc, LIBS="$LIBS -lgnumalloc",
AC_CHECK_LIB(bsdmalloc, malloc, LIBS="$LIBS -lbsdmalloc",))

AC_CHECK_LIB(inet, select, LIBS="$LIBS -linet",)
AC_CHECK_LIB(cposix, select, LIBS="$LIBS -lcposix",)
AC_CHECK_LIB(net, select, LIBS="$LIBS -lnet",)
AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt",)

AC_CHECK_FUNC(snprintf, AC_DEFINE(HAVE_SNPRINTF),)
AC_CHECK_FUNC(vsnprintf, AC_DEFINE(HAVE_VSNPRINTF),)

AC_OUTPUT(Makefile)
