aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:23:01 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:23:01 -0700
commitb97ec631c6f7dd9cff2e3caf3b38e70b006e1b2d (patch)
tree2a9609068ca980db627bceb3f5a48638eaad1c13 /configure
parentf81ba93d4a7e43fccf4730e5e7404ee765a76e3e (diff)
downloadzlib-b97ec631c6f7dd9cff2e3caf3b38e70b006e1b2d.tar.gz
zlib-b97ec631c6f7dd9cff2e3caf3b38e70b006e1b2d.tar.bz2
zlib-b97ec631c6f7dd9cff2e3caf3b38e70b006e1b2d.zip
zlib 1.2.0.7v1.2.0.7
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure57
1 files changed, 34 insertions, 23 deletions
diff --git a/configure b/configure
index 9999de8..e570a7a 100755
--- a/configure
+++ b/configure
@@ -20,8 +20,9 @@
20 20
21LIBS=libz.a 21LIBS=libz.a
22LDFLAGS="-L. ${LIBS}" 22LDFLAGS="-L. ${LIBS}"
23SHAREDLIB=libz.so
24VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` 23VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
24VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
25VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
25AR=${AR-"ar rc"} 26AR=${AR-"ar rc"}
26RANLIB=${RANLIB-"ranlib"} 27RANLIB=${RANLIB-"ranlib"}
27prefix=${prefix-/usr/local} 28prefix=${prefix-/usr/local}
@@ -55,10 +56,6 @@ case "$1" in
55 esac 56 esac
56done 57done
57 58
58if [ $shared -eq 1 ]; then
59 LDFLAGS="-L. ${SHAREDLIB}"
60fi
61
62test=ztest$$ 59test=ztest$$
63cat > $test.c <<EOF 60cat > $test.c <<EOF
64extern int getchar(); 61extern int getchar();
@@ -85,6 +82,13 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
85 HP-UX*) LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"} 82 HP-UX*) LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
86 shared_ext='.sl' 83 shared_ext='.sl'
87 SHAREDLIB='libz.sl';; 84 SHAREDLIB='libz.sl';;
85 Darwin*) shared_ext='.dylib'
86 SHAREDLIB=libz$shared_ext
87 SHAREDLIBV=libz.$VER$shared_ext
88 SHAREDLIBM=libz.$VER1$shared_ext
89 LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name /usr/lib/$SHAREDLIBV -compatibility_version $VER2 -current_version $VER"}
90 libdir='/usr/lib'
91 includedir='/usr/include';;
88 *) LDSHARED=${LDSHARED-"$cc -shared"};; 92 *) LDSHARED=${LDSHARED-"$cc -shared"};;
89 esac 93 esac
90else 94else
@@ -102,7 +106,7 @@ else
102 LDSHARED=${LDSHARED-"cc -shared"};; 106 LDSHARED=${LDSHARED-"cc -shared"};;
103 OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"} 107 OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
104 CFLAGS=${CFLAGS-"-O -std1"} 108 CFLAGS=${CFLAGS-"-O -std1"}
105 LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};; 109 LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
106 OSF1*) SFLAGS=${CFLAGS-"-O -std1"} 110 OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
107 CFLAGS=${CFLAGS-"-O -std1"} 111 CFLAGS=${CFLAGS-"-O -std1"}
108 LDSHARED=${LDSHARED-"cc -shared"};; 112 LDSHARED=${LDSHARED-"cc -shared"};;
@@ -143,14 +147,18 @@ else
143 esac 147 esac
144fi 148fi
145 149
150SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
151SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
152SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
153
146if test $shared -eq 1; then 154if test $shared -eq 1; then
147 echo Checking for shared library support... 155 echo Checking for shared library support...
148 # we must test in two steps (cc then ld), required at least on SunOS 4.x 156 # we must test in two steps (cc then ld), required at least on SunOS 4.x
149 if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && 157 if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" &&
150 test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then 158 test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then
151 CFLAGS="$SFLAGS" 159 CFLAGS="$SFLAGS"
152 LIBS="$SHAREDLIB.$VER" 160 LIBS="$SHAREDLIBV"
153 echo Building shared library $SHAREDLIB.$VER with $CC. 161 echo Building shared library $SHAREDLIBV with $CC.
154 elif test -z "$old_cc" -a -z "$old_cflags"; then 162 elif test -z "$old_cc" -a -z "$old_cflags"; then
155 echo No shared library support. 163 echo No shared library support.
156 shared=0; 164 shared=0;
@@ -162,6 +170,8 @@ fi
162if test $shared -eq 0; then 170if test $shared -eq 0; then
163 LDSHARED="$CC" 171 LDSHARED="$CC"
164 echo Building static library $LIBS version $VER with $CC. 172 echo Building static library $LIBS version $VER with $CC.
173else
174 LDFLAGS="-L. ${SHAREDLIBV}"
165fi 175fi
166 176
167cat > $test.c <<EOF 177cat > $test.c <<EOF
@@ -422,19 +432,20 @@ rm -f $test.[co] $test$shared_ext
422 432
423# udpate Makefile 433# udpate Makefile
424sed < Makefile.in " 434sed < Makefile.in "
425/^CC *=/s%=.*%=$CC% 435/^CC *=/s#=.*#=$CC#
426/^CFLAGS *=/s%=.*%=$CFLAGS% 436/^CFLAGS *=/s#=.*#=$CFLAGS#
427/^CPP *=/s%=.*%=$CPP% 437/^CPP *=/s#=.*#=$CPP#
428/^LDSHARED *=/s%=.*%=$LDSHARED% 438/^LDSHARED *=/s#=.*#=$LDSHARED#
429/^LIBS *=/s%=.*%=$LIBS% 439/^LIBS *=/s#=.*#=$LIBS#
430/^SHAREDLIB *=/s%=.*%=$SHAREDLIB% 440/^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
431/^AR *=/s%=.*%=$AR% 441/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
432/^RANLIB *=/s%=.*%=$RANLIB% 442/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
433/^VER *=/s%=.*%=$VER% 443/^AR *=/s#=.*#=$AR#
434/^prefix *=/s%=.*%=$prefix% 444/^RANLIB *=/s#=.*#=$RANLIB#
435/^exec_prefix *=/s%=.*%=$exec_prefix% 445/^prefix *=/s#=.*#=$prefix#
436/^libdir *=/s%=.*%=$libdir% 446/^exec_prefix *=/s#=.*#=$exec_prefix#
437/^includedir *=/s%=.*%=$includedir% 447/^libdir *=/s#=.*#=$libdir#
438/^mandir *=/s%=.*%=$mandir% 448/^includedir *=/s#=.*#=$includedir#
439/^LDFLAGS *=/s%=.*%=$LDFLAGS% 449/^mandir *=/s#=.*#=$mandir#
450/^LDFLAGS *=/s#=.*#=$LDFLAGS#
440" > Makefile 451" > Makefile