Ethereal-dev: Re: [Ethereal-dev] Windows zlib 1.1.4 understand .gz files ?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Kevin Humphries <khumphries@xxxxxxxxxxxx>
Date: Tue, 11 Nov 2003 20:40:27 -0700
Copy the files Makefile.w32, zlib.def, and zlib.rc from the msdos\ directory to the parent directory. Apply the following changes to Makefile.w32 and then nmake -f Makefile.w32 zlib.dll. I will also attach a text file of the diff just incase my mailer wraps the diff.

--- orig\zlib-1.1.4\msdos\Makefile.w32    Wed Jul 08 10:01:48 1998
+++ zlib-1.1.4\Makefile.w32    Tue Nov 11 20:15:25 2003
@@ -9,8 +9,9 @@
# See zconf.h for details about the memory requirements.

# ------------- Microsoft Visual C++ 4.0 and later -------------
+include <win32.mak>
MODEL=
-CFLAGS=-Ox -GA3s -nologo -W3
+CFLAGS=$(cvarsdll) -DZLIB_DLL -Ox -GA3s -nologo -W3
CC=cl
LD=link
LDFLAGS=
@@ -26,7 +27,7 @@
OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
  infutil$(O)+inffast$(O)

-all:  zlib.lib example.exe minigzip.exe
+all:  zlib.dll zlib.lib example.exe minigzip.exe

adler32.obj: adler32.c zlib.h zconf.h
  $(CC) -c $(CFLAGS) $*.c
@@ -82,6 +83,11 @@
  if exist zlib.lib del zlib.lib
  lib /OUT:zlib.lib $(OBJ1) $(OBJ2)

+zlib.dll: $(OBJ1) $(OBJ2) zlib.def
+    $(LD) $(dlllflags) $(guilibsdll) \
+    /DEF:zlib.def /out:zlib.dll \
+    /IMPLIB:zlib.lib $(OBJ1) $(OBJ2)
+
example.exe: example.obj zlib.lib
  $(LD) $(LDFLAGS) example.obj zlib.lib /OUT:example.exe /SUBSYSTEM:CONSOLE


Kevin Humphries wrote:

I fought with this recently and found that I needed to rebuild the zlib.dll file. I used the instuctions in the README file of the zlib-1.1.4.tar.gz file reading the instructions starting with "To build a Windows DLL version, include..." I copied the Makefile.w32 into the base directory, changed the makefile to support multi-threaded DLLs and then added the target for zlib.dll. Unfortunately I don't have the changes on this machine, but I will see if I can post them within a couple of days. After rebuilding the DLL and copying it to the appropriate spot, it would read/write gzip capture files.

Michael Lum wrote:

I have made clean, run cleanbld.bat and remade everything.

Still ethereal won't open a .gz file.

The About box says it was built with zlib 1.1.4.

VS.NET C++
Windows 2000

Thanks.

--
Michael Lum                          Architect
4600 Jacombs Road               (604) 276-0055
Richmond, B.C.
Canada V6V 3B1

Telos Technology
Winner of the 2003 GSM Association Award
for Technology Innovation
Best Infrastructure

_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev



_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev

--- old\Makefile.w32	Wed Jul 08 10:01:48 1998
+++ Makefile.w32	Tue Nov 11 20:15:25 2003
@@ -9,8 +9,9 @@
 # See zconf.h for details about the memory requirements.
 
 # ------------- Microsoft Visual C++ 4.0 and later -------------
+include <win32.mak>
 MODEL=
-CFLAGS=-Ox -GA3s -nologo -W3
+CFLAGS=$(cvarsdll) -DZLIB_DLL -Ox -GA3s -nologo -W3
 CC=cl
 LD=link
 LDFLAGS=
@@ -26,7 +27,7 @@
 OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
   infutil$(O)+inffast$(O)
 
-all:  zlib.lib example.exe minigzip.exe
+all:  zlib.dll zlib.lib example.exe minigzip.exe
 
 adler32.obj: adler32.c zlib.h zconf.h
   $(CC) -c $(CFLAGS) $*.c
@@ -82,6 +83,11 @@
   if exist zlib.lib del zlib.lib
   lib /OUT:zlib.lib $(OBJ1) $(OBJ2)
 
+zlib.dll: $(OBJ1) $(OBJ2) zlib.def
+	$(LD) $(dlllflags) $(guilibsdll) \
+	/DEF:zlib.def /out:zlib.dll \
+	/IMPLIB:zlib.lib $(OBJ1) $(OBJ2)
+
 example.exe: example.obj zlib.lib
   $(LD) $(LDFLAGS) example.obj zlib.lib /OUT:example.exe /SUBSYSTEM:CONSOLE