Skip to content

Instantly share code, notes, and snippets.

@taksatou
Created October 16, 2012 14:36
Show Gist options
  • Save taksatou/3899653 to your computer and use it in GitHub Desktop.
Save taksatou/3899653 to your computer and use it in GitHub Desktop.
ZeroMQ build script for iPhoneOS6.0 SDK
for platform in iPhoneOS iPhoneSimulator; do
BUILD_DIR=`pwd`/build.$platform
if [[ -d $BUILD_DIR ]]; then
rm -fr $BUILD_DIR
fi
mkdir -p $BUILD_DIR
ZMQ_BUILD_LOG_FILE=$BUILD_DIR/build.log
SDK_ROOT="/Applications/Xcode.app/Contents/Developer/Platforms/$platform.platform/Developer"
if [ $platform = "iPhoneOS" ]; then
SDK_VERSION="iPhoneOS6.0.sdk"
export CXX="${SDK_ROOT}/usr/bin/arm-apple-darwin10-llvm-g++-4.2"
export CC="${SDK_ROOT}/usr/bin/arm-apple-darwin10-llvm-gcc-4.2"
export CFLAGS="-march=armv6 -O -isysroot $SDK_ROOT/SDKs/$SDK_VERSION"
export CXXFLAGS="-march=armv6 -O -isysroot $SDK_ROOT/SDKs/$SDK_VERSION"
elif [ $platform = "iPhoneSimulator" ]; then
SDK_VERSION="iPhoneSimulator6.0.sdk"
export CXX="${SDK_ROOT}/usr/bin/i686-apple-darwin11-llvm-g++-4.2"
export CC="${SDK_ROOT}/usr/bin/i686-apple-darwin11-llvm-gcc-4.2"
export CFLAGS="-march=i386 -O -isysroot $SDK_ROOT/SDKs/$SDK_VERSION"
export CXXFLAGS="-march=i386 -O -isysroot $SDK_ROOT/SDKs/$SDK_VERSION"
else
echo unknown platform
exit 1
fi
export CPP="cpp"
export CXXCPP="cpp"
export AR=$SDK_ROOT"/usr/bin/ar"
export AS=$SDK_ROOT"/usr/bin/as"
export LD=$SDK_ROOT"/usr/bin/ld"
export LDFLAGS="-lstdc++ -isysroot $SDK_ROOT/SDKs/$SDK_VERSION"
export LIBTOOL=$SDK_ROOT"/usr/bin/libtool"
export STRIP=$SDK_ROOT"/usr/bin/strip"
export RANLIB=$SDK_ROOT"/usr/bin/ranlib"
env
./configure --disable-dependency-tracking --enable-static --disable-shared --host=arm-apple-darwin11 --prefix=$BUILD_DIR && make clean && make install
done;
lipo build.*/lib/*.a -create -output libzmq.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment