summaryrefslogtreecommitdiffstats
path: root/compat/zlib/win32
diff options
context:
space:
mode:
Diffstat (limited to 'compat/zlib/win32')
-rw-r--r--compat/zlib/win32/Makefile.gcc44
-rw-r--r--compat/zlib/win32/Makefile.msc34
-rw-r--r--compat/zlib/win32/README-WIN32.txt103
3 files changed, 160 insertions, 21 deletions
diff --git a/compat/zlib/win32/Makefile.gcc b/compat/zlib/win32/Makefile.gcc
index abe3d5a..0a33bf6 100644
--- a/compat/zlib/win32/Makefile.gcc
+++ b/compat/zlib/win32/Makefile.gcc
@@ -27,25 +27,32 @@ STATICLIB = libz.a
SHAREDLIB = zlib1.dll
IMPLIB = libzdll.a
+#
+# Set to 1 if shared object needs to be installed
+#
+SHARED_MODE=0
+
#LOC = -DASMV
#LOC = -DDEBUG -g
-CC = gcc
+PREFIX =
+CC = $(PREFIX)gcc
CFLAGS = $(LOC) -O3 -Wall
+EXTRA_CFLAGS = -DNO_VIZ
AS = $(CC)
ASFLAGS = $(LOC) -Wall
LD = $(CC)
-LDFLAGS = $(LOC) -s
+LDFLAGS = $(LOC)
-AR = ar
+AR = $(PREFIX)ar
ARFLAGS = rcs
-RC = windres
+RC = $(PREFIX)windres
RCFLAGS = --define GCC_WINDRES
-STRIP = strip
+STRIP = $(PREFIX)strip
CP = cp -fp
# If GNU install is available, replace $(CP) with install.
@@ -70,7 +77,7 @@ testdll: example_d.exe minigzip_d.exe
echo hello world | ./minigzip_d | ./minigzip_d -d
.c.o:
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
.S.o:
$(AS) $(ASFLAGS) -c -o $@ $<
@@ -81,43 +88,54 @@ $(STATICLIB): $(OBJS) $(OBJA)
$(IMPLIB): $(SHAREDLIB)
$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
- $(CC) -shared -Wl,--out-implib,$(IMPLIB) \
+ $(CC) -shared -Wl,--out-implib,$(IMPLIB) $(LDFLAGS) \
-o $@ win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
$(STRIP) $@
example.exe: example.o $(STATICLIB)
$(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB)
+ $(STRIP) $@
minigzip.exe: minigzip.o $(STATICLIB)
$(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB)
+ $(STRIP) $@
example_d.exe: example.o $(IMPLIB)
$(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB)
+ $(STRIP) $@
minigzip_d.exe: minigzip.o $(IMPLIB)
$(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB)
+ $(STRIP) $@
zlibrc.o: win32/zlib1.rc
$(RC) $(RCFLAGS) -o $@ win32/zlib1.rc
-# INCLUDE_PATH and LIBRARY_PATH must be set.
+# BINARY_PATH, INCLUDE_PATH and LIBRARY_PATH must be set.
.PHONY: install uninstall clean
-install: zlib.h zconf.h $(LIB)
- -@if not exist $(INCLUDE_PATH)/nul mkdir $(INCLUDE_PATH)
- -@if not exist $(LIBRARY_PATH)/nul mkdir $(LIBRARY_PATH)
+install: zlib.h zconf.h $(STATICLIB) $(IMPLIB)
+ -@mkdir -p $(INCLUDE_PATH)
+ -@mkdir -p $(LIBRARY_PATH)
+ -if [ "$(SHARED_MODE)" = "1" ]; then \
+ mkdir -p $(BINARY_PATH); \
+ $(INSTALL) $(SHAREDLIB) $(BINARY_PATH); \
+ $(INSTALL) $(IMPLIB) $(LIBRARY_PATH); \
+ fi
-$(INSTALL) zlib.h $(INCLUDE_PATH)
-$(INSTALL) zconf.h $(INCLUDE_PATH)
-$(INSTALL) $(STATICLIB) $(LIBRARY_PATH)
- -$(INSTALL) $(IMPLIB) $(LIBRARY_PATH)
uninstall:
+ -if [ "$(SHARED_MODE)" = "1" ]; then \
+ $(RM) $(BINARY_PATH)/$(SHAREDLIB); \
+ $(RM) $(LIBRARY_PATH)/$(IMPLIB); \
+ fi
-$(RM) $(INCLUDE_PATH)/zlib.h
-$(RM) $(INCLUDE_PATH)/zconf.h
-$(RM) $(LIBRARY_PATH)/$(STATICLIB)
- -$(RM) $(LIBRARY_PATH)/$(IMPLIB)
clean:
-$(RM) $(STATICLIB)
diff --git a/compat/zlib/win32/Makefile.msc b/compat/zlib/win32/Makefile.msc
index a731c0c..fa10a1a 100644
--- a/compat/zlib/win32/Makefile.msc
+++ b/compat/zlib/win32/Makefile.msc
@@ -2,15 +2,16 @@
# zlib is copyright (C) 1995-2006 Jean-loup Gailly and Mark Adler
#
# Usage:
-# nmake -f win32/Makefile.msc (standard build)
-# nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build)
-# nmake -f win32/Makefile.msc LOC=-DASMV OBJA=match.obj (use ASM code)
-
+# nmake -f win32/Makefile.msc (standard build)
+# nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build)
+# nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" \
+# OBJA="inffas32.obj match686.obj" (use ASM code, x86)
+# nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF" \
+# OBJA="inffasx64.obj gvmat64.obj inffas8664.c" (use ASM code, x64)
# optional build flags
LOC =
-
# variables
STATICLIB = zlib.lib
SHAREDLIB = zlib1.dll
@@ -23,13 +24,13 @@ AR = lib
RC = rc
CFLAGS = -nologo -MD -W3 -O2 -Oy- -Zi -Fd"zlib" $(LOC)
WFLAGS = -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
-ASFLAGS = -coff -Zi
+ASFLAGS = -coff -Zi $(LOC)
LDFLAGS = -nologo -debug -incremental:no -opt:ref
ARFLAGS = -nologo
RCFLAGS = /dWIN32 /r
OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj \
- gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
+ gzwrite.obj infback.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
OBJA =
@@ -71,7 +72,13 @@ minigzip_d.exe: minigzip.obj $(IMPLIB)
.c.obj:
$(CC) -c $(WFLAGS) $(CFLAGS) $<
-.asm.obj:
+{contrib/masmx64}.c.obj:
+ $(CC) -c $(WFLAGS) $(CFLAGS) $<
+
+{contrib/masmx64}.asm.obj:
+ $(AS) -c $(ASFLAGS) $<
+
+{contrib/masmx86}.asm.obj:
$(AS) -c $(ASFLAGS) $<
adler32.obj: adler32.c zlib.h zconf.h
@@ -107,6 +114,17 @@ uncompr.obj: uncompr.c zlib.h zconf.h
zutil.obj: zutil.c zutil.h zlib.h zconf.h
+gvmat64.obj: contrib\masmx64\gvmat64.asm
+
+inffasx64.obj: contrib\masmx64\inffasx64.asm
+
+inffas8664.obj: contrib\masmx64\inffas8664.c zutil.h zlib.h zconf.h \
+ inftrees.h inflate.h inffast.h
+
+inffas32.obj: contrib\masmx86\inffas32.asm
+
+match686.obj: contrib\masmx86\match686.asm
+
example.obj: example.c zlib.h zconf.h
minigzip.obj: minigzip.c zlib.h zconf.h
diff --git a/compat/zlib/win32/README-WIN32.txt b/compat/zlib/win32/README-WIN32.txt
new file mode 100644
index 0000000..1e4c093
--- /dev/null
+++ b/compat/zlib/win32/README-WIN32.txt
@@ -0,0 +1,103 @@
+ZLIB DATA COMPRESSION LIBRARY
+
+zlib 1.2.4 is a general purpose data compression library. All the code is
+thread safe. The data format used by the zlib library is described by RFCs
+(Request for Comments) 1950 to 1952 in the files
+http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
+and rfc1952.txt (gzip format).
+
+All functions of the compression library are documented in the file zlib.h
+(volunteer to write man pages welcome, contact zlib@gzip.org). Two compiled
+examples are distributed in this package, example and minigzip. The example_d
+and minigzip_d flavors validate that the zlib1.dll file is working correctly.
+
+Questions about zlib should be sent to <zlib@gzip.org>. The zlib home page
+is http://zlib.net/ . Before reporting a problem, please check this site to
+verify that you have the latest version of zlib; otherwise get the latest
+version and check whether the problem still exists or not.
+
+PLEASE read DLL_FAQ.txt, and the the zlib FAQ http://zlib.net/zlib_faq.html
+before asking for help.
+
+
+Manifest:
+
+The package zlib-1.2.4-win32-x86.zip contains the following files:
+
+ README-WIN32.txt This document
+ ChangeLog Changes since previous zlib packages
+ DLL_FAQ.txt Frequently asked questions about zlib1.dll
+ zlib.3.pdf Documentation of this library in Adobe Acrobat format
+
+ example.exe A statically-bound example (using zlib.lib, not the dll)
+ example.pdb Symbolic information for debugging example.exe
+
+ example_d.exe A zlib1.dll bound example (using zdll.lib)
+ example_d.pdb Symbolic information for debugging example_d.exe
+
+ minigzip.exe A statically-bound test program (using zlib.lib, not the dll)
+ minigzip.pdb Symbolic information for debugging minigzip.exe
+
+ minigzip_d.exe A zlib1.dll bound test program (using zdll.lib)
+ minigzip_d.pdb Symbolic information for debugging minigzip_d.exe
+
+ zlib.h Install these files into the compilers' INCLUDE path to
+ zconf.h compile programs which use zlib.lib or zdll.lib
+
+ zdll.lib Install these files into the compilers' LIB path if linking
+ zdll.exp a compiled program to the zlib1.dll binary
+
+ zlib.lib Install these files into the compilers' LIB path to link zlib
+ zlib.pdb into compiled programs, without zlib1.dll runtime dependency
+ (zlib.pdb provides debugging info to the compile time linker)
+
+ zlib1.dll Install this binary shared library into the system PATH, or
+ the program's runtime directory (where the .exe resides)
+ zlib1.pdb Install in the same directory as zlib1.dll, in order to debug
+ an application crash using WinDbg or similar tools.
+
+All .pdb files above are entirely optional, but are very useful to a developer
+attempting to diagnose program misbehavior or a crash. Many additional
+important files for developers can be found in the zlib124.zip source package
+available from http://zlib.net/ - review that package's README file for details.
+
+
+Acknowledgments:
+
+The deflate format used by zlib was defined by Phil Katz. The deflate and
+zlib specifications were written by L. Peter Deutsch. Thanks to all the
+people who reported problems and suggested various improvements in zlib; they
+are too numerous to cite here.
+
+
+Copyright notice:
+
+ (C) 1995-2010 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+If you use the zlib library in a product, we would appreciate *not* receiving
+lengthy legal documents to sign. The sources are provided for free but without
+warranty of any kind. The library has been entirely written by Jean-loup
+Gailly and Mark Adler; it does not include third-party code.
+
+If you redistribute modified sources, we would appreciate that you include in
+the file ChangeLog history information documenting your changes. Please read
+the FAQ for more information on the distribution of modified source versions.