Skip to content

Add libkqueue as a git submodule #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "libpwq"]
path = libpwq
url = https://github.com/mheily/libpwq.git
[submodule "libkqueue"]
path = libkqueue
url = https://github.com/mheily/libkqueue.git
31 changes: 15 additions & 16 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,23 @@
ACLOCAL_AMFLAGS = -I m4

if BUILD_OWN_PTHREAD_WORKQUEUES
SUBDIRS= \
dispatch \
libpwq \
man \
os \
private \
src \
tests
else
SUBDIRS= \
dispatch \
man \
os \
private \
src \
tests
MAYBE_PTHREAD_WORKQUEUES = libpwq
endif

if BUILD_OWN_KQUEUES
MAYBE_KQUEUES = libkqueue
endif

SUBDIRS= \
dispatch \
$(MAYBE_PTHREAD_WORKQUEUES) \
$(MAYBE_KQUEUES) \
man \
os \
private \
src \
tests

EXTRA_DIST= \
README.md \
LICENSE \
Expand Down
16 changes: 11 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,18 @@ esac
AC_SEARCH_LIBS(clock_gettime, rt)
AC_SEARCH_LIBS(pthread_create, pthread)

#
# Prefer native kqueue(2); otherwise use libkqueue if present.
#
AC_CHECK_HEADER(sys/event.h, [],
[PKG_CHECK_MODULES(KQUEUE, libkqueue)]
AS_IF([test -f $srcdir/libkqueue/configure.ac],
[AC_DEFINE(BUILD_OWN_KQUEUES, 1, [Define if building libkqueue from source])
ac_configure_args="--disable-libkqueue-install $ac_configure_args"
AC_CONFIG_SUBDIRS([libkqueue])
build_own_kqueues=true],
[build_own_kqueues=false
AC_CHECK_HEADER(sys/event.h, [],
[PKG_CHECK_MODULES(KQUEUE, libkqueue)]
)
]
)
AM_CONDITIONAL(BUILD_OWN_KQUEUES, $build_own_kqueues)

AC_CHECK_FUNCS([strlcpy getprogname], [],
[PKG_CHECK_MODULES(BSD_OVERLAY, libbsd-overlay,[
Expand Down
1 change: 1 addition & 0 deletions libkqueue
Submodule libkqueue added at f4f39d
11 changes: 8 additions & 3 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,20 @@ EXTRA_libdispatch_la_DEPENDENCIES=
AM_CPPFLAGS=-I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/private

DISPATCH_CFLAGS=-Wall $(VISIBILITY_FLAGS) $(OMIT_LEAF_FP_FLAGS) \
$(MARCH_FLAGS) $(KQUEUE_CFLAGS) $(BSD_OVERLAY_CFLAGS)
$(MARCH_FLAGS) $(BSD_OVERLAY_CFLAGS)
if DISPATCH_ENABLE_ASSERTS
DISPATCH_CFLAGS+=-DDISPATCH_DEBUG=1
endif
AM_CFLAGS= $(PTHREAD_WORKQUEUE_CFLAGS) $(DISPATCH_CFLAGS) $(CBLOCKS_FLAGS)
AM_CFLAGS= $(KQUEUE_CFLAGS) $(PTHREAD_WORKQUEUE_CFLAGS) $(DISPATCH_CFLAGS) $(CBLOCKS_FLAGS)
AM_OBJCFLAGS=$(DISPATCH_CFLAGS) $(CBLOCKS_FLAGS)
AM_CXXFLAGS=$(PTHREAD_WORKQUEUE_CFLAGS) $(DISPATCH_CFLAGS) $(CXXBLOCKS_FLAGS)
AM_CXXFLAGS=$(KQUEUE_CFLAGS) $(PTHREAD_WORKQUEUE_CFLAGS) $(DISPATCH_CFLAGS) $(CXXBLOCKS_FLAGS)
AM_OBJCXXFLAGS=$(DISPATCH_CFLAGS) $(CXXBLOCKS_FLAGS)

if BUILD_OWN_KQUEUES
KQUEUE_LIBS+=$(top_builddir)/libkqueue/libkqueue.la
KQUEUE_CFLAGS+=-I$(top_srcdir)/libkqueue/include
endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't assume /usr/local/include/kqueue is the right place to get them.


if BUILD_OWN_PTHREAD_WORKQUEUES
PTHREAD_WORKQUEUE_LIBS=$(top_builddir)/libpwq/libpthread_workqueue.la
PTHREAD_WORKQUEUE_CFLAGS=-I$(top_srcdir)/libpwq/include
Expand Down
5 changes: 5 additions & 0 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ AM_OBJCFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CBLOCKS_FLAGS)
AM_CXXFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CXXBLOCKS_FLAGS) $(BSD_OVERLAY_CFLAGS)
AM_OBJCXXFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CXXBLOCKS_FLAGS)

if BUILD_OWN_KQUEUES
KQUEUE_LIBS+=$(top_builddir)/libkqueue/libkqueue.la
KQUEUE_CFLAGS+=-I$(top_srcdir)/libkqueue/include
endif

if !BUILD_OWN_PTHREAD_WORKQUEUES
if HAVE_PTHREAD_WORKQUEUES
PTHREAD_WORKQUEUE_LIBS=-lpthread_workqueue
Expand Down