>From a164eac98dc028a2960c706c095de2ef15ff1537 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Jan 2023 14:48:31 +0100 Subject: [PATCH 14/18] sched_yield: Rename LIB_SCHED_YIELD to SCHED_YIELD_LIB. * m4/threadlib.m4: Rename LIB_SCHED_YIELD to SCHED_YIELD_LIB. All uses changed. * NEWS: Mention the change. --- ChangeLog | 7 +++++++ NEWS | 3 +++ m4/threadlib.m4 | 15 +++++++++------ m4/yield.m4 | 4 ++-- modules/pthread-cond-tests | 2 +- modules/pthread-mutex-tests | 2 +- modules/pthread-once-tests | 2 +- modules/pthread-rwlock-tests | 2 +- modules/pthread-spin-tests | 2 +- modules/pthread-tss-tests | 2 +- modules/sched-c++-tests | 2 +- modules/sched_yield | 2 +- 12 files changed, 29 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb61ac4bc2..634203127f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2023-01-07 Bruno Haible + + sched_yield: Rename LIB_SCHED_YIELD to SCHED_YIELD_LIB. + * m4/threadlib.m4: Rename LIB_SCHED_YIELD to SCHED_YIELD_LIB. + All uses changed. + * NEWS: Mention the change. + 2023-01-07 Bruno Haible pthread_sigmask: Rename LIB_PTHREAD_SIGMASK to PTHREAD_SIGMASK_LIB. diff --git a/NEWS b/NEWS index ec6147be99..e5605ee295 100644 --- a/NEWS +++ b/NEWS @@ -74,6 +74,9 @@ User visible incompatible changes Date Modules Changes +2023-01-07 sched_yield Link with $(SCHED_YIELD_LIB) instead of + $(LIB_SCHED_YIELD). + 2023-01-07 pthread_sigmask Link with $(PTHREAD_SIGMASK_LIB) instead of $(LIB_PTHREAD_SIGMASK). diff --git a/m4/threadlib.m4 b/m4/threadlib.m4 index ff959346c0..332491d42f 100644 --- a/m4/threadlib.m4 +++ b/m4/threadlib.m4 @@ -1,4 +1,4 @@ -# threadlib.m4 serial 32 +# threadlib.m4 serial 33 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, @@ -174,7 +174,7 @@ dnl Sets the variable LIBPMULTITHREAD, for programs that really need dnl multithread functionality. The difference between LIBPTHREAD and dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not. -dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the +dnl Sets the variable SCHED_YIELD_LIB to the linker options needed to use the dnl sched_yield() function. dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for dnl multithread-safe programs. @@ -297,13 +297,16 @@ AC_DEFUN([gl_PTHREADLIB_BODY], [AC_LANG_PROGRAM( [[#include ]], [[sched_yield ();]])], - [LIB_SCHED_YIELD= + [SCHED_YIELD_LIB= ], [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc. - AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt], + AC_CHECK_LIB([rt], [sched_yield], [SCHED_YIELD_LIB=-lrt], [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt. - AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])]) + AC_CHECK_LIB([posix4], [sched_yield], [SCHED_YIELD_LIB=-lposix4])]) ]) + AC_SUBST([SCHED_YIELD_LIB]) + dnl For backward compatibility. + LIB_SCHED_YIELD="$SCHED_YIELD_LIB" AC_SUBST([LIB_SCHED_YIELD]) gl_pthreadlib_body_done=done @@ -362,7 +365,7 @@ AC_DEFUN([gl_STDTHREADLIB_BODY], fi else dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c. - LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD" + LIBSTDTHREAD="$LIBPMULTITHREAD $SCHED_YIELD_LIB" fi ;; esac diff --git a/m4/yield.m4 b/m4/yield.m4 index 3bfb8cda5b..4eb6bd9808 100644 --- a/m4/yield.m4 +++ b/m4/yield.m4 @@ -1,4 +1,4 @@ -# yield.m4 serial 4 +# yield.m4 serial 5 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, @@ -10,7 +10,7 @@ AC_DEFUN([gl_YIELD], AC_REQUIRE([gl_THREADLIB]) if test $gl_threads_api = posix; then - YIELD_LIB="$LIB_SCHED_YIELD" + YIELD_LIB="$SCHED_YIELD_LIB" else YIELD_LIB= fi diff --git a/modules/pthread-cond-tests b/modules/pthread-cond-tests index 75a335d565..b104ae0651 100644 --- a/modules/pthread-cond-tests +++ b/modules/pthread-cond-tests @@ -13,4 +13,4 @@ configure.ac: Makefile.am: TESTS += test-pthread-cond check_PROGRAMS += test-pthread-cond -test_pthread_cond_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@ +test_pthread_cond_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ diff --git a/modules/pthread-mutex-tests b/modules/pthread-mutex-tests index c419dcc00d..4575ef5c79 100644 --- a/modules/pthread-mutex-tests +++ b/modules/pthread-mutex-tests @@ -12,4 +12,4 @@ configure.ac: Makefile.am: TESTS += test-pthread-mutex check_PROGRAMS += test-pthread-mutex -test_pthread_mutex_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@ @LIB_SEMAPHORE@ +test_pthread_mutex_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ @LIB_SEMAPHORE@ diff --git a/modules/pthread-once-tests b/modules/pthread-once-tests index d77dc19a5a..fc89cbcfcf 100644 --- a/modules/pthread-once-tests +++ b/modules/pthread-once-tests @@ -14,4 +14,4 @@ Makefile.am: TESTS += test-pthread-once1 test-pthread-once2 check_PROGRAMS += test-pthread-once1 test-pthread-once2 test_pthread_once1_LDADD = $(LDADD) @LIBPMULTITHREAD@ -test_pthread_once2_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@ +test_pthread_once2_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ diff --git a/modules/pthread-rwlock-tests b/modules/pthread-rwlock-tests index 594f6b6601..af29895580 100644 --- a/modules/pthread-rwlock-tests +++ b/modules/pthread-rwlock-tests @@ -13,4 +13,4 @@ configure.ac: Makefile.am: TESTS += test-pthread-rwlock check_PROGRAMS += test-pthread-rwlock -test_pthread_rwlock_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@ @LIB_SEMAPHORE@ +test_pthread_rwlock_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ @LIB_SEMAPHORE@ diff --git a/modules/pthread-spin-tests b/modules/pthread-spin-tests index aafe8c7bcd..9dfa698ca4 100644 --- a/modules/pthread-spin-tests +++ b/modules/pthread-spin-tests @@ -17,4 +17,4 @@ AC_REQUIRE([gl_SEMAPHORE]) Makefile.am: TESTS += test-pthread-spin check_PROGRAMS += test-pthread-spin -test_pthread_spin_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@ @LIB_SEMAPHORE@ +test_pthread_spin_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ @LIB_SEMAPHORE@ diff --git a/modules/pthread-tss-tests b/modules/pthread-tss-tests index caa4520e52..1d339345dd 100644 --- a/modules/pthread-tss-tests +++ b/modules/pthread-tss-tests @@ -12,4 +12,4 @@ configure.ac: Makefile.am: TESTS += test-pthread-tss check_PROGRAMS += test-pthread-tss -test_pthread_tss_LDADD = $(LDADD) @LIBPMULTITHREAD@ @LIB_SCHED_YIELD@ +test_pthread_tss_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ diff --git a/modules/sched-c++-tests b/modules/sched-c++-tests index 28c6ea184d..5e025de0ca 100644 --- a/modules/sched-c++-tests +++ b/modules/sched-c++-tests @@ -15,5 +15,5 @@ if ANSICXX TESTS += test-sched-c++ check_PROGRAMS += test-sched-c++ test_sched_c___SOURCES = test-sched-c++.cc -test_sched_c___LDADD = $(LDADD) $(LIB_SCHED_YIELD) +test_sched_c___LDADD = $(LDADD) $(SCHED_YIELD_LIB) endif diff --git a/modules/sched_yield b/modules/sched_yield index 6d683d58d4..ad29bcafb9 100644 --- a/modules/sched_yield +++ b/modules/sched_yield @@ -24,7 +24,7 @@ Include: Link: -$(LIB_SCHED_YIELD) +$(SCHED_YIELD_LIB) License: LGPLv2+ -- 2.34.1