|
Packit |
06dd63 |
# yield.m4 serial 2
|
|
Packit |
06dd63 |
dnl Copyright (C) 2005-2019 Free Software Foundation, Inc.
|
|
Packit |
06dd63 |
dnl This file is free software; the Free Software Foundation
|
|
Packit |
06dd63 |
dnl gives unlimited permission to copy and/or distribute it,
|
|
Packit |
06dd63 |
dnl with or without modifications, as long as this notice is preserved.
|
|
Packit |
06dd63 |
|
|
Packit |
06dd63 |
AC_DEFUN([gl_YIELD],
|
|
Packit |
06dd63 |
[
|
|
Packit |
06dd63 |
AC_REQUIRE([gl_THREADLIB])
|
|
Packit |
06dd63 |
dnl On some systems, sched_yield is in librt, rather than in libpthread.
|
|
Packit |
06dd63 |
YIELD_LIB=
|
|
Packit |
06dd63 |
if test $gl_threads_api = posix; then
|
|
Packit |
06dd63 |
dnl Solaris has sched_yield in librt, not in libpthread or libc.
|
|
Packit |
06dd63 |
AC_CHECK_LIB([rt], [sched_yield], [YIELD_LIB=-lrt],
|
|
Packit |
06dd63 |
[dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
|
|
Packit |
06dd63 |
AC_CHECK_LIB([posix4], [sched_yield], [YIELD_LIB=-lposix4])])
|
|
Packit |
06dd63 |
fi
|
|
Packit |
06dd63 |
AC_SUBST([YIELD_LIB])
|
|
Packit |
06dd63 |
])
|