]> Cypherpunks repositories - gostls13.git/commitdiff
nacltest.bash: nacl/arm support.
authorShenghou Ma <minux@golang.org>
Thu, 10 Jul 2014 19:15:41 +0000 (15:15 -0400)
committerShenghou Ma <minux@golang.org>
Thu, 10 Jul 2014 19:15:41 +0000 (15:15 -0400)
Also detect GOARCH automatically based on `uname -m`.

LGTM=crawshaw, dave, rsc
R=rsc, iant, crawshaw, dave
CC=golang-codereviews
https://golang.org/cl/111780043

src/nacltest.bash

index 33fc8c1c4eddaa44e8cfe35484e07bdc6886a4b1..2b62830a8807ae97eb84406058535c37a702a61f 100755 (executable)
 set -e
 ulimit -c 0
 
+# guess GOARCH if not set
+naclGOARCH=$GOARCH
+if [ -z "$naclGOARCH" ]; then
+       case "$(uname -m)" in
+       x86_64)
+               naclGOARCH=amd64p32
+               ;;
+       armv7l) # NativeClient on ARM only supports ARMv7A.
+               naclGOARCH=arm
+               ;;
+       i?86)
+               naclGOARCH=386
+               ;;
+       esac
+fi
+
 # Check GOARCH.
-naclGOARCH=${GOARCH:-386}
 case "$naclGOARCH" in
 amd64p32)
        if ! which sel_ldr_x86_64 >/dev/null; then
@@ -28,6 +43,12 @@ amd64p32)
                exit 1
        fi
        ;;
+arm)
+       if ! which sel_ldr_arm >/dev/null; then
+               echo 'cannot find sel_ldr_arm' 1>&2
+               exit 1
+       fi
+       ;;
 *)
        echo 'unsupported $GOARCH for nacl: '"$naclGOARCH" 1>&2
        exit 1