Skip to content

Rework of Dispatch overlay for Linux #61

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

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ AC_ARG_WITH([swift-toolchain],
[AS_HELP_STRING([--with-swift-toolchain], [Specify path to Swift toolchain])],
[swift_toolchain_path=${withval}
AC_DEFINE(HAVE_SWIFT, 1, [Define if building for Swift])
SWIFTC="$swift_toolchain_path/bin/swiftc"
SWIFT_TOOLCHAIN_PATH="$swift_toolchain_path"
have_swift=true],
[have_swift=false]
)
AM_CONDITIONAL(HAVE_SWIFT, $have_swift)
AC_SUBST([SWIFTC])
AC_SUBST([SWIFT_TOOLCHAIN_PATH])

AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE([foreign no-dependencies subdir-objects])
Expand Down
4 changes: 4 additions & 0 deletions dispatch/dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
#include <stdarg.h>
#include <unistd.h>
#include <fcntl.h>
#ifndef __APPLE__
#include <stdio.h>
#include <sys/types.h>
#endif

#ifndef __OSX_AVAILABLE_STARTING
#define __OSX_AVAILABLE_STARTING(x, y)
Expand Down
9 changes: 8 additions & 1 deletion dispatch/module.map
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
module Dispatch [system] {
module Dispatch {
requires blocks
export *
link "dispatch"
link "BlocksRuntime"
}

module CDispatch [system] {
umbrella header "dispatch.h"
requires blocks
export *
Expand Down
8 changes: 7 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ else
endif
endif

if HAVE_SWIFT
SWIFTC=${SWIFT_TOOLCHAIN_PATH}/bin/swiftc
SWIFT_RUNTIME_LIBS=$(SWIFT_TOOLCHAIN_PATH)/lib/swift/linux
SWIFT_LIBS=-L$(SWIFT_RUNTIME_LIBS) -lswiftCore
endif

libdispatch_la_LDFLAGS=-avoid-version
libdispatch_la_LIBADD=$(KQUEUE_LIBS) $(PTHREAD_WORKQUEUE_LIBS) $(BSD_OVERLAY_LIBS)
libdispatch_la_LIBADD=$(KQUEUE_LIBS) $(PTHREAD_WORKQUEUE_LIBS) $(BSD_OVERLAY_LIBS) $(SWIFT_LIBS)

if HAVE_DARWIN_LD
libdispatch_la_LDFLAGS+=-Wl,-compatibility_version,1 \
Expand Down
Loading