Skip to content

Commit

Permalink
zlib 1.2.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Sep 10, 2011
1 parent f6194ef commit d004b04
Show file tree
Hide file tree
Showing 74 changed files with 7,120 additions and 1,855 deletions.
177 changes: 177 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
cmake_minimum_required(VERSION 2.4.4)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)

project(zlib C)

if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build a shared library form of zlib" ON)
endif()

include(CheckTypeSize)
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
enable_testing()

check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stddef.h HAVE_STDDEF_H)

#
# Check to see if we have large file support
#
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE)

# We add these other definitions here because CheckTypeSize.cmake
# in CMake 2.4.x does not automatically do so and we want
# compatibility with CMake 2.4.x.
if(HAVE_SYS_TYPES_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
endif()
if(HAVE_STDINT_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
endif()
if(HAVE_STDDEF_H)
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
endif()

check_type_size(off64_t OFF64_T)

if(HAVE_OFF64_T)
add_definitions(-D_LARGEFILE64_SOURCE)
endif()
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable

#
# Check for fseeko
#
check_function_exists(fseeko HAVE_FSEEKO)
if(NOT HAVE_FSEEKO)
add_definitions(-DNO_FSEEKO)
endif()

#
# Check for unistd.h
#
check_include_file(unistd.h HAVE_UNISTD_H)

#
# Check for errno.h
check_include_file(errno.h HAVE_ERRNO_H)
if(NOT HAVE_ERRNO_H)
add_definitions(-DNO_ERRNO_H)
endif()

#
# Check for mmap support
#
set(mmap_test_code "
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
caddr_t hello() {
return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
}
int main() { return 0; }
")
check_c_source_compiles("${mmap_test_code}" USE_MMAP)
if(USE_MMAP)
add_definitions(-DUSE_MMAP)
endif()

#
# Create the zlibdefs.h file.
# Note: we create it in CMAKE_CURRENT_SOURCE_DIR instead
# of CMAKE_CURRENT_BINARY_DIR because an empty zlibdefs.h
# is shipped with zlib in the source tree.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h.cmakein
${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h)

if(MSVC)
set(CMAKE_DEBUG_POSTFIX "D")
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
endif()

#============================================================================
# zlib
#============================================================================

set(ZLIB_PUBLIC_HDRS
zconf.h
zlib.h
zlibdefs.h
)
set(ZLIB_PRIVATE_HDRS
crc32.h
deflate.h
gzguts.h
inffast.h
inffixed.h
inflate.h
inftrees.h
trees.h
zutil.h
)
set(ZLIB_SRCS
adler32.c
compress.c
crc32.c
deflate.c
gzclose.c
gzio.c
gzlib.c
gzread.c
gzwrite.c
inflate.c
infback.c
inftrees.c
inffast.c
trees.c
uncompr.c
zutil.c
)

add_library(zlib ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
set_target_properties(zlib PROPERTIES VERSION 1.2.3.4)
set_target_properties(zlib PROPERTIES SOVERSION 1)
if(UNIX)
# On unix like platforms the library is almost always called libz
set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
endif()

if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
install(TARGETS zlib
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib )
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION include)
endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES zlib.3 DESTINATION share/man/man3)
endif()

#============================================================================
# Example binaries
#============================================================================

add_executable(example example.c)
target_link_libraries(example zlib)
add_test(example example)

add_executable(minigzip minigzip.c)
target_link_libraries(minigzip zlib)

if(HAVE_OFF64_T)
add_executable(example64 example.c)
target_link_libraries(example64 zlib)
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
add_test(example64 example64)

add_executable(minigzip64 minigzip.c)
target_link_libraries(minigzip64 zlib)
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
endif()
25 changes: 23 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@

ChangeLog file for zlib

Changes in 1.2.3.5 (8 Jan 2010)
- Add space after #if in zutil.h for some compilers
- Fix relatively harmless bug in deflate_fast() [Exarevsky]
- Fix same problem in deflate_slow()
- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown]
- Add deflate_rle() for faster Z_RLE strategy run-length encoding
- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding
- Change name of "write" variable in inffast.c to avoid library collisions
- Fix premature EOF from gzread() in gzio.c [Brown]
- Use zlib header window size if windowBits is 0 in inflateInit2()
- Remove compressBound() call in deflate.c to avoid linking compress.o
- Replace use of errno in gz* with functions, support WinCE [Alves]
- Provide alternative to perror() in minigzip.c for WinCE [Alves]
- Don't use _vsnprintf on later versions of MSVC [Lowman]
- Add CMake build script and input file [Lowman]
- Update contrib/minizip to 1.1 [Svensson, Vollant]
- Moved nintendods directory from contrib to .
- Replace gzio.c with a new set of routines with the same functionality
- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
- Update contrib/minizip to 1.1b

Changes in 1.2.3.4 (21 Dec 2009)
- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility
- Update comments in configure and Makefile.in for default --shared
Expand All @@ -25,7 +46,7 @@ Changes in 1.2.3.4 (21 Dec 2009)
- Fix static and shared Makefile.in targets to be independent
- Correct error return bug in gz_open() by setting state [Brown]
- Put spaces before ;;'s in configure for better sh compatibility
- Added pigz.c (parallel implementation of gzip) to examples/
- Add pigz.c (parallel implementation of gzip) to examples/
- Correct constant in crc32.c to UL [Leventhal]
- Reject negative lengths in crc32_combine()
- Add inflateReset2() function to work like inflateEnd()/inflateInit2()
Expand Down Expand Up @@ -57,7 +78,7 @@ Changes in 1.2.3.4 (21 Dec 2009)
- Allow negative bits in inflatePrime() to delete existing bit buffer
- Add Z_TREES flush option to inflate() to return at end of trees
- Add inflateMark() to return current state information for random access
- Added Makefile for NintendoDS to contrib [Costa]
- Add Makefile for NintendoDS to contrib [Costa]
- Add -w in configure compile tests to avoid spurious warnings [Beucler]
- Fix typos in zlib.h comments for deflateSetDictionary()
- Fix EOF detection in transparent gzread() [Maier]
Expand Down
10 changes: 9 additions & 1 deletion INDEX
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
CMakeLists.txt cmake build file
ChangeLog history of changes
FAQ Frequently Asked Questions about zlib
INDEX this file
Expand All @@ -6,7 +7,7 @@ Makefile.in makefile for Unix (template for configure)
README guess what
configure configure script for Unix
make_vms.com makefile for VMS
treebuild.xml see http://treebuild.metux.de/
treebuild.xml XML description of source file dependencies
zlib.3 Man page for zlib
zlib.map Linux symbol information
zlib.pc.in Template for pkg-config descriptor
Expand All @@ -16,12 +17,14 @@ amiga/ makefiles for Amiga SAS C
as400/ makefiles for IBM AS/400
doc/ documentation for formats and algorithms
msdos/ makefiles for MSDOS
nintendods/ makefile for Nintendo DS
old/ makefiles for various architectures and zlib documentation
files that have not yet been updated for zlib 1.2.x
projects/ projects for various Integrated Development Environments
qnx/ makefiles for QNX
watcom/ makefiles for OpenWatcom
win32/ makefiles for Windows
zlibdefs.h.cmakein input file for cmake build

zlib public header files (required for library use):
zconf.h
Expand All @@ -35,7 +38,12 @@ crc32.c
crc32.h
deflate.c
deflate.h
gzclose.c
gzguts.h
gzio.c
gzlib.c
gzread.c
gzwrite.c
infback.c
inffast.c
inffast.h
Expand Down
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ CPP=$(CC) -E

STATICLIB=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.3.4
SHAREDLIBV=libz.so.1.2.3.5
SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIB)
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)

