# HG changeset patch # User Bruno Haible # Date 1220133696 -7200 # Node ID 500c5ea49ecf51d9009c474fde8fc93c35db49a0 # Parent ceb93e505c896917aea69886e61732b7aba312e5 Undo unintentional commit. diff --git a/modules/lock-tests b/modules/lock-tests --- a/modules/lock-tests +++ b/modules/lock-tests @@ -2,12 +2,20 @@ tests/test-lock.c Depends-on: -thread -yield configure.ac: +dnl Checks for special libraries for the tests/test-lock test. +dnl On some systems, sched_yield is in librt, rather than in libpthread. +LIBSCHED= +if test $gl_threads_api = posix; then + dnl Solaris has sched_yield in librt, not in libpthread or libc. + AC_CHECK_LIB(rt, sched_yield, [LIBSCHED=-lrt], + [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt. + AC_CHECK_LIB(posix4, sched_yield, [LIBSCHED=-lposix4])]) +fi +AC_SUBST([LIBSCHED]) Makefile.am: TESTS += test-lock check_PROGRAMS += test-lock -test_lock_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@ +test_lock_LDADD = $(LDADD) @LIBMULTITHREAD@ @LIBSCHED@ diff --git a/modules/tls-tests b/modules/tls-tests --- a/modules/tls-tests +++ b/modules/tls-tests @@ -2,13 +2,21 @@ tests/test-tls.c Depends-on: -thread -yield configure.ac: +dnl Checks for special libraries for the tests/test-tls test. +dnl On some systems, sched_yield is in librt, rather than in libpthread. +LIBSCHED= +if test $gl_threads_api = posix; then + dnl Solaris has sched_yield in librt, not in libpthread or libc. + AC_CHECK_LIB(rt, sched_yield, [LIBSCHED=-lrt], + [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt. + AC_CHECK_LIB(posix4, sched_yield, [LIBSCHED=-lposix4])]) +fi +AC_SUBST([LIBSCHED]) Makefile.am: TESTS += test-tls check_PROGRAMS += test-tls -test_tls_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@ +test_tls_LDADD = $(LDADD) @LIBMULTITHREAD@ @LIBSCHED@