aboutsummaryrefslogtreecommitdiffstats
path: root/erts/configure.in
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-01-22 16:19:32 +0100
committerBjörn Gustavsson <[email protected]>2014-01-22 16:19:32 +0100
commite99633a51cbd22b16606c2669c575c22cf1c511f (patch)
tree784ef6b3eec7461e7b8962fee2d1ba6858b516b6 /erts/configure.in
parent990b655c92f889d2c45e6f43ee6fdae29ffc8464 (diff)
parent9f57d8c4f86323cf7481c9a7e512486087bb5542 (diff)
downloadotp-e99633a51cbd22b16606c2669c575c22cf1c511f.tar.gz
otp-e99633a51cbd22b16606c2669c575c22cf1c511f.tar.bz2
otp-e99633a51cbd22b16606c2669c575c22cf1c511f.zip
Merge branch 'bjorn/erts/zlib-1.2.8'
* bjorn/erts/zlib-1.2.8: configure: Prefer the system's zlib over own our zlib source Update preloaded modules Add the 'rle' zstrategy Don't make gzio.c dependent on the zutil.h header file Update zlib to 1.2.8 erts/zlib: Remove unused file example.c
Diffstat (limited to 'erts/configure.in')
-rw-r--r--erts/configure.in46
1 files changed, 33 insertions, 13 deletions
diff --git a/erts/configure.in b/erts/configure.in
index cf21d0cbfc..c992fb5bd9 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -1372,24 +1372,44 @@ dnl -------------
dnl zlib
dnl -------------
-AC_ARG_ENABLE(shared-zlib,
-AS_HELP_STRING([--enable-shared-zlib], [enable using shared zlib library]),
-[ case "$enableval" in
- no) enable_shared_zlib=no ;;
- *) enable_shared_zlib=yes ;;
- esac ], enable_shared_zlib=no)
+AC_ARG_ENABLE(builtin-zlib,
+ AS_HELP_STRING([--enable-builtin-zlib],
+ [force use of our own built-in zlib]),
+ [ case "$enableval" in
+ no) enable_builtin_zlib=no ;;
+ *) enable_builtin_zlib=yes ;;
+ esac ], enable_builtin_zlib=no)
Z_LIB=
-if test "x$enable_shared_zlib" = "xyes" ; then
- AC_CHECK_LIB(z, adler32_combine,
- [Z_LIB="-lz"
- AC_DEFINE(HAVE_LIBZ, 1, [Define to 1 if you have the `z' library (-lz).])],
- [AC_MSG_ERROR([cannot find any shared zlib])])
+if test "x$enable_builtin_zlib" = "xyes"; then
+ AC_MSG_NOTICE([Using our own built-in zlib source])
else
- AC_MSG_NOTICE([Using own zlib source])
+AC_MSG_CHECKING(for zlib 1.2.5 or higher)
+zlib_save_LIBS=$LIBS
+LIBS="-lz $LIBS"
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include "zlib.h"
+]],[[
+#if ZLIB_VERNUM >= 0x1250
+ Bytef s[1];
+ s[0] = 0;
+ (void) adler32((uLong)0, s, 1);
+#else
+#error "No zlib 1.2.5 or higher found"
+error
+#endif
+]])],
+[
+ Z_LIB="-lz"
+ AC_DEFINE(HAVE_LIBZ, 1, [Define to 1 if you have the `z' library (-lz).])
+ AC_MSG_RESULT(yes)
+],[
+ AC_MSG_RESULT(no)
+])
+LIBS=$zlib_save_LIBS
fi
-
AC_SUBST(Z_LIB)
dnl