summaryrefslogtreecommitdiffstats
path: root/gl/m4/threadlib.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/threadlib.m4')
-rw-r--r--gl/m4/threadlib.m425
1 files changed, 19 insertions, 6 deletions
diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4
index 1fc5777..0be2c98 100644
--- a/gl/m4/threadlib.m4
+++ b/gl/m4/threadlib.m4
@@ -1,5 +1,5 @@
-# threadlib.m4 serial 38
-dnl Copyright (C) 2005-2023 Free Software Foundation, Inc.
+# threadlib.m4 serial 41
+dnl Copyright (C) 2005-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -85,7 +85,7 @@ AC_DEFUN([gl_WEAK_SYMBOLS],
AC_CACHE_CHECK([whether imported symbols can be declared weak],
[gl_cv_have_weak],
[case "$host_os" in
- cygwin* | mingw*)
+ cygwin* | mingw* | windows*)
dnl On Cygwin 3.2.0 with gcc 10.2, and likewise on mingw 10.0.0 with
dnl gcc 11.3, the test below would succeed, but programs that use
dnl pthread_in_use() with weak symbol references crash miserably at
@@ -269,6 +269,15 @@ changequote([,])dnl
[Define if the pthread_in_use() detection is hard.])
esac
fi
+ ],
+ [dnl This is needed on FreeBSD 5.2.1.
+ AC_CHECK_LIB([thr], [pthread_kill],
+ [if test $gl_pthread_in_glibc = yes; then
+ LIBPMULTITHREAD=
+ else
+ LIBPMULTITHREAD=-lthr
+ fi
+ ])
])
elif test $gl_pthread_api != yes; then
# Some library is needed. Try libpthread and libc_r.
@@ -344,7 +353,7 @@ AC_DEFUN([gl_STDTHREADLIB_BODY],
AC_CHECK_HEADERS_ONCE([threads.h])
case "$host_os" in
- mingw*)
+ mingw* | windows*)
LIBSTDTHREAD=
;;
*)
@@ -465,7 +474,7 @@ changequote(,)dnl
esac
;;
dnl Obey gl_AVOID_WINPTHREAD on mingw.
- mingw*)
+ mingw* | windows*)
case "$gl_use_winpthreads_default" in
yes) gl_use_threads=posix ;;
no) gl_use_threads=windows ;;
@@ -564,7 +573,7 @@ AC_DEFUN([gl_THREADLIB_BODY],
case "$gl_use_threads" in
yes | windows | win32) # The 'win32' is for backward compatibility.
if { case "$host_os" in
- mingw*) true;;
+ mingw* | windows*) true;;
*) false;;
esac
}; then
@@ -575,6 +584,10 @@ AC_DEFUN([gl_THREADLIB_BODY],
;;
esac
fi
+ else
+ dnl "$gl_use_threads" is "no".
+ AC_DEFINE([AVOID_ANY_THREADS], [1],
+ [Define if no multithread safety and no multithreading is desired.])
fi
AC_MSG_CHECKING([for multithread API to use])
AC_MSG_RESULT([$gl_threads_api])