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

AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_AWK
AC_ISC_POSIX

AC_CONST
FP_PROTOTYPES
AC_STDC_HEADERS
AC_HAVE_HEADERS(string.h)
AC_MEMORY_H
AC_SIZE_T

dnl Is there any UNIX without fileno or fstat?!?
dnl AC_HEADER_EGREP(fileno, stdio.h,
dnl   AC_DEFINE(HAVE_FILENO)
dnl   AC_FUNC_CHECK(fstat, AC_DEFINE(HAVE_FSTAT))
dnl )

# Define HAVE_MKSTEMP if mkstemp(3), checked only if not HAVE_TMPFILE.
AC_FUNC_CHECK(tmpfile, AC_DEFINE(HAVE_TMPFILE), tmpfile_missing=1)
if test -n "$tmpfile_missing"; then
  AC_FUNC_CHECK(mkstemp, AC_DEFINE(HAVE_MKSTEMP))
fi

AC_VPRINTF
AC_FUNC_CHECK(strerror)
# Define HAVE_EFGCVT if [efg]cvt(3), =2 if declared in <stdlib.h>.
AC_HEADER_EGREP(ecvt, stdlib.h, AC_DEFINE(HAVE_EFGCVT, 2), 
  AC_FUNC_CHECK(ecvt, AC_DEFINE(HAVE_EFGCVT)))
AC_REPLACE_FUNCS(vfprintf)
case "$LIBOBJS" in
*vfprintf.o*) AC_REPLACE_FUNCS(_doprnt) ;;
esac

AC_ALLOCA

AC_OUTPUT(Makefile lib/Makefile checks/Makefile)
