1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-25 13:05:08 -07:00
libsodium/test/default/nacl-test-wrapper.sh
Frank Denis 858b8e8c5e Put then and if on the same line.
Having `then` aligned with `if` was pretty confusing, and I kept
reading `else` instead of `then`.
2016-04-29 20:49:35 +02:00

26 lines
659 B
Bash
Executable File

#! /bin/sh
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"
$PNACL_TRANSLATE -arch $(uname -m) "$1.final" -o "$1.nexe"
fi
which python >/dev/null 2>&1 || \
{ echo >&2 "Python not found. Aborting."; exit 1; }
SEL_LDR=$(find "$NACL_SDK_ROOT" -name sel_ldr.py | head -n 1)
if [ -z "$SEL_LDR" ]; then
echo "Couldn't find sel_ldr.py under $NACL_SDK_ROOT"
exit 1
fi
exec python "$SEL_LDR" "$1.nexe"