]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix building under Cygwin. 20/head
authorMika Lindqvist <postmaster@raasu.org>
Thu, 7 May 2015 15:21:28 +0000 (18:21 +0300)
committerMika Lindqvist <postmaster@raasu.org>
Thu, 7 May 2015 15:21:28 +0000 (18:21 +0300)
deflate.c
gzlib.c
win32/Makefile.gcc

index eecd9253d5aca9d742a4d75e314ec28def07e4f2..16d5c83e40a338faa16b219bec86d2a9cc24422d 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -76,7 +76,9 @@ local void fill_window    (deflate_state *s);
 local block_state deflate_stored (deflate_state *s, int flush);
 local block_state deflate_fast   (deflate_state *s, int flush);
 block_state deflate_quick  (deflate_state *s, int flush);
+#ifdef MEDIUM_STRATEGY
 local block_state deflate_medium (deflate_state *s, int flush);
+#endif
 local block_state deflate_slow   (deflate_state *s, int flush);
 local block_state deflate_rle    (deflate_state *s, int flush);
 local block_state deflate_huff   (deflate_state *s, int flush);
diff --git a/gzlib.c b/gzlib.c
index 028a2d3c34d833dd3d7b75b727adc065ffbef87a..ce2084152b0991fdae0dc2a8573bb0ac8e428540 100644 (file)
--- a/gzlib.c
+++ b/gzlib.c
@@ -288,7 +288,7 @@ gzFile ZEXPORT gzdopen(fd, mode)
 }
 
 /* -- see zlib.h -- */
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__CYGWIN__)
 gzFile ZEXPORT gzopen_w(path, mode)
     const wchar_t *path;
     const char *mode;
index 6d1ded622bf0080a120868df69e49971b7174006..c95fb830cfe9f59eff4e939214aea3cc18b8b06a 100644 (file)
@@ -1,7 +1,8 @@
 # Makefile for zlib, derived from Makefile.dj2.
 # Modified for mingw32 by C. Spieler, 6/16/98.
 # Updated for zlib 1.2.x by Christian Spieler and Cosmin Truta, Mar-2003.
-# Last updated: Mar 2012.
+# Updated for zlib-ng by Mika Lindqvist
+# Last updated: May 2015.
 # Tested under Cygwin and MinGW.
 
 # Copyright (C) 1995-2003 Jean-loup Gailly.
 #
 #   make -fwin32/Makefile.gcc;  make test testdll -fwin32/Makefile.gcc
 #
-# To use the asm code, type:
-#   cp contrib/asm?86/match.S ./match.S
-#   make LOC=-DASMV OBJA=match.o -fwin32/Makefile.gcc
-#
 # To install libz.a, zconf.h and zlib.h in the system directories, type:
 #
 #   make install -fwin32/Makefile.gcc
@@ -38,16 +35,12 @@ IMPLIB    = libz.dll.a
 #
 SHARED_MODE=0
 
-#LOC = -DASMV
 #LOC = -DDEBUG -g
 
 PREFIX =
 CC = $(PREFIX)gcc
 CFLAGS = $(LOC) -O3 -Wall
 
-AS = $(CC)
-ASFLAGS = $(LOC) -Wall
-
 LD = $(CC)
 LDFLAGS = $(LOC)
 
@@ -68,8 +61,7 @@ prefix ?= /usr/local
 exec_prefix = $(prefix)
 
 OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o \
-       gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
-OBJA =
+       gzwrite.o infback.o inffast.o inflate.o inftrees.o match.o trees.o uncompr.o zutil.o
 
 all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example.exe minigzip.exe example_d.exe minigzip_d.exe
 
@@ -84,17 +76,14 @@ testdll: example_d.exe minigzip_d.exe
 .c.o:
        $(CC) $(CFLAGS) -c -o $@ $<
 
-.S.o:
-       $(AS) $(ASFLAGS) -c -o $@ $<
-
-$(STATICLIB): $(OBJS) $(OBJA)
-       $(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA)
+$(STATICLIB): $(OBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS)
 
 $(IMPLIB): $(SHAREDLIB)
 
-$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
+$(SHAREDLIB): win32/zlib.def $(OBJS) zlibrc.o
        $(CC) -shared -Wl,--out-implib,$(IMPLIB) $(LDFLAGS) \
-       -o $@ win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
+       -o $@ win32/zlib.def $(OBJS) zlibrc.o
        $(STRIP) $@
 
 example.exe: example.o $(STATICLIB)
@@ -165,6 +154,12 @@ clean:
        -$(RM) *.exe
        -$(RM) foo.gz
 
+distclean: clean
+       -$(CP) zconf.h.in zconf.h
+       @printf 'all:\n\t-@echo "Please use ./configure first.  Thank you."\n' > Makefile
+       @printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile
+       @touch -r Makefile.in Makefile
+
 adler32.o: zlib.h zconf.h
 compress.o: zlib.h zconf.h
 crc32.o: crc32.h zlib.h zconf.h