summaryrefslogtreecommitdiff
path: root/zlib
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-04-12 16:05:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-04-13 13:15:25 +0100
commit452af5f4522e750627d0c0ac9fbc794aeb1f1f8f (patch)
tree950d062f9e183873d64b06e212568a3b0968bb58 /zlib
parent99b04ed2be3023bec874fce529d453123f48ac99 (diff)
gbuildize internal zlib
and stick headers into the solver in the same hierarchy as is "standard" so we don't have to patch so much, similiarly rename to libz
Diffstat (limited to 'zlib')
-rw-r--r--zlib/CustomTarget_source.mk53
-rw-r--r--zlib/Makefile11
-rw-r--r--zlib/Module_zlib.mk36
-rw-r--r--zlib/Package_source.mk38
-rw-r--r--zlib/StaticLibrary_zlib.mk70
-rwxr-xr-xzlib/make_patched_header.pl66
-rw-r--r--zlib/makefile.mk75
-rw-r--r--zlib/patches/minizip-null.patch12
-rw-r--r--zlib/patches/zlib-1.2.5-gentoo.patch12
-rw-r--r--zlib/patches/zlib-1.2.5-minizip-fixuncrypt.patch14
-rw-r--r--zlib/patches/zlib-1.2.5-zip64.patch59
-rw-r--r--zlib/prj/build.lst5
-rw-r--r--zlib/prj/d.lst11
-rw-r--r--zlib/prj/makefile.mk1
-rw-r--r--zlib/zlib-1.2.5.patch67
15 files changed, 309 insertions, 221 deletions
diff --git a/zlib/CustomTarget_source.mk b/zlib/CustomTarget_source.mk
new file mode 100644
index 000000000000..e051ab0bdbff
--- /dev/null
+++ b/zlib/CustomTarget_source.mk
@@ -0,0 +1,53 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# Copyright (C) 2012 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com>
+# (initial developer)
+# Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+$(eval $(call gb_CustomTarget_CustomTarget,zlib/source))
+
+ZLSO := $(call gb_CustomTarget_get_workdir,zlib/source)
+
+$(call gb_CustomTarget_get_target,zlib/source) : $(ZLSO)/done
+
+# FIXME: do not hardcode the path here
+ifeq ($(OS_FOR_BUILD),WNT)
+zl_FIXED_TARFILE_LOCATION := $(shell cygpath -u $(TARFILE_LOCATION))/c735eab2d659a96e5a594c9e8541ad63-zlib-1.2.5.tar.gz
+else
+zl_FIXED_TARFILE_LOCATION := $(TARFILE_LOCATION)/c735eab2d659a96e5a594c9e8541ad63-zlib-1.2.5.tar.gz
+endif
+
+$(ZLSO)/done : $(zl_FIXED_TARFILE_LOCATION)
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),TAR,1)
+ $(call gb_Helper_abbreviate_dirs, \
+ mkdir -p $(dir $@) && cd $(dir $@) && \
+ $(GNUTAR) -x -z $(STRIP_COMPONENTS)=1 -f $< && \
+ $(GNUPATCH) -p1 < $(SRCDIR)/zlib/patches/zlib-1.2.5-gentoo.patch && \
+ $(GNUPATCH) -p1 < $(SRCDIR)/zlib/patches/minizip-null.patch && \
+ $(GNUPATCH) -p1 < $(SRCDIR)/zlib/patches/zlib-1.2.5-minizip-fixuncrypt.patch && \
+ $(GNUPATCH) -p1 < $(SRCDIR)/zlib/patches/zlib-1.2.5-zip64.patch )
+ touch $@
+
+# vim: set noet sw=4 ts=4:
diff --git a/zlib/Makefile b/zlib/Makefile
new file mode 100644
index 000000000000..5f46a974f7fe
--- /dev/null
+++ b/zlib/Makefile
@@ -0,0 +1,11 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+
+EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
+export EXTERNAL_WARNINGS_NOT_ERRORS
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/zlib/Module_zlib.mk b/zlib/Module_zlib.mk
new file mode 100644
index 000000000000..42c1e5d22f5a
--- /dev/null
+++ b/zlib/Module_zlib.mk
@@ -0,0 +1,36 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# Copyright (C) 2012 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com>
+# (initial developer)
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+$(eval $(call gb_Module_Module,zlib))
+
+$(eval $(call gb_Module_add_targets,zlib,\
+ CustomTarget_source \
+ StaticLibrary_zlib \
+ Package_source \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/zlib/Package_source.mk b/zlib/Package_source.mk
new file mode 100644
index 000000000000..3479f0836bc3
--- /dev/null
+++ b/zlib/Package_source.mk
@@ -0,0 +1,38 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# Copyright (C) 2012 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com>
+# (initial developer)
+# Copyright (C) 2012 Red Hat, Inc., David Tardon <dtardon@redhat.com>
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+$(eval $(call gb_Package_Package,zlib_source,$(call gb_CustomTarget_get_workdir,zlib/source)))
+
+$(call gb_Package_get_preparation_target,zlib_source) : $(call gb_CustomTarget_get_target,zlib/source)
+
+$(eval $(call gb_Package_add_file,zlib_source,inc/external/zconf.h,zconf.h))
+$(eval $(call gb_Package_add_file,zlib_source,inc/external/zlib.h,zlib.h))
+$(eval $(call gb_Package_add_file,zlib_source,inc/external/minizip/unzip.h,contrib/minizip/unzip.h))
+$(eval $(call gb_Package_add_file,zlib_source,inc/external/minizip/ioapi.h,contrib/minizip/ioapi.h))
+
+# vim: set noet sw=4 ts=4:
diff --git a/zlib/StaticLibrary_zlib.mk b/zlib/StaticLibrary_zlib.mk
new file mode 100644
index 000000000000..bb862d6f821a
--- /dev/null
+++ b/zlib/StaticLibrary_zlib.mk
@@ -0,0 +1,70 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# Copyright (C) 2012 Red Hat, Inc., Caolán McNamara <caolanm@redhat.com>
+# (initial developer)
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,z))
+
+$(eval $(call gb_StaticLibrary_use_package,z,zlib_source))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,zlib))
+
+$(eval $(call gb_StaticLibrary_set_include,z,\
+ $$(INCLUDE) \
+))
+
+$(eval $(call gb_StaticLibrary_add_defs,z,\
+ $(LFS_CFLAGS) \
+))
+
+# zlib does not depend on sal nor needs uwinapi here
+$(eval $(call gb_StaticLibrary_use_libraries,z,\
+ $(filter-out uwinapi,$(gb_STDLIBS)) \
+))
+
+ifeq ($(OS),LINUX)
+$(eval $(call gb_StaticLibrary_use_libraries,z,\
+ m \
+ pthread \
+))
+endif
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,z,\
+ CustomTarget/zlib/source/adler32 \
+ CustomTarget/zlib/source/compress \
+ CustomTarget/zlib/source/deflate \
+ CustomTarget/zlib/source/crc32 \
+ CustomTarget/zlib/source/inffast \
+ CustomTarget/zlib/source/inflate \
+ CustomTarget/zlib/source/inftrees \
+ CustomTarget/zlib/source/trees \
+ CustomTarget/zlib/source/zutil \
+ ,$(if $(filter TRUE,$(EXTERNAL_WARNINGS_NOT_ERRORS)),\
+ $(filter-out $(gb_CFLAGS_WERROR),$(CFLAGS)),\
+ $(CFLAGS)) \
+ $(gb_COMPILEROPTFLAGS) \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/zlib/make_patched_header.pl b/zlib/make_patched_header.pl
deleted file mode 100755
index 41dbdc5fbb96..000000000000
--- a/zlib/make_patched_header.pl
+++ /dev/null
@@ -1,66 +0,0 @@
-:
-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
deleted file mode 100644
index 6165ccc8ddbf..000000000000
--- a/zlib/makefile.mk
+++ /dev/null
@@ -1,75 +0,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.
-#
-#*************************************************************************
-
-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.5
-TARFILE_MD5=c735eab2d659a96e5a594c9e8541ad63
-
-PATCH_FILES=zlib-1.2.5.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/patches/minizip-null.patch b/zlib/patches/minizip-null.patch
new file mode 100644
index 000000000000..bffe2072c689
--- /dev/null
+++ b/zlib/patches/minizip-null.patch
@@ -0,0 +1,12 @@
+diff -up zlib-1.2.5/contrib/minizip/unzip.c.pom zlib-1.2.5/contrib/minizip/unzip.c
+--- zlib-1.2.5/contrib/minizip/unzip.c.pom 2010-02-15 12:59:40.000000000 +0100
++++ zlib-1.2.5/contrib/minizip/unzip.c 2011-04-06 12:06:04.000000000 +0200
+@@ -1145,7 +1145,7 @@ extern int ZEXPORT unzGetCurrentFileInfo
+ szFileName,fileNameBufferSize,
+ extraField,extraFieldBufferSize,
+ szComment,commentBufferSize);
+- if (err==UNZ_OK)
++ if (pfile_info && err==UNZ_OK)
+ {
+ pfile_info->version = file_info64.version;
+ pfile_info->version_needed = file_info64.version_needed;
diff --git a/zlib/patches/zlib-1.2.5-gentoo.patch b/zlib/patches/zlib-1.2.5-gentoo.patch
new file mode 100644
index 000000000000..82c7f39732dd
--- /dev/null
+++ b/zlib/patches/zlib-1.2.5-gentoo.patch
@@ -0,0 +1,12 @@
+diff -up zlib-1.2.5/zlib.h.pom zlib-1.2.5/zlib.h
+--- zlib-1.2.5/zlib.h.pom 2010-04-20 06:12:48.000000000 +0200
++++ zlib-1.2.5/zlib.h 2010-06-16 13:08:59.000000000 +0200
+@@ -1578,7 +1578,7 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF(
+ # define gzoffset gzoffset64
+ # define adler32_combine adler32_combine64
+ # define crc32_combine crc32_combine64
+-# ifdef _LARGEFILE64_SOURCE
++# ifndef _LARGEFILE64_SOURCE
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
diff --git a/zlib/patches/zlib-1.2.5-minizip-fixuncrypt.patch b/zlib/patches/zlib-1.2.5-minizip-fixuncrypt.patch
new file mode 100644
index 000000000000..d113879f5c37
--- /dev/null
+++ b/zlib/patches/zlib-1.2.5-minizip-fixuncrypt.patch
@@ -0,0 +1,14 @@
+diff -up zlib-1.2.5/contrib/minizip/unzip.c.fixuncrypt zlib-1.2.5/contrib/minizip/unzip.c
+--- zlib-1.2.5/contrib/minizip/unzip.c.fixuncrypt 2011-11-11 12:13:56.335867758 -0500
++++ zlib-1.2.5/contrib/minizip/unzip.c 2011-11-11 12:14:01.747799372 -0500
+@@ -68,10 +68,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-#ifndef NOUNCRYPT
+- #define NOUNCRYPT
+-#endif
+-
+ #include "zlib.h"
+ #include "unzip.h"
+
diff --git a/zlib/patches/zlib-1.2.5-zip64.patch b/zlib/patches/zlib-1.2.5-zip64.patch
new file mode 100644
index 000000000000..2bc94deb2979
--- /dev/null
+++ b/zlib/patches/zlib-1.2.5-zip64.patch
@@ -0,0 +1,59 @@
+diff -ru zlib-1.2.5/contrib/minizip/ioapi.c zlib-1.2.5-patch/contrib/minizip/ioapi.c
+--- zlib-1.2.5/contrib/minizip/ioapi.c 2010-01-04 12:31:24.000000000 -0500
++++ zlib-1.2.5-patch/contrib/minizip/ioapi.c 2011-07-05 15:47:48.263474587 -0400
+@@ -47,7 +47,7 @@
+ else
+ {
+ uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
+- if ((tell_uLong) == ((uLong)-1))
++ if ((tell_uLong) == MAXU32)
+ return (ZPOS64_T)-1;
+ else
+ return tell_uLong;
+diff -ru zlib-1.2.5/contrib/minizip/ioapi.h zlib-1.2.5-patch/contrib/minizip/ioapi.h
+--- zlib-1.2.5/contrib/minizip/ioapi.h 2010-02-15 06:59:40.000000000 -0500
++++ zlib-1.2.5-patch/contrib/minizip/ioapi.h 2011-07-05 15:48:36.281546917 -0400
+@@ -85,6 +85,8 @@
+ typedef uint64_t ZPOS64_T;
+ #else
+
++/* Maximum unsigned 32-bit value used as placeholder for zip64 */
++#define MAXU32 0xffffffff
+
+ #if defined(_MSC_VER) || defined(__BORLANDC__)
+ typedef unsigned __int64 ZPOS64_T;
+diff -ru zlib-1.2.5/contrib/minizip/unzip.c zlib-1.2.5-patch/contrib/minizip/unzip.c
+--- zlib-1.2.5/contrib/minizip/unzip.c 2010-02-15 06:59:40.000000000 -0500
++++ zlib-1.2.5-patch/contrib/minizip/unzip.c 2011-07-05 15:50:31.409310349 -0400
+@@ -1040,26 +1040,26 @@
+ {
+ uLong uL;
+
+- if(file_info.uncompressed_size == (ZPOS64_T)(unsigned long)-1)
++ if(file_info.uncompressed_size == MAXU32)
+ {
+ if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK)
+ err=UNZ_ERRNO;
+ }
+
+- if(file_info.compressed_size == (ZPOS64_T)(unsigned long)-1)
++ if(file_info.compressed_size == MAXU32)
+ {
+ if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK)
+ err=UNZ_ERRNO;
+ }
+
+- if(file_info_internal.offset_curfile == (ZPOS64_T)(unsigned long)-1)
++ if(file_info_internal.offset_curfile == MAXU32)
+ {
+ /* Relative Header offset */
+ if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK)
+ err=UNZ_ERRNO;
+ }
+
+- if(file_info.disk_num_start == (unsigned long)-1)
++ if(file_info.disk_num_start == MAXU32)
+ {
+ /* Disk Start Number */
+ if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK)
+
diff --git a/zlib/prj/build.lst b/zlib/prj/build.lst
index 8ef73d94723a..2eb61b40f5c7 100644
--- a/zlib/prj/build.lst
+++ b/zlib/prj/build.lst
@@ -1,2 +1,3 @@
-zl zlib : soltools NULL
-zl zlib nmake - all zl_mkout NULL
+cl zlib : soltools NULL
+cl zlib usr1 - all zl_mkout NULL
+cl zlib\prj nmake - all zl_prj NULL
diff --git a/zlib/prj/d.lst b/zlib/prj/d.lst
index ef40caf49c44..e69de29bb2d1 100644
--- a/zlib/prj/d.lst
+++ b/zlib/prj/d.lst
@@ -1,11 +0,0 @@
-mkdir: %_DEST%\inc\external\zlib
-mkdir: %_DEST%\lib\x64
-
-..\%__SRC%\inc\patched\zlib.h %_DEST%\inc\external\zlib\zlib.h
-..\%__SRC%\inc\zconf.h %_DEST%\inc\external\zlib\zconf.h
-
-..\%__SRC%\lib\libzlib.a %_DEST%\lib\libzlib.a
-..\%__SRC%\slb\zlib.lib %_DEST%\lib\zlib.lib
-..\%__SRC%\slb\zlib.lin %_DEST%\lib\zlib.lin
-..\%__SRC%\slb\x64\zlib.lib %_DEST%\lib\x64\zlib.lib
-..\%__SRC%\slb\x64\zlib.lin %_DEST%\lib\x64\zlib.lin
diff --git a/zlib/prj/makefile.mk b/zlib/prj/makefile.mk
new file mode 100644
index 000000000000..0997622e00f6
--- /dev/null
+++ b/zlib/prj/makefile.mk
@@ -0,0 +1 @@
+.INCLUDE : gbuildbridge.mk
diff --git a/zlib/zlib-1.2.5.patch b/zlib/zlib-1.2.5.patch
deleted file mode 100644
index 3389b88c0ae9..000000000000
--- a/zlib/zlib-1.2.5.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- misc/zlib-1.2.5/makefile.mk Fri Mar 14 10:17:06 2008
-+++ misc/build/zlib-1.2.5/makefile.mk Fri Mar 14 10:16:56 2008
-@@ -1 +1,63 @@
--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)$/trees.obj \
-+ $(SLO)$/zutil.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)$/trees.obj \
-+ $(SLO_X64)$/zutil.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
-+