diff -urN zlib-1.1.3-orig/cygwin/Makefile zlib-1.1.3/cygwin/Makefile
--- zlib-1.1.3-orig/cygwin/Makefile	Wed Dec 31 19:00:00 1969
+++ zlib-1.1.3/cygwin/Makefile	Sat Jul 15 02:05:24 2000
@@ -0,0 +1,229 @@
+# Makefile for zlib
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h 
+
+# To compile and test, type:
+#   ./configure; make test
+# The call of configure is optional if you don't have special requirements
+# If you wish to build zlib as a shared library, use: ./configure -s
+
+# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
+#    make install
+# To install in $HOME instead of /usr/local, use:
+#    make install prefix=$HOME
+
+CC=cc
+
+CFLAGS=-O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+#           -Wstrict-prototypes -Wmissing-prototypes
+
+LDFLAGS=-L. -lz
+LDSHARED=$(CC)
+LDEXTRA=
+CPP=$(CC) -E
+
+VER=1.1.3
+LIBS=libz.a
+SHAREDLIB=libz.so
+STATLIB=libz.a
+IMPLIB=libz.dll.a
+SHAREDDEF=libz.def
+AR=ar rc
+RANLIB=ranlib
+TAR=tar
+SHELL=/bin/sh
+EXE=
+
+prefix = /usr/local
+exec_prefix = ${prefix}
+libdir = ${exec_prefix}/lib
+bindir = ${exec_prefix}/bin
+includedir = ${prefix}/include
+mandir = ${prefix}/man
+man3dir = ${mandir}/man3
+docdir = ${prefix}/doc/zlib-1.1.3
+
+OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
+OBJSDLL = $(OBJS:.o=.pic.o)
+
+# to use the asm code, 'cp contrib/asm?86/match.S ./match.S' and 
+# make OBJA=match.o
+# Also, add '-DASMV' to CFLAGS above.
+OBJA = 
+OBJADLL = $(OBJA:.o=.pic.o)
+
+TEST_OBJS = example.o minigzip.o
+TEST_OBJSDLL = $(TEST_OBJS:.o=.pic.o)
+
+DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
+  algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
+  nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
+  contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
+  contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
+  contrib/asm[56]86/*.S contrib/iostream/*.cpp \
+  contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \
+  contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
+  contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
+  contrib/delphi*/*.???
+
+all: example$(EXE) example-stat$(EXE) minigzip$(EXE) minigzip-stat$(EXE)
+
+%.o : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -DZLIB_STATIC -o $@ $<
+
+%.pic.o : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -DZLIB_DLL -o $@ $<
+
+
+test: test-dll test-stat
+
+test-dll: all
+	@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+	echo hello world | ./minigzip | ./minigzip -d || \
+	  echo '		*** minigzip test FAILED ***' ; \
+	if ./example; then \
+	  echo '		*** zlib test OK ***'; \
+	else \
+	  echo '		*** zlib test FAILED ***'; \
+	fi
+
+test-stat: all
+	@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+	echo hello world | ./minigzip-stat | ./minigzip-stat -d || \
+	  echo '		*** minigzip test FAILED ***' ; \
+	if ./example-stat; then \
+	  echo '		*** zlib test OK ***'; \
+	else \
+	  echo '		*** zlib test FAILED ***'; \
+	fi
+
+$(STATLIB): $(OBJS) $(OBJA)
+	$(AR) $@ $(OBJS) $(OBJA)
+	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+match.o: match.S
+	$(CPP) match.S > _match.s
+	$(CC) -c _match.s -o _match.o
+	mv _match.o match.o
+	rm -f _match.s
+
+match.pic.o: match.S
+	$(CPP) match.S > _match.pic.s
+	$(CC) -c _match.pic.s -o _match.pic.o
+	mv _match.pic.o match.pic.o
+	rm -f _match.pic.s
+
+
+#$(SHAREDLIB).$(VER): $(OBJS)
+#	$(LDSHARED) -o $@ $(OBJS)
+#	rm -f $(SHAREDLIB) $(SHAREDLIB).1
+#	ln -s $@ $(SHAREDLIB)
+#	ln -s $@ $(SHAREDLIB).1
+$(SHAREDLIB): $(OBJSDLL) $(OBJADLL) $(SHAREDDEF)
+	$(LDSHARED) -o $@ $(LDEXTRA) $(OBJSDLL) $(OBJADLL)
+
+example-stat$(EXE): example.o $(LIBS)
+	$(CC) -static $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+example$(EXE): example.pic.o $(LIBS)
+	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+minigzip-stat$(EXE): minigzip.o $(LIBS)
+	$(CC) -static $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+minigzip$(EXE): minigzip.pic.o $(LIBS)
+	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+example.o: example.c $(LIBS)
+	$(CC) $(CFLAGS) -DZLIB_STATIC -c $< -o $@
+
+example.pic.o: example.c $(LIBS)
+	$(CC) $(CFLAGS) -c $< -o $@
+
+minigzip.o: minigzip.c $(LIBS)
+	$(CC) $(CFLAGS) -DZLIB_STATIC -c $< -o $@
+
+minigzip.pic.o: minigzip.c $(LIBS)
+	$(CC) $(CFLAGS) -c $< -o $@
+
+install: $(LIBS)
+	-@if [ ! -d $(includedir)  ]; then mkdir -p $(includedir); fi
+	-@if [ ! -d $(bindir) ]; then mkdir -p $(bindir); fi
+	-@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
+	-@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
+	-@if [ ! -d $(docdir) ]; then mkdir -p $(docdir); fi
+	install -m 644 zlib.h zconf.h $(includedir)
+	install -m 755 $(IMPLIB) $(libdir)
+	install -m 755 $(STATLIB) $(libdir)
+	-@(cd $(libdir); $(RANLIB) $(STATLIB) || true) >/dev/null 2>&1
+	install -s -m 755 $(SHAREDLIB) $(bindir)
+	install -m 644 zlib.3 $(man3dir)
+	install -m 644 README FAQ $(docdir)
+
+uninstall:
+	-@rm -f $(includedir)/zlib.h
+	-@rm -f $(includedir)/zconf.h
+	-@rm -f $(libdir)/$(IMPLIB)
+	-@rm -f $(libdir)/$(STATLIB)
+	-@rm -f $(bindir)/$(SHAREDLIB)
+	-@rm -f $(man3dir)/zlib.3
+
+clean:
+	rm -f *.o *.pic.o *~ example$(EXE) minigzip$(EXE) example-stat$(EXE) \
+		minigzip-stat$(EXE)  \
+		libz.a libz.so* foo.gz so_locations _match.s maketree \
+		$(IMPLIB) $(STATLIB) $(SHAREDLIB)
+
+distclean:	clean
+
+zip:
+	mv Makefile Makefile~; cp -p Makefile.in Makefile
+	rm -f test.c ztest*.c contrib/minizip/test.zip
+	v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+	zip -ul9 zlib$$v $(DISTFILES)
+	mv Makefile~ Makefile
+
+dist:
+	mv Makefile Makefile~; cp -p Makefile.in Makefile
+	rm -f test.c ztest*.c contrib/minizip/test.zip
+	d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+	rm -f $$d.tar.gz; \
+	if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
+	files=""; \
+	for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
+	cd ..; \
+	GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
+	if test ! -d $$d; then rm -f $$d; fi
+	mv Makefile~ Makefile
+
+tags:	
+	etags *.[ch]
+
+depend:
+	makedepend -- $(CFLAGS) -- *.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
+infcodes.o: zutil.h zlib.h zconf.h
+infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h
+inffast.o: infblock.h infcodes.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+minigzip.o:  zlib.h zconf.h 
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h  
diff -urN zlib-1.1.3-orig/cygwin/Makefile.in zlib-1.1.3/cygwin/Makefile.in
--- zlib-1.1.3-orig/cygwin/Makefile.in	Wed Dec 31 19:00:00 1969
+++ zlib-1.1.3/cygwin/Makefile.in	Sat Jul 15 02:05:03 2000
@@ -0,0 +1,229 @@
+# Makefile for zlib
+# Copyright (C) 1995-1998 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h 
+
+# To compile and test, type:
+#   ./configure; make test
+# The call of configure is optional if you don't have special requirements
+# If you wish to build zlib as a shared library, use: ./configure -s
+
+# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
+#    make install
+# To install in $HOME instead of /usr/local, use:
+#    make install prefix=$HOME
+
+CC=cc
+
+CFLAGS=-O
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
+#CFLAGS=-g -DDEBUG
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
+#           -Wstrict-prototypes -Wmissing-prototypes
+
+LDFLAGS=-L. -lz
+LDSHARED=$(CC)
+LDEXTRA=
+CPP=$(CC) -E
+
+VER=1.1.3
+LIBS=libz.a
+SHAREDLIB=libz.so
+STATLIB=libz.a
+IMPLIB=libz.dll.a
+SHAREDDEF=libz.def
+AR=ar rc
+RANLIB=ranlib
+TAR=tar
+SHELL=/bin/sh
+EXE=
+
+prefix = /usr/local
+exec_prefix = ${prefix}
+libdir = ${exec_prefix}/lib
+bindir = ${exec_prefix}/bin
+includedir = ${prefix}/include
+mandir = ${prefix}/man
+man3dir = ${mandir}/man3
+docdir = ${prefix}/doc/zlib-1.1.3
+
+OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
+       zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
+
+OBJSDLL = $(OBJS:.o=.pic.o)
+
+# to use the asm code, 'cp contrib/asm?86/match.S ./match.S' and 
+# make OBJA=match.o
+# Also, add '-DASMV' to CFLAGS above.
+OBJA = 
+OBJADLL = $(OBJA:.o=.pic.o)
+
+TEST_OBJS = example.o minigzip.o
+TEST_OBJSDLL = $(TEST_OBJS:.o=.pic.o)
+
+DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
+  algorithm.txt zlib.3 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
+  nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
+  contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
+  contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
+  contrib/asm[56]86/*.S contrib/iostream/*.cpp \
+  contrib/iostream/*.h  contrib/iostream2/*.h contrib/iostream2/*.cpp \
+  contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
+  contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
+  contrib/delphi*/*.???
+
+all: example$(EXE) example-stat$(EXE) minigzip$(EXE) minigzip-stat$(EXE)
+
+%.o : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -DZLIB_STATIC -o $@ $<
+
+%.pic.o : %.c
+	$(CC) -c $(CFLAGS) $(CPPFLAGS) -DZLIB_DLL -o $@ $<
+
+
+test: test-dll test-stat
+
+test-dll: all
+	@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+	echo hello world | ./minigzip | ./minigzip -d || \
+	  echo '		*** minigzip test FAILED ***' ; \
+	if ./example; then \
+	  echo '		*** zlib test OK ***'; \
+	else \
+	  echo '		*** zlib test FAILED ***'; \
+	fi
+
+test-stat: all
+	@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+	echo hello world | ./minigzip-stat | ./minigzip-stat -d || \
+	  echo '		*** minigzip test FAILED ***' ; \
+	if ./example-stat; then \
+	  echo '		*** zlib test OK ***'; \
+	else \
+	  echo '		*** zlib test FAILED ***'; \
+	fi
+
+$(STATLIB): $(OBJS) $(OBJA)
+	$(AR) $@ $(OBJS) $(OBJA)
+	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
+
+match.o: match.S
+	$(CPP) match.S > _match.s
+	$(CC) -c _match.s -o _match.o
+	mv _match.o match.o
+	rm -f _match.s
+
+match.pic.o: match.S
+	$(CPP) match.S > _match.pic.s
+	$(CC) -c _match.pic.s -o _match.pic.o
+	mv _match.pic.o match.pic.o
+	rm -f _match.pic.s
+
+
+#$(SHAREDLIB).$(VER): $(OBJS)
+#	$(LDSHARED) -o $@ $(OBJS)
+#	rm -f $(SHAREDLIB) $(SHAREDLIB).1
+#	ln -s $@ $(SHAREDLIB)
+#	ln -s $@ $(SHAREDLIB).1
+$(SHAREDLIB): $(OBJSDLL) $(OBJADLL) $(SHAREDDEF)
+	$(LDSHARED) -o $@ $(LDEXTRA) $(OBJSDLL) $(OBJADLL)
+
+example-stat$(EXE): example.o $(LIBS)
+	$(CC) -static $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+example$(EXE): example.pic.o $(LIBS)
+	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+minigzip-stat$(EXE): minigzip.o $(LIBS)
+	$(CC) -static $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+minigzip$(EXE): minigzip.pic.o $(LIBS)
+	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+
+example.o: example.c $(LIBS)
+	$(CC) $(CFLAGS) -DZLIB_STATIC -c $< -o $@
+
+example.pic.o: example.c $(LIBS)
+	$(CC) $(CFLAGS) -c $< -o $@
+
+minigzip.o: minigzip.c $(LIBS)
+	$(CC) $(CFLAGS) -DZLIB_STATIC -c $< -o $@
+
+minigzip.pic.o: minigzip.c $(LIBS)
+	$(CC) $(CFLAGS) -c $< -o $@
+
+install: $(LIBS)
+	-@if [ ! -d $(includedir)  ]; then mkdir -p $(includedir); fi
+	-@if [ ! -d $(bindir) ]; then mkdir -p $(bindir); fi
+	-@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi
+	-@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi
+	-@if [ ! -d $(docdir) ]; then mkdir -p $(docdir); fi
+	install -m 644 zlib.h zconf.h $(includedir)
+	install -m 755 $(IMPLIB) $(libdir)
+	install -m 755 $(STATLIB) $(libdir)
+	-@(cd $(libdir); $(RANLIB) $(STATLIB) || true) >/dev/null 2>&1
+	install -s -m 755 $(SHAREDLIB) $(bindir)
+	install -m 644 zlib.3 $(man3dir)
+	install -m 644 README FAQ $(docdir)
+
+uninstall:
+	-@rm -f $(includedir)/zlib.h
+	-@rm -f $(includedir)/zconf.h
+	-@rm -f $(libdir)/$(IMPLIB)
+	-@rm -f $(libdir)/$(STATLIB)
+	-@rm -f $(bindir)/$(SHAREDLIB)
+	-@rm -f $(man3dir)/zlib.3
+
+clean:
+	rm -f *.o *.pic.o *~ example$(EXE) minigzip$(EXE) example-stat$(EXE) \
+		minigzip-stat$(EXE)  \
+		libz.a libz.so* foo.gz so_locations _match.s maketree \
+		$(IMPLIB) $(STATLIB) $(SHAREDLIB)
+
+distclean:	clean
+
+zip:
+	mv Makefile Makefile~; cp -p Makefile.in Makefile
+	rm -f test.c ztest*.c contrib/minizip/test.zip
+	v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+	zip -ul9 zlib$$v $(DISTFILES)
+	mv Makefile~ Makefile
+
+dist:
+	mv Makefile Makefile~; cp -p Makefile.in Makefile
+	rm -f test.c ztest*.c contrib/minizip/test.zip
+	d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
+	rm -f $$d.tar.gz; \
+	if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
+	files=""; \
+	for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
+	cd ..; \
+	GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
+	if test ! -d $$d; then rm -f $$d; fi
+	mv Makefile~ Makefile
+
+tags:	
+	etags *.[ch]
+
+depend:
+	makedepend -- $(CFLAGS) -- *.[ch]
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzio.o: zutil.h zlib.h zconf.h
+infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
+infcodes.o: zutil.h zlib.h zconf.h
+infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h
+inffast.o: infblock.h infcodes.h infutil.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h infblock.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.h
+infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
+minigzip.o:  zlib.h zconf.h 
+trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
+uncompr.o: zlib.h zconf.h
+zutil.o: zutil.h zlib.h zconf.h  
diff -urN zlib-1.1.3-orig/cygwin/README zlib-1.1.3/cygwin/README
--- zlib-1.1.3-orig/cygwin/README	Wed Dec 31 19:00:00 1969
+++ zlib-1.1.3/cygwin/README	Sat Jul 15 02:10:00 2000
@@ -0,0 +1,20 @@
+copy all files in this directory to the top level zlib source directory,
+overwriting other files if necessary.
+
+Then, cd to the top level zlib source directory, and
+
+./configure
+make
+
+This will build both a static zlib library and a zlib dll with associated
+  import library. It will also build two versions of both test programs.
+  "example.exe" and "minigzip.exe" are dynamically linked to the dll,
+  while "example-stat.exe" and "minigzip-stat.exe" are statically linked.
+
+make test
+
+This will exercise both sets of test programs, verifying proper operation
+  with the dll and with the static library.
+
+make install
+
diff -urN zlib-1.1.3-orig/cygwin/configure zlib-1.1.3/cygwin/configure
--- zlib-1.1.3-orig/cygwin/configure	Wed Dec 31 19:00:00 1969
+++ zlib-1.1.3/cygwin/configure	Sat Jul 15 01:59:54 2000
@@ -0,0 +1,235 @@
+#!/bin/sh
+# configure script for zlib. This script is needed only if
+# you wish to build a shared library and your system supports them,
+# of if you need special compiler, flags or install directory.
+# Otherwise, you can just use directly "make test; make install"
+#
+# To create a shared library, use "configure --shared"; by default a static
+# library is created. If the primitive shared library support provided here
+# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz
+#
+# To impose specific compiler or flags or install directory, use for example:
+#    prefix=$HOME CC=cc CFLAGS="-O4" ./configure
+# or for csh/tcsh users:
+#    (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
+# LDSHARED is the command to be used to create a shared library
+
+# Incorrect settings of CC or CFLAGS may prevent creating a shared library.
+# If you have problems, try without defining CC and CFLAGS before reporting
+# an error.
+
+LIBS=libz.a
+SHAREDLIB=libz.so
+VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
+AR=${AR-"ar rc"}
+RANLIB=${RANLIB-"ranlib"}
+prefix=${prefix-/usr/local}
+exec_prefix=${exec_prefix-'${prefix}'}
+libdir=${libdir-'${exec_prefix}/lib'}
+bindir=${bindir-'${exec_prefix}/bin'}
+includedir=${includedir-'${prefix}/include'}
+mandir=${mandir-'${prefix}/man'}
+cygdocdir=${cygdocdir-'${prefix}/doc/Cygwin'}
+docdir=${docdir-'${prefix}/doc/zlib-1.1.3'}
+shared_ext='.so'
+shared=0
+gcc=0
+old_cc="$CC"
+old_cflags="$CFLAGS"
+
+while test $# -ge 1
+do
+case "$1" in
+    -h* | --h*)
+      echo 'usage:'
+      echo '  configure [--shared] [--prefix=PREFIX]  [--exec_prefix=EXPREFIX]'
+      echo '     [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
+        exit 0;;
+    -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+    -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+    -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
+    -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;;
+    -p* | --p*) prefix="$2"; shift; shift;;
+    -e* | --e*) exec_prefix="$2"; shift; shift;;
+    -l* | --l*) libdir="$2"; shift; shift;;
+    -i* | --i*) includedir="$2"; shift; shift;;
+    -s* | --s*) shared=1; shift;;
+    esac
+done
+
+test=ztest$$
+cat > $test.c <<EOF
+extern int getchar();
+int hello() {return getchar();}
+EOF
+
+test -z "$CC" && echo Checking for gcc...
+cc=${CC-gcc}
+cflags=${CFLAGS-"-O3"}
+# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
+case "$cc" in
+  *gcc*) gcc=1;;
+esac
+
+if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
+  CC="$cc"
+  SFLAGS=${CFLAGS-"-fPIC -O3"}
+  CFLAGS="$cflags"
+  case `(uname -s || echo unknown) 2>/dev/null` in
+  Linux | linux) LDSHARED=${LDSHARED-"gcc -shared -Wl,-soname,libz.so.1"};;
+  CYGWIN* | Cygwin* | cygwin*) 
+     LDSHARED=${LDSHARED-"gcc -shared -Wl,--enable-auto-image-base"}
+     CFLAGS=${CFLAGS-"-O3"}
+     SHAREDLIB=libz.dll
+     SHAREDDEF=libz.def
+     IMPLIB=libz.dll.a
+     STATLIB=libz.a
+	  EXE=.exe
+     LDEXTRA="-Wl,--out-implib=${IMPLIB} ${SHAREDDEF}"
+     LIBS="${SHAREDLIB} ${STATLIB}";;
+  *)             LDSHARED=${LDSHARED-"gcc -shared"};;
+  esac
+else
+  # find system name and corresponding cc options
+  CC=${CC-cc}
+  case `(uname -sr || echo unknown) 2>/dev/null` in
+  HP-UX*)    SFLAGS=${CFLAGS-"-O +z"}
+	     CFLAGS=${CFLAGS-"-O"}
+#	     LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
+	     LDSHARED=${LDSHARED-"ld -b"}
+	     shared_ext='.sl'
+	     SHAREDLIB='libz.sl';;
+  IRIX*)     SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
+	     CFLAGS=${CFLAGS-"-ansi -O2"}
+	     LDSHARED=${LDSHARED-"cc -shared"};;
+  OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
+	     CFLAGS=${CFLAGS-"-O -std1"}
+	     LDSHARED=${LDSHARED-"cc -shared  -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
+  OSF1*)     SFLAGS=${CFLAGS-"-O -std1"}
+	     CFLAGS=${CFLAGS-"-O -std1"}
+	     LDSHARED=${LDSHARED-"cc -shared"};;
+  QNX*)      SFLAGS=${CFLAGS-"-4 -O"}
+             CFLAGS=${CFLAGS-"-4 -O"}
+	     LDSHARED=${LDSHARED-"cc"}
+             RANLIB=${RANLIB-"true"}
+             AR="cc -A";;
+  SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
+	     CFLAGS=${CFLAGS-"-O3"}
+	     LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};;
+  SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."}
+             CFLAGS=${CFLAGS-"-fast -xcg89"}
+	     LDSHARED=${LDSHARED-"cc -G"};;
+  SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
+	     CFLAGS=${CFLAGS-"-O2"}
+	     LDSHARED=${LDSHARED-"ld"};;
+  UNIX_System_V\ 4.2.0) 
+	     SFLAGS=${CFLAGS-"-KPIC -O"}
+	     CFLAGS=${CFLAGS-"-O"}
+	     LDSHARED=${LDSHARED-"cc -G"};;
+  UNIX_SV\ 4.2MP)
+	     SFLAGS=${CFLAGS-"-Kconform_pic -O"}
+	     CFLAGS=${CFLAGS-"-O"}
+	     LDSHARED=${LDSHARED-"cc -G"};;
+  # send working options for other systems to support@gzip.org
+  *)         SFLAGS=${CFLAGS-"-O"}
+	     CFLAGS=${CFLAGS-"-O"}
+	     LDSHARED=${LDSHARED-"cc -shared"};;
+  esac
+fi
+
+#if test $shared -eq 1; then
+#  echo Checking for shared library support...
+#  # we must test in two steps (cc then ld), required at least on SunOS 4.x
+#  if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
+#     test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
+#    CFLAGS="$SFLAGS"
+#    LIBS="$SHAREDLIB.$VER"
+#    echo Building shared library $SHAREDLIB.$VER with $CC.
+#  elif test -z "$old_cc" -a -z "$old_cflags"; then
+#    echo No shared library suppport.
+#    shared=0;
+#  else
+#    echo 'No shared library suppport; try without defining CC and CFLAGS'
+#    shared=0;
+#  fi
+#fi
+#if test $shared -eq 0; then
+#  LDSHARED="$CC"
+#  echo Building static library $LIBS version $VER with $CC.
+#fi
+
+cat > $test.c <<EOF
+#include <unistd.h>
+int main() { return 0; }
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+  CFLAGS="$CFLAGS -DHAVE_UNISTD_H"
+  echo "Checking for unistd.h... Yes."
+else
+  echo "Checking for unistd.h... No."
+fi
+
+cat > $test.c <<EOF
+#include <errno.h>
+int main() { return 0; }
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+  echo "Checking for errno.h...	 Yes."
+else
+  echo "Checking for errno.h...	 No."
+  CFLAGS="$CFLAGS -DNO_ERRNO_H"
+fi
+
+cat > $test.c <<EOF
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+caddr_t hello() {
+  return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0); 
+}
+EOF
+if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+  CFLAGS="$CFLAGS -DUSE_MMAP"
+  echo Checking for mmap support... Yes.
+else
+  echo Checking for mmap support... No.
+fi
+
+CPP=${CPP-"$CC -E"}
+case $CFLAGS in
+  *ASMV*)
+    if test "`nm $test.o | grep _hello`" = ""; then
+      CPP="$CPP -DNO_UNDERLINE"
+      echo Checking for underline in external names... No.
+    else
+      echo Checking for underline in external names... Yes.
+    fi;;
+esac
+
+rm -f $test.[co] $test$shared_ext
+
+# udpate Makefile
+sed < Makefile.in "
+/^CC *=/s%=.*%=$CC%
+/^CFLAGS *=/s%=.*%=$CFLAGS%
+/^CPP *=/s%=.*%=$CPP%
+/^LDSHARED *=/s%=.*%=$LDSHARED%
+/^LDEXTRA *=/s%=.*%=$LDEXTRA%
+/^LIBS *=/s%=.*%=$LIBS%
+/^SHAREDLIB *=/s%=.*%=$SHAREDLIB%
+/^SHAREDDEF *=/s%=.*%=$SHAREDDEF%
+/^IMPLIB *=/s%=.*%=$IMPLIB%
+/^STATLIB *=/s%=.*%=$STATLIB%
+/^AR *=/s%=.*%=$AR%
+/^RANLIB *=/s%=.*%=$RANLIB%
+/^VER *=/s%=.*%=$VER%
+/^EXE *=/s%=.*%=$EXE%
+/^prefix *=/s%=.*%=$prefix%
+/^exec_prefix *=/s%=.*%=$exec_prefix%
+/^libdir *=/s%=.*%=$libdir%
+/^bindir *=/s%=.*%=$bindir%
+/^includedir *=/s%=.*%=$includedir%
+/^mandir *=/s%=.*%=$mandir%
+/^cygdocdir *=/s%=.*%=$cygdocdir%
+/^docdir *=/s%=.*%=$docdir%
+" > Makefile
diff -urN zlib-1.1.3-orig/cygwin/libz.def zlib-1.1.3/cygwin/libz.def
--- zlib-1.1.3-orig/cygwin/libz.def	Wed Dec 31 19:00:00 1969
+++ zlib-1.1.3/cygwin/libz.def	Sat Jul 15 02:00:02 2000
@@ -0,0 +1,60 @@
+
+EXPORTS
+
+    adler32 @1
+    compress @2
+    compress2 @3
+    crc32 @4
+    deflate @5
+    deflateCopy @6
+    deflateEnd @7
+    deflateInit2_ @8
+    deflateInit_ @9
+    deflateParams @10
+    deflateReset @11
+    deflateSetDictionary @12
+    get_crc_table @13
+    gzclose @14
+    gzdopen @15
+    gzeof @16
+    gzerror @17
+    gzflush @18
+    gzgetc @19
+    gzgets @20
+    gzopen @21
+    gzprintf @22
+    gzputc @23
+    gzputs @24
+    gzread @25
+    gzrewind @26
+    gzseek @27
+    gzsetparams @28
+    gztell @29
+    gzwrite @30
+    inflate @31
+    inflateEnd @32
+    inflateInit2_ @33
+    inflateInit_ @34
+    inflateReset @35
+    inflateSetDictionary @36
+    inflateSync @37
+    inflateSyncPoint @38
+    inflate_blocks @39
+    inflate_blocks_free @40
+    inflate_blocks_new @41
+    inflate_blocks_reset @42
+    inflate_blocks_sync_point @43
+    inflate_codes @44
+    inflate_codes_free @45
+    inflate_codes_new @46
+    inflate_fast @47
+    inflate_flush @48
+    inflate_set_dictionary @49
+    inflate_trees_bits @50
+    inflate_trees_dynamic @51
+    inflate_trees_fixed @52
+    uncompress @53
+    zError @54
+    zcalloc @55
+    zcfree @56
+    zlibVersion @57
diff -urN zlib-1.1.3-orig/minigzip.c zlib-1.1.3/minigzip.c
--- zlib-1.1.3-orig/minigzip.c	Tue Apr  7 12:04:18 1998
+++ zlib-1.1.3/minigzip.c	Wed Jul 12 21:09:40 2000
@@ -31,7 +31,7 @@
 #  include <sys/stat.h>
 #endif
 
