blob: 9ef56b010d3091aa31fb292d424a997420e0e209 [file] [log] [blame]
diff -aruN a/configure b/configure
--- a/configure 2012-01-29 09:48:11.000000000 -0800
+++ b/configure 2012-02-08 12:53:27.214832230 -0800
@@ -13,9 +13,15 @@
# If you have problems, try without defining CC and CFLAGS before reporting
# an error.
-echo -------------------- >> configure.log
-echo $0 $* >> configure.log
-date >> configure.log
+confdir=`dirname "$0"`
+srcdir=$confdir
+builddir=`pwd`
+
+LOG="$builddir/configure.log"
+
+echo -------------------- >> ${LOG}
+echo $0 $* >> ${LOG}
+date >> ${LOG}
if [ -n "${CHOST}" ]; then
uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
@@ -23,27 +29,27 @@
fi
STATICLIB=libz.a
-VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
-VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\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`
+VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < $srcdir/zlib.h`
+VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < $srcdir/zlib.h`
+VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < $srcdir/zlib.h`
+VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < $srcdir/zlib.h`
if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
AR=${AR-"${CROSS_PREFIX}ar"}
- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
+ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a ${LOG}
else
AR=${AR-"ar"}
- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
+ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a ${LOG}
fi
ARFLAGS=${ARFLAGS-"rc"}
if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
- test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
+ test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a ${LOG}
else
RANLIB=${RANLIB-"ranlib"}
fi
if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
NM=${NM-"${CROSS_PREFIX}nm"}
- test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
+ test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a ${LOG}
else
NM=${NM-"nm"}
fi
@@ -72,10 +78,10 @@
do
case "$1" in
-h* | --help)
- echo 'usage:' | tee -a configure.log
- echo ' configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log
- echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
- echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
+ echo 'usage:' | tee -a ${LOG}
+ echo ' configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a ${LOG}
+ echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a ${LOG}
+ echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a ${LOG}
exit 0 ;;
-p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
-e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
@@ -94,9 +100,9 @@
-z* | --zprefix) zprefix=1; shift ;;
-6* | --64) build64=1; shift ;;
-a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
- --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
- --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
- *) echo "unknown option: $1"; echo "$0 --help for help" | tee -a configure.log; exit 1 ;;
+ --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a ${LOG}; shift ;;
+ --localstatedir=*) echo "ignored option: --localstatedir" | tee -a ${LOG}; shift ;;
+ *) echo "unknown option: $1"; echo "$0 --help for help" | tee -a ${LOG}; exit 1 ;;
esac
done
@@ -106,11 +112,11 @@
{
case "$*" in
*$test.c*)
- echo === $test.c === >> configure.log
- cat $test.c >> configure.log
- echo === >> configure.log;;
+ echo === $test.c === >> ${LOG}
+ cat $test.c >> ${LOG}
+ echo === >> ${LOG};;
esac
- echo $* >> configure.log
+ echo $* >> ${LOG}
}
cat > $test.c <<EOF
@@ -120,30 +126,30 @@
try()
{
show $*
- test "`( $* ) 2>&1 | tee -a configure.log`" = ""
+ test "`( $* ) 2>&1 | tee -a ${LOG}`" = ""
}
- echo - using any output from compiler to indicate an error >> configure.log
+ echo - using any output from compiler to indicate an error >> ${LOG}
else
try()
{
show $*
- ( $* ) >> configure.log 2>&1
+ ( $* ) >> ${LOG} 2>&1
ret=$?
if test $ret -ne 0; then
- echo "(exit code "$ret")" >> configure.log
+ echo "(exit code "$ret")" >> ${LOG}
fi
return $ret
}
fi
-echo >> configure.log
+echo >> ${LOG}
cat > $test.c <<EOF
extern int getchar();
int hello() {return getchar();}
EOF
-test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
+test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a ${LOG}
cc=${CC-${CROSS_PREFIX}gcc}
cflags=${CFLAGS-"-O3"}
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
@@ -155,8 +161,8 @@
esac
show $cc -c $cflags $test.c
-if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) >> configure.log 2>&1; then
- echo ... using gcc >> configure.log
+if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) >> ${LOG} 2>&1; then
+ echo ... using gcc >> ${LOG}
CC="$cc"
CFLAGS="${CFLAGS--O3} ${ARCHS}"
SFLAGS="${CFLAGS--O3} -fPIC"
@@ -173,16 +179,16 @@
fi
case "$uname" in
Linux* | linux* | GNU | GNU/* | solaris*)
- LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,$srcdir/zlib.map"} ;;
*BSD | *bsd* | DragonFly)
- LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
+ LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,$srcdir/zlib.map"}
LDCONFIG="ldconfig -m" ;;
CYGWIN* | Cygwin* | cygwin* | OS/2*)
EXE='.exe' ;;
MINGW* | mingw*)
# temporary bypass
rm -f $test.[co] $test $test$shared_ext
- echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
+ echo "Please use win32/Makefile.gcc instead." | tee -a ${LOG}
exit 1
LDSHARED=${LDSHARED-"$cc -shared"}
LDSHAREDLIBC=""
@@ -214,7 +220,7 @@
# find system name and corresponding cc options
CC=${CC-cc}
gcc=0
- echo ... using $CC >> configure.log
+ echo ... using $CC >> ${LOG}
if test -z "$uname"; then
uname=`(uname -sr || echo unknown) 2>/dev/null`
fi
@@ -293,19 +299,19 @@
SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
-echo >> configure.log
+echo >> ${LOG}
if test $shared -eq 1; then
- echo Checking for shared library support... | tee -a configure.log
+ echo Checking for shared library support... | tee -a ${LOG}
# we must test in two steps (cc then ld), required at least on SunOS 4.x
if try $CC -w -c $SFLAGS $test.c &&
try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
- echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
+ echo Building shared library $SHAREDLIBV with $CC. | tee -a ${LOG}
elif test -z "$old_cc" -a -z "$old_cflags"; then
- echo No shared library support. | tee -a configure.log
+ echo No shared library support. | tee -a ${LOG}
shared=0;
else
- echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
+ echo 'No shared library support; try without defining CC and CFLAGS' | tee -a ${LOG}
shared=0;
fi
fi
@@ -316,7 +322,7 @@
SHAREDLIB=""
SHAREDLIBV=""
SHAREDLIBM=""
- echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
+ echo Building static library $STATICLIB version $VER with $CC. | tee -a ${LOG}
else
ALL="static shared"
TEST="all teststatic testshared"
@@ -325,17 +331,17 @@
CPP=${CPP-"$CC -E"}
case $CFLAGS in
*ASMV*)
- echo >> configure.log
+ echo >> ${LOG}
show "$NM $test.o | grep _hello"
- if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then
+ if test "`$NM $test.o | grep _hello | tee -a ${LOG}`" = ""; then
CPP="$CPP -DNO_UNDERLINE"
- echo Checking for underline in external names... No. | tee -a configure.log
+ echo Checking for underline in external names... No. | tee -a ${LOG}
else
- echo Checking for underline in external names... Yes. | tee -a configure.log
+ echo Checking for underline in external names... Yes. | tee -a ${LOG}
fi ;;
esac
-echo >> configure.log
+echo >> ${LOG}
cat > $test.c <<EOF
#include <sys/types.h>
@@ -346,11 +352,11 @@
SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
ALL="${ALL} all64"
TEST="${TEST} test64"
- echo "Checking for off64_t... Yes." | tee -a configure.log
- echo "Checking for fseeko... Yes." | tee -a configure.log
+ echo "Checking for off64_t... Yes." | tee -a ${LOG}
+ echo "Checking for fseeko... Yes." | tee -a ${LOG}
else
- echo "Checking for off64_t... No." | tee -a configure.log
- echo >> configure.log
+ echo "Checking for off64_t... No." | tee -a ${LOG}
+ echo >> ${LOG}
cat > $test.c <<EOF
#include <stdio.h>
int main(void) {
@@ -359,17 +365,17 @@
}
EOF
if try $CC $CFLAGS -o $test $test.c; then
- echo "Checking for fseeko... Yes." | tee -a configure.log
+ echo "Checking for fseeko... Yes." | tee -a ${LOG}
else
CFLAGS="${CFLAGS} -DNO_FSEEKO"
SFLAGS="${SFLAGS} -DNO_FSEEKO"
- echo "Checking for fseeko... No." | tee -a configure.log
+ echo "Checking for fseeko... No." | tee -a ${LOG}
fi
fi
-cp -p zconf.h.in zconf.h
+cp -p $srcdir/zconf.h.in zconf.h
-echo >> configure.log
+echo >> ${LOG}
cat > $test.c <<EOF
#include <unistd.h>
@@ -378,12 +384,12 @@
if try $CC -c $CFLAGS $test.c; then
sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
- echo "Checking for unistd.h... Yes." | tee -a configure.log
+ echo "Checking for unistd.h... Yes." | tee -a ${LOG}
else
- echo "Checking for unistd.h... No." | tee -a configure.log
+ echo "Checking for unistd.h... No." | tee -a ${LOG}
fi
-echo >> configure.log
+echo >> ${LOG}
cat > $test.c <<EOF
#include <stdarg.h>
@@ -392,16 +398,16 @@
if try $CC -c $CFLAGS $test.c; then
sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
- echo "Checking for stdarg.h... Yes." | tee -a configure.log
+ echo "Checking for stdarg.h... Yes." | tee -a ${LOG}
else
- echo "Checking for stdarg.h... No." | tee -a configure.log
+ echo "Checking for stdarg.h... No." | tee -a ${LOG}
fi
if test $zprefix -eq 1; then
sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
mv zconf.temp.h zconf.h
- echo >> configure.log
- echo "Using z_ prefix on all symbols." | tee -a configure.log
+ echo >> ${LOG}
+ echo "Using z_ prefix on all symbols." | tee -a ${LOG}
fi
if test $solo -eq 1; then
@@ -418,7 +424,7 @@
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
fi
-echo >> configure.log
+echo >> ${LOG}
cat > $test.c <<EOF
#include <stdio.h>
@@ -434,9 +440,9 @@
EOF
if try $CC -c $CFLAGS $test.c; then
- echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
+ echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a ${LOG}
- echo >> configure.log
+ echo >> ${LOG}
cat > $test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
@@ -455,9 +461,9 @@
}
EOF
if try $CC $CFLAGS -o $test $test.c; then
- echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
+ echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a ${LOG}
- echo >> configure.log
+ echo >> ${LOG}
cat >$test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
@@ -478,24 +484,24 @@
EOF
if try $CC -c $CFLAGS $test.c; then
- echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
+ echo "Checking for return value of vsnprintf()... Yes." | tee -a ${LOG}
else
CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
- echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
- echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
- echo " can build but will be open to possible string-format security" | tee -a configure.log
- echo " vulnerabilities." | tee -a configure.log
+ echo "Checking for return value of vsnprintf()... No." | tee -a ${LOG}
+ echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a ${LOG}
+ echo " can build but will be open to possible string-format security" | tee -a ${LOG}
+ echo " vulnerabilities." | tee -a ${LOG}
fi
else
CFLAGS="$CFLAGS -DNO_vsnprintf"
SFLAGS="$SFLAGS -DNO_vsnprintf"
- echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
- echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
- echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
- echo " vulnerabilities." | tee -a configure.log
+ echo "Checking for vsnprintf() in stdio.h... No." | tee -a ${LOG}
+ echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a ${LOG}
+ echo " can build but will be open to possible buffer-overflow security" | tee -a ${LOG}
+ echo " vulnerabilities." | tee -a ${LOG}
- echo >> configure.log
+ echo >> ${LOG}
cat >$test.c <<EOF
#include <stdio.h>
#include <stdarg.h>
@@ -516,20 +522,20 @@
EOF
if try $CC -c $CFLAGS $test.c; then
- echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
+ echo "Checking for return value of vsprintf()... Yes." | tee -a ${LOG}
else
CFLAGS="$CFLAGS -DHAS_vsprintf_void"
SFLAGS="$SFLAGS -DHAS_vsprintf_void"
- echo "Checking for return value of vsprintf()... No." | tee -a configure.log
- echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
- echo " can build but will be open to possible string-format security" | tee -a configure.log
- echo " vulnerabilities." | tee -a configure.log
+ echo "Checking for return value of vsprintf()... No." | tee -a ${LOG}
+ echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a ${LOG}
+ echo " can build but will be open to possible string-format security" | tee -a ${LOG}
+ echo " vulnerabilities." | tee -a ${LOG}
fi
fi
else
- echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
+ echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a ${LOG}
- echo >> configure.log
+ echo >> ${LOG}
cat >$test.c <<EOF
#include <stdio.h>
int mytest()
@@ -545,9 +551,9 @@
EOF
if try $CC $CFLAGS -o $test $test.c; then
- echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
+ echo "Checking for snprintf() in stdio.h... Yes." | tee -a ${LOG}
- echo >> configure.log
+ echo >> ${LOG}
cat >$test.c <<EOF
#include <stdio.h>
int mytest()
@@ -562,24 +568,24 @@
EOF
if try $CC -c $CFLAGS $test.c; then
- echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
+ echo "Checking for return value of snprintf()... Yes." | tee -a ${LOG}
else
CFLAGS="$CFLAGS -DHAS_snprintf_void"
SFLAGS="$SFLAGS -DHAS_snprintf_void"
- echo "Checking for return value of snprintf()... No." | tee -a configure.log
- echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
- echo " can build but will be open to possible string-format security" | tee -a configure.log
- echo " vulnerabilities." | tee -a configure.log
+ echo "Checking for return value of snprintf()... No." | tee -a ${LOG}
+ echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a ${LOG}
+ echo " can build but will be open to possible string-format security" | tee -a ${LOG}
+ echo " vulnerabilities." | tee -a ${LOG}
fi
else
CFLAGS="$CFLAGS -DNO_snprintf"
SFLAGS="$SFLAGS -DNO_snprintf"
- echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
- echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
- echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
- echo " vulnerabilities." | tee -a configure.log
+ echo "Checking for snprintf() in stdio.h... No." | tee -a ${LOG}
+ echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a ${LOG}
+ echo " can build but will be open to possible buffer-overflow security" | tee -a ${LOG}
+ echo " vulnerabilities." | tee -a ${LOG}
- echo >> configure.log
+ echo >> ${LOG}
cat >$test.c <<EOF
#include <stdio.h>
int mytest()
@@ -594,20 +600,20 @@
EOF
if try $CC -c $CFLAGS $test.c; then
- echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
+ echo "Checking for return value of sprintf()... Yes." | tee -a ${LOG}
else
CFLAGS="$CFLAGS -DHAS_sprintf_void"
SFLAGS="$SFLAGS -DHAS_sprintf_void"
- echo "Checking for return value of sprintf()... No." | tee -a configure.log
- echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
- echo " can build but will be open to possible string-format security" | tee -a configure.log
- echo " vulnerabilities." | tee -a configure.log
+ echo "Checking for return value of sprintf()... No." | tee -a ${LOG}
+ echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a ${LOG}
+ echo " can build but will be open to possible string-format security" | tee -a ${LOG}
+ echo " vulnerabilities." | tee -a ${LOG}
fi
fi
fi
if test "$gcc" -eq 1; then
- echo >> configure.log
+ echo >> ${LOG}
cat > $test.c <<EOF
#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33)
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
@@ -621,52 +627,52 @@
}
EOF
if try $CC -c $CFLAGS $test.c; then
- echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
+ echo "Checking for attribute(visibility) support... Yes." | tee -a ${LOG}
else
CFLAGS="$CFLAGS -DNO_VIZ"
SFLAGS="$SFLAGS -DNO_VIZ"
- echo "Checking for attribute(visibility) support... No." | tee -a configure.log
+ echo "Checking for attribute(visibility) support... No." | tee -a ${LOG}
fi
fi
rm -f $test.[co] $test $test$shared_ext $test.gcno
# show the results in the log
-echo >> configure.log
-echo ALL = $ALL >> configure.log
-echo AR = $AR >> configure.log
-echo ARFLAGS = $ARFLAGS >> configure.log
-echo CC = $CC >> configure.log
-echo CFLAGS = $CFLAGS >> configure.log
-echo CPP = $CPP >> configure.log
-echo EXE = $EXE >> configure.log
-echo LDCONFIG = $LDCONFIG >> configure.log
-echo LDFLAGS = $LDFLAGS >> configure.log
-echo LDSHARED = $LDSHARED >> configure.log
-echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
-echo OBJC = $OBJC >> configure.log
-echo PIC_OBJC = $PIC_OBJC >> configure.log
-echo RANLIB = $RANLIB >> configure.log
-echo SFLAGS = $SFLAGS >> configure.log
-echo SHAREDLIB = $SHAREDLIB >> configure.log
-echo SHAREDLIBM = $SHAREDLIBM >> configure.log
-echo SHAREDLIBV = $SHAREDLIBV >> configure.log
-echo STATICLIB = $STATICLIB >> configure.log
-echo TEST = $TEST >> configure.log
-echo VER = $VER >> configure.log
-echo exec_prefix = $exec_prefix >> configure.log
-echo includedir = $includedir >> configure.log
-echo libdir = $libdir >> configure.log
-echo mandir = $mandir >> configure.log
-echo prefix = $prefix >> configure.log
-echo sharedlibdir = $sharedlibdir >> configure.log
-echo uname = $uname >> configure.log
-echo -------------------- >> configure.log
-echo >> configure.log
-echo >> configure.log
+echo >> ${LOG}
+echo ALL = $ALL >> ${LOG}
+echo AR = $AR >> ${LOG}
+echo ARFLAGS = $ARFLAGS >> ${LOG}
+echo CC = $CC >> ${LOG}
+echo CFLAGS = $CFLAGS >> ${LOG}
+echo CPP = $CPP >> ${LOG}
+echo EXE = $EXE >> ${LOG}
+echo LDCONFIG = $LDCONFIG >> ${LOG}
+echo LDFLAGS = $LDFLAGS >> ${LOG}
+echo LDSHARED = $LDSHARED >> ${LOG}
+echo LDSHAREDLIBC = $LDSHAREDLIBC >> ${LOG}
+echo OBJC = $OBJC >> ${LOG}
+echo PIC_OBJC = $PIC_OBJC >> ${LOG}
+echo RANLIB = $RANLIB >> ${LOG}
+echo SFLAGS = $SFLAGS >> ${LOG}
+echo SHAREDLIB = $SHAREDLIB >> ${LOG}
+echo SHAREDLIBM = $SHAREDLIBM >> ${LOG}
+echo SHAREDLIBV = $SHAREDLIBV >> ${LOG}
+echo STATICLIB = $STATICLIB >> ${LOG}
+echo TEST = $TEST >> ${LOG}
+echo VER = $VER >> ${LOG}
+echo exec_prefix = $exec_prefix >> ${LOG}
+echo includedir = $includedir >> ${LOG}
+echo libdir = $libdir >> ${LOG}
+echo mandir = $mandir >> ${LOG}
+echo prefix = $prefix >> ${LOG}
+echo sharedlibdir = $sharedlibdir >> ${LOG}
+echo uname = $uname >> ${LOG}
+echo -------------------- >> ${LOG}
+echo >> ${LOG}
+echo >> ${LOG}
# udpate Makefile
-sed < Makefile.in "
+sed < $srcdir/Makefile.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
/^SFLAGS *=/s#=.*#=$SFLAGS#
@@ -693,9 +699,11 @@
/^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
/^all: */s#:.*#: $ALL#
/^test: */s#:.*#: $TEST#
+/^builddir *=/s#=.*#=$builddir#
+/^srcdir *=/s#=.*#=$srcdir#
" > Makefile
-sed < zlib.pc.in "
+sed < $srcdir/zlib.pc.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
/^CPP *=/s#=.*#=$CPP#
@@ -715,6 +723,8 @@
/^includedir *=/s#=.*#=$includedir#
/^mandir *=/s#=.*#=$mandir#
/^LDFLAGS *=/s#=.*#=$LDFLAGS#
+/^builddir *=/s#=.*#=$builddir#
+/^srcdir *=/s#=.*#=$srcdir#
" | sed -e "
s/\@VERSION\@/$VER/g;
" > zlib.pc
diff -aruN a/Makefile.in b/Makefile.in
--- a/Makefile.in 2012-01-28 14:48:50.000000000 -0800
+++ b/Makefile.in 2012-02-08 12:53:35.695989833 -0800
@@ -45,6 +45,8 @@
SHELL=/bin/sh
EXE=
+builddir = .
+srcdir = .
prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
@@ -55,6 +57,8 @@
pkgconfigdir = ${libdir}/pkgconfig
tempfile := $(shell mktemp -u __XXXXXX)
+VPATH = ${srcdir}
+
OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
OBJC = $(OBJZ) $(OBJG)
@@ -111,8 +115,8 @@
fi
-@rm -f foo.gz
-infcover.o: test/infcover.c zlib.h zconf.h
- $(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c
+infcover.o: test/infcover.c $(srcdir)/zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -I$(srcdir) -c -o $@ test/infcover.c
infcover: infcover.o libz.a
$(CC) $(CFLAGS) -o $@ infcover.o libz.a
@@ -138,17 +142,17 @@
mv _match.o match.lo
rm -f _match.s
-example.o: test/example.c zlib.h zconf.h
- $(CC) $(CFLAGS) -I. -c -o $@ test/example.c
+example.o: $(srcdir)/test/example.c $(srcdir)/zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -I$(srcdir) -c -o $@ $(srcdir)/test/example.c
-minigzip.o: test/minigzip.c zlib.h zconf.h
- $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c
+minigzip.o: $(srcdir)/test/minigzip.c $(srcdir)/zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -I$(srcdir) -c -o $@ $(srcdir)/test/minigzip.c
-example64.o: test/example.c zlib.h zconf.h
- $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c
+example64.o: $(srcdir)/test/example.c $(srcdir)/zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -I$(srcdir) -D_FILE_OFFSET_BITS=64 -c -o $@ $(srcdir)/test/example.c
-minigzip64.o: test/minigzip.c zlib.h zconf.h
- $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c
+minigzip64.o: test/minigzip.c $(srcdir)/zlib.h zconf.h
+ $(CC) $(CFLAGS) -I. -I$(srcdir) -D_FILE_OFFSET_BITS=64 -c -o $@ $(srcdir)/test/minigzip.c
.SUFFIXES: .lo
@@ -201,7 +205,7 @@
ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
($(LDCONFIG) || true) >/dev/null 2>&1; \
fi
- cp zlib.3 $(DESTDIR)$(man3dir)
+ cp $(srcdir)/zlib.3 $(DESTDIR)$(man3dir)
chmod 644 $(DESTDIR)$(man3dir)/zlib.3
cp zlib.pc $(DESTDIR)$(pkgconfigdir)
chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
@@ -210,7 +214,7 @@
install: install-libs
-@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
- cp zlib.h zconf.h $(DESTDIR)$(includedir)
+ cp $(srcdir)/zlib.h zconf.h $(DESTDIR)$(includedir)
chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
uninstall:
@@ -227,14 +231,14 @@
zlib.3.pdf: zlib.3
groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf
-zconf.h.cmakein: zconf.h.in
+zconf.h.cmakein: $(srcdir)/zconf.h.in
-@echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" > $(tempfile)
- -@sed -f $(tempfile) zconf.h.in > zconf.h.cmakein
- -@touch -r zconf.h.in zconf.h.cmakein
+ -@sed -f $(tempfile) $< > $@
+ -@touch -r $< $@
-@rm $(tempfile)
-zconf: zconf.h.in
- cp -p zconf.h.in zconf.h
+zconf: $(srcdir)/zconf.h.in
+ cp -p $< zconf.h
mostlyclean: clean
clean: