]> git.meshlink.io Git - meshlink/blob - m4/zlib.m4
Add a better autoconf check for libevent.
[meshlink] / m4 / zlib.m4
1 dnl Check to find the zlib headers/libraries
2
3 AC_DEFUN([tinc_ZLIB],
4 [
5   AC_ARG_WITH(zlib,
6     AS_HELP_STRING([--with-zlib=DIR], [zlib base directory, or:]),
7     [zlib="$withval"
8      CPPFLAGS="$CPPFLAGS -I$withval/include"
9      LDFLAGS="$LDFLAGS -L$withval/lib"]
10   )
11
12   AC_ARG_WITH(zlib-include,
13     AS_HELP_STRING([--with-zlib-include=DIR], [zlib headers directory]),
14     [zlib_include="$withval"
15      CPPFLAGS="$CPPFLAGS -I$withval"]
16   )
17
18   AC_ARG_WITH(zlib-lib,
19     AS_HELP_STRING([--with-zlib-lib=DIR], [zlib library directory]),
20     [zlib_lib="$withval"
21      LDFLAGS="$LDFLAGS -L$withval"]
22   )
23
24   AC_CHECK_HEADERS(zlib.h,
25     [],
26     [AC_MSG_ERROR("zlib header files not found."); break]
27   )
28
29   AC_CHECK_LIB(z, compress2,
30     [LIBS="$LIBS -lz"],
31     [AC_MSG_ERROR("zlib libraries not found.")]
32   )
33 ])