]> git.meshlink.io Git - meshlink/blob - m4/zlib.m4
Autoconf cleanup. Works for both 2.13 and 2.53, although running autoconf
[meshlink] / m4 / zlib.m4
1 dnl Check to find the zlib headers/libraries
2
3 AC_DEFUN(tinc_ZLIB,
4 [
5   tinc_ac_save_CPPFLAGS="$CPPFLAGS"
6
7   AC_ARG_WITH(zlib-include,
8     [  --with-zlib-include=DIR zlib headers directory],
9     [zlib_include="$withval"
10      CFLAGS="$CFLAGS -I$withval"
11      CPPFLAGS="$CPPFLAGS -I$withval"]
12   )
13
14   AC_ARG_WITH(zlib-lib,
15     [  --with-zlib-lib=DIR     zlib library directory],
16     [zlib_lib="$withval"
17      LIBS="$LIBS -L$withval"]
18   )
19
20   AC_CHECK_HEADERS(zlib.h,
21     [],
22     [AC_MSG_ERROR("zlib header files not found."); break]
23   )
24
25   CPPFLAGS="$tinc_ac_save_CPPFLAGS"
26
27   AC_CHECK_LIB(z, compress2,
28     [LIBS="$LIBS -lz"],
29     [AC_MSG_ERROR("zlib libraries not found.")]
30   )
31 ])