From 06c1552e44f630b7bdb26cefb9c4ffaffc47846d Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 4 Oct 2018 19:33:36 +1300 Subject: [PATCH] Avoid timer_create() on NetBSD and OpenBSD On OpenBSD it always fails with ENOSYS (and there's no prototype in the libc headers). On NetBSD it seems to work, but the timer never seems to fire, so it's useless to us (see #770). (cherry picked from commit 973d9889d5a31c4ed063cb42819ecbc91c7320e0) --- xapian-core/configure.ac | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xapian-core/configure.ac b/xapian-core/configure.ac index 7002b4fe0..7ed7488d5 100644 --- a/xapian-core/configure.ac +++ b/xapian-core/configure.ac @@ -470,9 +470,21 @@ SAVE_LIBS=$LIBS AC_SEARCH_LIBS([timer_create], [rt], [ AC_MSG_CHECKING([for timer_create() usability]) + dnl Several platforms have timer_create() but it's non-functional. + dnl + dnl Some of these (at least those with a stub implementation which always + dnl fails with ENOSYS) could be probed for, but we'd have to run code + dnl which isn't possible when cross-compiling, so just maintain a list + dnl of such platforms for now. AC_COMPILE_IFELSE([AC_LANG_PROGRAM( -[[#if defined _AIX || defined __GNU__ -#error timer_create known not to work +[[#if defined _AIX +#error timer_create always fails with EAGAIN on AIX 7.1 +#elif defined __GNU__ +#error timer_create always fails with ENOSYS on GNU Hurd +#elif defined __NetBSD__ +#error timer_create timers never fire on NetBSD 7.1 +#elif defined __OpenBSD__ +#error timer_create always fails with ENOSYS on OpenBSD 6.2 (and no prototype) #endif]])], [AC_MSG_RESULT([yes]) XAPIAN_LIBS="$LIBS $XAPIAN_LIBS" -- 2.11.4.GIT