diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 7b2eee5f821592be9add0f35392c1c9e94155e0b..991afd367c020a08b6b502db7173053f193ceb11 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -259,7 +259,6 @@ sh -c  "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \
             --includedir=%{_includedir} \
             --mandir=%{_mandir} \
 	    --enable-thread-safe-client \
-	    --with-zlib-dir=bundled \
 	    --with-readline ; \
 	    # Add this for more debugging support
 	    # --with-debug
@@ -362,8 +361,9 @@ BuildMySQL "--disable-shared \
 %if %{STATIC_BUILD}
 		--with-mysqld-ldflags='-all-static' \
 		--with-client-ldflags='-all-static' \
-		--with-zlib-dir=bundled \
 		$USE_OTHER_LIBC_DIR \
+%else
+		--with-zlib-dir=bundled \
 %endif
 		--with-comment=\"MySQL Community Edition - Standard (GPL)\" \
 		--with-server-suffix='%{server_suffix}' \