-#if defined(MSDOS) || defined(OS2) || defined(WIN32)
+#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
 #  include <fcntl.h>
 #  include <io.h>
 #  define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
@@ -52,7 +52,7 @@
 #  include <unix.h> /* for fileno */
 #endif
 
-#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
+#if !defined(WIN32) || defined(__CYGWIN__) /* unlink already in stdio.h for WIN32 */
   extern int unlink OF((const char *));
 #endif
 
diff -urN zlib-1.1.3-orig/zconf.h zlib-1.1.3/zconf.h
--- zlib-1.1.3-orig/zconf.h	Sat Jul  8 01:09:36 2000
+++ zlib-1.1.3/zconf.h	Wed Jul 12 21:04:56 2000
@@ -71,7 +71,7 @@
 #  define UNALIGNED_OK
 #endif
 
-#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)
+#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32) || defined(__CYGWIN))  && !defined(STDC)
 #  define STDC
 #endif
 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
@@ -161,7 +161,7 @@
 #endif
 
 /* Compile with -DZLIB_DLL for Windows DLL support */
-#if defined(ZLIB_DLL)
+#if defined(ZLIB_DLL) && !defined(__CYGWIN__)
 #  if defined(_WINDOWS) || defined(WINDOWS)
 #    ifdef FAR
 #      undef FAR
