--- configure.orig	2005-07-11 22:11:57.000000000 +0200
+++ configure	2009-04-20 12:21:24.000000000 +0200
@@ -73,7 +73,7 @@
 
 if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
   CC="$cc"
-  SFLAGS=${CFLAGS-"-fPIC -O3"}
+  SFLAGS="${cflags} -fPIC"
   CFLAGS="$cflags"
   case `(uname -s || echo unknown) 2>/dev/null` in
   Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};;
@@ -171,8 +171,8 @@
 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
+  if ($CC -c $SFLAGS $test.c) 2>>config.log &&
+     ($LDSHARED -o $test$shared_ext $test.o) 2>>config.log; then
     CFLAGS="$SFLAGS"
     LIBS="$SHAREDLIBV"
     echo Building shared library $SHAREDLIBV with $CC.
@@ -195,7 +195,7 @@
 #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>>config.log; then
   sed < zconf.in.h "/HAVE_UNISTD_H/s%0%1%" > zconf.h
   echo "Checking for unistd.h... Yes."
 else
@@ -218,7 +218,7 @@
 }
 EOF
 
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+if ($CC -c $CFLAGS $test.c) 2>>config.log; then
   echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()"
 
   cat > $test.c <<EOF
@@ -242,7 +242,7 @@
 }
 EOF
 
-  if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
+  if ($CC $CFLAGS -o $test $test.c) 2>>config.log; then
     echo "Checking for vsnprintf() in stdio.h... Yes."
 
     cat >$test.c <<EOF
@@ -267,7 +267,7 @@
 }
 EOF
 
-    if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+    if ($CC -c $CFLAGS $test.c) 2>>config.log; then
       echo "Checking for return value of vsnprintf()... Yes."
     else
       CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
@@ -305,7 +305,7 @@
 }
 EOF
 
-    if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+    if ($CC -c $CFLAGS $test.c) 2>>config.log; then
       echo "Checking for return value of vsprintf()... Yes."
     else
       CFLAGS="$CFLAGS -DHAS_vsprintf_void"
@@ -335,7 +335,7 @@
 }
 EOF
 
-  if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
+  if ($CC $CFLAGS -o $test $test.c) 2>>config.log; then
     echo "Checking for snprintf() in stdio.h... Yes."
 
     cat >$test.c <<EOF
@@ -354,7 +354,7 @@
 }
 EOF
 
-    if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+    if ($CC -c $CFLAGS $test.c) 2>>config.log; then
       echo "Checking for return value of snprintf()... Yes."
     else
       CFLAGS="$CFLAGS -DHAS_snprintf_void"
@@ -386,7 +386,7 @@
 }
 EOF
 
-    if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+    if ($CC -c $CFLAGS $test.c) 2>>config.log; then
       echo "Checking for return value of sprintf()... Yes."
     else
       CFLAGS="$CFLAGS -DHAS_sprintf_void"
@@ -402,7 +402,7 @@
 #include <errno.h>
 int main() { return 0; }
 EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+if ($CC -c $CFLAGS $test.c) 2>>config.log; then
   echo "Checking for errno.h... Yes."
 else
   echo "Checking for errno.h... No."
@@ -417,7 +417,7 @@
   return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0);
 }
 EOF
-if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
+if ($CC -c $CFLAGS $test.c) 2>>config.log; then
   CFLAGS="$CFLAGS -DUSE_MMAP"
   echo Checking for mmap support... Yes.
 else
