From 8e34b3a8024c028dd9fd21d70525fc6d215efde5 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 9 Sep 2011 23:22:10 -0700 Subject: zlib 1.2.0.2 --- win32/Makefile.gcc | 15 +++++++++++++-- win32/Makefile.msc | 33 ++++++++++++++++++++++++++++----- win32/zlib.def | 13 ++++++++----- 3 files changed, 49 insertions(+), 12 deletions(-) (limited to 'win32') diff --git a/win32/Makefile.gcc b/win32/Makefile.gcc index 7f9973b..da32859 100644 --- a/win32/Makefile.gcc +++ b/win32/Makefile.gcc @@ -16,7 +16,7 @@ # LIB = libz.a -SHAREDLIB = libz.so +SHAREDLIB = zlib.dll VER = 1.2.0 CC = gcc @@ -32,6 +32,8 @@ LDFLAGS = $(LOC) -s AR = ar ARFLAGS = rcs +RC = windres + CP = cp -fp # If GNU install is available, replace $(CP) with install. INSTALL = $(CP) @@ -43,12 +45,14 @@ exec_prefix = $(prefix) OBJS = adler32.o compress.o crc32.o deflate.o gzio.o infback.o \ inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o +DLLDEF = win32/zlibgcc.def + # to use the asm code: make OBJA=match.o OBJA = TEST_OBJS = example.o minigzip.o -all: $(LIB) example minigzip +all: $(LIB) $(SHAREDLIB) example minigzip test: all ./example @@ -60,12 +64,18 @@ test: all libz.a: $(OBJS) $(AR) $(ARFLAGS) $@ $(OBJS) +$(SHAREDLIB): $(OBJS) $(DLLDEF) zlibrc.o + dllwrap --driver-name $(CC) --def $(DLLDEF) -o $@ $(OBJS) zlibrc.o + example: example.o $(LIB) $(LD) -o $@ $< $(LIB) minigzip: minigzip.o $(LIB) $(LD) -o $@ $< $(LIB) +zlibrc.o: win32/zlib.rc + -$(RC) -o $@ --define GCC_WINDRES win32/zlib.rc + # INCLUDE_PATH and LIBRARY_PATH were set for [make] in djgpp.env . @@ -87,6 +97,7 @@ clean: $(RM) *.o $(RM) *.exe $(RM) libz.a + $(RM) zlib.dll $(RM) foo.gz adler32.o: zlib.h zconf.h diff --git a/win32/Makefile.msc b/win32/Makefile.msc index 9760208..4dc8819 100644 --- a/win32/Makefile.msc +++ b/win32/Makefile.msc @@ -1,10 +1,13 @@ -# Makefile for (static) zlib -- Microsoft (Visual) C. -# Author: Cosmin Truta, 11-Mar-2003. +# Makefile for Win32 zlib.dll and the static library zlibstat.lib +# -- Microsoft (Visual) C. +# Author: Cosmin Truta, 11-Mar-2003 +# Christian Spieler, 19-Mar-2003 # # Usage: nmake -f win32/Makefile.msc CC = cl LD = cl +RC = rc CFLAGS = -nologo -MD -O2 LDFLAGS = -nologo @@ -12,19 +15,33 @@ OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj \ inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj # targets -all: zlib.lib example.exe minigzip.exe +all: zlib.dll zlibstat.lib example.exe minigzip.exe exampl_s.exe minigz_s.exe -zlib.lib: $(OBJS) +zlibstat.lib: $(OBJS) lib -out:$@ $(OBJS) +zlib.dll: $(OBJS) zlib.res win32/zlib.def + link -release -def:win32/zlib.def -dll -out:$@ $(OBJS) zlib.res + +zlib.lib: zlib.dll + example.exe: example.obj zlib.lib $(LD) $(LDFLAGS) example.obj zlib.lib minigzip.exe: minigzip.obj zlib.lib $(LD) $(LDFLAGS) minigzip.obj zlib.lib +exampl_s.exe: example.obj zlibstat.lib + $(LD) $(LDFLAGS) -o $@ example.obj zlibstat.lib + +minigz_s.exe: minigzip.obj zlibstat.lib + $(LD) $(LDFLAGS) -o $@ minigzip.obj zlibstat.lib + .c.obj: - $(CC) -c $(CFLAGS) $*.c + $(CC) -c $(CFLAGS) $< + +zlib.res: win32/zlib.rc + $(RC) /l 0x409 /fo$@ /d WIN32 win32/zlib.rc adler32.obj: adler32.c zlib.h zconf.h @@ -62,8 +79,14 @@ test: example.exe minigzip.exe example echo hello world | minigzip | minigzip -d +teststat: exampl_s.exe minigz_s.exe + exampl_s + echo hello world | minigz_s | minigz_s -d + # cleanup clean: del *.obj + del *.dll del *.lib + del *.exp del *.exe diff --git a/win32/zlib.def b/win32/zlib.def index 3b4b05a..d299ed5 100644 --- a/win32/zlib.def +++ b/win32/zlib.def @@ -1,5 +1,5 @@ LIBRARY zlib.dll -DESCRIPTION "zlib compression library for Windows" +DESCRIPTION "zlib data compression library" EXPORTS adler32 @1 @@ -43,7 +43,10 @@ EXPORTS compress2 @39 gzputs @40 gzgets @41 -; The following functions exist since zlib-1.2.0 -; deflateBound @42 -; compressBound @43 -; etc. +; since zlib-1.2.0: + inflateCopy @42 + inflateBackInit_ @43 + inflateBack @44 + inflateBackEnd @45 + compressBound @46 + deflateBound @47 -- cgit v1.2.3-55-g6feb