]>
Commit | Line | Data |
---|---|---|
e85f4437 A |
1 | Grand Central Dispatch (GCD) |
2 | ||
3 | GCD is a concurrent programming framework first shipped with Mac OS X Snow | |
4 | Leopard. This package is an open source bundling of libdispatch, the core | |
5 | user space library implementing GCD. At the time of writing, support for | |
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. Other | |
8 | systems are currently unsupported. | |
9 | ||
10 | Configuring and installing libdispatch | |
11 | ||
12 | GCD is built using autoconf, automake, and libtool, and has a number of | |
13 | compile-time configuration options that should be reviewed before starting. | |
14 | An uncustomized install requires: | |
15 | ||
16 | sh autogen.sh | |
17 | ./configure | |
18 | make | |
19 | make install | |
20 | ||
21 | The following configure options may be of general interest: | |
22 | ||
23 | --with-apple-libc-source | |
24 | ||
c093abd6 A |
25 | Specify the path to Apple's Libc package, so that appropriate headers can |
26 | be found and used. | |
e85f4437 A |
27 | |
28 | --with-apple-libclosure-source | |
29 | ||
30 | Specify the path to Apple's Libclosure package, so that appropriate headers | |
31 | can be found and used. | |
32 | ||
33 | --with-apple-xnu-source | |
34 | ||
c093abd6 A |
35 | Specify the path to Apple's XNU package, so that appropriate headers can be |
36 | found and used. | |
e85f4437 A |
37 | |
38 | --with-blocks-runtime | |
39 | ||
c093abd6 A |
40 | On systems where -fblocks is supported, specify an additional library path |
41 | in which libBlocksRuntime can be found. This is not required on Mac OS X, | |
42 | where the Blocks runtime is included in libSystem, but is required on | |
43 | FreeBSD. | |
e85f4437 | 44 | |
c093abd6 A |
45 | The following options are likely to only be useful when building libdispatch on |
46 | Mac OS X as a replacement for /usr/lib/system/libdispatch.dylib: | |
e85f4437 A |
47 | |
48 | --disable-libdispatch-init-constructor | |
49 | ||
c093abd6 A |
50 | Do not tag libdispatch's init routine as __constructor, in which case it |
51 | must be run manually before libdispatch routines can be called. This is the | |
52 | default when building on Mac OS X. For /usr/lib/system/libdispatch.dylib | |
53 | the init routine is called automatically during process start. | |
e85f4437 A |
54 | |
55 | --enable-apple-tsd-optimizations | |
56 | ||
c093abd6 A |
57 | Use a non-portable allocation scheme for pthread per-thread data (TSD) keys |
58 | when building libdispatch for /usr/lib/system on Mac OS X. This should not | |
59 | be used on other OS's, or on Mac OS X when building a stand-alone library. | |
e85f4437 A |
60 | |
61 | Typical configuration commands | |
62 | ||
63 | The following command lines create the configuration required to build | |
64 | libdispatch for /usr/lib/system on Mac OS X Lion: | |
65 | ||
66 | sh autogen.sh | |
c093abd6 | 67 | ./configure CFLAGS='-arch x86_64 -arch i386 -g -Os' \ |
e85f4437 A |
68 | --prefix=/usr --libdir=/usr/lib/system \ |
69 | --disable-dependency-tracking --disable-static \ | |
e85f4437 A |
70 | --enable-apple-tsd-optimizations \ |
71 | --with-apple-libc-source=/path/to/10.7.0/Libc-763.11 \ | |
72 | --with-apple-libclosure-source=/path/to/10.7.0/libclosure-53 \ | |
73 | --with-apple-xnu-source=/path/to/10.7.0/xnu-1699.22.73 | |
c093abd6 | 74 | make check |
e85f4437 A |
75 | |
76 | Typical configuration line for FreeBSD 8.x and 9.x to build libdispatch with | |
77 | clang and blocks support: | |
78 | ||
79 | sh autogen.sh | |
80 | ./configure CC=clang --with-blocks-runtime=/usr/local/lib | |
c093abd6 | 81 | make check |