* zlib.m4 (AM_ZLIB): Unset zlibdir and zlibinc only for
	--with-system-zlib.
+2015-04-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * zlib.m4 (AM_ZLIB): Unset zlibdir and zlibinc only for
+       --with-system-zlib.
+
 2015-03-31  H.J. Lu  <hongjiu.lu@intel.com>
 
        * zlib.m4 (AM_ZLIB): Replace --with-zlib with --with-system-zlib.
 
   zlibinc="-I\$(srcdir)/../zlib"
   AC_ARG_WITH(system-zlib,
   [AS_HELP_STRING([--with-system-zlib], [use installed libz])],
-  zlibdir=
-  zlibinc=
+  if test x$with_system_zlib = xyes ; then
+    zlibdir=
+    zlibinc=
+  fi
   )
   AC_SUBST(zlibdir)
   AC_SUBST(zlibinc)