AC_PREREQ( 2.59 )
AC_INIT( libewf, 20060820-1, forensics@hoffmannbv.nl )
AM_INIT_AUTOMAKE( libewf, 20060820-1 )
AM_CONFIG_HEADER( config.h )

AC_CANONICAL_HOST

AC_CHECK_FUNCS( memchr memset strchr strtoul uname )

AC_CHECK_HEADERS( fcntl.h inttypes.h stdlib.h string.h sys/ioctl.h unistd.h )

AC_CHECK_LIB( z, compress2, [], [ echo "Missing function: compress2 in library: zlib" && exit ] )
AC_CHECK_LIB( z, uncompress, [], [ echo "Missing function: uncompress in library: zlib" && exit ] )
AC_CHECK_LIB( crypto, MD5_Init, [], [ echo "Missing function: MD5_Init in library: libcrypto" && exit ] )
AC_CHECK_LIB( crypto, MD5_Update, [], [ echo "Missing function: MD5_Update in library: libcrypto" && exit ] )
AC_CHECK_LIB( crypto, MD5_Final, [], [ echo "Missing function: MD5_Final in library: libcrypto" && exit ] )

AC_C_CONST

AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_REALLOC
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF

AC_HEADER_STDC

AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_MAKE_SET
AC_PROG_RANLIB

AC_STRUCT_TM

AC_TYPE_OFF_T
AC_TYPE_SIZE_T

LIBEWF_PLATFORM=
case "$build" in
#	*cygwin* )
#		LIBEWF_PLATFORM="-DCYGWIN";
#		;;
	*darwin* )
		LIBEWF_PLATFORM="-DDARWIN";
		;;
	*freebsd* | *netbsd* | *openbsd* )
		LIBEWF_PLATFORM="-DBSD";
		;;
	*linux* )
		LIBEWF_PLATFORM="-DLINUX";
		;;
#	*solaris* )
#		LIBEWF_PLATFORM="-DSUNOS";
#		;;
	* )
		echo "Reading from devices not supported for $build.";
		;;
esac
AC_SUBST( LIBEWF_PLATFORM )

AC_CONFIG_FILES( Makefile src/Makefile )

AC_OUTPUT

