2019-08-26 11:44:36 +00:00
|
|
|
dnl Check to find the zlib headers/libraries
|
|
|
|
|
2019-08-26 11:44:36 +00:00
|
|
|
AC_DEFUN([tinc_ZLIB],
|
2019-08-26 11:44:36 +00:00
|
|
|
[
|
2019-08-26 11:44:36 +00:00
|
|
|
AC_ARG_WITH(zlib,
|
|
|
|
AS_HELP_STRING([--with-zlib=DIR], [zlib base directory, or:]),
|
|
|
|
[zlib="$withval"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$withval/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval/lib"]
|
|
|
|
)
|
2019-08-26 11:44:36 +00:00
|
|
|
|
|
|
|
AC_ARG_WITH(zlib-include,
|
2019-08-26 11:44:36 +00:00
|
|
|
AS_HELP_STRING([--with-zlib-include=DIR], [zlib headers directory]),
|
2019-08-26 11:44:36 +00:00
|
|
|
[zlib_include="$withval"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$withval"]
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_ARG_WITH(zlib-lib,
|
2019-08-26 11:44:36 +00:00
|
|
|
AS_HELP_STRING([--with-zlib-lib=DIR], [zlib library directory]),
|
2019-08-26 11:44:36 +00:00
|
|
|
[zlib_lib="$withval"
|
2019-08-26 11:44:36 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L$withval"]
|
2019-08-26 11:44:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(zlib.h,
|
|
|
|
[],
|
|
|
|
[AC_MSG_ERROR("zlib header files not found."); break]
|
|
|
|
)
|
|
|
|
|
|
|
|
AC_CHECK_LIB(z, compress2,
|
|
|
|
[LIBS="$LIBS -lz"],
|
|
|
|
[AC_MSG_ERROR("zlib libraries not found.")]
|
|
|
|
)
|
|
|
|
])
|