diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-10-07 01:57:07 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-10-07 02:11:56 -0700 |
commit | f442c1e89e99ae5a0068a2d32e7284c2623f09fd (patch) | |
tree | 1bc659f486af707673c36916c4d75ef7f517dece /configure | |
parent | 518ad0177ae2f1aaefc49285b3536a6bd8d9973c (diff) | |
download | zlib-f442c1e89e99ae5a0068a2d32e7284c2623f09fd.tar.gz |
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.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -54,11 +54,14 @@ includedir=${includedir-'${prefix}/include'} mandir=${mandir-'${prefix}/share/man'} shared_ext='.so' shared=1 +solo=0 zprefix=0 build64=0 gcc=0 old_cc="$CC" old_cflags="$CFLAGS" +OBJC='$(OBJZ) $(OBJG)' +PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)' while test $# -ge 1 do @@ -81,6 +84,7 @@ case "$1" in -i* | --includedir) includedir="$2"; shift; shift ;; -s* | --shared | --enable-shared) shared=1; shift ;; -t | --static) shared=0; shift ;; + --solo) solo=1; shift ;; -z* | --zprefix) zprefix=1; shift ;; -6* | --64) build64=1; shift ;; -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;; @@ -331,6 +335,16 @@ if test $zprefix -eq 1; then echo "Using z_ prefix on all symbols." fi +if test $solo -eq 1; then + sed '/#define ZCONF_H/a\ +#define Z_SOLO + +' < zconf.h > zconf.temp.h + mv zconf.temp.h zconf.h +OBJC='$(OBJZ)' +PIC_OBJC='$(PIC_OBJZ)' +fi + cat > $test.c <<EOF #include <stdio.h> #include <stdarg.h> @@ -589,6 +603,8 @@ sed < Makefile.in " /^sharedlibdir *=/s#=.*#=$sharedlibdir# /^includedir *=/s#=.*#=$includedir# /^mandir *=/s#=.*#=$mandir# +/^OBJC *=/s#=.*#= $OBJC# +/^PIC_OBJC *=/s#=.*#= $PIC_OBJC# /^all: */s#:.*#: $ALL# /^test: */s#:.*#: $TEST# " > Makefile |