1 #!/bin/sh 2 # This uses the latest available iOS SDK, which is recommended. 3 # To select a specific SDK, run 'xcodebuild -showsdks' 4 # to see the available SDKs and replace iphoneos with one of them. 5 SDK=iphoneos 6 SDK_PATH=`xcrun --sdk $SDK --show-sdk-path` 7 export IPHONEOS_DEPLOYMENT_TARGET=5.1 8 # cmd/cgo doesn't support llvm-gcc-4.2, so we have to use clang. 9 CLANG=`xcrun --sdk $SDK --find clang` 10 11 if [ "$GOARCH" == "arm" ]; then 12 CLANGARCH="armv7" 13 elif [ "$GOARCH" == "arm64" ]; then 14 CLANGARCH="arm64" 15 else 16 echo "unknown GOARCH=$GOARCH" >&2 17 exit 1 18 fi 19 20 exec $CLANG -arch $CLANGARCH -isysroot $SDK_PATH "$@" 21