]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/libsodium/test/default/nacl-test-wrapper.sh
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / sys / contrib / libsodium / test / default / nacl-test-wrapper.sh
1 #! /bin/sh
2
3 if [ -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
7 fi
8
9 if [ -z "$PNACL_FINALIZE" -o -z "$PNACL_TRANSLATE" ]; then
10   exe="$1"
11 else
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
17 fi
18
19 command -v command >/dev/null 2>&1 || {
20   echo "command is required, but wasn't found on this system" >&2
21   exit 1
22 }
23
24 command -v python >/dev/null 2>&1 || {
25   echo "Python not found. Aborting." >&2
26   exit 1
27 }
28
29 SEL_LDR=$(find "$NACL_SDK_ROOT" -name sel_ldr.py | head -n 1)
30 if [ -z "$SEL_LDR" ]; then
31   echo "Couldn't find sel_ldr.py under $NACL_SDK_ROOT" >&2
32   exit 1
33 fi
34
35 exec python "$SEL_LDR" "$exe"