dnl Process this file with autoconf to produce a configure script.
AC_INIT(ztr/compression.c)
AM_INIT_AUTOMAKE(io_lib, 1.8.11)
AM_CONFIG_HEADER(config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LIBTOOL

dnl Handling shared libraries
SC_ENABLE_SHARED
SC_CONFIG_SHLIB_FLAGS

dnl Check for zlib. If not found then we won't include ZTR support
AC_CHECK_LIB(z,main,LIBZ='-lz';AC_DEFINE(HAVE_ZLIB),
             AC_MSG_WARN(*** zlib not found; hence no ZTR support))
AC_SUBST(LIBZ)

AM_CONDITIONAL(HAVE_ZLIB, test x$ac_cv_lib_z_main = xyes)

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h unistd.h)
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
AC_CHECK_HEADER(zlib.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(short,2)
AC_CHECK_SIZEOF(int,4)
AC_CHECK_SIZEOF(long,4)
dnl AC_C_CONST
AC_C_INLINE
AC_TYPE_MODE_T
dnl AC_TYPE_OFF_T
dnl AC_TYPE_SIZE_T
dnl AC_STRUCT_TM

dnl Checks for library functions.
AC_CHECK_LIBM
AC_SUBST(LIBM)
dnl AC_FUNC_MEMCMP
dnl AC_FUNC_STRFTIME
dnl AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strdup)
dnl AC_CHECK_FUNCS(mktime strspn strstr strtol)

AC_OUTPUT(Makefile utils/Makefile abi/Makefile alf/Makefile ctf/Makefile exp_file/Makefile plain/Makefile scf/Makefile ztr/Makefile read/Makefile progs/Makefile)