AR=ar rc
RANLIB=ranlib
Expand All @@ -50,11 +50,11 @@ mandir = ${prefix}/share/man
man3dir = ${mandir}/man3
pkgconfigdir = ${libdir}/pkgconfig

OBJC = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
zutil.o inflate.o infback.o inftrees.o inffast.o
OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzio.o gzlib.o gzread.o \
gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o

PIC_OBJC = adler32.lo compress.lo crc32.lo gzio.lo uncompr.lo deflate.lo trees.lo \
zutil.lo inflate.lo infback.lo inftrees.lo inffast.lo
PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzio.lo gzlib.lo gzread.lo \
gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo

# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
OBJA =
Expand Down Expand Up @@ -221,6 +221,7 @@ depend:
# DO NOT DELETE THIS LINE -- make depend depends on it.

adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h zlibdefs.h gzguts.h
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h
crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
Expand All @@ -230,6 +231,7 @@ inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h

adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h zlibdefs.h gzguts.h
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h
crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
Expand Down
14 changes: 8 additions & 6 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ CPP=$(CC) -E

STATICLIB=libz.a
SHAREDLIB=libz.so
SHAREDLIBV=libz.so.1.2.3.4
SHAREDLIBV=libz.so.1.2.3.5
SHAREDLIBM=libz.so.1
LIBS=$(STATICLIB) $(SHAREDLIB)
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)

AR=ar rc
RANLIB=ranlib
Expand All @@ -50,11 +50,11 @@ mandir = ${prefix}/share/man
man3dir = ${mandir}/man3
pkgconfigdir = ${libdir}/pkgconfig

OBJC = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
zutil.o inflate.o infback.o inftrees.o inffast.o
OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzio.o gzlib.o gzread.o \
gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o

PIC_OBJC = adler32.lo compress.lo crc32.lo gzio.lo uncompr.lo deflate.lo trees.lo \
zutil.lo inflate.lo infback.lo inftrees.lo inffast.lo
PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzio.lo gzlib.lo gzread.lo \
gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo

# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
OBJA =
Expand Down Expand Up @@ -221,6 +221,7 @@ depend:
# DO NOT DELETE THIS LINE -- make depend depends on it.

adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h zlibdefs.h gzguts.h
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h
crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
Expand All @@ -230,6 +231,7 @@ inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h

adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h zlibdefs.h gzguts.h
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h
crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY

zlib 1.2.3.4 is a general purpose data compression library. All the code is
zlib 1.2.3.5 is a general purpose data compression library. All the code is
thread safe. The data format used by the zlib library is described by RFCs
(Request for Comments) 1950 to 1952 in the files
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
Expand Down Expand Up @@ -33,7 +33,7 @@ Mark Nelson <[email protected]> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available in
http://dogma.net/markn/articles/zlibtool/zlibtool.htm

The changes made in version 1.2.3.4 are documented in the file ChangeLog.
The changes made in version 1.2.3.5 are documented in the file ChangeLog.

Unsupported third party contributions are provided in directory "contrib".

Expand Down
8 changes: 6 additions & 2 deletions amiga/Makefile.pup
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ LDFLAGS = -o
LDLIBS = LIB:scppc.a LIB:end.o
RM = delete quiet

OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
zutil.o inflate.o infback.o inftrees.o inffast.o
OBJS = adler32.o compress.o crc32.o gzclose.o gzio.o gzlib.o gzread.o gzwrite.o \
uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o

TEST_OBJS = example.o minigzip.o

Expand Down Expand Up @@ -55,7 +55,11 @@ 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
gzio.o: zutil.h zlib.h zconf.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
Expand Down
Loading

0 comments on commit d004b04

Please sign in to comment.