Skip to content

if building Swift overlay, install into Swift toolchain dir structure #49

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
Feb 15, 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
8 changes: 8 additions & 0 deletions dispatch/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#
#

if HAVE_SWIFT
dispatchdir=${prefix}/lib/swift/dispatch
else
dispatchdir=$(includedir)/dispatch
endif

dispatch_HEADERS= \
base.h \
Expand All @@ -19,3 +23,7 @@ dispatch_HEADERS= \
source.h \
time.h

if HAVE_SWIFT
dispatch_HEADERS+=module.map
endif

2 changes: 1 addition & 1 deletion src/swift/module.map.in → dispatch/module.map
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Dispatch [system] {
umbrella header "PREFIX/dispatch/dispatch.h"
umbrella header "dispatch.h"
requires blocks
export *
link "dispatch"
Expand Down
2 changes: 1 addition & 1 deletion libpwq
2 changes: 2 additions & 0 deletions man/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
#

if !HAVE_SWIFT
dist_man3_MANS= \
dispatch.3 \
dispatch_after.3 \
Expand Down Expand Up @@ -148,3 +149,4 @@ uninstall-hook:
dispatch_io_barrier.3 \
dispatch_io_write.3 \
dispatch_write.3
endif
4 changes: 4 additions & 0 deletions os/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#
#

if HAVE_SWIFT
osdir=${prefix}/lib/swift/os
else
osdir=$(includedir)/os
endif

os_HEADERS= \
object.h \
Expand Down
30 changes: 15 additions & 15 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
#
#

if HAVE_SWIFT
swiftlibdir=${prefix}/lib/swift/linux
swiftlib_LTLIBRARIES=libdispatch.la
else
lib_LTLIBRARIES=libdispatch.la
endif

libdispatch_la_SOURCES= \
allocator.c \
Expand Down Expand Up @@ -112,33 +117,28 @@ EXTRA_libdispatch_la_SOURCES+=swift/Dispatch.swift
EXTRA_libdispatch_la_DEPENDENCIES+=$(abs_builddir)/Dispatch.o $(abs_builddir)/Dispatch.swiftmodule
libdispatch_la_LIBADD+=$(abs_builddir)/Dispatch.o

SWIFT_MODULEMAPS=$(abs_builddir)/module.map $(abs_builddir)/module.build.map
SWIFTMODULE_OBJECTS= \
SWIFT_OBJECTS= \
$(abs_builddir)/Dispatch.swiftmodule \
$(abs_builddir)/Dispatch.swiftdoc \
$(abs_builddir)/Dispatch.o

SWIFTC_FLAGS = -I$(abs_top_srcdir) -parse-as-library -Xcc -fblocks -Xcc -fmodule-map-file=module.build.map

$(abs_builddir)/module.build.map: $(abs_srcdir)/swift/module.map.in
m4 -DPREFIX=$(abs_top_srcdir) $< > $@
SWIFTC_FLAGS = -Xcc -fmodule-map-file=$(abs_top_srcdir)/dispatch/module.map -I$(abs_top_srcdir) -parse-as-library -Xcc -fblocks

$(abs_builddir)/module.map: $(abs_srcdir)/swift/module.map.in
m4 -DPREFIX=$(includedir) $< > $@

$(abs_builddir)/Dispatch.o: $(abs_srcdir)/swift/Dispatch.swift $(abs_builddir)/module.build.map
$(abs_builddir)/Dispatch.o: $(abs_srcdir)/swift/Dispatch.swift
$(SWIFTC) $(SWIFTC_FLAGS) -c -o $@ $<

$(abs_builddir)/Dispatch.swiftmodule: $(abs_srcdir)/swift/Dispatch.swift $(abs_builddir)/module.build.map
$(abs_builddir)/Dispatch.swiftmodule: $(abs_srcdir)/swift/Dispatch.swift
$(SWIFTC) $(SWIFTC_FLAGS) -emit-module -emit-module-path $@ $<

swiftdir=$(includedir)/Dispatch
swift_HEADERS=$(abs_builddir)/module.map $(abs_builddir)/Dispatch.swiftmodule $(abs_builddir)/Dispatch.swiftdoc
if HAVE_SWIFT
swiftmoddir=${prefix}/lib/swift/linux/${build_cpu}
swiftmod_HEADERS=$(abs_builddir)/Dispatch.swiftmodule $(abs_builddir)/Dispatch.swiftdoc
endif

endif

BUILT_SOURCES=$(MIG_SOURCES) $(DTRACE_SOURCES) $(SWIFT_MODULEMAPS)
BUILT_SOURCES=$(MIG_SOURCES) $(DTRACE_SOURCES)
nodist_libdispatch_la_SOURCES=$(BUILT_SOURCES)
CLEANFILES=$(BUILT_SOURCES) $(SWIFTMODULE_OBJECTS)
CLEANFILES=$(BUILT_SOURCES) $(SWIFT_OBJECTS)
DISTCLEANFILES=pthread_machdep.h pthread System mach objc