dnl AUTOCONF configuration for libz
dnl Copyright (C) 2004-2009 Sam Steingold <sds@gnu.org>
dnl This is Free Software, distributed under the GNU GPL v2+

AC_PREREQ([2.64])
AC_INIT(zlib, 1.0, clisp-list)
AC_CONFIG_SRCDIR(zlib.lisp)
AC_CONFIG_HEADERS(config.h)

RSE_BOLD
BOLD_MSG([Zlib (Common)])
CL_MODULE_COMMON_CHECKS([ffi])

dnl Search for libz and define LIBZ, LTLIBZ and INCZ.
AC_LIB_LINKFLAGS([z])

BOLD_MSG([Zlib (Headers)])
AC_CHECK_HEADERS(zlib.h)
if test "$ac_cv_header_zlib_h" = "no" ;
then AC_MSG_ERROR([cannot find ZLIB headers])
fi

BOLD_MSG([Zlib (Functions)])
AC_LIB_APPENDTOVAR([LIBS], [$LIBZ])
AC_SEARCH_LIBS(compress2, z)
if test "$ac_cv_search_compress2" = "no"; then
  AC_MSG_ERROR([cannot find ZLIB library])
fi
AC_CHECK_FUNCS(compressBound)
if test "$ac_cv_func_compressBound" = "no"; then
  AC_MSG_ERROR([ZLIB version 1.2 or better is required])
fi

BOLD_MSG([Zlib (Output)])
AC_CONFIG_FILES(Makefile link.sh)
AC_OUTPUT

BOLD_MSG([Zlib (Done)])
