re PR libobjc/20252 (Libobjc build broken)

2005-02-28  Andrew Pinski <pinskia@physics.uc.edu>

        PR libobjc/20252
        * Makefile.in (GTHREAD_FLAGS): Remove.
        (ALL_CFLAGS): Remove usage of GTHREAD_FLAGS.
        * thr-objc.c: Include config.h.
        * configure.ac: Instead of looking at GCC's makefile, figure out if
        GTHREAD_FLAGS should be defined by looking at the `thread model'
        of the current gcc.
        * configure: Regenerate.
        * config.h.in: Regenerate.

From-SVN: r95696
diff --git a/libobjc/configure.ac b/libobjc/configure.ac
index 5e56fb7..8c554b5 100644
--- a/libobjc/configure.ac
+++ b/libobjc/configure.ac
@@ -218,18 +218,15 @@
 # Miscellanea
 # -----------
 
-# Determine CFLAGS for gthread.
-AC_CACHE_CHECK([for gthread cflags],objc_cv_gthread_flags,
-[# we know we are compiled as a target library, so the toplevel build directory
-# is ../..
-if test -f ../../$host_subdir/gcc/Makefile
-then
-  objc_cv_gthread_flags=`grep \^GTHREAD_FLAGS ../../$host_subdir/gcc/Makefile | awk -F= '{ print $2 }'`
-else
-  AC_MSG_ERROR([not found])
-fi])
-GTHREAD_FLAGS=$objc_cv_gthread_flags
-AC_SUBST(GTHREAD_FLAGS)
+AC_MSG_CHECKING([for thread model used by GCC])
+target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+AC_MSG_RESULT([$target_thread_file]) 
+
+if test $target_thread_file != single; then
+  AC_DEFINE(HAVE_GTHR_DEFAULT, 1,
+        [Define if the compiler has a thread header that is non single.])
+fi 
+
 
 AC_MSG_CHECKING([for exception model to use])
 AC_LANG_PUSH(C)