Fix various Android NDK build issues

(specify endianness, copy libsqlite.so from an Android phone
for link templating)
This commit is contained in:
gardners 2011-12-19 08:56:25 +10:30
parent b775e48042
commit d5004e15d2
3 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,7 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -lsqlite
LOCAL_LDLIBS := -L$(LOCAL_PATH) -lsqlite
LOCAL_SRC_FILES:= \
client.c \
export.c \
@ -28,6 +28,7 @@ LOCAL_SRC_FILES:= \
randombytes.c \
simulate.c \
jni.c \
sha2.c \
rhizome.c
LOCAL_MODULE:= dnalib

View File

@ -33,3 +33,13 @@ sources=`echo nacl-source/*/nacl-source/*/*.c`
echo sed -e 's,LOCAL_SRC_FILES:= \\,LOCAL_SRC_FILES:= '"${sources}"' \\,'
cat Android-without-NaCl.mk | sed -e 's,LOCAL_SRC_FILES:= \\,LOCAL_SRC_FILES:= '"${sources}"' \\,' > Android.mk
# 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;}'`
echo "Copying /system/lib/sqlite.so from device $dev"
adb -s $dev pull /system/lib/libsqlite.so

View File

@ -1,3 +1,7 @@
#ifndef BYTE_ORDER
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#include "sqlite-amalgamation-3070900/sqlite3.h"
#include "sha2.h"
#include <sys/stat.h>