From b97ec631c6f7dd9cff2e3caf3b38e70b006e1b2d Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 9 Sep 2011 23:23:01 -0700 Subject: zlib 1.2.0.7 --- configure | 57 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 23 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 9999de8..e570a7a 100755 --- a/configure +++ b/configure @@ -20,8 +20,9 @@ LIBS=libz.a LDFLAGS="-L. ${LIBS}" -SHAREDLIB=libz.so VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` +VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` +VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h` AR=${AR-"ar rc"} RANLIB=${RANLIB-"ranlib"} prefix=${prefix-/usr/local} @@ -55,10 +56,6 @@ case "$1" in esac done -if [ $shared -eq 1 ]; then - LDFLAGS="-L. ${SHAREDLIB}" -fi - test=ztest$$ cat > $test.c </dev/null; then HP-UX*) LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"} shared_ext='.sl' SHAREDLIB='libz.sl';; + Darwin*) shared_ext='.dylib' + SHAREDLIB=libz$shared_ext + SHAREDLIBV=libz.$VER$shared_ext + SHAREDLIBM=libz.$VER1$shared_ext + LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name /usr/lib/$SHAREDLIBV -compatibility_version $VER2 -current_version $VER"} + libdir='/usr/lib' + includedir='/usr/include';; *) LDSHARED=${LDSHARED-"$cc -shared"};; esac else @@ -102,7 +106,7 @@ else LDSHARED=${LDSHARED-"cc -shared"};; OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"} CFLAGS=${CFLAGS-"-O -std1"} - LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};; + LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};; OSF1*) SFLAGS=${CFLAGS-"-O -std1"} CFLAGS=${CFLAGS-"-O -std1"} LDSHARED=${LDSHARED-"cc -shared"};; @@ -143,14 +147,18 @@ else esac fi +SHAREDLIB=${SHAREDLIB-"libz$shared_ext"} +SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"} +SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"} + if test $shared -eq 1; then echo Checking for shared library support... # we must test in two steps (cc then ld), required at least on SunOS 4.x if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then CFLAGS="$SFLAGS" - LIBS="$SHAREDLIB.$VER" - echo Building shared library $SHAREDLIB.$VER with $CC. + LIBS="$SHAREDLIBV" + echo Building shared library $SHAREDLIBV with $CC. elif test -z "$old_cc" -a -z "$old_cflags"; then echo No shared library support. shared=0; @@ -162,6 +170,8 @@ fi if test $shared -eq 0; then LDSHARED="$CC" echo Building static library $LIBS version $VER with $CC. +else + LDFLAGS="-L. ${SHAREDLIBV}" fi cat > $test.c < Makefile -- cgit v1.2.3-55-g6feb