Date: Wed, 4 Jan 2017 09:30:47 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311275 - in head: contrib/zlib contrib/zlib/amiga contrib/zlib/as400 contrib/zlib/contrib/ada contrib/zlib/contrib/amd64 contrib/zlib/contrib/blast contrib/zlib/contrib/delphi contrib/... Message-ID: <201701040930.v049UlwN003322@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: delphij Date: Wed Jan 4 09:30:47 2017 New Revision: 311275 URL: https://svnweb.freebsd.org/changeset/base/311275 Log: Restructure libz, place vendor files in contrib/zlib like other third party software, this provides more standarized import workflow and makes future upgrades easier. The following files are new with this commit: zconf.h.in zlib.map zlib.pc.in They are not connected to build, but were kept in tree for reference for future maintenance. All our local trivial changes were applied to contrib/zlib, and the contrib/zlib vendor source code is intended to 100% match lib/libz before this commit. MFC after: 2 weeks Added: - copied from r311267, vendor/zlib/dist/ Directory Properties: head/contrib/zlib/ (props changed) Deleted: head/contrib/zlib/CMakeLists.txt head/contrib/zlib/INDEX head/contrib/zlib/Makefile head/contrib/zlib/Makefile.in head/contrib/zlib/amiga/ head/contrib/zlib/as400/ head/contrib/zlib/configure head/contrib/zlib/contrib/ada/ head/contrib/zlib/contrib/amd64/ head/contrib/zlib/contrib/blast/ head/contrib/zlib/contrib/delphi/ head/contrib/zlib/contrib/dotzlib/ head/contrib/zlib/contrib/infback9/ head/contrib/zlib/contrib/inflate86/ head/contrib/zlib/contrib/iostream/ head/contrib/zlib/contrib/iostream2/ head/contrib/zlib/contrib/iostream3/ head/contrib/zlib/contrib/masmx64/ head/contrib/zlib/contrib/masmx86/ head/contrib/zlib/contrib/minizip/ head/contrib/zlib/contrib/pascal/ head/contrib/zlib/contrib/puff/ head/contrib/zlib/contrib/testzlib/ head/contrib/zlib/contrib/untgz/ head/contrib/zlib/contrib/vstudio/ head/contrib/zlib/examples/ head/contrib/zlib/make_vms.com head/contrib/zlib/msdos/ head/contrib/zlib/nintendods/ head/contrib/zlib/old/ head/contrib/zlib/qnx/ head/contrib/zlib/treebuild.xml head/contrib/zlib/watcom/ head/contrib/zlib/win32/ head/contrib/zlib/zconf.h.cmakein head/contrib/zlib/zlib.3.pdf head/contrib/zlib/zlib.pc.cmakein head/contrib/zlib/zlib2ansi head/lib/libz/ChangeLog head/lib/libz/FAQ head/lib/libz/README head/lib/libz/adler32.c head/lib/libz/compress.c head/lib/libz/contrib/ head/lib/libz/crc32.c head/lib/libz/crc32.h head/lib/libz/deflate.c head/lib/libz/deflate.h head/lib/libz/doc/ head/lib/libz/gzclose.c head/lib/libz/gzguts.h head/lib/libz/gzlib.c head/lib/libz/gzread.c head/lib/libz/gzwrite.c head/lib/libz/infback.c head/lib/libz/inffast.c head/lib/libz/inffast.h head/lib/libz/inffixed.h head/lib/libz/inflate.c head/lib/libz/inflate.h head/lib/libz/inftrees.c head/lib/libz/inftrees.h head/lib/libz/test/ head/lib/libz/trees.c head/lib/libz/trees.h head/lib/libz/uncompr.c head/lib/libz/zconf.h head/lib/libz/zlib.3 head/lib/libz/zlib.h head/lib/libz/zutil.c head/lib/libz/zutil.h Modified: head/contrib/zlib/gzlib.c head/contrib/zlib/gzread.c head/contrib/zlib/gzwrite.c head/contrib/zlib/inflate.c head/contrib/zlib/zconf.h head/lib/libstand/Makefile head/lib/libz/FREEBSD-upgrade head/lib/libz/Makefile head/usr.bin/minigzip/Makefile Modified: head/contrib/zlib/gzlib.c ============================================================================== --- vendor/zlib/dist/gzlib.c Wed Jan 4 08:12:31 2017 (r311267) +++ head/contrib/zlib/gzlib.c Wed Jan 4 09:30:47 2017 (r311275) @@ -3,7 +3,10 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ +/* $FreeBSD$ */ + #include "gzguts.h" +#include "zutil.h" #if defined(_WIN32) && !defined(__BORLANDC__) # define LSEEK _lseeki64 Modified: head/contrib/zlib/gzread.c ============================================================================== --- vendor/zlib/dist/gzread.c Wed Jan 4 08:12:31 2017 (r311267) +++ head/contrib/zlib/gzread.c Wed Jan 4 09:30:47 2017 (r311275) @@ -3,7 +3,10 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ +/* $FreeBSD$ */ + #include "gzguts.h" +#include <unistd.h> /* Local functions */ local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *)); Modified: head/contrib/zlib/gzwrite.c ============================================================================== --- vendor/zlib/dist/gzwrite.c Wed Jan 4 08:12:31 2017 (r311267) +++ head/contrib/zlib/gzwrite.c Wed Jan 4 09:30:47 2017 (r311275) @@ -3,7 +3,10 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ +/* $FreeBSD$ */ + #include "gzguts.h" +#include <unistd.h> /* Local functions */ local int gz_init OF((gz_statep)); Modified: head/contrib/zlib/inflate.c ============================================================================== --- vendor/zlib/dist/inflate.c Wed Jan 4 08:12:31 2017 (r311267) +++ head/contrib/zlib/inflate.c Wed Jan 4 09:30:47 2017 (r311275) @@ -1504,7 +1504,7 @@ z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; + if (strm == Z_NULL || strm->state == Z_NULL) return -(1L << 16); state = (struct inflate_state FAR *)strm->state; return ((long)(state->back) << 16) + (state->mode == COPY ? state->length : Modified: head/contrib/zlib/zconf.h ============================================================================== --- vendor/zlib/dist/zconf.h Wed Jan 4 08:12:31 2017 (r311267) +++ head/contrib/zlib/zconf.h Wed Jan 4 09:30:47 2017 (r311275) @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $Id$ */ +/* @(#) $FreeBSD$ */ #ifndef ZCONF_H #define ZCONF_H @@ -408,7 +408,7 @@ typedef uLong FAR uLongf; typedef unsigned long z_crc_t; #endif -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +#if 0 /* was set to #if 0 by ./configure */ # define Z_HAVE_UNISTD_H #endif @@ -477,6 +477,14 @@ typedef uLong FAR uLongf; # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif +/* + * This is hard-configured for FreeBSD. + */ +#define z_off_t off_t +#ifndef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 64 +#endif + #ifndef z_off_t # define z_off_t long #endif Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Wed Jan 4 09:06:49 2017 (r311274) +++ head/lib/libstand/Makefile Wed Jan 4 09:30:47 2017 (r311275) @@ -109,9 +109,9 @@ libstand_bzlib_private.h: bzlib_private. sed -e 's|<stdlib.h>|"stand.h"|' \ ${.ALLSRC} > ${.TARGET} -# decompression functionality from libz -.PATH: ${LIBSTAND_SRC}/../libz -CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../libz +# decompression functionality from zlib +.PATH: ${LIBSTAND_SRC}/../../contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../../contrib/zlib SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h .for file in infback.c inffast.c inflate.c inftrees.c zutil.c Modified: head/lib/libz/FREEBSD-upgrade ============================================================================== --- head/lib/libz/FREEBSD-upgrade Wed Jan 4 09:06:49 2017 (r311274) +++ head/lib/libz/FREEBSD-upgrade Wed Jan 4 09:30:47 2017 (r311275) @@ -1,44 +1,16 @@ $FreeBSD$ -ZLib 1.2.2 - -Original distribution from http://www.gzip.org/zlib/ - -Vendor files removed from distribution before import: - INDEX configure qnx/ - Makefile contrib/ win32/ - Makefile.in msdos/ zconf.in.h - amiga/ old/ - as400/ projects/ - -Vendor files imported: - ChangeLog example.c minigzip.c - FAQ gzio.c trees.c - README infback.c trees.h - adler32.c inffast.c uncompr.c - algorithm.txt inffast.h zconf.h - compress.c inffixed.h zlib.3 - crc32.c inflate.c zlib.h - crc32.h inflate.h zutil.c - deflate.c inftrees.c zutil.h - deflate.h inftrees.h - -As of April, 2005, only the following three vendor files -had non-trivial local changes: - gzio.c minigzip.c zconf.h - -Added files (not from vendor): - Makefile zopen.c FREEBSD-upgrade +Original distribution from http://zlib.net/. Currently, only trivial +changes were made to support build of libstand and to suppress certain +compiler warnings, we upstream our local changes whenever they would +benefit other consumers. To Update: 1) Unpack vendor sources into a clean directory. - 2) Delete unnecessary files. - 3) Import onto the vendor branch. The 1.2.2 import was done like this: - cvs -d <CVSROOT> import -ko -m "ZLib 1.2.2" src/lib/libz ZLIB v1_2_2 - 4) In a clean directory, check out a fresh copy of HEAD, - merging in vendor changes since the last import. - cvs -d <CVSROOT> co -jZLIB:yesterday -jZLIB src/lib/libz - 5) Resolve any conflicts and commit them. - 6) Update this file with any changes to the file list or update procedure. + 2) Import onto the vendor area. + 3) Merge the vendor tree to contrib/zlib, which contains a stripped down + version of upstream source, resolve any conflicts. + 4) Double check zconf.h, zlib.pc, and Symbol.map to make sure that we + have the required changes. Test universe and commit them. -kientzle@FreeBSD.org +delphij@FreeBSD.org Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Wed Jan 4 09:06:49 2017 (r311274) +++ head/lib/libz/Makefile Wed Jan 4 09:30:47 2017 (r311275) @@ -8,6 +8,10 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 6 MAN= zlib.3 zopen.3 +ZLIBSRC= ${SRCTOP}/contrib/zlib + +.PATH: ${ZLIBSRC} + #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 #CFLAGS=-g -DDEBUG #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ @@ -37,14 +41,14 @@ SRCS+= zopen.c SRCS+= zutil.c #.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*} -#.PATH: ${.CURDIR}/contrib/asm686 +#.PATH: ${ZLIBSRC}/contrib/asm686 #SRCS+= match.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack #.endif #.if ${MACHINE_ARCH} == "amd64" -#.PATH: ${.CURDIR}/contrib/gcc_gvmat64 +#.PATH: ${ZLIBSRC}/contrib/gcc_gvmat64 #SRCS+= gvmat64.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack @@ -56,7 +60,7 @@ CFLAGS+= -DSYMBOL_VERSIONING INCS= zconf.h zlib.h -.PATH: ${.CURDIR}/test +.PATH: ${ZLIBSRC}/test minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz Modified: head/usr.bin/minigzip/Makefile ============================================================================== --- head/usr.bin/minigzip/Makefile Wed Jan 4 09:06:49 2017 (r311274) +++ head/usr.bin/minigzip/Makefile Wed Jan 4 09:30:47 2017 (r311275) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCDIR= ${.CURDIR}/../../lib/libz/test +SRCDIR= ${.CURDIR}/../../contrib/zlib/test .PATH: ${SRCDIR} PROG= minigzip
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701040930.v049UlwN003322>