diff options
Diffstat (limited to 'source3/configure.in')
-rw-r--r-- | source3/configure.in | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in index 443cdd6161..29209fd835 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -6248,6 +6248,42 @@ if test x$enable_merged_build = xyes; then m4_include(samba4.m4) fi +AC_CHECK_HEADERS(zlib.h) + +AC_CHECK_LIB_EXT(z, ZLIB_LIBS, zlibVersion) + +AC_CACHE_CHECK([for zlib >= 1.2.3], samba_cv_zlib_1_2_3, [ + AC_TRY_COMPILE([ + #include <zlib.h> + ],[ + #if (ZLIB_VERNUM >= 0x1230) + #else + #error "ZLIB_VERNUM < 0x1230" + #endif + ],[ + samba_cv_zlib_1_2_3=yes + ],[ + samba_cv_zlib_1_2_3=no + ]) +]) + +AC_SUBST(ZLIB_LIBS) +AC_SUBST(ZLIB_OBJS) +if test x"$ac_cv_header_zlib_h" = x"yes" -a \ + x"$ac_cv_lib_ext_z_zlibVersion" = x"yes" -a \ + x"$samba_cv_zlib_1_2_3" = x"yes"; then + ZLIB_OBJS="" +else + ZLIB_LIBS="" + for o in adler32.o compress.o crc32.o gzio.o uncompr.o \ + deflate.o trees.o zutil.o inflate.o infback.o \ + inftrees.o inffast.o + do + ZLIB_OBJS="$ZLIB_OBJS ../lib/zlib/$o" + done + CFLAGS="$CFLAGS -I../lib/zlib" +fi + dnl Remove -L/usr/lib/? from LDFLAGS and LIBS LIB_REMOVE_USR_LIB(LDFLAGS) LIB_REMOVE_USR_LIB(LIBS) |