Commit Graph

68 Commits

Author SHA1 Message Date
Mark Adler
be5e3647c4 Add address checking in clang to -w option of configure. 2017-02-18 23:07:01 -08:00
Mark Adler
cca27e95cf Avoid the need for ssize_t.
Limit read() and write() requests to sizes that fit in an int.
This allows storing the return value in an int, and avoiding the
need to use or construct an ssize_t type. This is required for
Microsoft C, whose _read and _write functions take an unsigned
request and return an int.
2016-12-31 10:06:40 -08:00
Mark Adler
f12d3dc367 Detect clang in cc version. 2016-12-30 20:00:57 -08:00
Mark Adler
3f8c768745 Fix compile option for when z_size_t needs to be a long long. 2016-12-04 17:19:36 -08:00
Mark Adler
ca50ebd4df Create z_size_t and z_ssize_t types.
Normally these are set to size_t and ssize_t. But if they do not
exist, then they are set to the smallest integer type that can
contain a pointer. size_t is unsigned and ssize_t is signed.
2016-12-04 07:48:48 -08:00
Mark Adler
fc130cdd9f Add --debug (-d) option to ./configure to define ZLIB_DEBUG. 2016-12-04 07:39:37 -08:00
Mark Adler
8b95fa19cd Add --warn option to ./configure, instead of environment variable. 2016-10-11 22:21:04 -07:00
Mark Adler
55d98b4c30 Allow building zlib outside of the source directory.
To build, simply run configure from the source directory by
specifying its path.  That path will be used to find the source
files.  The source directory will not be touched.  All new and
modified files will be made in the current directory.  Discovered
in the process that not all makes understand % or $<, and not all
compilers understand -include or -I-.  This required a larger
Makefile.in with explicit dependencies.
2015-08-02 21:35:50 -07:00
Mark Adler
03ff48cc67 Remove runtime check in configure for four-byte integer type.
That didn't work when cross-compiling.  Simply rely on limits.h.
If a compiler does not have limits.h, then zconf.h.in should be
modified to define Z_U4 as an unsiged four-byte integer type in
order for crc32() to be fast.

This also simplifies and makes more portable to check for a four-
byte type using limits.h.
2013-03-23 22:30:09 -07:00
Mark Adler
66fcefbb2f Fix configure for Sun shell. 2013-03-23 13:50:10 -07:00
Mark Adler
62d6112a79 Clean up the usage of z_const and respect const usage within zlib.
This patch allows zlib to compile cleanly with the -Wcast-qual gcc
warning enabled, but only if ZLIB_CONST is defined, which adds
const to next_in and msg in z_stream and in the in_func prototype.
A --const option is added to ./configure which adds -DZLIB_CONST
to the compile flags, and adds -Wcast-qual to the compile flags
when ZLIBGCCWARN is set in the environment.
2012-08-13 00:02:40 -07:00
Mark Adler
bfac156463 Fix configure check for veracity of compiler error return codes.
There were two problems before that this fixes.  One was that the
check for the compiler error return code preceded the determination
of the compiler and its options.  The other was that the checks
for compiler and library characteristics could be fooled if the
error options were set to reject K&R-style C.  configure now aborts
if the compiler produces a hard error on K&R-style C.

In addition, aborts of configure are now consistent, and remove
any temporary files.
2012-06-09 23:17:07 -07:00
Mark Adler
977e108047 Delete "--version" file if created by "ar --version" [Richard G.]. 2012-06-09 22:59:54 -07:00
Mark Adler
148b8f630c Cleaner check for whether libtool is Apple or not on Darwin. 2012-06-09 22:59:53 -07:00
Mark Adler
a72bcd5607 On Darwin, only use /usr/bin/libtool if libtool is not Apple.
The original change was to always use /usr/bin/libtool on Darwin,
in order to avoid using a GNU libtool installed by the user in the
path ahead of Apple's libtool.  However someone might install a
more recent Apple libtool ahead of /usr/bin/libtool.  This commit
checks to see if libtool is Apple, and uses /usr/bin/libtool if it
isn't.
2012-06-09 19:15:36 -07:00
Mark Adler
dee3d4ae36 Force the native libtool in Mac OS X to avoid GNU libtool [Beebe]. 2012-05-01 21:17:08 -07:00
Mark Adler
dbcdbf8c41 Fix location of executable for finding a four-byte integer. 2012-04-29 19:20:05 -07:00
Mark Adler
6c9bd474aa Fix type mismatch between get_crc_table() and crc_table.
crc_table is made using a four-byte integer (when that can be
determined).  However get_crc_table() returned a pointer to an
unsigned long, which could be eight bytes.  This fixes that by
creating a new z_crc_t type for the crc_table.

