@@ -4,21 +4,45 @@ GCD is a concurrent programming framework first shipped with Mac OS X Snow
4
4
Leopard. This package is an open source bundling of libdispatch, the core
5
5
user space library implementing GCD. At the time of writing, support for
6
6
the BSD kqueue API, and specifically extensions introduced in Mac OS X Snow
7
- Leopard and FreeBSD 9-CURRENT, are required to use libdispatch. Support
8
- for Linux is a work in progress (see Linux notes below). Other systems are
9
- currently unsupported.
7
+ Leopard and FreeBSD 9-CURRENT, are required to use libdispatch. Linux is
8
+ supported, but requires specific packages to be installed (see Linux
9
+ section at the end of the file). Other systems are currently unsupported.
10
10
11
- Configuring and installing libdispatch
11
+ I. Configuring and installing libdispatch (general comments)
12
12
13
13
GCD is built using autoconf, automake, and libtool, and has a number of
14
14
compile-time configuration options that should be reviewed before starting.
15
- An uncustomized install requires:
15
+ An uncustomized install of the C-API to libdispatch requires:
16
16
17
17
sh autogen.sh
18
18
./configure
19
19
make
20
20
make install
21
21
22
+ libdispatch can be optionally built to include a Swift API. This requires a
23
+ Swift toolchain to compile the Swift code in libdispatch and can be done
24
+ in two possible scenarios.
25
+
26
+ If you are building your own Swift toolchain from source, then you should build
27
+ libdispatch simply by giving additional arguments to swift/utils/build-script:
28
+
29
+ ./swift/utils/build-script --libdispatch -- --install-libdispatch
30
+
31
+ To build libdispatch using a pre-built Swift toolchain and install libdispatch
32
+ into that toolchain (to allow that toolchain to compile Swift code containing
33
+ "import Dispatch") requires:
34
+
35
+ sh autogen.sh
36
+ ./configure --with-swift-toolchain=<PATH_TO_SWIFT_TOOLCHAIN> --prefix=<PATH_TO_SWIFT_TOOLCHAIN>
37
+ make
38
+ make install
39
+
40
+ Note that once libdispatch is installed into a Swift toolchain, that
41
+ toolchain cannot be used to compile libdispatch again (you must 'make uninstall'
42
+ libdispatch from the toolchain before using it to rebuild libdispatch).
43
+
44
+ II. Building and installing on OS X
45
+
22
46
The following configure options may be of general interest:
23
47
24
48
--with-apple-libpthread-source
@@ -88,33 +112,42 @@ libdispatch for /usr/lib/system on OS X El Capitan:
88
112
--with-apple-objc4-source=/path/to/10.11.0/objc4-680
89
113
make check
90
114
115
+ III. Building and installing for FreeBSD
116
+
91
117
Typical configuration line for FreeBSD 8.x and 9.x to build libdispatch with
92
118
clang and blocks support:
93
119
94
120
sh autogen.sh
95
121
./configure CC=clang --with-blocks-runtime=/usr/local/lib
96
122
make check
97
123
98
- Instructions for building on Linux. Initial focus is on ubuntu 15.04.
99
- Prepare your system
100
- 1. Install compiler, autotools
101
- sudo apt-get install clang
102
- sudo apt-get install autoconf libtool pkg-config
103
- 2. Install dtrace (to generate provider.h)
124
+ IV. Building and installing for Linux
125
+
126
+ Note that libdispatch development and testing is done only
127
+ on Ubuntu; currently supported versions are 14.04, 15.10 and 16.04.
128
+
129
+ (1) The first thing to do is install required packages:
130
+ 1a. Install build tools and clang compiler.
131
+ sudo apt-get install autoconf libtool pkg-config clang
132
+ 1b. Install dtrace (to generate provider.h)
104
133
sudo apt-get install systemtap-sdt-dev
105
- 3 . Install libdispatch pre-reqs
134
+ 1c . Install additional libdispatch dependencies
106
135
sudo apt-get install libblocksruntime-dev libkqueue-dev libbsd-dev
107
136
108
- Initialize git submodules:
109
- We are using git submodules to incorporate a specific revision of the
110
- upstream pthread_workqueue library into the build.
137
+ Note: compiling libdispatch requires clang 3.8 or better and
138
+ the gold linker. If the default clang on your Ubuntu version is
139
+ too old, see http://apt.llvm.org/ to install a newer version.
140
+ On older Ubuntu releases, you may need to install binutils-gold
141
+ to get the gold linker.
142
+
143
+ (2) Initialize git submodules.
144
+ We are using git submodules to incorporate specific revisions of the
145
+ upstream pthread_workqueue and libkqueue projects into the build.
111
146
git submodule init
112
147
git submodule update
113
148
114
- Build:
149
+ (3) Build (as in the general instructions above)
115
150
sh autogen.sh
116
151
./configure
117
152
make
118
-
119
- Note: the build currently fails building tests, but libdispatch.so should
120
- build successfully.
153
+ make install
0 commit comments