[vlc-devel] [PATCH] contrib: Use the official zlib Win32 build system

Derek Buitenhuis derek.buitenhuis at gmail.com
Thu May 19 18:34:47 CEST 2016


We don't actually need to patch or use the configure script. By properly
passing the Makefile variables, instead of environement variables,
we can use the official Win32 build system for zlib.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
The only part I'm unhappy with here is:
    RC="$(HOST)-windres"

because we do not define RC or WINDRES in the contrib build
system, apparently.

Further explanation for LD="$(CC)" is that it seems to be what
zlib expects here. If I am wrong, please do speak up.

Lastly, zlib documents how to use the .S/asm on Win32, but I have not
enabled that here because I was not sure if VLC wants this.
---
 contrib/src/zlib/mingw.patch | 11 -----------
 contrib/src/zlib/rules.mak   |  8 +++++---
 2 files changed, 5 insertions(+), 14 deletions(-)
 delete mode 100644 contrib/src/zlib/mingw.patch

diff --git a/contrib/src/zlib/mingw.patch b/contrib/src/zlib/mingw.patch
deleted file mode 100644
index 3439d99..0000000
--- a/contrib/src/zlib/mingw.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- zlib/configure	2016-02-25 16:35:50.228444200 +0100
-+++ zlib/configure.mingw	2016-02-25 16:34:19.725510100 +0100
-@@ -194,7 +194,7 @@ if test "$gcc" -eq 1 && ($cc -c $test.c)
- # temporary bypass
-         rm -f $test.[co] $test $test$shared_ext
-         echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
--        leave 1
-+#        leave 1
-         LDSHARED=${LDSHARED-"$cc -shared"}
-         LDSHAREDLIBC=""
-         EXE='.exe' ;;
diff --git a/contrib/src/zlib/rules.mak b/contrib/src/zlib/rules.mak
index 5728d58..8c903f3 100644
--- a/contrib/src/zlib/rules.mak
+++ b/contrib/src/zlib/rules.mak
@@ -24,12 +24,14 @@ $(TARBALLS)/zlib-$(ZLIB_VERSION).tar.gz:
 
 zlib: zlib-$(ZLIB_VERSION).tar.gz .sum-zlib
 	$(UNPACK)
-ifdef HAVE_WIN32
-	$(APPLY) $(SRC)/zlib/mingw.patch
-endif
 	$(MOVE)
 
 .zlib: zlib
+ifdef HAVE_WIN32
+	cd $< && $(HOSTVARS) $(MAKE) -fwin32/Makefile.gcc $(HOSTVARS) $(ZLIB_CONFIG_VARS) CFLAGS="$(CFLAGS) $(ZLIB_ECFLAGS)" RC="$(HOST)-windres" LD="$(CC)"
+	cd $< && $(MAKE) -fwin32/Makefile.gcc install INCLUDE_PATH="$(PREFIX)/include" LIBRARY_PATH="$(PREFIX)/lib" BINARY_PATH="$(PREFIX)/bin"
+else
 	cd $< && $(HOSTVARS) $(ZLIB_CONFIG_VARS) CFLAGS="$(CFLAGS) $(ZLIB_ECFLAGS)" ./configure --prefix=$(PREFIX) --static
 	cd $< && $(MAKE) install
+endif
 	touch $@
-- 
2.8.1



More information about the vlc-devel mailing list