>From 871eca2ee3da0d7a6a35460757954a1d9444e4e8 Mon Sep 17 00:00:00 2001 From: Enrico Weigelt, metux IT service Date: Sun, 28 Mar 2010 16:45:58 +0200 Subject: [PATCH] configure: fixed compile tests The current tests compiles assume a compiler failure when it gives some output - thats obviously wrong. This patch fixes this be checking the compiler's exitcode. See: http://bugs.gentoo.org/55434 --- configure | 42 +++++++++++++++++++++++++++++------------- 1 files changed, 29 insertions(+), 13 deletions(-) diff --git a/configure b/configure index bd9edd2..e87ee3a 100755 --- a/configure +++ b/configure @@ -229,11 +229,14 @@ SHAREDLIB=${SHAREDLIB-"libz$shared_ext"} SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"} SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"} +## +## Check for shared libraries +## 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 -w -c $SFLAGS $test.c) 2>&1`" = "" && - test "`($LDSHARED $SFLAGS -o $test$shared_ext $test.o) 2>&1`" = ""; then + if $CC -w -c $SFLAGS $test.c && + $LDSHARED $SFLAGS -o $test$shared_ext $test.o ; then echo Building shared library $SHAREDLIBV with $CC. elif test -z "$old_cc" -a -z "$old_cflags"; then echo No shared library support. @@ -260,11 +263,14 @@ else TEST="all teststatic testshared" fi +## +## Check for off64_t and fseeko() +## cat > $test.c < off64_t dummy = 0; EOF -if test "`($CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c) 2>&1`" = ""; then +if $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c ; then CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1" SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1" ALL="${ALL} all64" @@ -280,7 +286,7 @@ int main(void) { return 0; } EOF - if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then + if $CC $CFLAGS -o $test $test.c ; then echo "Checking for fseeko... Yes." else CFLAGS="${CFLAGS} -DNO_FSEEKO" @@ -289,13 +295,17 @@ EOF fi fi + cp -p zconf.h.in zconf.h +## +## Check for +## cat > $test.c < int main() { return 0; } EOF -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then +if $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." @@ -303,12 +313,18 @@ else echo "Checking for unistd.h... No." 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 "Using z_ prefix on all symbols." fi + +## +## Check for vs[n]printf() or s[n]printf() +## + cat > $test.c < #include @@ -324,7 +340,7 @@ int main() } EOF -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then +if $CC -c $CFLAGS $test.c ; then echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." cat > $test.c <&1`" = ""; then + if $CC $CFLAGS -o $test $test.c ; then echo "Checking for vsnprintf() in stdio.h... Yes." cat >$test.c <&1`" = ""; then + if $CC -c $CFLAGS $test.c ; then echo "Checking for return value of vsnprintf()... Yes." else CFLAGS="$CFLAGS -DHAS_vsnprintf_void" @@ -413,7 +429,7 @@ int main() } EOF - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then + if $CC -c $CFLAGS $test.c ; then echo "Checking for return value of vsprintf()... Yes." else CFLAGS="$CFLAGS -DHAS_vsprintf_void" @@ -444,7 +460,7 @@ int main() } EOF - if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then + if $CC $CFLAGS -o $test $test.c ; then echo "Checking for snprintf() in stdio.h... Yes." cat >$test.c <&1`" = ""; then + if $CC -c $CFLAGS $test.c ; then echo "Checking for return value of snprintf()... Yes." else CFLAGS="$CFLAGS -DHAS_snprintf_void" @@ -497,7 +513,7 @@ int main() } EOF - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then + if $CC -c $CFLAGS $test.c ; then echo "Checking for return value of sprintf()... Yes." else CFLAGS="$CFLAGS -DHAS_sprintf_void" @@ -523,7 +539,7 @@ int main() return 0; } EOF - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then + if ($CC -c $CFLAGS $test.c) 2>/dev/null; then echo "Checking for attribute(visibility) support... Yes." else CFLAGS="$CFLAGS -DNO_VIZ" -- 1.7.1