1 Grand Central Dispatch (GCD)
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.
10 Configuring and installing libdispatch
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:
21 The following configure options may be of general interest:
23 --with-apple-libc-source
25 Specify the path to Apple's Libc package, so that appropriate headers can
28 --with-apple-libclosure-source
30 Specify the path to Apple's Libclosure package, so that appropriate headers
31 can be found and used.
33 --with-apple-xnu-source
35 Specify the path to Apple's XNU package, so that appropriate headers can be
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
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:
48 --with-apple-objc4-source
50 Specify the path to Apple's objc4 package, so that appropriate headers can
53 --with-apple-libauto-source
55 Specify the path to Apple's libauto package, so that appropriate headers
56 can be found and used.
58 --disable-libdispatch-init-constructor
60 Do not tag libdispatch's init routine as __constructor, in which case it
61 must be run manually before libdispatch routines can be called. This is the
62 default when building on Mac OS X. For /usr/lib/system/libdispatch.dylib
63 the init routine is called automatically during process start.
65 --enable-apple-tsd-optimizations
67 Use a non-portable allocation scheme for pthread per-thread data (TSD) keys
68 when building libdispatch for /usr/lib/system on Mac OS X. This should not
69 be used on other OS's, or on Mac OS X when building a stand-alone library.
71 Typical configuration commands
73 The following command lines create the configuration required to build
74 libdispatch for /usr/lib/system on OS X MountainLion:
77 cflags='-arch x86_64 -arch i386 -g -Os'
78 ./configure CFLAGS="$cflags" OBJCFLAGS="$cflags" CXXFLAGS="$cflags" \
79 --prefix=/usr --libdir=/usr/lib/system \
80 --disable-dependency-tracking --disable-static \
81 --enable-apple-tsd-optimizations \
82 --with-apple-libc-source=/path/to/10.8.0/Libc-825.24 \
83 --with-apple-libclosure-source=/path/to/10.8.0/libclosure-59 \
84 --with-apple-xnu-source=/path/to/10.8.0/xnu-2050.7.9 \
85 --with-apple-objc4-source=/path/to/10.8.0/objc4-532 \
86 --with-apple-libauto-source=/path/to/10.8.0/libauto-185.1
89 Typical configuration line for FreeBSD 8.x and 9.x to build libdispatch with
90 clang and blocks support:
93 ./configure CC=clang --with-blocks-runtime=/usr/local/lib