Make rule for sample-config.tar.gz.
[tinc] / 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,
8     AC_HELP_STRING([--with-zlib=DIR], [zlib base directory, or:]),
9     [zlib="$withval"
10      CFLAGS="$CFLAGS -I$withval/include"
11      CPPFLAGS="$CPPFLAGS -I$withval/include"
12      LIBS="$LIBS -L$withval/lib"]
13   )
14
15   AC_ARG_WITH(zlib-include,
16     AC_HELP_STRING([--with-zlib-include=DIR], [zlib headers directory]),
17     [zlib_include="$withval"
18      CFLAGS="$CFLAGS -I$withval"
19      CPPFLAGS="$CPPFLAGS -I$withval"]
20   )
21
22   AC_ARG_WITH(zlib-lib,
23     AC_HELP_STRING([--with-zlib-lib=DIR], [zlib library directory]),
24     [zlib_lib="$withval"
25      LIBS="$LIBS -L$withval"]
26   )
27
28   AC_CHECK_HEADERS(zlib.h,
29     [],
30     [AC_MSG_ERROR("zlib header files not found."); break]
31   )
32
33   CPPFLAGS="$tinc_ac_save_CPPFLAGS"
34
35   AC_CHECK_LIB(z, compress2,
36     [LIBS="$LIBS -lz"],
37     [AC_MSG_ERROR("zlib libraries not found.")]
38   )
39 ])