diff --git a/configure b/configure
index b4af543c9fdabaa9adc42a792a3019d79ee62fed..e3e5809b2b9f9606932f029f68e64b0736b6e848 100755
--- a/configure
+++ b/configure
@@ -5149,13 +5149,11 @@ if test "x${HDF5}" = "xyes"; then
 fi
 
 if test "x${ZLIB}" = "xyes"; then
-    if test "x${FL_ZLIB}" = "xyes"; then
-    cat >>confdefs.h <<\_ACEOF
+  cat >>confdefs.h <<\_ACEOF
 #define HAVE_LIBZ 1
 _ACEOF
 
-  else
-    FLAGS="-DHAVE_LIBZ ${FLAGS}"
+  if test "x${FL_ZLIB}" != "xyes"; then
     if test "x${ZLIB_PREFIX}" = "x"; then
       GMSH_LIBS="${GMSH_LIBS} -lz"
     else
diff --git a/configure.in b/configure.in
index a16c4525dad364bbc076755c42340c4ad2b98146..f68f635636d01072199508c5d5b6d14307bf747b 100644
--- a/configure.in
+++ b/configure.in
@@ -646,11 +646,8 @@ fi
 dnl Complete zlib link line (zlib must be linked in after libpng and
 dnl libhdf5)
 if test "x${ZLIB}" = "xyes"; then
-  dnl If provided by FLTK, use that one; otherwise, look for it
-  if test "x${FL_ZLIB}" = "xyes"; then
-    AC_DEFINE(HAVE_LIBZ)
-  else
-    FLAGS="-DHAVE_LIBZ ${FLAGS}"
+  AC_DEFINE(HAVE_LIBZ)
+  if test "x${FL_ZLIB}" != "xyes"; then
     if test "x${ZLIB_PREFIX}" = "x"; then
       GMSH_LIBS="${GMSH_LIBS} -lz"
     else