2015-08-02 08:39:17 -04:00
|
|
|
#! /bin/sh
|
2015-06-22 14:02:21 -04:00
|
|
|
|
2016-04-29 15:55:06 -04:00
|
|
|
if [ -z "$NACL_SDK_ROOT" ]; then
|
|
|
|
echo "The following variable needs to be set:
|
|
|
|
\$NACL_SDK_ROOT=$NACL_SDK_ROOT" >&2
|
|
|
|
exit 1
|
2015-06-22 14:02:21 -04:00
|
|
|
fi
|
|
|
|
|
2016-04-29 15:55:06 -04:00
|
|
|
if [ -z "$PNACL_FINALIZE" -o -z "$PNACL_TRANSLATE" ]; then
|
|
|
|
exe="$1"
|
|
|
|
else
|
|
|
|
exe="$1.nexe"
|
|
|
|
if [ ! -f "$exe" ]; then
|
|
|
|
$PNACL_FINALIZE "$1" -o "$1.final"
|
|
|
|
$PNACL_TRANSLATE -arch $(uname -m) "$1.final" -o "$exe"
|
|
|
|
fi
|
2015-06-22 14:02:21 -04:00
|
|
|
fi
|
|
|
|
|
2017-05-19 08:51:56 -04:00
|
|
|
command -v command >/dev/null 2>&1 || \
|
|
|
|
{ echo "command is required, but wasn't found on this system"; exit 1; }
|
|
|
|
|
|
|
|
command -v python >/dev/null 2>&1 || \
|
2016-04-29 14:49:35 -04:00
|
|
|
{ echo >&2 "Python not found. Aborting."; exit 1; }
|
|
|
|
|
2015-08-02 08:39:17 -04:00
|
|
|
SEL_LDR=$(find "$NACL_SDK_ROOT" -name sel_ldr.py | head -n 1)
|
2016-04-29 14:49:35 -04:00
|
|
|
if [ -z "$SEL_LDR" ]; then
|
2016-04-29 15:55:06 -04:00
|
|
|
echo "Couldn't find sel_ldr.py under $NACL_SDK_ROOT" >&2
|
|
|
|
exit 1
|
2015-06-22 14:02:21 -04:00
|
|
|
fi
|
2015-08-02 08:39:17 -04:00
|
|
|
|
2016-04-29 15:55:06 -04:00
|
|
|
exec python "$SEL_LDR" "$exe"
|