1 dnl ----------------------------------------------------------------------
2 dnl This whole bit snagged from libgomp.
6 dnl (SHELL-CODE_HANDLER)
8 AC_DEFUN([GCC_LINUX_FUTEX],[dnl
9 GCC_ENABLE(linux-futex,default, ,[use the Linux futex system call],
10 permit yes|no|default)
13 case "$enable_linux_futex" in
15 # If headers don't have gettid/futex syscalls definition, then
16 # default to no, otherwise there will be compile time failures.
17 # Otherwise, default to yes. If we don't detect we are
18 # compiled/linked against NPTL and not cross-compiling, check
19 # if programs are run by default against NPTL and if not, issue
24 [#include <sys/syscall.h>
26 [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])],
28 LIBS="-lpthread $LIBS"
35 pthread_t th; void *status;],
36 [pthread_tryjoin_np (th, &status);])],[enable_linux_futex=yes],
37 [if test x$cross_compiling = xno; then
38 if getconf GNU_LIBPTHREAD_VERSION 2>/dev/null \
39 | LC_ALL=C grep -i NPTL > /dev/null 2>/dev/null; then :; else
40 AC_MSG_WARN([The kernel might not support futex or gettid syscalls.
41 If so, please configure with --disable-linux-futex])
44 enable_linux_futex=yes])
50 [#include <sys/syscall.h>
52 [syscall (SYS_gettid); syscall (SYS_futex, &lk, 0, 0, 0);])],[],
53 [AC_MSG_ERROR([SYS_gettid and SYS_futex required for --enable-linux-futex])])
61 if test x$enable_linux_futex = xyes; then