This type is also used for the BYFOUR crc calculations that depend
on a four-byte type.  The four-byte type can now be determined by
./configure, which also solves a problem where ./configure --solo
would never use BYFOUR.  No the Z_U4 #define indicates that four-
byte integer was found either by ./configure or by zconf.h.
2012-04-29 16:18:12 -07:00
Mark Adler
cc538ebf79 Remove -R. from Solaris shared build (possible security issue). 2012-04-22 18:41:11 -07:00
Mark Adler
6635b78987 Update ./configure for Solaris, support --64 [Mooney]. 2012-04-22 18:27:41 -07:00
Mark Adler
3fb77ac08b Add more comments to configure. 2012-04-01 08:49:00 -07:00
Mark Adler
a3881cc745 Recognize clang as gcc. 2012-03-14 23:14:13 -07:00
Mark Adler
dab7531ecc Simplify test and use of gcc hidden attribute. 2012-03-03 00:20:00 -08:00
Mark Adler
3f4339b61b Improve the detection of no hidden visibility attribute. 2012-02-19 23:33:10 -08:00
Mark Adler
6838df9246 Test for existence of strerror.
SunOS 4.1 claims that it is __STDC__, but it does not have strerror
in string.h.  Instead of using __STDC__, this puts a direct test
for strerror in configure, and uses that information in gzguts.h.
2012-02-18 13:55:09 -08:00
Mark Adler
2dadd2fab4 Use name in GCC_CLASSIC as C compiler for coverage testing, if set.
Apple removed support for gcov in the default gcc compiler chain,
when they moved to llvm.  This can be circumvented in XCode 4.2 by
using the gcc chain with gcc-4.2.  This patch allows setting
GCC_CLASSIC to the name of a real gcc executable (e.g. "gcc-4.2")
to allow coverage testing.
2012-02-04 10:00:48 -08:00
Mark Adler
5461db945c Use the -m option on ldconfig for BSD systems [Tobias]. 2012-01-29 09:48:11 -08:00
Mark Adler
520561c577 Add the generation of configure.log by ./configure. 2012-01-28 14:48:50 -08:00
Mark Adler
2d55657c03 Have ./configure use the compiler return code for error indication.
Previously ./configure would use any output on stderr as an indication
that the compilation failed.  However if some compiler wrapper uses
stderr for some other purpose, e.g. distcc for nodes going down, then
./configure would not properly configure the build.  This problem was
noted by Mike Frysinger.  For backwards compatibility, ./configure
will revert to the old way, i.e. checking for anything on stderr, if
when it deliberately runs the compiler with an error, a zero exit
status is returned.
2012-01-16 16:44:40 -08:00
Mark Adler
d169dd7300 Split off AR options in Makefile.in and configure.
Adds ARFLAGS variable for options, where AR is now just the command
name.  So now $(AR) $(ARFLAGS) is used to build the static library.
2011-11-13 13:04:26 -08:00
Mark Adler
d66a307941 Add --cover option to ./configure for gcc coverage testing.
This adds the -fprofile-arcs and -ftest-coverage options when compiling
the source code for the static library.  Those same options must then be
used when linking the static library into an executable.  This updates
Makefile.in to remove and .gitignore to ignore the files generated when
testing coverage.
2011-10-09 10:25:15 -07:00
Mark Adler
f442c1e89e Add a ./config --solo option to make zlib subset with no libary use
A common request has been the ability to compile zlib to require no
other libraries.  This --solo option provides that ability.  The price
is that the gz*, compress*, and uncompress functions are eliminated,
and that the user must provide memory allocation and free routines to
deflate and inflate when initializing.
2011-10-07 02:11:56 -07:00
Mark Adler
10daf0d4d7 zlib 1.2.5.1 2011-09-11 11:04:49 -07:00
Mark Adler
9712272c78 zlib 1.2.5 2011-09-09 23:35:10 -07:00
Mark Adler
7301420248 zlib 1.2.4.5 2011-09-09 23:34:55 -07:00
Mark Adler
a7d70663cf zlib 1.2.4.4 2011-09-09 23:34:45 -07:00
Mark Adler
f4498bea28 zlib 1.2.4.3 2011-09-09 23:34:38 -07:00
Mark Adler
7147f24cd7 zlib 1.2.4.2 2011-09-09 23:34:30 -07:00
Mark Adler
05d47d2627 zlib 1.2.4.1 2011-09-09 23:34:22 -07:00
Mark Adler
59ca2179ff zlib 1.2.4-pre2 2011-09-09 23:33:23 -07:00
Mark Adler
67cc20d004 zlib 1.2.4-pre1 2011-09-09 23:32:36 -07:00
Mark Adler
7751bd4c71 zlib 1.2.3.9 2011-09-09 23:27:26 -07:00
Mark Adler
e0ff940e1a zlib 1.2.3.8 2011-09-09 23:27:17 -07:00
Mark Adler
7df877eccd zlib 1.2.3.7 2011-09-09 23:27:08 -07:00
Mark Adler
dc5a43ebfa zlib 1.2.3.6 2011-09-09 23:26:58 -07:00
Mark Adler
f6194ef39a zlib 1.2.3.4 2011-09-09 23:26:40 -07:00
Mark Adler
639be99788 zlib 1.2.3.3 2011-09-09 23:26:29 -07:00
Mark Adler
d6231142d2 zlib 1.2.3.2 2011-09-09 23:25:38 -07:00
Mark Adler
b1c19ca6d8 zlib 1.2.3.1 2011-09-09 23:25:27 -07:00
Mark Adler
9c3a583021 zlib 1.2.2.4 2011-09-09 23:24:52 -07:00