configure, drd: Only build the swapcontext test if swapcontext() is available

Add a configure test for swapcontext() since MUSL does not provide a
swapcontext() implementation. See also
https://bugs.kde.org/show_bug.cgi?id=434775 .
This commit is contained in:
Bart Van Assche 2021-03-22 19:12:20 -07:00
parent 06a6b1799c
commit c9e88f3459
2 changed files with 6 additions and 1 deletions

View File

@ -4403,6 +4403,7 @@ AC_CHECK_FUNCS([ \
strpbrk \
strrchr \
strstr \
swapcontext \
syscall \
utimensat \
process_vm_readv \
@ -4433,6 +4434,7 @@ AM_CONDITIONAL([HAVE_PREADV_PWRITEV],
[test x$ac_cv_func_preadv = xyes && test x$ac_cv_func_pwritev = xyes])
AM_CONDITIONAL([HAVE_PREADV2_PWRITEV2],
[test x$ac_cv_func_preadv2 = xyes && test x$ac_cv_func_pwritev2 = xyes])
AM_CONDITIONAL([HAVE_SWAPCONTEXT], [test x$ac_cv_func_swapcontext = xyes])
AM_CONDITIONAL([HAVE_MEMFD_CREATE],
[test x$ac_cv_func_memfd_create = xyes])

View File

@ -408,7 +408,6 @@ check_PROGRAMS = \
sem_as_mutex \
sem_open \
sigalrm \
swapcontext \
threaded-fork \
trylock \
unit_bitmap \
@ -470,6 +469,10 @@ if HAVE_PTHREAD_SPINLOCK
check_PROGRAMS += pth_spinlock
endif
if HAVE_SWAPCONTEXT
check_PROGRAMS += swapcontext
endif
if !VGCONF_OS_IS_DARWIN
check_PROGRAMS += sem_wait
endif