From ac49ae5c99993cb312645c26d3f07efa4c668bc8 Mon Sep 17 00:00:00 2001
From: Rickard Green <rickard@erlang.org>
Date: Mon, 18 Dec 2017 11:44:30 +0100
Subject: Do not add -lz to LIBS; keep it in Z_LIB

---
 erts/configure.in | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'erts')

diff --git a/erts/configure.in b/erts/configure.in
index 913315e402..cbebca97a3 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -1507,12 +1507,16 @@ error
 ],[
  AC_MSG_RESULT(no)
 ])
+
+if test "$Z_LIB" != ""; then
+  AC_MSG_CHECKING(for zlib inflateGetDictionary presence)
+  AC_SEARCH_LIBS(inflateGetDictionary, [z],
+                 AC_DEFINE(HAVE_ZLIB_INFLATEGETDICTIONARY, 1,
+                           [Define if your zlib version defines inflateGetDictionary.]))
+fi
+
 LIBS=$zlib_save_LIBS
 
-AC_MSG_CHECKING(for zlib inflateGetDictionary presence)
-AC_SEARCH_LIBS(inflateGetDictionary, [z],
-               AC_DEFINE(HAVE_ZLIB_INFLATEGETDICTIONARY, 1,
-                         [Define if your zlib version defines inflateGetDictionary.]))
 fi
 AC_SUBST(Z_LIB)
 
-- 
cgit v1.2.3