After some screwing around with things, I wrote the following script that solved the issue. Posting it here for others:
#!/bin/bash
set -e
platform="MacOSX"
SDK="MacOSX10.8"
checkExists() {
if [ ! -e $1 ]
then
echo "Didn't find: $1 -- try to locate parts of this to see how to fix the path"
exit 1
else
echo "using $1"
fi
}
root="/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer"
oldRoot="/Developer/Platforms/${platform}.platform/Developer"
if [ ! -d "${root}" ]
then
newRoot="${root}"
root="${oldRoot}"
fi
if [ ! -d "${root}" ]
then
echo " "
echo "Oopsie. You don't have an SDK root in either of these locations: "
echo " ${newRoot} "
echo " ${oldRoot}"
echo " "
exit 1
fi
export CC="/usr/bin/gcc"
export CFLAGS="-isysroot ${root}/SDKs/${SDK}.sdk -I ${root}/usr/include"
checkExists ${CC}
checkExists ${root}/SDKs/${SDK}.sdk
./configure --enable-shared --enable-static
make clean
make