#!/bin/bash # # ocamloptrev ocamlopt for specified iOS revision # USAGE='ocamloptrev -rev M.N other-ocamlopt-options ...' OCAMLDIR=/usr/local/ocamlxarm/v7 REV='' declare -a ARGS while [ $# -gt 0 ] ; do case $1 in -rev) if [ $# -gt 1 ]; then REV=$2 shift 2 else echo "$USAGE" >&2 exit 1 fi ;; *) ARGS[${#ARGS[*]}]="$1" shift 1 ;; esac done if [ "$REV" = "" ]; then echo "$USAGE" >&2 exit 1 fi HIDEOUT=/Applications/Xcode.app/Contents/Developer PLT=$HIDEOUT/Platforms/iPhoneOS.platform SDK=/Developer/SDKs/iPhoneOS${REV}.sdk OCAMLC=$OCAMLDIR/bin/ocamlopt $OCAMLC -ccopt -isysroot -ccopt "$PLT$SDK" "${ARGS[@]}"