diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2014-03-26 11:27:48 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2014-03-26 11:42:11 +0000 |
commit | 46335e7dd8889952f2b39b962f3f8d7b2cd9759a (patch) | |
tree | 7640d329bc7d6192f109ed6920a2482eb9495e6d | |
parent | db3aed6856d7a23186844fdf93105cad2fcf2f2f (diff) | |
download | zlib-46335e7dd8889952f2b39b962f3f8d7b2cd9759a.tar.gz |
Revert "Make configure test exit code rather than output"
This reverts commit 5b718b5db4f848e68761adad23c4919b5076fa0a.
While I'm still of the opinion the configure script should be using true
and false instead of 1 and 0; the distcc issue is fixed upstream.
It turns out the reason they check the output is that they have to
support some badly behaved C compilers that don't use the return code to
indicate failure to compile.
Upstream now has a check and if it is well behaved it uses the return
code, which would fix the issue we had with distcc, if we were still
using it.
-rwxr-xr-x | configure | 74 |
1 files changed, 37 insertions, 37 deletions
@@ -53,10 +53,10 @@ sharedlibdir=${sharedlibdir-'${libdir}'} includedir=${includedir-'${prefix}/include'} mandir=${mandir-'${prefix}/share/man'} shared_ext='.so' -shared=true -zprefix=false -build64=false -gcc=false +shared=1 +zprefix=0 +build64=0 +gcc=0 old_cc="$CC" old_cflags="$CFLAGS" @@ -79,10 +79,10 @@ case "$1" in -e* | --eprefix) exec_prefix="$2"; shift; shift ;; -l* | --libdir) libdir="$2"; shift; shift ;; -i* | --includedir) includedir="$2"; shift; shift ;; - -s* | --shared | --enable-shared) shared=true; shift ;; - -t | --static) shared=false; shift ;; - -z* | --zprefix) zprefix=true; shift ;; - -6* | --64) build64=true; shift ;; + -s* | --shared | --enable-shared) shared=1; shift ;; + -t | --static) shared=0; shift ;; + -z* | --zprefix) zprefix=1; shift ;; + -6* | --64) build64=1; shift ;; --sysconfdir=*) echo "ignored option: --sysconfdir"; shift ;; --localstatedir=*) echo "ignored option: --localstatedir"; shift ;; *) echo "unknown option: $1"; echo "$0 --help for help"; exit 1 ;; @@ -100,14 +100,14 @@ cc=${CC-${CROSS_PREFIX}gcc} cflags=${CFLAGS-"-O3"} # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure case "$cc" in - *gcc*) gcc=true ;; + *gcc*) gcc=1 ;; esac -if $gcc && ($cc -c $cflags $test.c) 2>/dev/null; then +if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then CC="$cc" SFLAGS="${CFLAGS--O3} -fPIC" CFLAGS="${CFLAGS--O3}" - if $build64; then + if test $build64 -eq 1; then CFLAGS="${CFLAGS} -m64" SFLAGS="${SFLAGS} -m64" fi @@ -152,7 +152,7 @@ if $gcc && ($cc -c $cflags $test.c) 2>/dev/null; then else # find system name and corresponding cc options CC=${CC-cc} - gcc=false + gcc=0 if test -z "$uname"; then uname=`(uname -sr || echo unknown) 2>/dev/null` fi @@ -229,28 +229,25 @@ SHAREDLIB=${SHAREDLIB-"libz$shared_ext"} SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"} SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"} -if $shared; then +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 ($CC -w -c $SFLAGS $test.c) 2>&1 >/dev/null && - ($LDSHARED $SFLAGS -o $test$shared_ext $test.o) 2>&1 >/dev/null; then + if test "`($CC -w -c $SFLAGS $test.c) 2>&1`" = "" && + test "`($LDSHARED $SFLAGS -o $test$shared_ext $test.o) 2>&1`" = ""; then echo Building shared library $SHAREDLIBV with $CC. elif test -z "$old_cc" -a -z "$old_cflags"; then echo No shared library support. - shared=false; + shared=0; else echo Tested $CC -w -c $SFLAGS $test.c $CC -w -c $SFLAGS $test.c echo Tested $LDSHARED $SFLAGS -o $test$shared_ext $test.o $LDSHARED $SFLAGS -o $test$shared_ext $test.o echo 'No shared library support; try without defining CC and CFLAGS' - shared=false; + shared=0; fi fi -if $shared; then - ALL="static shared" - TEST="all teststatic testshared" -else +if test $shared -eq 0; then LDSHARED="$CC" ALL="static" TEST="all teststatic" @@ -258,13 +255,16 @@ else SHAREDLIBV="" SHAREDLIBM="" echo Building static library $STATICLIB version $VER with $CC. +else + ALL="static shared" + TEST="all teststatic testshared" fi cat > $test.c <<EOF #include <sys/types.h> off64_t dummy = 0; EOF -if ($CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c) 2>&1 >/dev/null; then +if test "`($CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c) 2>&1`" = ""; then CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1" SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1" ALL="${ALL} all64" @@ -280,7 +280,7 @@ int main(void) { return 0; } EOF - if ($CC $CFLAGS -o $test $test.c) 2>&1 >/dev/null; then + if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then echo "Checking for fseeko... Yes." else CFLAGS="${CFLAGS} -DNO_FSEEKO" @@ -295,7 +295,7 @@ cat > $test.c <<EOF #include <unistd.h> int main() { return 0; } EOF -if ($CC -c $CFLAGS $test.c) 2>&1 >/dev/null; then +if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; 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." @@ -303,7 +303,7 @@ else echo "Checking for unistd.h... No." fi -if $zprefix; then +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 "Using z_ prefix on all symbols." @@ -324,7 +324,7 @@ int main() } EOF -if ($CC -c $CFLAGS $test.c) 2>&1 >/dev/null; then +if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." cat > $test.c <<EOF @@ -348,7 +348,7 @@ int main() } EOF - if ($CC $CFLAGS -o $test $test.c) 2>&1 >/dev/null; then + if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then echo "Checking for vsnprintf() in stdio.h... Yes." cat >$test.c <<EOF @@ -373,7 +373,7 @@ int main() } EOF - if ($CC -c $CFLAGS $test.c) 2>&1 >/dev/null; then + if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then echo "Checking for return value of vsnprintf()... Yes." else CFLAGS="$CFLAGS -DHAS_vsnprintf_void" @@ -413,7 +413,7 @@ int main() } EOF - if ($CC -c $CFLAGS $test.c) 2>&1 >/dev/null; then + if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then echo "Checking for return value of vsprintf()... Yes." else CFLAGS="$CFLAGS -DHAS_vsprintf_void" @@ -444,7 +444,7 @@ int main() } EOF - if ($CC $CFLAGS -o $test $test.c) 2>&1 >/dev/null; then + if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then echo "Checking for snprintf() in stdio.h... Yes." cat >$test.c <<EOF @@ -463,7 +463,7 @@ int main() } EOF - if ($CC -c $CFLAGS $test.c) 2>&1 >/dev/null; then + if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then echo "Checking for return value of snprintf()... Yes." else CFLAGS="$CFLAGS -DHAS_snprintf_void" @@ -497,7 +497,7 @@ int main() } EOF - if ($CC -c $CFLAGS $test.c) 2>&1 >/dev/null; then + if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then echo "Checking for return value of sprintf()... Yes." else CFLAGS="$CFLAGS -DHAS_sprintf_void" @@ -510,7 +510,7 @@ EOF fi fi -if $gcc; then +if test "$gcc" -eq 1; then cat > $test.c <<EOF #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) @@ -523,7 +523,7 @@ int main() return 0; } EOF - if ($CC -c $CFLAGS $test.c) 2>&1 >/dev/null; then + if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then echo "Checking for attribute(visibility) support... Yes." else CFLAGS="$CFLAGS -DNO_VIZ" @@ -535,11 +535,11 @@ fi CPP=${CPP-"$CC -E"} case $CFLAGS in *ASMV*) - if $NM $test.o | grep _hello 2>&1 >/dev/null; then - echo Checking for underline in external names... Yes. - else + if test "`$NM $test.o | grep _hello`" = ""; then CPP="$CPP -DNO_UNDERLINE" echo Checking for underline in external names... No. + else + echo Checking for underline in external names... Yes. fi ;; esac |