]> granicus.if.org Git - curl/commitdiff
winbuild: prefer documented zlib library names
authorrichardthe3rd <richard.alcock@gmail.com>
Fri, 2 Mar 2018 22:13:42 +0000 (22:13 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 4 Mar 2018 22:02:51 +0000 (23:02 +0100)
Check for existence of import and static libraries with documented names
and use them if they do. Fallback to previous names.

According to
https://github.com/madler/zlib/blob/master/win32/README-WIN32.txt on
Windows, the names of the import library is "zdll.lib" and static
library is "zlib.lib".

closes #2354

winbuild/MakefileBuild.vc

index 54160beb13e138cd77c43d81b617a0fb6d62ec1d..28500aeba1c17c43c4eb918a271e6ebd6eeac807 100644 (file)
@@ -181,12 +181,26 @@ CARES          = static
 CARES_CFLAGS   = /DUSE_ARES /I"$(DEVEL_INCLUDE)/cares"\r
 !ENDIF\r
 \r
+# Depending on how zlib is built the libraries have different names, we \r
+# try to handle them all. \r
 !IF "$(WITH_ZLIB)"=="dll"\r
+!IF EXISTS("$(DEVEL_LIB)\zlibwapi.lib")\r
+ZLIB_LIBS = zlibwapi.lib\r
+!ELSEIF EXISTS("$(DEVEL_LIB)\zdll.lib")\r
+ZLIB_LIBS   = zdll.lib\r
+!ELSE\r
 ZLIB_LIBS   = zlib.lib\r
+!ENDIF\r
 USE_ZLIB    = true\r
 ZLIB        = dll\r
 !ELSEIF "$(WITH_ZLIB)"=="static"\r
+!IF EXISTS("$(DEVEL_LIB)\zlibstat.lib")\r
+ZLIB_LIBS   = zlibstat.lib\r
+!ELSEIF EXISTS("$(DEVEL_LIB)\zlib.lib")\r
+ZLIB_LIBS   = zlib.lib\r
+!ELSE\r
 ZLIB_LIBS   = zlib_a.lib\r
+!ENDIF\r
 USE_ZLIB    = true\r
 ZLIB        = static\r
 !ENDIF\r