check_zlib.m4 778 Bytes
Newer Older
1
AC_DEFUN([CHECK_ZLIB],
Philip Carns's avatar
Philip Carns committed
2
[
3

4 5 6 7 8 9 10 11
AC_ARG_WITH(zlib,
[  --with-zlib=DIR root directory path of zlib installation [defaults to
                    /usr/local or /usr if not found in /usr/local]
  --without-zlib to disable zlib usage completely],
[if test "$withval" != no ; then
  if test -d "$withval"
  then
    ZLIB_HOME="$withval"
Philip Carns's avatar
Philip Carns committed
12 13
    LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
    CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
14 15
    __DARSHAN_ZLIB_LINK_FLAGS="-L${ZLIB_HOME}/lib"
    __DARSHAN_ZLIB_INCLUDE_FLAGS="-I${ZLIB_HOME}/include"
16 17 18 19
  else
    AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
  fi
else
Philip Carns's avatar
Philip Carns committed
20
  AC_MSG_ERROR(zlib is required)
21 22
fi])

Philip Carns's avatar
Philip Carns committed
23 24
AC_CHECK_HEADER(zlib.h, [],[AC_MSG_ERROR(z.h not found)])
AC_CHECK_LIB(z, inflateEnd, [],[AC_MSG_ERROR(libz not found)])
25 26

])