LEFT | RIGHT |
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 | 3 |
4 outdir="v8/out/Debug" | 4 outdir="v8/out/Debug" |
| 5 system=`uname -s` |
| 6 android_build=0 |
5 | 7 |
6 # the arguments are | 8 # the arguments are |
7 # [file1, ...] [-D outdir] -C dir ... | 9 # [-a arch] [file1, ...] [-D outdir] -C dir ... |
8 # | 10 # |
| 11 # -a if we are building for Android. arch target. |
9 # -D is the output directory to copy from | 12 # -D is the output directory to copy from |
10 # the rest is passed verbatim to make. | 13 # the rest is passed verbatim to make. |
| 14 if [ "$1" = "-a" ] ; then |
| 15 android_build=1 |
| 16 shift |
| 17 android_arch="$1" |
| 18 shift |
| 19 fi |
11 while [ "$1" != "-D" -a "$1" != "-C" ] ; do | 20 while [ "$1" != "-D" -a "$1" != "-C" ] ; do |
12 target="$target $1" | 21 target="$target $1" |
13 shift | 22 shift |
14 done | 23 done |
15 if [ "$1" = "-D" ] ; then | 24 if [ "$1" = "-D" ] ; then |
16 shift | 25 shift |
17 outdir="$1" | 26 outdir="$1" |
18 shift | 27 shift |
19 fi | 28 fi |
20 | 29 |
21 make $* && for t in $target ; do | 30 make $* && for t in $target ; do |
22 cp $outdir/$t . | 31 cp $outdir/$t . |
| 32 # When building for Android on Darwin we must execute ranlib |
| 33 if [ $android_build -eq 1 -a "$system" = "Darwin" ] ; then |
| 34 case "$android_arch" in |
| 35 arm64) |
| 36 ${ANDROID_NDK_ROOT}/toolchains/aarch64-linux-android-4.9/prebuil
t/darwin-x86_64/bin/aarch64-linux-android-ranlib $t |
| 37 ;; |
| 38 arm) |
| 39 ${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.9/prebuil
t/darwin-x86_64/bin/arm-linux-androideabi-ranlib $t |
| 40 ;; |
| 41 ia32) |
| 42 ${ANDROID_NDK_ROOT}/toolchains/x86-4.9/prebuilt/darwin-x86_64/bi
n/i686-linux-android-ranlib $t |
| 43 ;; |
| 44 x64) |
| 45 ${ANDROID_NDK_ROOT}/toolchains/x86_64-4.9/prebuilt/darwin-x86_64
/bin/x86_64-linux-android-ranlib $t |
| 46 ;; |
| 47 *) |
| 48 echo "Unknown architecture $android_arch" |
| 49 exit 255 |
| 50 ;; |
| 51 esac |
| 52 fi |
23 done | 53 done |
LEFT | RIGHT |