2015-08-02 08:39:17 -04:00
|
|
|
#! /bin/sh
|
2015-06-22 14:02:21 -04:00
|
|
|
|
|
|
|
if [ -z "$NACL_SDK_ROOT" -o -z "$PNACL_TRANSLATE" -o -z "$PNACL_FINALIZE" ]
|
|
|
|
then
|
|
|
|
echo "One or more variables need to be set:
|
|
|
|
\$NACL_SDK_ROOT=$NACL_SDK_ROOT
|
|
|
|
\$PNACL_TRANSLATE=$PNACL_TRANSLATE
|
|
|
|
\$PNACL_FINALIZE=$PNACL_FINALIZE"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "$1.nexe" ]
|
|
|
|
then
|
|
|
|
$PNACL_FINALIZE "$1" -o "$1.final"
|
2015-08-02 08:39:17 -04:00
|
|
|
$PNACL_TRANSLATE -arch $(uname -m) "$1.final" -o "$1.nexe"
|
2015-06-22 14:02:21 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
command -v python >/dev/null 2>&1 || { echo >&2 "I require python but it's not installed. Aborting."; exit 1; }
|
2015-08-02 08:39:17 -04:00
|
|
|
SEL_LDR=$(find "$NACL_SDK_ROOT" -name sel_ldr.py | head -n 1)
|
|
|
|
if [ -z "$SEL_LDR" ]
|
2015-06-22 14:02:21 -04:00
|
|
|
then
|
|
|
|
echo "Couldn't find a sel_ldr.py under $NACL_SDK_ROOT"
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-08-02 08:39:17 -04:00
|
|
|
|
|
|
|
exec python "$SEL_LDR" "$1.nexe"
|