Here is what you need to do to be able to build XFree86 (or other clients of IOGraphics services) on Mac OS X Public Beta.
Now su to root and do a ``make install'' from the bootstrap_cmds directory.
cvs checkout bootstrap_cmds cd bootstrap_cmds make
cd /Library mkdir -p Frameworks cp -R /System/Library/Frameworks/IOKit.framework Frameworks/IOKit.framework cd / mkdir -p Local ln -s /Library /Local/Library
The "make install" will start by assembling all the headers you need, but then will proceed to build a new kernel. You can Control-C out of the build once it starts compiling things if you want. Otherwise, just be patient.
cvs checkout xnu cd xnu source SETUP/setup.csh make exporthdrs make install
Then you need to change the Makefile so it builds on top of the new IOKit framework you are building. Change to the IOKitUser project directory and edit the Makefile. Change the following line:
cvs checkout IOKitUser
NEXTSTEP_BUILD_OUTPUT_DIR = /$(USER)/build/$(NAME)
Now, run ``make'' while in the IOKitUser directory. It will likely not finish building since the IOKitUser project relies on some stuff that Apple hasn't really made public yet, but it should finish populating the new IOKit framework with headers and start compiling. (Strangely enough, the headers installed in your new IOKit framework don't contain the real header files. They are just single line files with an #import of the file in your IOKitUser project. This works fine as long as you don't ever delete or move your IOKitUser project. I imagine that using ``make install'' would fix this up, but you can't do this as long as the project doesn't build correctly. So for now you can either move the header files by hand, or make sure you leave your IOKitUser project in place.)
NEXTSTEP_BUILD_OUTPUT_DIR = <your xnudir>/BUILD/dst/System/Library/Frameworks
cd BUILD/dst/System/Library/Frameworks/ cp -R IOKit.framework/Versions/A/Headers/* \ /Library/Frameworks/IOKit.framework/Versions/A/Headers
cd BUILD/dst/System/Library/Frameworks/System.framework/Versions/B/Headers cp -R libkern /System/Library/Frameworks/System.framework/Headers/libkern
Here is an outline of what you need to do to be able to build XFree86 (or other clients of IOGraphics services) on Mac OS X Developers' Preview 4.
source SETUP/setup.csh make exporthdrs
This will create a new local version of the IOKit framework that will override the System version without changing the original.
mkdir -p /Local/Library/Frameworks cp -R /System/Library/Frameworks/IOKit.framework /Local/Library/Frameworks
The only problem with this is that there are a few stub header files included that are just a single line with an #import to the appropriate place in the xnu source on your disk. This is fine as long as you don't move your xnu project. If you do, you can copy the original file to replace the stub. There is probably an easier way to automatically build a clean version of the IOKit framework, but I didn't find it. (Let me know if you do.)
cp -R sandbox/xnu/BUILD/dst/System/Library/Frameworks/IOKit.framework/Versions/A/Headers \ /Local/Library/Frameworks/IOKit.framework/Versions/A
47c47 < #include <Kernel/libkern/OSTypes.h> --- > #include <libkern/OSTypes.h>