summaryrefslogtreecommitdiff
path: root/zlib
diff options
context:
space:
mode:
Diffstat (limited to 'zlib')
-rwxr-xr-xzlib/make_patched_header.pl66
-rw-r--r--zlib/makefile.mk75
-rw-r--r--zlib/prj/build.lst2
-rw-r--r--zlib/prj/d.lst13
-rw-r--r--zlib/zlib-1.2.3.patch103
-rw-r--r--zlib/zlib-valgrind.patch78
6 files changed, 337 insertions, 0 deletions
diff --git a/zlib/make_patched_header.pl b/zlib/make_patched_header.pl
new file mode 100755
index 000000000000..41dbdc5fbb96
--- /dev/null
+++ b/zlib/make_patched_header.pl
@@ -0,0 +1,66 @@
+:
+eval 'exec perl -S $0 ${1+"$@"}'
+ if 0;
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+#
+# make_patched_header - make patched header
+#
+
+use strict;
+use File::Basename;
+use File::Path;
+use Carp;
+
+my $patched_file = shift @ARGV;
+$patched_file =~ s/\\/\//g;
+my $module = shift @ARGV;
+my $patch_dir = dirname($patched_file);
+my $orig_file = $patched_file;
+$orig_file =~ s/\/patched\//\//;
+
+if (!-f $orig_file) { carp("Cannot find file $orig_file\n"); };
+if (!-d $patch_dir) {
+ mkpath($patch_dir, 0, 0775);
+ if (!-d $patch_dir) {("mkdir: could not create directory $patch_dir\n"); };
+};
+
+open(PATCHED_FILE, ">$patched_file") or carp("Cannot open file $patched_file\n");
+open(ORIG_FILE, "<$orig_file") or carp("Cannot open file $orig_file\n");
+foreach (<ORIG_FILE>) {
+ if (/#include\s*"(\w+\.h\w*)"/) {
+ my $include = $1;
+ s/#include "$include"/#include <$module\/$include>/g;
+ };
+ print PATCHED_FILE $_;
+};
+close PATCHED_FILE;
+close ORIG_FILE;
+
+exit(0);
+
+
diff --git a/zlib/makefile.mk b/zlib/makefile.mk
new file mode 100644
index 000000000000..b928c82ddae1
--- /dev/null
+++ b/zlib/makefile.mk
@@ -0,0 +1,75 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=.
+
+PRJNAME=zlib
+TARGET=zlib
+
+.IF "$(GUI)" == "UNX"
+.IF "$(SYSTEM_ZLIB)" == "YES"
+all:
+ @echo "An already available installation of zlib should exist on your system."
+ @echo "Therefore the version provided here does not need to be built in addition."
+.ENDIF
+.ENDIF
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+
+TARFILE_NAME=zlib-1.2.3
+TARFILE_MD5=debc62758716a169df9f62e6ab2bc634
+
+PATCH_FILES=zlib-1.2.3.patch
+ADDITIONAL_FILES=makefile.mk
+
+#relative to CONFIGURE_DIR
+
+BUILD_DIR=$(CONFIGURE_DIR)
+BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS)
+
+OUT2INC= \
+ zlib.h \
+ zconf.h \
+ contrib$/minizip$/unzip.h \
+ contrib$/minizip$/ioapi.h
+
+PATCHED_HEADERS=$(INCCOM)$/patched$/zlib.h
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : set_ext.mk
+.INCLUDE : target.mk
+.INCLUDE : tg_ext.mk
+
+ALLTAR: $(PATCHED_HEADERS)
+
+$(PATCHED_HEADERS) : $(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE)
+ @$(PERL) make_patched_header.pl $@ $(PRJNAME)
diff --git a/zlib/prj/build.lst b/zlib/prj/build.lst
new file mode 100644
index 000000000000..8ef73d94723a
--- /dev/null
+++ b/zlib/prj/build.lst
@@ -0,0 +1,2 @@
+zl zlib : soltools NULL
+zl zlib nmake - all zl_mkout NULL
diff --git a/zlib/prj/d.lst b/zlib/prj/d.lst
new file mode 100644
index 000000000000..b6433510d6c8
--- /dev/null
+++ b/zlib/prj/d.lst
@@ -0,0 +1,13 @@
+mkdir: %_DEST%\inc%_EXT%\external\zlib
+mkdir: %_DEST%\lib%_EXT%\x64
+
+..\%__SRC%\inc\patched\zlib.h %_DEST%\inc%_EXT%\external\zlib\zlib.h
+..\%__SRC%\inc\unzip.h %_DEST%\inc%_EXT%\external\zlib\unzip.h
+..\%__SRC%\inc\ioapi.h %_DEST%\inc%_EXT%\external\zlib\ioapi.h
+..\%__SRC%\inc\zconf.h %_DEST%\inc%_EXT%\external\zlib\zconf.h
+
+..\%__SRC%\lib\libzlib.a %_DEST%\lib%_EXT%\libzlib.a
+..\%__SRC%\slb\zlib.lib %_DEST%\lib%_EXT%\zlib.lib
+..\%__SRC%\slb\zlib.lin %_DEST%\lib%_EXT%\zlib.lin
+..\%__SRC%\slb\x64\zlib.lib %_DEST%\lib%_EXT%\x64\zlib.lib
+..\%__SRC%\slb\x64\zlib.lin %_DEST%\lib%_EXT%\x64\zlib.lin
diff --git a/zlib/zlib-1.2.3.patch b/zlib/zlib-1.2.3.patch
new file mode 100644
index 000000000000..4bfad287c231
--- /dev/null
+++ b/zlib/zlib-1.2.3.patch
@@ -0,0 +1,103 @@
+--- misc/zlib-1.2.3/makefile.mk Fri Mar 14 10:17:06 2008
++++ misc/build/zlib-1.2.3/makefile.mk Fri Mar 14 10:16:56 2008
+@@ -1 +1,73 @@
+-dummy
++#*************************************************************************
++#
++# Copyright according the GNU Public License.
++#
++#*************************************************************************
++
++PRJ=..$/..$/..$/..
++
++PRJNAME=zlib
++TARGET=zlib
++LIBTARGET=NO
++EXTERNAL_WARNINGS_NOT_ERRORS=TRUE
++
++# --- Settings -----------------------------------------------------
++
++.INCLUDE : settings.mk
++
++# --- Files --------------------------------------------------------
++
++INCEXT=contrib$/minizip
++
++SLOFILES= $(SLO)$/adler32.obj \
++ $(SLO)$/compress.obj \
++ $(SLO)$/deflate.obj \
++ $(SLO)$/crc32.obj \
++ $(SLO)$/inffast.obj \
++ $(SLO)$/inflate.obj \
++ $(SLO)$/inftrees.obj \
++ $(SLO)$/infback.obj \
++ $(SLO)$/trees.obj \
++ $(SLO)$/zutil.obj \
++ $(SLO)$/uncompr.obj \
++ $(SLO)$/gzio.obj \
++ $(SLO)$/unzip.obj \
++ $(SLO)$/ioapi.obj
++
++
++LIB1TARGET=$(SLB)$/$(TARGET).lib
++LIB1ARCHIV=$(LB)$/lib$(TARGET).a
++LIB1OBJFILES=$(SLOFILES)
++
++.IF "$(BUILD_X64)"!=""
++SLOFILES_X64= $(SLO_X64)$/adler32.obj \
++ $(SLO_X64)$/compress.obj \
++ $(SLO_X64)$/deflate.obj \
++ $(SLO_X64)$/crc32.obj \
++ $(SLO_X64)$/inffast.obj \
++ $(SLO_X64)$/inflate.obj \
++ $(SLO_X64)$/inftrees.obj \
++ $(SLO_X64)$/infback.obj \
++ $(SLO_X64)$/trees.obj \
++ $(SLO_X64)$/zutil.obj \
++ $(SLO_X64)$/uncompr.obj \
++ $(SLO_X64)$/gzio.obj \
++ $(SLO_X64)$/unzip.obj \
++ $(SLO_X64)$/ioapi.obj
++
++LIB1TARGET_X64=$(SLB_X64)$/$(TARGET).lib
++LIB1OBJFILES_X64=$(SLOFILES_X64)
++.ENDIF # "$(BUILD_X64)"!=""
++
++
++# --- Targets ------------------------------------------------------
++
++$(MISC)$/%.c : contrib$/minizip$/%.c
++ @echo ------------------------------
++ @echo Making: $@
++ @$(COPY) $< $@
++
++.INCLUDE : set_wntx64.mk
++.INCLUDE : target.mk
++.INCLUDE : tg_wntx64.mk
++
+--- misc/zlib-1.2.3/zconf.h 2010-07-15 09:33:48.921875000 +0200
++++ misc/build/zlib-1.2.3/zconf.h 2010-07-15 09:39:27.000000000 +0200
+@@ -12,6 +12,12 @@
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ */
++/*
++ * we need the prefix to get the same names as in 1.1.3
++*/
++
++#define Z_PREFIX
++
+ #ifdef Z_PREFIX
+ # define deflateInit_ z_deflateInit_
+ # define deflate z_deflate
+--- misc/zlib-1.2.3/zutil.h
++++ misc/build/zlib-1.2.3/zutil.h
+@@ -175,7 +175,7 @@
+
+ /* functions */
+
+-#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
++#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) || defined(_MSC_VER)
+ # ifndef HAVE_VSNPRINTF
+ # define HAVE_VSNPRINTF
+ # endif
diff --git a/zlib/zlib-valgrind.patch b/zlib/zlib-valgrind.patch
new file mode 100644
index 000000000000..3789ee4b13ec
--- /dev/null
+++ b/zlib/zlib-valgrind.patch
@@ -0,0 +1,78 @@
+--- misc/zlib-1.2.3/deflate.c
++++ misc/build/zlib-1.2.3/deflate.c
+@@ -288,6 +288,8 @@
+ s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
+ s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
+
++ s->high_water = 0; /* nothing written to s->window yet */
++
+ s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
+
+ overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
+@@ -1355,6 +1355,40 @@
+ */
+
+ } while (s->lookahead < MIN_LOOKAHEAD && s->strm->avail_in != 0);
++
++ /* If the WIN_INIT bytes after the end of the current data have never been
++ * written, then zero those bytes in order to avoid memory check reports of
++ * the use of uninitialized (or uninitialised as Julian writes) bytes by
++ * the longest match routines. Update the high water mark for the next
++ * time through here. WIN_INIT is set to MAX_MATCH since the longest match
++ * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
++ */
++ if (s->high_water < s->window_size) {
++ ulg curr = s->strstart + (ulg)(s->lookahead);
++ ulg init;
++
++ if (s->high_water < curr) {
++ /* Previous high water mark below current data -- zero WIN_INIT
++ * bytes or up to end of window, whichever is less.
++ */
++ init = s->window_size - curr;
++ if (init > WIN_INIT)
++ init = WIN_INIT;
++ zmemzero(s->window + curr, (unsigned)init);
++ s->high_water = curr + init;
++ }
++ else if (s->high_water < (ulg)curr + WIN_INIT) {
++ /* High water mark at or above current data, but below current data
++ * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
++ * to end of window, whichever is less.
++ */
++ init = (ulg)curr + WIN_INIT - s->high_water;
++ if (init > s->window_size - s->high_water)
++ init = s->window_size - s->high_water;
++ zmemzero(s->window + s->high_water, (unsigned)init);
++ s->high_water += init;
++ }
++ }
+ }
+
+ /* ===========================================================================
+--- misc/zlib-1.2.3/deflate.h
++++ misc/build/zlib-1.2.3/deflate.h
+@@ -260,6 +260,12 @@
+ * are always zero.
+ */
+
++ ulg high_water;
++ /* High water mark offset in window for initialized bytes -- bytes above
++ * this are set to zero in order to avoid memory check warnings when
++ * longest match routines access bytes past the input. This is then
++ * updated to the new high water mark.
++ */
+ } FAR deflate_state;
+
+ /* Output a byte on the stream.
+@@ -278,6 +284,10 @@
+ * distances are limited to MAX_DIST instead of WSIZE.
+ */
+
++#define WIN_INIT MAX_MATCH
++/* Number of bytes after end of data in window to initialize in order to avoid
++ memory checker errors from longest match routines */
++
+ /* in trees.c */
+ void _tr_init OF((deflate_state *s));
+ int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));