summaryrefslogtreecommitdiffstats
path: root/gl/m4/threadlib.m4
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:38:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:38:57 +0000
commitf5b6b735a731901f09d7f3cc153c1d869269ee83 (patch)
tree565a1b0f3c6a4094a5f2198879fb239053549f1e /gl/m4/threadlib.m4
parentAdding upstream version 2.12.0. (diff)
downloadman-db-upstream.tar.xz
man-db-upstream.zip
Adding upstream version 2.12.1.upstream/2.12.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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])