Skip to content

Commit 9c4e58f

Browse files
committed
Import zlib 1.2.12 from https://zlib.net/zlib-1.2.12.tar.gz
1 parent 75277be commit 9c4e58f

Some content is hidden

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

86 files changed

+12197
-7854
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
33

44
project(zlib C)
55

6-
set(VERSION "1.2.11")
6+
set(VERSION "1.2.12")
77

88
option(ASM686 "Enable building i686 assembly implementation")
99
option(AMD64 "Enable building amd64 assembly implementation")

ChangeLog

Lines changed: 112 additions & 49 deletions
Large diffs are not rendered by default.

Makefile.in

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

3333
STATICLIB=libz.a
3434
SHAREDLIB=libz.so
35-
SHAREDLIBV=libz.so.1.2.11
35+
SHAREDLIBV=libz.so.1.2.12
3636
SHAREDLIBM=libz.so.1
3737
LIBS=$(STATICLIB) $(SHAREDLIBV)
3838

@@ -91,8 +91,8 @@ teststatic: static
9191
echo ' *** zlib test OK ***'; \
9292
else \
9393
echo ' *** zlib test FAILED ***'; false; \
94-
fi; \
95-
rm -f $$TMPST
94+
fi
95+
@rm -f tmpst_$$
9696

9797
testshared: shared
9898
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
@@ -104,17 +104,17 @@ testshared: shared
104104
echo ' *** zlib shared test OK ***'; \
105105
else \
106106
echo ' *** zlib shared test FAILED ***'; false; \
107-
fi; \
108-
rm -f $$TMPSH
107+
fi
108+
@rm -f tmpsh_$$
109109

110110
test64: all64
111111
@TMP64=tmp64_$$; \
112112
if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
113113
echo ' *** zlib 64-bit test OK ***'; \
114114
else \
115115
echo ' *** zlib 64-bit test FAILED ***'; false; \
116-
fi; \
117-
rm -f $$TMP64
116+
fi
117+
@rm -f tmp64_$$
118118

119119
infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
120120
$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
@@ -376,15 +376,13 @@ clean:
376376
rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
377377

378378
maintainer-clean: distclean
379-
distclean: clean zconf zconf.h.cmakein docs
379+
distclean: clean zconf zconf.h.cmakein
380380
rm -f Makefile zlib.pc configure.log
381381
-@rm -f .DS_Store
382382
@if [ -f Makefile.in ]; then \
383383
printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
384384
printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
385385
touch -r $(SRCDIR)Makefile.in Makefile ; fi
386-
@if [ ! -f zconf.h.in ]; then rm -f zconf.h zconf.h.cmakein ; fi
387-
@if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf ; fi
388386

389387
tags:
390388
etags $(SRCDIR)*.[ch]

README

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

3-
zlib 1.2.11 is a general purpose data compression library. All the code is
3+
zlib 1.2.12 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://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@@ -31,7 +31,7 @@ Mark Nelson <[email protected]> wrote an article about zlib for the Jan. 1997
3131
issue of Dr. Dobb's Journal; a copy of the article is available at
3232
http://marknelson.us/1997/01/01/zlib-engine/ .
3333

34-
The changes made in version 1.2.11 are documented in the file ChangeLog.
34+
The changes made in version 1.2.12 are documented in the file ChangeLog.
3535

3636
Unsupported third party contributions are provided in directory contrib/ .
3737

@@ -84,7 +84,7 @@ Acknowledgments:
8484

8585
Copyright notice:
8686

87-
(C) 1995-2017 Jean-loup Gailly and Mark Adler
87+
(C) 1995-2022 Jean-loup Gailly and Mark Adler
8888

8989
This software is provided 'as-is', without any express or implied
9090
warranty. In no event will the authors be held liable for any damages
@@ -108,7 +108,10 @@ Copyright notice:
108108
If you use the zlib library in a product, we would appreciate *not* receiving
109109
lengthy legal documents to sign. The sources are provided for free but without
110110
warranty of any kind. The library has been entirely written by Jean-loup
111-
Gailly and Mark Adler; it does not include third-party code.
111+
Gailly and Mark Adler; it does not include third-party code. We make all
112+
contributions to and distributions of this project solely in our personal
113+
capacity, and are not conveying any rights to any intellectual property of
114+
any third parties.
112115

113116
If you redistribute modified sources, we would appreciate that you include in
114117
the file ChangeLog history information documenting your changes. Please read

configure

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ build64=0
8787
gcc=0
8888
warn=0
8989
debug=0
90+
sanitize=0
9091
old_cc="$CC"
9192
old_cflags="$CFLAGS"
9293
OBJC='$(OBJZ) $(OBJG)'
@@ -137,6 +138,7 @@ case "$1" in
137138
-c* | --const) zconst=1; shift ;;
138139
-w* | --warn) warn=1; shift ;;
139140
-d* | --debug) debug=1; shift ;;
141+
--sanitize) sanitize=1; shift ;;
140142
*)
141143
echo "unknown option: $1" | tee -a configure.log
142144
echo "$0 --help for help" | tee -a configure.log
@@ -165,8 +167,14 @@ extern int getchar();
165167
int hello() {return getchar();}
166168
EOF
167169

