Skip to content

Commit d004b04

Browse files
committed
zlib 1.2.3.5
1 parent f6194ef commit d004b04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+7120
-1855
lines changed

CMakeLists.txt

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
cmake_minimum_required(VERSION 2.4.4)
2+
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
3+
4+
project(zlib C)
5+
6+
if(NOT DEFINED BUILD_SHARED_LIBS)
7+
option(BUILD_SHARED_LIBS "Build a shared library form of zlib" ON)
8+
endif()
9+
10+
include(CheckTypeSize)
11+
include(CheckFunctionExists)
12+
include(CheckIncludeFile)
13+
include(CheckCSourceCompiles)
14+
enable_testing()
15+
16+
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
17+
check_include_file(stdint.h HAVE_STDINT_H)
18+
check_include_file(stddef.h HAVE_STDDEF_H)
19+
20+
#
21+
# Check to see if we have large file support
22+
#
23+
set(CMAKE_REQUIRED_DEFINITIONS -D_LARGEFILE64_SOURCE)
24+
25+
# We add these other definitions here because CheckTypeSize.cmake
26+
# in CMake 2.4.x does not automatically do so and we want
27+
# compatibility with CMake 2.4.x.
28+
if(HAVE_SYS_TYPES_H)
29+
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_SYS_TYPES_H)
30+
endif()
31+
if(HAVE_STDINT_H)
32+
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDINT_H)
33+
endif()
34+
if(HAVE_STDDEF_H)
35+
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DHAVE_STDDEF_H)
36+
endif()
37+
38+
check_type_size(off64_t OFF64_T)
39+
40+
if(HAVE_OFF64_T)
41+
add_definitions(-D_LARGEFILE64_SOURCE)
42+
endif()
43+
set(CMAKE_REQUIRED_DEFINITIONS) # clear variable
44+
45+
#
46+
# Check for fseeko
47+
#
48+
check_function_exists(fseeko HAVE_FSEEKO)
49+
if(NOT HAVE_FSEEKO)
50+
add_definitions(-DNO_FSEEKO)
51+
endif()
52+
53+
#
54+
# Check for unistd.h
55+
#
56+
check_include_file(unistd.h HAVE_UNISTD_H)
57+
58+
#
59+
# Check for errno.h
60+
check_include_file(errno.h HAVE_ERRNO_H)
61+
if(NOT HAVE_ERRNO_H)
62+
add_definitions(-DNO_ERRNO_H)
63+
endif()
64+
65+
#
66+
# Check for mmap support
67+
#
68+
set(mmap_test_code "
69+
#include <sys/types.h>
70+
#include <sys/mman.h>
71+
#include <sys/stat.h>
72+
caddr_t hello() {
73+
return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
74+
}
75+
int main() { return 0; }
76+
")
77+
check_c_source_compiles("${mmap_test_code}" USE_MMAP)
78+
if(USE_MMAP)
79+
add_definitions(-DUSE_MMAP)
80+
endif()
81+
82+
#
83+
# Create the zlibdefs.h file.
84+
# Note: we create it in CMAKE_CURRENT_SOURCE_DIR instead
85+
# of CMAKE_CURRENT_BINARY_DIR because an empty zlibdefs.h
86+
# is shipped with zlib in the source tree.
87+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h.cmakein
88+
${CMAKE_CURRENT_SOURCE_DIR}/zlibdefs.h)
89+
90+
if(MSVC)
91+
set(CMAKE_DEBUG_POSTFIX "D")
92+
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
93+
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
94+
endif()
95+
96+
#============================================================================
97+
# zlib
98+
#============================================================================
99+
100+
set(ZLIB_PUBLIC_HDRS
101+
zconf.h
102+
zlib.h
103+
zlibdefs.h
104+
)
105+
set(ZLIB_PRIVATE_HDRS
106+
crc32.h
107+
deflate.h
108+
gzguts.h
109+
inffast.h
110+
inffixed.h
111+
inflate.h
112+
inftrees.h
113+
trees.h
114+
zutil.h
115+
)
116+
set(ZLIB_SRCS
117+
adler32.c
118+
compress.c
119+
crc32.c
120+
deflate.c
121+
gzclose.c
122+
gzio.c
123+
gzlib.c
124+
gzread.c
125+
gzwrite.c
126+
inflate.c
127+
infback.c
128+
inftrees.c
129+
inffast.c
130+
trees.c
131+
uncompr.c
132+
zutil.c
133+
)
134+
135+
add_library(zlib ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
136+
set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
137+
set_target_properties(zlib PROPERTIES VERSION 1.2.3.4)
138+
set_target_properties(zlib PROPERTIES SOVERSION 1)
139+
if(UNIX)
140+
# On unix like platforms the library is almost always called libz
141+
set_target_properties(zlib PROPERTIES OUTPUT_NAME z)
142+
endif()
143+
144+
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
145+
install(TARGETS zlib
146+
RUNTIME DESTINATION bin
147+
ARCHIVE DESTINATION lib
148+
LIBRARY DESTINATION lib )
149+
endif()
150+
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
151+
install(FILES ${ZLIB_PUBLIC_HDRS} DESTINATION include)
152+
endif()
153+
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
154+
install(FILES zlib.3 DESTINATION share/man/man3)
155+
endif()
156+
157+
#============================================================================
158+
# Example binaries
159+
#============================================================================
160+
161+
add_executable(example example.c)
162+
target_link_libraries(example zlib)
163+
add_test(example example)
164+
165+
add_executable(minigzip minigzip.c)
166+
target_link_libraries(minigzip zlib)
167+
168+
if(HAVE_OFF64_T)
169+
add_executable(example64 example.c)
170+
target_link_libraries(example64 zlib)
171+
set_target_properties(example64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
172+
add_test(example64 example64)
173+
174+
add_executable(minigzip64 minigzip.c)
175+
target_link_libraries(minigzip64 zlib)
176+
set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64")
177+
endif()

ChangeLog

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11

22
ChangeLog file for zlib
33

4+
Changes in 1.2.3.5 (8 Jan 2010)
5+
- Add space after #if in zutil.h for some compilers
6+
- Fix relatively harmless bug in deflate_fast() [Exarevsky]
7+
- Fix same problem in deflate_slow()
8+
- Add $(SHAREDLIBV) to LIBS in Makefile.in [Brown]
9+
- Add deflate_rle() for faster Z_RLE strategy run-length encoding
10+
- Add deflate_huff() for faster Z_HUFFMAN_ONLY encoding
11+
- Change name of "write" variable in inffast.c to avoid library collisions
12+
- Fix premature EOF from gzread() in gzio.c [Brown]
13+
- Use zlib header window size if windowBits is 0 in inflateInit2()
14+
- Remove compressBound() call in deflate.c to avoid linking compress.o
15+
- Replace use of errno in gz* with functions, support WinCE [Alves]
16+
- Provide alternative to perror() in minigzip.c for WinCE [Alves]
17+
- Don't use _vsnprintf on later versions of MSVC [Lowman]
18+
- Add CMake build script and input file [Lowman]
19+
- Update contrib/minizip to 1.1 [Svensson, Vollant]
20+
- Moved nintendods directory from contrib to .
21+
- Replace gzio.c with a new set of routines with the same functionality
22+
- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
23+
- Update contrib/minizip to 1.1b
24+
425
Changes in 1.2.3.4 (21 Dec 2009)
526
- Use old school .SUFFIXES in Makefile.in for FreeBSD compatibility
627
- Update comments in configure and Makefile.in for default --shared
@@ -25,7 +46,7 @@ Changes in 1.2.3.4 (21 Dec 2009)
2546
- Fix static and shared Makefile.in targets to be independent
2647
- Correct error return bug in gz_open() by setting state [Brown]
2748
- Put spaces before ;;'s in configure for better sh compatibility
28-
- Added pigz.c (parallel implementation of gzip) to examples/
49+
- Add pigz.c (parallel implementation of gzip) to examples/
2950
- Correct constant in crc32.c to UL [Leventhal]
3051
- Reject negative lengths in crc32_combine()
3152
- Add inflateReset2() function to work like inflateEnd()/inflateInit2()
@@ -57,7 +78,7 @@ Changes in 1.2.3.4 (21 Dec 2009)
5778
- Allow negative bits in inflatePrime() to delete existing bit buffer
5879
- Add Z_TREES flush option to inflate() to return at end of trees
5980
- Add inflateMark() to return current state information for random access
60-
- Added Makefile for NintendoDS to contrib [Costa]
81+
- Add Makefile for NintendoDS to contrib [Costa]
6182
- Add -w in configure compile tests to avoid spurious warnings [Beucler]
6283
- Fix typos in zlib.h comments for deflateSetDictionary()
6384
- Fix EOF detection in transparent gzread() [Maier]

INDEX

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CMakeLists.txt cmake build file
12
ChangeLog history of changes
23
FAQ Frequently Asked Questions about zlib
34
INDEX this file
@@ -6,7 +7,7 @@ Makefile.in makefile for Unix (template for configure)
67
README guess what
78
configure configure script for Unix
89
make_vms.com makefile for VMS
9-
treebuild.xml see http://treebuild.metux.de/
10+
treebuild.xml XML description of source file dependencies
1011
zlib.3 Man page for zlib
1112
zlib.map Linux symbol information
1213
zlib.pc.in Template for pkg-config descriptor
@@ -16,12 +17,14 @@ amiga/ makefiles for Amiga SAS C
1617
as400/ makefiles for IBM AS/400
1718
doc/ documentation for formats and algorithms
1819
msdos/ makefiles for MSDOS
20+
nintendods/ makefile for Nintendo DS
1921
old/ makefiles for various architectures and zlib documentation
2022
files that have not yet been updated for zlib 1.2.x
2123
projects/ projects for various Integrated Development Environments
2224
qnx/ makefiles for QNX
2325
watcom/ makefiles for OpenWatcom
2426
win32/ makefiles for Windows
27+
zlibdefs.h.cmakein input file for cmake build
2528

2629
zlib public header files (required for library use):
2730
zconf.h
@@ -35,7 +38,12 @@ crc32.c
3538
crc32.h
3639
deflate.c
3740
deflate.h
41+
gzclose.c
42+
gzguts.h
3843
gzio.c
44+
gzlib.c
45+
gzread.c
46+
gzwrite.c
3947
infback.c
4048
inffast.c
4149
inffast.h

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ CPP=$(CC) -E
3232

3333
STATICLIB=libz.a
3434
SHAREDLIB=libz.so
35-
SHAREDLIBV=libz.so.1.2.3.4
35+
SHAREDLIBV=libz.so.1.2.3.5
3636
SHAREDLIBM=libz.so.1
37-
LIBS=$(STATICLIB) $(SHAREDLIB)
37+
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
3838

3939
AR=ar rc
4040
RANLIB=ranlib
@@ -50,11 +50,11 @@ mandir = ${prefix}/share/man
5050
man3dir = ${mandir}/man3
5151
pkgconfigdir = ${libdir}/pkgconfig
5252

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

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

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

223223
adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
224+
gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h zlibdefs.h gzguts.h
224225
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h
225226
crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
226227
deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
@@ -230,6 +231,7 @@ inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
230231
trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
231232

232233
adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
234+
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h zlibdefs.h gzguts.h
233235
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h
234236
crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
235237
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h

Makefile.in

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ CPP=$(CC) -E
3232

3333
STATICLIB=libz.a
3434
SHAREDLIB=libz.so
35-
SHAREDLIBV=libz.so.1.2.3.4
35+
SHAREDLIBV=libz.so.1.2.3.5
3636
SHAREDLIBM=libz.so.1
37-
LIBS=$(STATICLIB) $(SHAREDLIB)
37+
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
3838

3939
AR=ar rc
4040
RANLIB=ranlib
@@ -50,11 +50,11 @@ mandir = ${prefix}/share/man
5050
man3dir = ${mandir}/man3
5151
pkgconfigdir = ${libdir}/pkgconfig
5252

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

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

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

223223
adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
224+
gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h zlibdefs.h gzguts.h
224225
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h
225226
crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
226227
deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
@@ -230,6 +231,7 @@ inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
230231
trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
231232

232233
adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
234+
gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h zlibdefs.h gzguts.h
233235
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h
234236
crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
235237
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h

README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ZLIB DATA COMPRESSION LIBRARY
22

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

36-
The changes made in version 1.2.3.4 are documented in the file ChangeLog.
36+
The changes made in version 1.2.3.5 are documented in the file ChangeLog.
3737

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

amiga/Makefile.pup

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ LDFLAGS = -o
1414
LDLIBS = LIB:scppc.a LIB:end.o
1515
RM = delete quiet
1616

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

2020
TEST_OBJS = example.o minigzip.o
2121

@@ -55,7 +55,11 @@ compress.o: zlib.h zconf.h
5555
crc32.o: crc32.h zlib.h zconf.h
5656
deflate.o: deflate.h zutil.h zlib.h zconf.h
5757
example.o: zlib.h zconf.h
58+
gzclose.o: zlib.h zconf.h gzguts.h
5859
gzio.o: zutil.h zlib.h zconf.h
60+
gzlib.o: zlib.h zconf.h gzguts.h
61+
gzread.o: zlib.h zconf.h gzguts.h
62+
gzwrite.o: zlib.h zconf.h gzguts.h
5963
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
6064
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
6165
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h

0 commit comments

Comments
 (0)