dnl Process this file with autoconf to produce a configure script.
AC_INIT(mkfs.jffs.c)
AM_INIT_AUTOMAKE(mtd-utils, 0.1.0)
AM_CONFIG_HEADER(config.h)

dnl Checks for programs.
AC_PROG_LN_S
AC_PROG_CC
AC_PROG_RANLIB

dnl Checks for libraries.
dnl Replace `main' with a function in -lz:
AC_CHECK_LIB(z, zlibVersion)

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

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_RDEV

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_PROG_GCC_TRADITIONAL
AC_HEADER_MAJOR
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(getcwd strdup strerror strtol strtoul)

dnl Check for directory with kernel source...
AC_MSG_CHECKING(for directory with kernel source)
AC_ARG_WITH(kernel,
  [  --with-kernel=dir       give the directory with kernel sources]
  [                        [/usr/src/linux]],
  kerneldir="$withval", kerneldir="/usr/src/linux")

CONFIG_KERNELDIR="$kerneldir"
AC_SUBST(CONFIG_KERNELDIR)
AC_MSG_RESULT($kerneldir)

AC_OUTPUT(Makefile)
