summaryrefslogtreecommitdiff
path: root/libmudflap/configure.ac
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-30 23:13:06 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-30 23:13:06 +0000
commit83703eea9ce67d68f2e051fcb6391000f9aebcc0 (patch)
tree5640ad73ab8b36db0e64e26d539b9e1a1d19f603 /libmudflap/configure.ac
parent36813f7d8d1e46f92676f06a0f977170729fdbed (diff)
downloadgcc-83703eea9ce67d68f2e051fcb6391000f9aebcc0.tar.gz
Don't build thread library for targets that don't support threads.
* configure.ac (pthread.h): Use AC_CHECK_HEADERS instead of AC_CHECK_HEADER. (target_thread_file): New. Set from sed'ed gcc output. (posix_threads): New. Set from target_thread_file. Use instead of ac_have_pthread_h. (pthread_create_version): Move initialization before code using it. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104838 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libmudflap/configure.ac')
-rw-r--r--libmudflap/configure.ac34
1 files changed, 24 insertions, 10 deletions
diff --git a/libmudflap/configure.ac b/libmudflap/configure.ac
index 038bac54618..039ff4e5f5c 100644
--- a/libmudflap/configure.ac
+++ b/libmudflap/configure.ac
@@ -114,15 +114,28 @@ then
mkdir pth
fi
-pthread_create_version='""'
-AC_CHECK_HEADER(pthread.h,[
-AC_DEFINE_UNQUOTED(HAVE_PTHREAD_H, 1, [define if you have <pthread.h>])
-ac_have_pthread_h=yes
-],[
-ac_have_pthread_h=
-])
-AM_CONDITIONAL(LIBMUDFLAPTH, [test "x$ac_have_pthread_h" != "x"])
-if test "x$ac_have_pthread_h" != "x"
+AC_CHECK_HEADERS(pthread.h)
+
+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])
+
+# We only support posix threads, or no threads at all.
+posix_threads=
+case ${target_thread_file} in
+ posix)
+ posix_threads=yes
+ ;;
+ single)
+ ;;
+ *)
+ echo "${target_thread_file} is an unsupported thread package" 1>&2
+ exit 1
+ ;;
+esac
+
+AM_CONDITIONAL(LIBMUDFLAPTH, [test "x$posix_threads" != "x"])
+if test "x$posix_threads" != "x"
then
build_libmudflapth=1
else
@@ -162,7 +175,8 @@ esac
AC_SUBST(toolexecdir)
AC_SUBST(toolexeclibdir)
-if test "x$enable_shared" = "xyes" && test "x$ac_have_pthread_h" != "x"; then
+pthread_create_version='""'
+if test "x$enable_shared" = "xyes" && test "x$posix_threads" != "x"; then
# NB: don't check for -lpthread here, because then it would be
# added to LIBS. For the thread-unaware libmudflap.la, we don't
# want it there.