diff m4/zlib.m4 @ 0:d39e1d0d75b6

initial add
author paulo@hit-nxdomain.opendns.com
date Sat, 20 Feb 2010 21:18:28 -0800
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/m4/zlib.m4	Sat Feb 20 21:18:28 2010 -0800
     1.3 @@ -0,0 +1,64 @@
     1.4 +###############################################################################
     1.5 +## $Id: zlib.m4,v 1.1 2003/09/17 22:26:07 hipnod Exp $
     1.6 +###############################################################################
     1.7 +
     1.8 +dnl
     1.9 +dnl Check for zlib in some bizarre locations...
    1.10 +dnl
    1.11 +AC_DEFUN([GIFT_PLUGIN_CHECK_ZLIB], 
    1.12 +[
    1.13 +   # set the minimum ZLIB_VER we're willing to link against...
    1.14 +   ZLIB_VER=1.1.4
    1.15 +
    1.16 +   # for some reason Darwin has a 1.1.3 version with the 1.1.4 security fix
    1.17 +   # applied backwards...
    1.18 +   case "${host}" in
    1.19 +   *-*-darwin* )
    1.20 +     ZLIB_VER=1.1.3
    1.21 +   ;;
    1.22 +   esac
    1.23 +
    1.24 +   if test x"$OPT_ZLIB" = xno; then
    1.25 +      zlib_ok=no
    1.26 +   else
    1.27 +      ZLIB_DIRS="$OPT_ZLIB /usr /usr/local /sw"
    1.28 +      for ZLIB_DIR in $ZLIB_DIRS;
    1.29 +      do
    1.30 +         LIBS_SAVE="$LIBS"
    1.31 +         CPPFLAGS_SAVE="$CPPFLAGS"
    1.32 +         LIBS="$LIBS -L${ZLIB_DIR}/lib"
    1.33 +         CPPFLAGS="$CPPFLAGS -I${ZLIB_DIR}/include"
    1.34 +         AC_CACHE_CHECK(
    1.35 +            [for zlib version ${ZLIB_VER}+ in ${ZLIB_DIR}],
    1.36 +            zlib_ok,
    1.37 +            AC_TRY_RUN(
    1.38 +              [#include <zlib.h>
    1.39 +               #include <string.h>
    1.40 +               void main() {
    1.41 +                 exit(strcmp(ZLIB_VERSION, "${ZLIB_VER}") < 0);
    1.42 +               }
    1.43 +               ],
    1.44 +              [zlib_ok=yes],
    1.45 +              [zlib_ok=no],
    1.46 +              [zlib_ok=yes]))
    1.47 +
    1.48 +         if test "$zlib_ok" != "no"; then
    1.49 +            AC_CHECK_FUNC(gzread, , AC_CHECK_LIB(z, gzread))
    1.50 +            AC_DEFINE(USE_ZLIB)
    1.51 +            AC_SUBST(USE_ZLIB)
    1.52 +            break
    1.53 +         fi
    1.54 +         LIBS="$LIBS_SAVE"
    1.55 +         CPPFLAGS="$CPPFLAGS_SAVE"
    1.56 +      done
    1.57 +
    1.58 +      if test "$zlib_ok" = "no"; then
    1.59 +         AC_MSG_ERROR([
    1.60 +NOTE: The zlib compression library version ${ZLIB_VER} or greater was not found
    1.61 +      on your system.
    1.62 +
    1.63 +      If zlib ${ZLIB_VER}+ is not installed, install it.
    1.64 +         ])
    1.65 +      fi
    1.66 +   fi
    1.67 +])