You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
@@ -8,7 +8,7 @@ Leopard and FreeBSD 9-CURRENT, are required to use libdispatch. Linux is
8
8
supported, but requires specific packages to be installed (see Linux
9
9
section at the end of the file). Other systems are currently unsupported.
10
10
11
-
I. Configuring and installing libdispatch (general comments)
11
+
###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.
@@ -41,59 +41,82 @@ Note that once libdispatch is installed into a Swift toolchain, that
41
41
toolchain cannot be used to compile libdispatch again (you must 'make uninstall'
42
42
libdispatch from the toolchain before using it to rebuild libdispatch).
43
43
44
-
II. Building and installing on OS X
44
+
To create the toolchain with libdispatch Using build-toolchain in Linux:
45
+
46
+
1. Add libdispatch and install-libdispatch lines to ./swift/utils/build-presets.ini under `[preset: buildbot_linux]` section, as following:
47
+
48
+
```
49
+
[preset: buildbot_linux]
50
+
mixin-preset=mixin_linux_installation
51
+
build-subdir=buildbot_linux
52
+
lldb
53
+
release
54
+
test
55
+
validation-test
56
+
long-test
57
+
libdispatch
58
+
foundation
59
+
lit-args=-v
60
+
dash-dash
61
+
62
+
install-libdispatch
63
+
install-foundation
64
+
reconfigure
65
+
```
66
+
67
+
2. Run:
68
+
69
+
```
70
+
./swift/utils/build-toolchain local.swift
71
+
```
72
+
73
+
Note that adding libdispatch in build-presets.ini is for Linux only as Swift on macOS platforms uses the system installed libdispatch, so its not required.
74
+
75
+
### Building and installing on OS X
45
76
46
77
The following configure options may be of general interest:
47
78
48
-
--with-apple-libpthread-source
79
+
`--with-apple-libpthread-source`
49
80
50
-
Specify the path to Apple's libpthread package, so that appropriate headers
81
+
Specify the path to Apple's libpthread package, so that appropriate headers
51
82
can be found and used.
52
83
53
-
--with-apple-libplatform-source
84
+
`--with-apple-libplatform-source`
54
85
55
-
Specify the path to Apple's libplatform package, so that appropriate headers
86
+
Specify the path to Apple's libplatform package, so that appropriate headers
56
87
can be found and used.
57
88
58
-
--with-apple-libclosure-source
89
+
`--with-apple-libclosure-source`
59
90
60
-
Specify the path to Apple's Libclosure package, so that appropriate headers
91
+
Specify the path to Apple's Libclosure package, so that appropriate headers
61
92
can be found and used.
62
93
63
-
--with-apple-xnu-source
94
+
`--with-apple-xnu-source`
64
95
65
-
Specify the path to Apple's XNU package, so that appropriate headers can be
96
+
Specify the path to Apple's XNU package, so that appropriate headers can be
66
97
found and used.
67
98
68
-
--with-blocks-runtime
99
+
`--with-blocks-runtime`
69
100
70
-
On systems where -fblocks is supported, specify an additional library path
71
-
in which libBlocksRuntime can be found. This is not required on OS X,
72
-
where the Blocks runtime is included in libSystem, but is required on
73
-
FreeBSD.
101
+
On systems where -fblocks is supported, specify an additional library path in which libBlocksRuntime can be found. This is not required on OS X, where the Blocks runtime is included in libSystem, but is required on FreeBSD.
74
102
75
103
The following options are likely to only be useful when building libdispatch on
76
104
OS X as a replacement for /usr/lib/system/libdispatch.dylib:
77
105
78
-
--with-apple-objc4-source
106
+
`--with-apple-objc4-source`
79
107
80
-
Specify the path to Apple's objc4 package, so that appropriate headers can
108
+
Specify the path to Apple's objc4 package, so that appropriate headers can
81
109
be found and used.
82
110
83
-
--disable-libdispatch-init-constructor
111
+
`--disable-libdispatch-init-constructor`
84
112
85
-
Do not tag libdispatch's init routine as __constructor, in which case it
86
-
must be run manually before libdispatch routines can be called. This is the
87
-
default when building on OS X. For /usr/lib/system/libdispatch.dylib
88
-
the init routine is called automatically during process start.
113
+
Do not tag libdispatch's init routine as __constructor, in which case it must be run manually before libdispatch routines can be called. This is the default when building on OS X. For /usr/lib/system/libdispatch.dylib the init routine is called automatically during process start.
89
114
90
-
--enable-apple-tsd-optimizations
115
+
`--enable-apple-tsd-optimizations`
91
116
92
-
Use a non-portable allocation scheme for pthread per-thread data (TSD) keys
93
-
when building libdispatch for /usr/lib/system on OS X. This should not
94
-
be used on other OS's, or on OS X when building a stand-alone library.
117
+
Use a non-portable allocation scheme for pthread per-thread data (TSD) keys when building libdispatch for /usr/lib/system on OS X. This should not be used on other OS's, or on OS X when building a stand-alone library.
95
118
96
-
Typical configuration commands
119
+
#### Typical configuration commands
97
120
98
121
The following command lines create the configuration required to build
99
122
libdispatch for /usr/lib/system on OS X El Capitan:
@@ -112,7 +135,7 @@ libdispatch for /usr/lib/system on OS X El Capitan:
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,13 @@ libdispatch on Darwin is a combination of logic in the `xnu` kernel alongside th
18
18
19
19
Our first tasks for this project are:
20
20
21
-
0. Adapt the current autotools build system to work on Linux, or develop a new makefile or other build script for the project on Linux. The current version of the build system has only been tested on Darwin, though previous versions have been made to work on FreeBSD and Linux (see INSTALL).
22
-
0. Omit as much of the extra functionality of the library as possible, to get a core version of the project building. Much of the OS X-specific functionality can be elided completely on Linux.
23
-
0. Adopt libdispatch in other Core Libraries projects, especially Foundation. This will validate our work and get immediate coverage on basic functionality.
24
-
0. Incrementally add functionality back in.
21
+
1. Adapt the current autotools build system to work on Linux, or develop a new makefile or other build script for the project on Linux. The current version of the build system has only been tested on Darwin, though previous versions have been made to work on FreeBSD and Linux (see [INSTALL](INSTALL.md)).
22
+
2. Omit as much of the extra functionality of the library as possible, to get a core version of the project building. Much of the OS X-specific functionality can be elided completely on Linux.
23
+
3. Adopt libdispatch in other Core Libraries projects, especially Foundation. This will validate our work and get immediate coverage on basic functionality.
24
+
4. Incrementally add functionality back in.
25
25
26
26
Some C headers and sources (e.g. `Availability.h`, `Block.h`, and the libclosure `runtime.c`) are similar to ones embedded into the CoreFoundation part of [swift-corelibs-foundation](http://github.com/apple/swift-corelibs-foundation). We should figure out a mechanism to share these instead of duplicating them across projects.
0 commit comments