From 92dbe524b0f7543a62a48c414bcf4106f31cb2cc Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 15 Oct 2023 21:55:28 +0200 Subject: [PATCH] threadlib: Fix link errors on FreeBSD 5.2.1/i386. * m4/threadlib.m4 (gl_PTHREADLIB_BODY): When pthread_kill could not be found in -lpthread, try -lthr. --- ChangeLog | 6 ++++++ m4/threadlib.m4 | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index beb1e0fde2..1888aea1cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-10-15 Bruno Haible + + threadlib: Fix link errors on FreeBSD 5.2.1/i386. + * m4/threadlib.m4 (gl_PTHREADLIB_BODY): When pthread_kill could not be + found in -lpthread, try -lthr. + 2023-10-15 Bruno Haible lock: Make Autoconf macro more robust. diff --git a/m4/threadlib.m4 b/m4/threadlib.m4 index 39c4896ae6..cbe2d66369 100644 --- a/m4/threadlib.m4 +++ b/m4/threadlib.m4 @@ -1,4 +1,4 @@ -# threadlib.m4 serial 32b +# threadlib.m4 serial 32c dnl Copyright (C) 2005-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -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. -- 2.39.5