dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT(xarchie.c)
AC_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CPP
AC_GCC_TRADITIONAL
AC_ISC_POSIX
AC_IRIX_SUN
AC_STDC_HEADERS
AC_HAVE_HEADERS(string.h memory.h [sys/param.h])
AC_COMPILE_CHECK([fd_set in sys/types.h],
[#include <stdio.h>
#include <sys/types.h>], [fd_set foo;],
 AC_DEFINE(FD_SET_IN_SYS_TYPES_H,1),
 AC_COMPILE_CHECK([fd_set in sys/select.h],
[#include <stdio.h>
#include <sys/select.h>], [fd_set foo;],
 AC_DEFINE(FD_SET_IN_SYS_SELECT_H,1),
 AC_COMPILE_CHECK([fd_set in sys/inet.h],
[#include <stdio.h>
#include <sys/inet.h>], [fd_set foo;],
 AC_DEFINE(FD_SET_IN_SYS_INET_H,1))))
AC_SUBST(FD_SET_IN_SYS_TYPES_H)dnl 
AC_SUBST(FD_SET_IN_SYS_SELECT_H)dnl 
AC_SUBST(FD_SET_IN_SYS_INET_H)dnl 
AC_STRUCT_TM
AC_HAVE_FUNCS(re_comp regcmp strcasecmp random rand strerror getlogin getpwuid)
AC_HAVE_FUNCS(strspn)
AC_COMPILE_CHECK(errno, , [extern int errno; int i=errno;],
 AC_DEFINE(HAVE_ERRNO))
AC_SUBST(HAVE_ERRNO)dnl
AC_COMPILE_CHECK(sys_errlist, ,
 [extern char **sys_errlist; char *s=*sys_errlist;],
 AC_DEFINE(HAVE_SYS_ERRLIST))
AC_SUBST(HAVE_SYS_ERRLIST)dnl
dnl To test for -lresolv we use the provided test program, resolv.c:
echo checking whether -lresolv is needed
AC_TEST_PROGRAM([#include "resolv.c"], , AC_DEFINE(NEED_LRESOLV))
AC_SUBST(NEED_LRESOLV)dnl
AC_OUTPUT()
