aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-10-07 01:57:07 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-10-07 02:11:56 -0700
commitf442c1e89e99ae5a0068a2d32e7284c2623f09fd (patch)
tree1bc659f486af707673c36916c4d75ef7f517dece /configure
parent518ad0177ae2f1aaefc49285b3536a6bd8d9973c (diff)
downloadzlib-f442c1e89e99ae5a0068a2d32e7284c2623f09fd.tar.gz
zlib-f442c1e89e99ae5a0068a2d32e7284c2623f09fd.tar.bz2
zlib-f442c1e89e99ae5a0068a2d32e7284c2623f09fd.zip
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-xconfigure16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure b/configure
index 1838846..672b24f 100755
--- a/configure
+++ b/configure
@@ -54,11 +54,14 @@ includedir=${includedir-'${prefix}/include'}
54mandir=${mandir-'${prefix}/share/man'} 54mandir=${mandir-'${prefix}/share/man'}
55shared_ext='.so' 55shared_ext='.so'
56shared=1 56shared=1
57solo=0
57zprefix=0 58zprefix=0
58build64=0 59build64=0
59gcc=0 60gcc=0
60old_cc="$CC" 61old_cc="$CC"
61old_cflags="$CFLAGS" 62old_cflags="$CFLAGS"
63OBJC='$(OBJZ) $(OBJG)'
64PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
62 65
63while test $# -ge 1 66while test $# -ge 1
64do 67do
@@ -81,6 +84,7 @@ case "$1" in
81 -i* | --includedir) includedir="$2"; shift; shift ;; 84 -i* | --includedir) includedir="$2"; shift; shift ;;
82 -s* | --shared | --enable-shared) shared=1; shift ;; 85 -s* | --shared | --enable-shared) shared=1; shift ;;
83 -t | --static) shared=0; shift ;; 86 -t | --static) shared=0; shift ;;
87 --solo) solo=1; shift ;;
84 -z* | --zprefix) zprefix=1; shift ;; 88 -z* | --zprefix) zprefix=1; shift ;;
85 -6* | --64) build64=1; shift ;; 89 -6* | --64) build64=1; shift ;;
86 -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;; 90 -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
@@ -331,6 +335,16 @@ if test $zprefix -eq 1; then
331 echo "Using z_ prefix on all symbols." 335 echo "Using z_ prefix on all symbols."
332fi 336fi
333 337
338if test $solo -eq 1; then
339 sed '/#define ZCONF_H/a\
340#define Z_SOLO
341
342' < zconf.h > zconf.temp.h
343 mv zconf.temp.h zconf.h
344OBJC='$(OBJZ)'
345PIC_OBJC='$(PIC_OBJZ)'
346fi
347
334cat > $test.c <<EOF 348cat > $test.c <<EOF
335#include <stdio.h> 349#include <stdio.h>
336#include <stdarg.h> 350#include <stdarg.h>
@@ -589,6 +603,8 @@ sed < Makefile.in "
589/^sharedlibdir *=/s#=.*#=$sharedlibdir# 603/^sharedlibdir *=/s#=.*#=$sharedlibdir#
590/^includedir *=/s#=.*#=$includedir# 604/^includedir *=/s#=.*#=$includedir#
591/^mandir *=/s#=.*#=$mandir# 605/^mandir *=/s#=.*#=$mandir#
606/^OBJC *=/s#=.*#= $OBJC#
607/^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
592/^all: */s#:.*#: $ALL# 608/^all: */s#:.*#: $ALL#
593/^test: */s#:.*#: $TEST# 609/^test: */s#:.*#: $TEST#
594" > Makefile 610" > Makefile