--- /dev/null
+--- configure.in.org 2008-05-01 12:40:58.000000000 +0200
++++ configure.in 2008-05-01 12:39:39.000000000 +0200
+@@ -998,7 +999,7 @@
+ # so we need to run a program to see whether it really made the
+ # function available.
+ AC_MSG_CHECKING(whether $CC accepts -pthread)
+-AC_CACHE_VAL(ac_cv_thread,
++AC_CACHE_VAL(ac_cv_pthread,
+ [ac_save_cc="$CC"
+ CC="$CC -pthread"
+ AC_TRY_RUN([
+@@ -1023,11 +1024,11 @@
+
+ # If we have set a CC compiler flag for thread support then
+ # check if it works for CXX, too.
+-ac_cv_cxx_thread=no
+ if test ! -z "$CXX"
+ then
+ AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
+-ac_save_cxx="$CXX"
++AC_CACHE_VAL(ac_cv_cxx_thread,
++[ac_save_cxx="$CXX"
+
+ if test "$ac_cv_kpthread" = "yes"
+ then
+@@ -1056,9 +1057,11 @@
+ fi
+ rm -fr conftest*
+ fi
++CXX="$ac_save_cxx"])
+ AC_MSG_RESULT($ac_cv_cxx_thread)
++else
++ ac_cv_cxx_thread=no
+ fi
+-CXX="$ac_save_cxx"
+
+ dnl # check for ANSI or K&R ("traditional") preprocessor
+ dnl AC_MSG_CHECKING(for C preprocessor type)