On Tue, Jan 11, 2011 at 01:08:17PM +0100, Kern Sibbald wrote:
> On Tuesday 11 January 2011 11:58:20 Graham Keeling wrote:
> > Hello,
> >
> > As part of my own backup project, I compiled zlib-1.2.5 for 32bit and 64bit
> > Windows.
> > Zlib needed a patch to make it work.
> > The bacula project uses zlib-1.2.3.
> > If wanted, I can upload my zlib patch.
> >
> 
> Yes, that would be interesting to see what you have done.

It's nothing special, but it might stop somebody else going through the bother
of figuring it out. Patch attached (works for win32 and win64).

Then for win32:

tar -zxvf zlib-1.2.5.tar.gz
cd zlib-1.2.5
patch -Np1 < $SRCDIR/zlib.patch
make -f win32/Makefile.mingw32 PREFIX=$DEPKGS all
make -f win32/Makefile.mingw32 PREFIX=$DEPKGS install


And for win64:

tar -zxvf zlib-1.2.5.tar.gz
cd zlib-1.2.5
patch -Np1 <$SRCDIR/zlib.patch
sed 's/mingw32-/x86_64-pc-mingw32-/g' win32/Makefile.mingw32 \
        > Makefile.tmp && mv Makefile.tmp win32/Makefile.mingw32
make -f win32/Makefile.mingw32 PREFIX=$DEPKGS all
make -f win32/Makefile.mingw32 PREFIX=$DEPKGS install
diff -uNr zlib-1.2.5/win32/Makefile.mingw32 zlib-1.2.5.new/win32/Makefile.mingw32
--- zlib-1.2.5/win32/Makefile.mingw32	1970-01-01 01:00:00.000000000 +0100
+++ zlib-1.2.5.new/win32/Makefile.mingw32	2010-12-30 21:44:40.000000000 +0000
@@ -0,0 +1,151 @@
+# 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: 1-Aug-2003.
+# Tested under Cygwin and MinGW.
+
+# Copyright (C) 1995-2003 Jean-loup Gailly.
+# For conditions of distribution and use, see copyright notice in zlib.h
+
+# To compile, or to compile and test, type:
+#
+#   make -fmakefile.gcc;  make test testdll -fmakefile.gcc
+#
+# To use the asm code, type:
+#   cp contrib/asm?86/match.S ./match.S
+#   make LOC=-DASMV OBJA=match.o -fmakefile.gcc
+#
+# To install libz.a, zconf.h and zlib.h in the system directories, type:
+#
+#   make install -fmakefile.gcc
+
+# Note:
+# If the platform is *not* MinGW (e.g. it is Cygwin or UWIN),
+# the DLL name should be changed from "zlib1.dll".
+
+STATICLIB = libz.a
+SHAREDLIB = zlib1.dll
+IMPLIB    = libzdll.a
+
+PREFIX = /usr/local
+EXEC_PREFIX = $(prefix)
+
+INCLUDE_PATH = $(PREFIX)/include
+LIBRARY_PATH = $(PREFIX)/lib
+BIN_PATH = $(PREFIX)/bin
+
+#LOC = -DASMV
+#LOC = -DDEBUG -g
+
+CC = mingw32-gcc
+CFLAGS = $(LOC) -O3 -Wall
+
+AS = $(CC)
+ASFLAGS = $(LOC) -Wall
+
+LD = $(CC)
+LDFLAGS = $(LOC) -s
+
+AR = mingw32-ar
+ARFLAGS = rcs
+
+RC = mingw32-windres
+RCFLAGS = --define GCC_WINDRES
+
+CP = cp -fp
+# If GNU install is available, replace $(CP) with install.
+INSTALL = $(CP)
+RM = rm -f
+
+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 =
+
+
+all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example.exe minigzip.exe example_d.exe minigzip_d.exe
+
+test: example.exe minigzip.exe
+	./example.exe
+	echo hello world | ./minigzip.exe | ./minigzip.exe -d
+
+testdll: example_d.exe minigzip_d.exe
+	./example_d.exe
+	echo hello world | ./minigzip_d.exe | ./minigzip_d.exe -d
+
+.c.o:
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+.S.o:
+	$(AS) $(ASFLAGS) -c -o $@ $<
+
+$(STATICLIB): $(OBJS) $(OBJA)
+	$(AR) $(ARFLAGS) $@ $(OBJS) $(OBJA)
+
+$(IMPLIB): $(SHAREDLIB)
+
+$(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o
+	mingw32-dllwrap --dlltool-name mingw32-dlltool --driver-name $(CC) --def win32/zlib.def \
+	  --implib $(IMPLIB) -o $@ $(OBJS) $(OBJA) zlibrc.o
+	mingw32-strip $@
+
+example.exe: example.o $(STATICLIB)
+	$(LD) $(LDFLAGS) -o $@ example.o $(STATICLIB)
+
+minigzip.exe: minigzip.o $(STATICLIB)
+	$(LD) $(LDFLAGS) -o $@ minigzip.o $(STATICLIB)
+
+example_d.exe: example.o $(IMPLIB)
+	$(LD) $(LDFLAGS) -o $@ example.o $(IMPLIB)
+
+minigzip_d.exe: minigzip.o $(IMPLIB)
+	$(LD) $(LDFLAGS) -o $@ minigzip.o $(IMPLIB)
+
+zlibrc.o: win32/zlib1.rc
+	$(RC) $(RCFLAGS) -o $@ win32/zlib1.rc
+
+
+# INCLUDE_PATH and LIBRARY_PATH must be set.
+
+.PHONY: install uninstall clean
+
+install: zlib.h zconf.h $(STATICLIB) $(SHAREDLIB) $(IMPLIB)
+	-...@if test ! -e $(INCLUDE_PATH); then mkdir $(INCLUDE_PATH); fi
+	-...@if test ! -e $(LIBRARY_PATH); then mkdir $(LIBRARY_PATH); fi
+	-...@if test ! -e $(BIN_PATH); then mkdir $(BIN_PATH); fi
+	-$(INSTALL) zlib.h $(INCLUDE_PATH)
+	-$(INSTALL) zconf.h $(INCLUDE_PATH)
+	-$(INSTALL) $(STATICLIB) $(LIBRARY_PATH)
+	-$(INSTALL) $(IMPLIB) $(LIBRARY_PATH)
+	-$(INSTALL) $(SHAREDLIB) $(BIN_PATH)
+
+uninstall:
+	-$(RM) $(INCLUDE_PATH)/zlib.h
+	-$(RM) $(INCLUDE_PATH)/zconf.h
+	-$(RM) $(LIBRARY_PATH)/$(STATICLIB)
+	-$(RM) $(LIBRARY_PATH)/$(IMPLIB)
+
+clean:
+	-$(RM) $(STATICLIB)
+	-$(RM) $(SHAREDLIB)
+	-$(RM) $(IMPLIB)
+	-$(RM) *.o
+	-$(RM) *.exe
+	-$(RM) foo.gz
+
+adler32.o: zlib.h zconf.h
+compress.o: zlib.h zconf.h
+crc32.o: crc32.h zlib.h zconf.h
+deflate.o: deflate.h zutil.h zlib.h zconf.h
+example.o: zlib.h zconf.h
+gzclose.o: zlib.h zconf.h gzguts.h
+gzlib.o: zlib.h zconf.h gzguts.h
+gzread.o: zlib.h zconf.h gzguts.h
+gzwrite.o: zlib.h zconf.h gzguts.h
+inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
+inftrees.o: zutil.h zlib.h zconf.h inftrees.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
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to