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.
This commit is contained in:
Mark Adler
2011-10-07 01:57:07 -07:00
parent 518ad0177a
commit f442c1e89e
13 changed files with 537 additions and 195 deletions

View File

@@ -85,7 +85,11 @@ uLong ZEXPORT zlibCompileFlags()
#ifdef FASTEST
flags += 1L << 21;
#endif
#ifdef Z_SOLO
return flags;
#else
return flags + gzflags();
#endif
}
#ifdef DEBUG
@@ -157,6 +161,7 @@ void ZLIB_INTERNAL zmemzero(dest, len)
}
#endif
#ifndef Z_SOLO
#ifdef SYS16BIT
@@ -292,3 +297,5 @@ void ZLIB_INTERNAL zcfree (opaque, ptr)
}
#endif /* MY_ZCALLOC */
#endif /* !Z_SOLO */