168-
test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
169-
cc=${CC-${CROSS_PREFIX}gcc}
170+
if test -z "$CC"; then
171+
echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
172+
if ${CROSS_PREFIX}gcc -v >/dev/null 2>&1; then
173+
cc=${CROSS_PREFIX}gcc
174+
else
175+
cc=${CROSS_PREFIX}cc
176+
fi
177+
fi
170178
cflags=${CFLAGS-"-O3"}
171179
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
172180
case "$cc" in
@@ -199,6 +207,9 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
199207
CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
200208
fi
201209
fi
210+
if test $sanitize -eq 1; then
211+
CFLAGS="${CFLAGS} -fsanitize=address"
212+
fi
202213
if test $debug -eq 1; then
203214
CFLAGS="${CFLAGS} -DZLIB_DEBUG"
204215
SFLAGS="${SFLAGS} -DZLIB_DEBUG"
@@ -367,8 +378,11 @@ else
367378
try()
368379
{
369380
show $*
370-
( $* ) >> configure.log 2>&1
381+
got=`( $* ) 2>&1`
371382
ret=$?
383+
if test "$got" != ""; then
384+
printf "%s\n" "$got" >> configure.log
385+
fi
372386
if test $ret -ne 0; then
373387
echo "(exit code "$ret")" >> configure.log
374388
fi
@@ -381,8 +395,11 @@ tryboth()
381395
show $*
382396
got=`( $* ) 2>&1`
383397
ret=$?
384-
printf %s "$got" >> configure.log
398+
if test "$got" != ""; then
399+
printf "%s\n" "$got" >> configure.log
400+
fi
385401
if test $ret -ne 0; then
402+
echo "(exit code "$ret")" >> configure.log
386403
return $ret
387404
fi
388405
test "$got" = ""
@@ -457,17 +474,11 @@ size_t dummy = 0;
457474
EOF
458475
if try $CC -c $CFLAGS $test.c; then
459476
echo "Checking for size_t... Yes." | tee -a configure.log
460-
need_sizet=0
461477
else
462478
echo "Checking for size_t... No." | tee -a configure.log
463-
need_sizet=1
464-
fi
465-
466-
echo >> configure.log
467-
468-
# find the size_t integer type, if needed
469-
if test $need_sizet -eq 1; then
470-
cat > $test.c <<EOF
479+
# find a size_t integer type
480+
# check for long long
481+
cat > $test.c << EOF
471482
long long dummy = 0;
472483
EOF
473484
if try $CC -c $CFLAGS $test.c; then
@@ -495,17 +506,13 @@ EOF
495506
if try $CC $CFLAGS -o $test $test.c; then
496507
sizet=`./$test`
497508
echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
509+
CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
510+
SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
498511
else
499-
echo "Failed to find a pointer-size integer type." | tee -a configure.log
500-
leave 1
512+
echo "Checking for a pointer-size integer type... not found." | tee -a configure.log
501513
fi
502514
fi
503515

504-
if test $need_sizet -eq 1; then
505-
CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
506-
SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
507-
fi
508-
509516
echo >> configure.log
510517

511518
# check for large file support, and if none, check for fseeko()
@@ -849,7 +856,6 @@ echo SHAREDLIBV = $SHAREDLIBV >> configure.log
849856
echo STATICLIB = $STATICLIB >> configure.log
850857
echo TEST = $TEST >> configure.log
851858
echo VER = $VER >> configure.log
852-
echo Z_U4 = $Z_U4 >> configure.log
853859
echo SRCDIR = $SRCDIR >> configure.log
854860
echo exec_prefix = $exec_prefix >> configure.log
855861
echo includedir = $includedir >> configure.log

contrib/README.contrib

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ ada/ by Dmitriy Anisimkov <[email protected]>
88
Support for Ada
99
See http://zlib-ada.sourceforge.net/
1010

11-
amd64/ by Mikhail Teterin <[email protected]>
12-
asm code for AMD64
13-
See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393
14-
15-
asm686/ by Brian Raiter <[email protected]>
16-
asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
17-
See http://www.muppetlabs.com/~breadbox/software/assembly.html
18-
1911
blast/ by Mark Adler <[email protected]>
2012
Decompressor for output of PKWare Data Compression Library (DCL)
2113

@@ -32,9 +24,6 @@ gcc_gvmat64/by Gilles Vollant <[email protected]>
3224
infback9/ by Mark Adler <[email protected]>
3325
Unsupported diffs to infback to decode the deflate64 format
3426

35-
inflate86/ by Chris Anderson <[email protected]>
36-
Tuned x86 gcc asm code to replace inflate_fast()
37-
3827
iostream/ by Kevin Ruland <[email protected]>
3928
A C++ I/O streams interface to the zlib gz* functions
4029

@@ -45,16 +34,6 @@ iostream3/ by Ludwig Schwardt <[email protected]>
4534
and Kevin Ruland <[email protected]>
4635
Yet another C++ I/O streams interface
4736

48-
masmx64/ by Gilles Vollant <[email protected]>
49-
x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
50-
replace longest_match() and inflate_fast(), also masm x86
51-
64-bits translation of Chris Anderson inflate_fast()
52-
53-
masmx86/ by Gilles Vollant <[email protected]>
54-
x86 asm code to replace longest_match() and inflate_fast(),
55-
for Visual C++ and MASM (32 bits).
56-
Based on Brian Raiter (asm686) and Chris Anderson (inflate86)
57-
5837
minizip/ by Gilles Vollant <[email protected]>
5938
Mini zip and unzip based on zlib
6039
Includes Zip64 support by Mathias Svensson <[email protected]>

0 commit comments

Comments
 (0)