@@ -185,6 +185,44 @@
 #        define ZEXPORTVA _export
 #      endif
 #    endif
+#  endif
+#endif
+
+/* CYGWIN comments: There are three ways a function can be defined:
+   (1) extern int foo() --- used for building and linking to the static library
+	(2) extern __declspec(dllexport) int foo() -- used for building the dll
+	(3) extern __declspec(dllimport) int foo() -- used for linking to the dll
+	
+	With no command line defines, the default is #3. If ZLIB_DLL is defined,
+	then #2 is used. If ZLIB_STATIC is defined, then #1 is  used.
+	If both ZLIB_DLL and ZLIB_STATIC are defined, ZLIB_DLL takes precedence.
+
+   ZEXPORT is used for functions
+	ZEXPORTVA is used for functions that have variable args
+	ZEXPORTVAR is used for variables (zlib doesn't have any, but this
+	  is included for completeness)
+(end CYGWIN comments) */
+#if defined (__CYGWIN__) 
+#  ifdef ZLIB_STATIC
+#    ifdef ZLIB_DLL
+#      undef ZLIB_STATIC
+#    endif
+#  endif
+#  if defined (ZLIB_DLL)
+/* building a DLL */
+#    define    ZEXPORT __declspec(dllexport) /* not necessary */
+#    define  ZEXPORTVA __declspec(dllexport) /* not necessary */
+#    define ZEXPORTVAR __declspec(dllexport) /* necessary but unused */
+#  elif defined (ZLIB_STATIC)
+/* building or linking to a static library */
+#    define    ZEXPORT
+#    define  ZEXPORTVA
+#    define ZEXPORTVAR
+#  else
+/* linking to the DLL */
+#      define    ZEXPORT /* __declspec(dllimport) not necessary */
+#      define  ZEXPORTVA /* __declspec(dllimport) not necessary */
+#      define ZEXPORTVAR __declspec(dllimport)    /* necessary but unused */
 #  endif
 #endif
 
diff -urN zlib-1.1.3-orig/zutil.h zlib-1.1.3/zutil.h
--- zlib-1.1.3-orig/zutil.h	Wed Jul  8 13:01:48 1998
+++ zlib-1.1.3/zutil.h	Wed Jul 12 21:12:02 2000
@@ -92,7 +92,7 @@
 #  define OS_CODE  0x06
 #endif
 
-#ifdef WIN32 /* Window 95 & Windows NT */
+#if defined(WIN32) && !defined(__CYGWIN__) /* Window 95 & Windows NT; CYGWIN=unix */
 #  define OS_CODE  0x0b
 #endif
 
