1#! /bin/sh 2 3if [ -z "$NACL_SDK_ROOT" ]; then 4 echo "The following variable needs to be set: 5 \$NACL_SDK_ROOT=$NACL_SDK_ROOT" >&2 6 exit 1 7fi 8 9if [ -z "$PNACL_FINALIZE" -o -z "$PNACL_TRANSLATE" ]; then 10 exe="$1" 11else 12 exe="$1.nexe" 13 if [ ! -f "$exe" ]; then 14 $PNACL_FINALIZE "$1" -o "$1.final" 15 $PNACL_TRANSLATE -arch $(uname -m) "$1.final" -o "$exe" 16 fi 17fi 18 19command -v command >/dev/null 2>&1 || { 20 echo "command is required, but wasn't found on this system" >&2 21 exit 1 22} 23 24command -v python >/dev/null 2>&1 || { 25 echo "Python not found. Aborting." >&2 26 exit 1 27} 28 29SEL_LDR=$(find "$NACL_SDK_ROOT" -name sel_ldr.py | head -n 1) 30if [ -z "$SEL_LDR" ]; then 31 echo "Couldn't find sel_ldr.py under $NACL_SDK_ROOT" >&2 32 exit 1 33fi 34 35exec python "$SEL_LDR" "$exe" 36