6 swiftlibdir=${prefix}/lib/swift/${OS_STRING}
7 swiftlib_LTLIBRARIES=libdispatch.la
9 lib_LTLIBRARIES=libdispatch.la
12 if DISPATCH_USE_INTERNAL_WORKQUEUE
13 INTERNAL_WORKQUEUE_SOURCES= \
15 event/workqueue_internal.h
18 libdispatch_la_SOURCES= \
37 allocator_internal.h \
41 introspection_internal.h \
46 semaphore_internal.h \
52 event/event_config.h \
54 event/event_internal.h \
55 event/event_kevent.c \
56 firehose/firehose_internal.h \
57 shims/android_stubs.h \
70 $(INTERNAL_WORKQUEUE_SOURCES)
72 EXTRA_libdispatch_la_SOURCES=
73 EXTRA_libdispatch_la_DEPENDENCIES=
75 AM_CPPFLAGS=-I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/private
77 DISPATCH_CFLAGS=-Wall $(VISIBILITY_FLAGS) $(OMIT_LEAF_FP_FLAGS) \
78 $(MARCH_FLAGS) $(BSD_OVERLAY_CFLAGS)
79 if DISPATCH_ENABLE_ASSERTS
80 DISPATCH_CFLAGS+=-DDISPATCH_DEBUG=1
82 AM_CFLAGS= $(PTHREAD_WORKQUEUE_CFLAGS) $(DISPATCH_CFLAGS) $(CBLOCKS_FLAGS)
83 AM_OBJCFLAGS=$(DISPATCH_CFLAGS) $(CBLOCKS_FLAGS)
84 AM_CXXFLAGS=$(PTHREAD_WORKQUEUE_CFLAGS) $(DISPATCH_CFLAGS) $(CXXBLOCKS_FLAGS)
85 AM_OBJCXXFLAGS=$(DISPATCH_CFLAGS) $(CXXBLOCKS_FLAGS)
87 if HAVE_PTHREAD_WORKQUEUES
88 PTHREAD_WORKQUEUE_LIBS=-lpthread_workqueue
89 PTHREAD_WORKQUEUE_CFLAGS=
92 if BUILD_OWN_BLOCKS_RUNTIME
93 libdispatch_la_SOURCES+= BlocksRuntime/data.c BlocksRuntime/runtime.c
94 CBLOCKS_FLAGS+= -I$(top_srcdir)/src/BlocksRuntime
95 CXXBLOCKS_FLAGS+= -I$(top_srcdir)/src/BlocksRuntime
97 BLOCKS_RUNTIME_LIBS=-ldl
101 libdispatch_la_LDFLAGS=-avoid-version
102 libdispatch_la_LIBADD=$(PTHREAD_WORKQUEUE_LIBS) $(BSD_OVERLAY_LIBS) $(BLOCKS_RUNTIME_LIBS)
105 libdispatch_la_LDFLAGS+=-Wl,-compatibility_version,1 \
106 -Wl,-current_version,$(VERSION) -Wl,-dead_strip \
107 -Wl,-alias_list,$(top_srcdir)/xcodeconfig/libdispatch.aliases
111 libdispatch_la_LDFLAGS+=-Xcompiler -fuse-ld=gold
115 libdispatch_la_SOURCES+=block.cpp data.m object.m
116 libdispatch_la_OBJCFLAGS=$(AM_OBJCFLAGS) -Wno-switch -fobjc-gc
117 libdispatch_la_CXXFLAGS=$(AM_CXXFLAGS) -std=gnu++11 -fno-exceptions
118 libdispatch_la_LDFLAGS+=-Wl,-upward-lobjc -Wl,-upward-lauto \
119 -Wl,-order_file,$(top_srcdir)/xcodeconfig/libdispatch.order
121 libdispatch_la_SOURCES+=block.cpp
122 libdispatch_la_CXXFLAGS=$(AM_CXXFLAGS) -std=gnu++11 -fno-exceptions
132 %User.c %.h %Server.c %Server.h: $(abs_srcdir)/%.defs
133 $(MIG) -user $*User.c -header $*.h \
134 -server $*Server.c -sheader $*Server.h $<
138 DTRACE_SOURCES=provider.h
140 %.h: $(abs_srcdir)/%.d
141 $(DTRACE) -h -s $< -o $@
148 swift/Dispatch.swift \
150 swift/Private.swift \
156 SWIFT_ABS_SRC_FILES = $(SWIFT_SRC_FILES:%=$(abs_srcdir)/%)
157 SWIFT_OBJ_FILES = $(abs_builddir)/swift/swift_overlay.o
158 SWIFT_LIBTOOL_OBJ_FILES = $(abs_builddir)/swift/swift_overlay.lo
160 SWIFTC_FLAGS+= -Xcc -fmodule-map-file=$(abs_top_srcdir)/dispatch/module.modulemap -I$(abs_top_srcdir) -Xcc -fblocks
161 if DISPATCH_ENABLE_OPTIMIZATION
165 # this saves the object file, then tricks libtool into generating a .lo file and
166 # then moves the object file back in the places libtool expects them to be for
167 # the PIC and non-PIC case.
168 $(abs_builddir)/swift/swift_overlay.lo: $(abs_builddir)/swift/swift_overlay.o
169 mv $(abs_builddir)/swift/swift_overlay.o $(abs_builddir)/swift/.libs/swift_overlay.o.save
170 $(LIBTOOL) --mode=compile --tag=CC true -o $< -c /dev/null
171 cp $(abs_builddir)/swift/.libs/swift_overlay.o.save $(abs_builddir)/swift/.libs/swift_overlay.o
172 mv $(abs_builddir)/swift/.libs/swift_overlay.o.save $(abs_builddir)/swift/swift_overlay.o
174 $(abs_builddir)/swift/swift_overlay.o: $(SWIFT_ABS_SRC_FILES) $(SWIFTC)
176 $(SWIFTC) -whole-module-optimization -emit-library -c $(SWIFT_ABS_SRC_FILES) \
177 $(SWIFTC_FLAGS) -module-name Dispatch -module-link-name dispatch \
178 -o $@ -emit-module-path $(abs_builddir)/swift/Dispatch.swiftmodule
180 libdispatch_la_SOURCES+=swift/DispatchStubs.cc
181 EXTRA_libdispatch_la_SOURCES+=$(SWIFT_SRC_FILES)
183 EXTRA_libdispatch_la_DEPENDENCIES+=$(SWIFT_OBJ_FILES) $(SWIFT_LIBTOOL_OBJ_FILES) $(abs_builddir)/swift/Dispatch.swiftmodule
184 libdispatch_la_LIBADD+=$(SWIFT_LIBTOOL_OBJ_FILES)
187 $(abs_builddir)/swift/Dispatch.swiftmodule \
188 $(abs_builddir)/swift/Dispatch.swiftdoc \
191 swiftmoddir=${prefix}/lib/swift/${OS_STRING}/${host_cpu}
193 $(abs_builddir)/swift/Dispatch.swiftmodule \
194 $(abs_builddir)/swift/Dispatch.swiftdoc
197 BUILT_SOURCES=$(MIG_SOURCES) $(DTRACE_SOURCES)
198 nodist_libdispatch_la_SOURCES=$(BUILT_SOURCES)
199 CLEANFILES=$(BUILT_SOURCES) $(SWIFT_GEN_FILES)
200 DISTCLEANFILES=pthread_machdep.h pthread System mach objc