May 26

Compiling Blender 2.5x on Xcode 4 (with SCONS)

Thu, 05/26/2011 - 15:11 — peter

The Problem

You, like me once, just upgraded to Xcode 4 and now you can't compile blender... This happens because the blender compiler (BTW: I use scons to compile) uses the old sdk 10.5 and/or 10.4u, which is not available on Xcode 4.

If you need help getting the initial setup to compile blender, view this video done by the awesome people at blender cookie.

The Solution

Well, if you had Xcode 3 and installed Xcode 4 on top of that, you are pretty much set for this step. If you upgraded your Mac or did a fresh install of Xcode 4, then I believe I have some bad news for you: you will most likely need to uninstall Xcode 4, reinstall Xcode 3, then upgrade to Xcode 4 to continue...

To uninstall Xcode 4, use the following command that I got from this site:

sudo /Developer/Library/uninstall-devtools --mode=all

Now go get the old Xcode 3 installer at the Apple site and install it.

Now go ahead and install Xcode 4 again... The normal behavior of Xcode 4 is to place Xcode 3 on a folder called "/Developer-old". Once that happens and the install complete, the only thing you need to do is create a symbolic link from the old sdk into the new Xcode installation. To do that, type the following on the command line:

sudo ln -s /Developer-old/SDKs/MacOSX10.4u.sdk /Developer/SDKs/
sudo ln -s /Developer-old/SDKs/MacOSX10.5.sdk /Developer/SDKs/

That is it.

Easy Peasy!
-PCP