dnl Process this file with autoconf to produce a configure script.

dnl Initialization
AC_INIT(Makefile.am)
AM_CONFIG_HEADER(config.h)

dnl Determine the host and build type. The target is always a PIC.
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE(flexloader, 0.03)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h)

dnl Linux kernel
AC_CHECK_HEADERS(linux/ppdev.h)
AC_CHECK_HEADERS(linux/parport.h)

dnl FreeBSD kernel
AC_CHECK_HEADERS(dev/ppbus/ppi.h)
AC_CHECK_HEADERS(dev/ppbus/ppbconf.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_STRUCT_TM

# some extra flags
CFLAGS="$CFLAGS -Wall -Werror-implicit-function-declaration "
LDFLAGS="$LDFLAGS"

# pass flags
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)

dnl Substitute configuration variables
AC_OUTPUT(
Makefile \
doc/Makefile \
src/Makefile \
)
AC_MSG_RESULT([

fleur-$VERSION is now configured for $canonical_host_type

  Build:                $build
  Host:                 $host
  Source directory:     $srcdir
  Installation prefix:  $prefix
  C compiler:           $CC $CFLAGS
  
])