aboutsummaryrefslogtreecommitdiff
path: root/libobjc
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-02-28 20:04:41 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-02-28 12:04:41 -0800
commit6886e18e758f87f7d409dccda8073a28dd883f3e (patch)
treeca433912ca749c15300ad2f27fa98b4a4aa5786c /libobjc
parentd436d3dea2af2288cf3bace09f693bf27caebe15 (diff)
downloadgcc-6886e18e758f87f7d409dccda8073a28dd883f3e.zip
gcc-6886e18e758f87f7d409dccda8073a28dd883f3e.tar.gz
gcc-6886e18e758f87f7d409dccda8073a28dd883f3e.tar.bz2
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
Diffstat (limited to 'libobjc')
-rw-r--r--libobjc/ChangeLog12
-rw-r--r--libobjc/Makefile.in3
-rw-r--r--libobjc/config.h.in3
-rwxr-xr-xlibobjc/configure36
-rw-r--r--libobjc/configure.ac21
-rw-r--r--libobjc/thr-objc.c1
6 files changed, 40 insertions, 36 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 278cde2..1edd668 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,15 @@
+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.
+
2005-02-28 Paolo Bonzini <bonzini@gnu.org>
PR bootstrap/17383
diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
index 23af100..3c09183 100644
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -72,9 +72,8 @@ RANLIB = @RANLIB@
CC = @CC@
CFLAGS = @CFLAGS@
WARN_CFLAGS = -W -Wall -Wwrite-strings -Wstrict-prototypes
-GTHREAD_FLAGS=@GTHREAD_FLAGS@
ALL_CFLAGS = -I. -I$(srcdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARN_CFLAGS) \
- $(GTHREAD_FLAGS) -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing
+ -DIN_GCC -DIN_TARGET_LIBS -fno-strict-aliasing
# Libtool
# The following strings describe the version of the obj-C library
diff --git a/libobjc/config.h.in b/libobjc/config.h.in
index 700e045..51811a5 100644
--- a/libobjc/config.h.in
+++ b/libobjc/config.h.in
@@ -1,5 +1,8 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Define if the compiler has a thread header that is non single. */
+#undef HAVE_GTHR_DEFAULT
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
diff --git a/libobjc/configure b/libobjc/configure
index 71bd0a763..893645a 100755
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -309,7 +309,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir VERSION OBJC_BOEHM_GC toplevel_srcdir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical glibcpp_srcdir gcc_version_trigger gcc_version_full gcc_version toolexecdir toolexeclibdir includedirname libext CC ac_ct_CC EXEEXT OBJEXT CFLAGS AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LN_S STRIP ac_ct_STRIP LIBTOOL SET_MAKE CPP CPPFLAGS EGREP GTHREAD_FLAGS LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_subdir host_subdir target_subdir VERSION OBJC_BOEHM_GC toplevel_srcdir host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical glibcpp_srcdir gcc_version_trigger gcc_version_full gcc_version toolexecdir toolexeclibdir includedirname libext CC ac_ct_CC EXEEXT OBJEXT CFLAGS AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LN_S STRIP ac_ct_STRIP LIBTOOL SET_MAKE CPP CPPFLAGS EGREP LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -5111,26 +5111,19 @@ done
# Miscellanea
# -----------
-# Determine CFLAGS for gthread.
-echo "$as_me:$LINENO: checking for gthread cflags" >&5
-echo $ECHO_N "checking for gthread cflags... $ECHO_C" >&6
-if test "${objc_cv_gthread_flags+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # 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
- { { echo "$as_me:$LINENO: error: not found" >&5
-echo "$as_me: error: not found" >&2;}
- { (exit 1); exit 1; }; }
-fi
+echo "$as_me:$LINENO: checking for thread model used by GCC" >&5
+echo $ECHO_N "checking for thread model used by GCC... $ECHO_C" >&6
+target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'`
+echo "$as_me:$LINENO: result: $target_thread_file" >&5
+echo "${ECHO_T}$target_thread_file" >&6
+
+if test $target_thread_file != single; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GTHR_DEFAULT 1
+_ACEOF
+
fi
-echo "$as_me:$LINENO: result: $objc_cv_gthread_flags" >&5
-echo "${ECHO_T}$objc_cv_gthread_flags" >&6
-GTHREAD_FLAGS=$objc_cv_gthread_flags
echo "$as_me:$LINENO: checking for exception model to use" >&5
@@ -5147,7 +5140,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then
:
else
cat > conftest.$ac_ext << EOF
-#line 5150 "configure"
+#line 5143 "configure"
@interface Frob
@end
@implementation Frob
@@ -5903,7 +5896,6 @@ s,@SET_MAKE@,$SET_MAKE,;t t
s,@CPP@,$CPP,;t t
s,@CPPFLAGS@,$CPPFLAGS,;t t
s,@EGREP@,$EGREP,;t t
-s,@GTHREAD_FLAGS@,$GTHREAD_FLAGS,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
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 @@ AC_CHECK_HEADERS(sched.h)
# 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)
diff --git a/libobjc/thr-objc.c b/libobjc/thr-objc.c
index 5afef68..d954f93 100644
--- a/libobjc/thr-objc.c
+++ b/libobjc/thr-objc.c
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */
covered by the GNU General Public License. */
#define _LIBOBJC
+#include "config.h"
#include "tconfig.h"
#include "coretypes.h"
#include "tm.h"