forked from joshmarinacci/aminolang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AndroidFixup.sh
executable file
·51 lines (38 loc) · 1.51 KB
/
AndroidFixup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
set -x
OUTFILE=$1
MY_DIR=`dirname $1`
cat > $OUTFILE <<EOF
#include <stdio.h>
void main()
{
printf("This is a simple C file to force the shell script to run so we can work around some android make limitations. Android HACK!\n");
}
EOF
NUM_PROCS=`cat /proc/cpuinfo | egrep processor | cat -n | awk {'print $1'} | tail -1`
cd $MY_DIR;
echo "APO=$ANDROID_PRODUCT_OUT"
echo "NUM_PROCS=$NUM_PROCS"
echo "me=$0"
echo "outfile=$OUTFILE"
echo "my_dir=$MY_DIR"
echo "cwd="`pwd`
mkdir -p $ANDROID_PRODUCT_OUT/data/phonetest
if [ -f ${ANDROID_PRODUCT_OUT}/system/lib/libaminolang.so ]; then
# given how node imports addons, we CANNOT use a soft link here. sad but true.
#ln -sf ../system/lib/libaminolang.so ${ANDROID_PRODUCT_OUT}/data/phonetest/aminonative.node
cp ${ANDROID_PRODUCT_OUT}/system/lib/libaminolang.so ${ANDROID_PRODUCT_OUT}/data/phonetest/aminonative.node
echo "copying libaminolang.so to /data/phonetest/aminonative.node so node can load it as an addon"
else
echo "no libaminolang.so to link node addon to"
fi
cp src/sg/amino.js $ANDROID_PRODUCT_OUT/data/phonetest
cp src/sg/Bacon.js $ANDROID_PRODUCT_OUT/data/phonetest
cp src/jscommon/*.js $ANDROID_PRODUCT_OUT/data/phonetest
cp resources/*.* $ANDROID_PRODUCT_OUT/data/phonetest
cp tests/phone3.* $ANDROID_PRODUCT_OUT/data/phonetest
#the following makes the make system run everytime you build android. If you comment it out
# you either need to touch the AndroidFixup.sh or
# rm XXXX-dependencyForcer.c
# touch $ANDROID_BUILD_TOP/$0