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

# We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS= auto_cflags=1
test -z "$LDFLAGS" && LDFLAGS=

AC_PROG_CC

# If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"

AC_SUBST(CFLAGS)dnl
AC_SUBST(LDFLAGS)dnl

AC_PROG_CPP
AC_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_AIX
AC_MINIX
AC_ISC_POSIX
AC_RETSIGTYPE
AC_SIZE_T
AC_CONST
AC_LONG_DOUBLE
AC_SIZEOF_TYPE(long, sizevar)
AC_STDC_HEADERS
AC_WORDS_BIGENDIAN
AC_STAT_MACROS_BROKEN
AC_HAVE_HEADERS(limits.h string.h memory.h fcntl.h unistd.h)
AC_REPLACE_FUNCS(bcopy memcmp memset stpcpy strtoul)
echo "checking if memcmp is 8-bit clean"
AC_TEST_PROGRAM([
main()
{
  char c1 = 0x80, c2 = 0x81;
  exit(memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
}
],[
test -n "$verbose" && echo "	memcmp is 8-bit clean"
],[
test -n "$verbose" && echo "	memcmp is NOT 8-bit clean -- using replacement"
case "$LIBOBJS" in
*memcmp*) ;;
*) LIBOBJS="$LIBOBJS memcmp.o" ;;
esac
])
AC_HAVE_FUNCS(strerror)
AC_VPRINTF
AC_ALLOCA
AC_ST_BLKSIZE
AC_XENIX_DIR
AC_OUTPUT(Makefile lib/Makefile src/Makefile man/Makefile)
