2011-10-16 11:41:43 +00:00
|
|
|
# Fetch latest version of source as recommended by nacl installation page
|
|
|
|
[ -e nacl-source.tar.bz2 ] || \
|
|
|
|
`wget -q -O - http://nacl.cr.yp.to/install.html | grep wget | sed -e 's/^ *//g' -e 's/^wget /wget -O nacl-source.tar.bz2 /'`
|
|
|
|
|
|
|
|
# Extract tarball
|
|
|
|
bzip2 -d nacl-source.tar.bz2
|
|
|
|
mkdir nacl-source
|
|
|
|
cd nacl-source
|
|
|
|
tar xvf ../nacl-source.tar
|
|
|
|
nacldir=`echo *`
|
|
|
|
cd ${nacldir}
|
|
|
|
|
|
|
|
# Now build the actual compilable sources using our
|
|
|
|
# hacked version of NaCl's 'do' script
|
|
|
|
cp ../../nacl-prepare-sources .
|
|
|
|
chmod 755 nacl-prepare-sources
|
|
|
|
./nacl-prepare-sources
|
|
|
|
cd nacl-source
|
|
|
|
|
2011-10-18 09:09:01 +00:00
|
|
|
ls -1 *.h | grep -v mphlr.h | sed -e 's,^,#include ",' -e 's,$,",' > nacl.h
|
|
|
|
|
|
|
|
ls -1 *.h >../../../nacl-sources.list
|
|
|
|
|
|
|
|
mv *.h ../../../
|
|
|
|
cd ../../../
|
|
|
|
|
2011-11-21 22:49:50 +00:00
|
|
|
rm nacl-source/*/nacl-source/*/measure.c
|
|
|
|
|
2011-10-18 09:09:01 +00:00
|
|
|
echo `ls -1 nacl-source/*/nacl-source/*/*.c` >>nacl-sources.list
|
|
|
|
|
2011-10-16 11:41:43 +00:00
|
|
|
# Now build Android.mk with the extra .c files listed
|
2011-10-18 09:09:01 +00:00
|
|
|
sources=`echo nacl-source/*/nacl-source/*/*.c`
|
|
|
|
echo sed -e 's,LOCAL_SRC_FILES:= \\,LOCAL_SRC_FILES:= '"${sources}"' \\,'
|
2011-11-03 00:53:19 +00:00
|
|
|
cat Android-without-NaCl.mk | sed -e 's,LOCAL_SRC_FILES:= \\,LOCAL_SRC_FILES:= '"${sources}"' \\,' > Android.mk
|
2011-10-16 11:41:43 +00:00
|
|
|
|
2011-12-18 22:39:03 +00:00
|
|
|
if [ ! -e libsqlite.so ]; then
|
2011-12-18 22:26:25 +00:00
|
|
|
# Copy libsqlite.so from /system/lib/ on an android phone.
|
|
|
|
phonecount=`adb devices | wc -l`
|
|
|
|
if [ ${phonecount} -lt 3 ]; then
|
|
|
|
echo "ERROR: You MUST connect and Android phone with USB debugging enabled"
|
|
|
|
echo " so that I can copy /system/lib/libsqlite.so to link against."
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
dev=`adb devices | awk '($1>"") { n=$1;} END { print n;}'`
|
2011-12-18 22:39:03 +00:00
|
|
|
echo "Copying /system/lib/libsqlite.so from device $dev"
|
2011-12-18 22:26:25 +00:00
|
|
|
adb -s $dev pull /system/lib/libsqlite.so
|
2011-12-18 22:39:03 +00:00
|
|
|
fi
|