[Zlib-devel] [PATCH] configure: use exit status rather than stderr with compiler tests
Mike Frysinger
vapier at gentoo.org
Mon Jan 16 15:26:37 EST 2012
If people build with compiler wrappers that happen to spew to stderr,
then most of the zlib configure tests will fail to detect the right
values and completely mess up the build. An example would be the
distcc compiler suite and a transient node goes down -- distcc would
issue debug info to stderr about timeouts/retrying on a diff node.
Instead, ignore stderr and just key off the exit status.
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
configure | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/configure b/configure
index 5a5a488..552b6f4 100755
--- a/configure
+++ b/configure
@@ -249,8 +249,8 @@ 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 -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) 2>/dev/null &&
+ ($LDSHARED $SFLAGS -o $test$shared_ext $test.o) 2>/dev/null; then
echo Building shared library $SHAREDLIBV with $CC.
elif test -z "$old_cc" -a -z "$old_cflags"; then
echo No shared library support.
@@ -281,7 +281,7 @@ cat > $test.c <<EOF
#include <sys/types.h>
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) 2>/dev/null; then
CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
ALL="${ALL} all64"
@@ -297,7 +297,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) 2>/dev/null; then
echo "Checking for fseeko... Yes."
else
CFLAGS="${CFLAGS} -DNO_FSEEKO"
@@ -312,7 +312,7 @@ cat > $test.c <<EOF
#include <unistd.h>
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
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."
@@ -324,7 +324,7 @@ cat > $test.c <<EOF
#include <stdarg.h>
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
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."
@@ -367,7 +367,7 @@ int main()
}
EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()."
cat > $test.c <<EOF
@@ -390,7 +390,7 @@ int main()
return (mytest("Hello%d\n", 1));
}
EOF
- if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
+ if ($CC $CFLAGS -o $test $test.c) 2>/dev/null; then
echo "Checking for vsnprintf() in stdio.h... Yes."
cat >$test.c <<EOF
@@ -415,7 +415,7 @@ int main()
}
EOF
- if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
echo "Checking for return value of vsnprintf()... Yes."
else
CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
@@ -455,7 +455,7 @@ int main()
}
EOF
- if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
echo "Checking for return value of vsprintf()... Yes."
else
CFLAGS="$CFLAGS -DHAS_vsprintf_void"
@@ -486,7 +486,7 @@ int main()
}
EOF
- if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
+ if ($CC $CFLAGS -o $test $test.c) 2>/dev/null; then
echo "Checking for snprintf() in stdio.h... Yes."
cat >$test.c <<EOF
@@ -505,7 +505,7 @@ int main()
}
EOF
- if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
echo "Checking for return value of snprintf()... Yes."
else
CFLAGS="$CFLAGS -DHAS_snprintf_void"
@@ -539,7 +539,7 @@ int main()
}
EOF
- if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+ if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
echo "Checking for return value of sprintf()... Yes."
else
CFLAGS="$CFLAGS -DHAS_sprintf_void"
@@ -565,7 +565,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.8.3
More information about the Zlib-devel
mailing list