X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=m4%2Fzlib.m4;h=71f39f717ce895038c68edf0b87f7247f4643788;hp=8407838a4d3b5aa6f8d219e68e61043c9e0da9ee;hb=396ac4be802f8b75c5a2ab5925925427c61c1da3;hpb=d9a62c6354d1e2ad78ee8c610518ae9f9ab012d1 diff --git a/m4/zlib.m4 b/m4/zlib.m4 index 8407838a..71f39f71 100644 --- a/m4/zlib.m4 +++ b/m4/zlib.m4 @@ -1,20 +1,24 @@ dnl Check to find the zlib headers/libraries -AC_DEFUN(tinc_ZLIB, +AC_DEFUN([tinc_ZLIB], [ - tinc_ac_save_CPPFLAGS="$CPPFLAGS" + 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"] + ) AC_ARG_WITH(zlib-include, - [ --with-zlib-include=DIR zlib headers directory], + AS_HELP_STRING([--with-zlib-include=DIR], [zlib headers directory]), [zlib_include="$withval" - CFLAGS="$CFLAGS -I$withval" CPPFLAGS="$CPPFLAGS -I$withval"] ) AC_ARG_WITH(zlib-lib, - [ --with-zlib-lib=DIR zlib library directory], + AS_HELP_STRING([--with-zlib-lib=DIR], [zlib library directory]), [zlib_lib="$withval" - LIBS="$LIBS -L$withval"] + LDFLAGS="$LDFLAGS -L$withval"] ) AC_CHECK_HEADERS(zlib.h, @@ -22,8 +26,6 @@ AC_DEFUN(tinc_ZLIB, [AC_MSG_ERROR("zlib header files not found."); break] ) - CPPFLAGS="$tinc_ac_save_CPPFLAGS" - AC_CHECK_LIB(z, compress2, [LIBS="$LIBS -lz"], [AC_MSG_ERROR("zlib libraries not found.")]