Skip to content

Commit b2ccfeb

Browse files
committed
Merge pull request swiftlang#14 from dgrove-oss/autoconf-lib-search-take3
Propagate linker flags for kqueue and pthread_workqueue
2 parents 6dbebd6 + 855872c commit b2ccfeb

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

configure.ac

+4-1
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,11 @@ AS_IF([test -n "$apple_libpthread_source_path" -a -n "$apple_xnu_source_osfmk_pa
157157
])
158158
AC_CHECK_HEADERS([pthread_machdep.h pthread/qos.h])
159159
AC_CHECK_HEADERS([pthread/workqueue_private.h pthread_workqueue.h],
160-
[AC_DEFINE(HAVE_PTHREAD_WORKQUEUES, 1, [Define if pthread work queues are present])]
160+
[AC_DEFINE(HAVE_PTHREAD_WORKQUEUES, 1, [Define if pthread work queues are present])
161+
have_pthread_workqueues=true],
162+
[have_pthread_workqueues=false]
161163
)
164+
AM_CONDITIONAL(HAVE_PTHREAD_WORKQUEUES, $have_pthread_workqueues)
162165
AC_CHECK_HEADERS([libproc_internal.h], [], [], [#include <mach/mach.h>])
163166
AC_CHECK_FUNCS([pthread_workqueue_setdispatch_np _pthread_workqueue_init])
164167
AS_IF([test -n "$apple_libpthread_source_path" -a -n "$apple_xnu_source_osfmk_path"], [

src/Makefile.am

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ AM_CXXFLAGS=$(DISPATCH_CFLAGS) $(CXXBLOCKS_FLAGS)
5757
AM_OBJCXXFLAGS=$(DISPATCH_CFLAGS) $(CXXBLOCKS_FLAGS)
5858

5959
libdispatch_la_LDFLAGS=-avoid-version
60+
libdispatch_la_LIBADD=$(KQUEUE_LIBS) $(PTHREAD_WORKQUEUE_LIBS)
61+
62+
if HAVE_PTHREAD_WORKQUEUES
63+
PTHREAD_WORKQUEUE_LIBS=-lpthread_workqueue
64+
endif
6065

6166
if HAVE_DARWIN_LD
6267
libdispatch_la_LDFLAGS+=-Wl,-compatibility_version,1 \

src/shims/.dirstamp

Whitespace-only changes.

0 commit comments

Comments
 (0)