The problem was in the --host
parameter to configure
. It needs to be changed depending on the machine on which you want to run the Simulator. In my case, this is a MacBook Pro from mid 2009, running Mac OS X 10.8.5.
uname -a
reports:
Darwin <my computer name>.local 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013; root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64
So I wildly guessed that the --host
parameter for configure
for this environment, in which the Simulator runs, needs to be set to i686-apple-darwin12.5.0
. The guess was right. My build script now looks like this:
mkdir -p build
rm -rf build/* #*/
function build_lame()
{
make distclean
./configure \
CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/${SDK}.platform/Developer/SDKs/$SDK$SDK_VERSION.sdk" \
CC="/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -arch $PLATFORM -miphoneos-version-min=7.0" \
--prefix="/Users/$USER/Desktop/$PROJECTNAME" \
--host="$HOST" \
--disable-shared \
--enable-static \
--disable-frontend \
make
cp "$PROJECTNAME/.libs/$PROJECTNAME.a" "build/$PROJECTNAME-$PLATFORM.a"
}
PROJECTNAME=libmp3lame
SDK_VERSION=7.0
SDK="iPhoneSimulator"
HOST="i686-apple-darwin12.5.0"
PLATFORM="i686"
build_lame
SDK="iPhoneOS"
HOST="arm-apple-darwin9"
PLATFORM="armv7"
build_lame
SDK="iPhoneOS"
HOST="arm-apple-darwin9"
PLATFORM="armv7s"
build_lame
lipo -create build/$PROJECTNAME-* -output build/$PROJECTNAME.a
This works when building for Simulator in Xcode.