From 3398f5b73b23f6ffe3332e4f172c5e84afe6fe99 Mon Sep 17 00:00:00 2001 From: David Grove Date: Mon, 14 Dec 2015 16:20:11 +0000 Subject: [PATCH] Add AC_SEARCH_LIBS stanzas for kqueue and pthread_workqueue If libdispatch is using functions found in libkqueue or libpthread_workqueue, then we want libdispatch.so to depend on those libraries. Putting in AC_SEARCH_LIBS stanzas results in the proper linker flags being added when libdispatch.so is built. Therefore the application compilation command can simply say -ldispatch and not need to explicitly mention -lkqueue and -lpthread_workqueue. --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 75a00ac56..1bb3fb534 100644 --- a/configure.ac +++ b/configure.ac @@ -139,6 +139,7 @@ AC_SEARCH_LIBS(pthread_create, pthread) AC_CHECK_HEADER(sys/event.h, [], [PKG_CHECK_MODULES(KQUEUE, libkqueue)] ) +AC_SEARCH_LIBS(kevent, kqueue) # # Checks for header files. @@ -157,7 +158,8 @@ AS_IF([test -n "$apple_libpthread_source_path" -a -n "$apple_xnu_source_osfmk_pa ]) AC_CHECK_HEADERS([pthread_machdep.h pthread/qos.h]) AC_CHECK_HEADERS([pthread/workqueue_private.h pthread_workqueue.h], - [AC_DEFINE(HAVE_PTHREAD_WORKQUEUES, 1, [Define if pthread work queues are present])] + [AC_DEFINE(HAVE_PTHREAD_WORKQUEUES, 1, [Define if pthread work queues are present]) + AC_SEARCH_LIBS(pthread_workqueue_create_np, pthread_workqueue)] ) AC_CHECK_HEADERS([libproc_internal.h], [], [], [#include ]) AC_CHECK_FUNCS([pthread_workqueue_setdispatch_np _pthread_workqueue_init])