Building xnu requires Xcode and some additional open-source (but not pre-installed) dependencies. You can build xnu manually by doing:
- Install OS X Mountain Lion and Xcode 4.4
- Launch Xcode, go to Preferences... > Downloads and install the Command Line Tools
- Download the source for the dtrace and AvailabilityVersions projects, which are required dependencies, as well as xnu itself
$ curl -O http://opensource.apple.com/tarballs/dtrace/dtrace-96.tar.gz $ curl -O http://opensource.apple.com/tarballs/AvailabilityVersions/AvailabilityVersions-4.2.tar.gz $ curl -O http://opensource.apple.com/tarballs/xnu/xnu-2050.7.9.tar.gz
- Build and install CTF tools from dtrace
$ tar zxf dtrace-96.tar.gz $ cd dtrace-96 $ mkdir -p obj sym dst $ xcodebuild install -target ctfconvert -target ctfdump -target ctfmerge ARCHS="x86_64" SRCROOT=$PWD OBJROOT=$PWD/obj SYMROOT=$PWD/sym DSTROOT=$PWD/dst ... $ sudo ditto $PWD/dst/usr/local /usr/local Password: $ cd ..
- Install AvailabilityVersions
$ tar zxf AvailabilityVersions-4.2.tar.gz $ cd AvailabilityVersions-4.2 $ mkdir -p dst $ make install SRCROOT=$PWD DSTROOT=$PWD/dst $ sudo ditto $PWD/dst/usr/local /usr/local $ cd ..
- Build xnu
$ tar zxf xnu-2050.7.9.tar.gz $ cd xnu-2050.7.9 $ make ARCH_CONFIGS=X86_64 KERNEL_CONFIGS=RELEASE