Skip to content

Commit 480c013

Browse files
Merge pull request #70 from littlesavage/x86build
x86 build
2 parents 22b1151 + 1d509ee commit 480c013

21 files changed

+20
-11
lines changed

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,14 @@ clean:
3030
ant clean
3131
cd ${EXTERNAL_DIR} && ndk-build clean
3232
-cd ${SQLCIPHER_DIR} && make clean
33-
cd ${JNI_DIR} && ndk-build clean
33+
cd ${JNI_DIR} && ndk-build clean
3434
-rm ${LIBRARY_ROOT}/armeabi/libsqlcipher_android.so
3535
-rm ${LIBRARY_ROOT}/armeabi/libdatabase_sqlcipher.so
36+
-rm ${LIBRARY_ROOT}/armeabi/libstlport_shared.so
3637
-rm ${LIBRARY_ROOT}/sqlcipher.jar
38+
-rm ${LIBRARY_ROOT}/x86/libsqlcipher_android.so
39+
-rm ${LIBRARY_ROOT}/x86/libdatabase_sqlcipher.so
40+
-rm ${LIBRARY_ROOT}/x86/libstlport_shared.so
3741

3842
copy-libs:
3943
mkdir -p ${LIBRARY_ROOT}/armeabi
@@ -44,6 +48,13 @@ copy-libs:
4448
cp ${CURDIR}/bin/classes/sqlcipher.jar ${LIBRARY_ROOT} && \
4549
cp ${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so \
4650
${LIBRARY_ROOT}/armeabi
51+
mkdir -p ${LIBRARY_ROOT}/x86
52+
cp ${EXTERNAL_DIR}/libs/x86/libsqlcipher_android.so \
53+
${LIBRARY_ROOT}/x86 && \
54+
cp ${JNI_DIR}/libs/x86/libdatabase_sqlcipher.so \
55+
${LIBRARY_ROOT}/x86 && \
56+
cp ${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/x86/libstlport_shared.so \
57+
${LIBRARY_ROOT}/x86
4758

4859
copy-libs-dist:
4960
cp ${LIBRARY_ROOT}/*.jar dist/SQLCipherForAndroid-SDK/libs/ && \

external/Android.mk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sqlcipher/sqlite3.c:
1919
copy-libs-hack: build-local-hack
2020
install -p -m644 libs/armeabi/*.so ../obj/local/armeabi/
2121

22-
project_ldflags:= -Llibs/armeabi/ -Landroid-libs/
22+
project_ldflags:= -Llibs/$(TARGET_ARCH_ABI)/ -Landroid-libs/$(TARGET_ARCH_ABI)/
2323

2424
#------------------------------------------------------------------------------#
2525
# libsqlite3
@@ -75,7 +75,8 @@ LOCAL_ALLOW_UNDEFINED_SYMBOLS := false
7575
#LOCAL_REQUIRED_MODULES += libsqlcipher libicui18n libicuuc
7676
LOCAL_STATIC_LIBRARIES := libsqlcipher libicui18n libicuuc
7777

78-
LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlite_cflags) -DOS_PATH_SEPARATOR="'/'"
78+
LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlite_cflags) \
79+
-DOS_PATH_SEPARATOR="'/'" -DHAVE_SYS_UIO_H
7980

8081
LOCAL_C_INCLUDES := \
8182
$(LOCAL_PATH)/includes \
@@ -85,7 +86,7 @@ LOCAL_C_INCLUDES := \
8586
$(LOCAL_PATH)/platform-system-core/include \
8687
$(LOCAL_PATH)/platform-frameworks-base/include
8788

88-
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/android-libs/ -L$(LOCAL_PATH)/libs/armeabi/
89+
LOCAL_LDFLAGS += -L${LOCAL_PATH}/android-libs/$(TARGET_ARCH_ABI)/ -L$(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/
8990
LOCAL_LDLIBS := -llog -lutils -lcutils -lcrypto
9091
LOCAL_MODULE := libsqlcipher_android
9192
LOCAL_MODULE_FILENAME := libsqlcipher_android

external/String16.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# define htons(x) (x)
4343
# endif
4444
#else
45-
//# include <netinet/in.h>
45+
# include <netinet/in.h>
4646
# include <sys/endian.h>
4747
#endif
4848

Binary file not shown.
307 KB
Binary file not shown.
1.54 MB
Binary file not shown.
117 KB
Binary file not shown.

external/android-libs/x86/liblog.so

20.8 KB
Binary file not shown.
469 KB
Binary file not shown.

external/android-libs/x86/libutils.so

428 KB
Binary file not shown.

external/android-libs/x86/libz.so

94.3 KB
Binary file not shown.

jni/Android.mk

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ LOCAL_PATH:= $(call my-dir)
22

33
EXTERNAL_PATH := ../external
44

5-
ifeq ($(TARGET_ARCH), arm)
6-
LOCAL_CFLAGS += -DPACKED="__attribute__ ((packed))"
7-
else
8-
LOCAL_CFLAGS += -DPACKED=""
9-
endif
5+
LOCAL_CFLAGS += -DPACKED="__attribute__ ((packed))"
106

117
#TARGET_PLATFORM := android-8
128

@@ -49,7 +45,7 @@ LOCAL_SHARED_LIBRARIES := \
4945
libsqlite3_android
5046

5147
LOCAL_CFLAGS += -U__APPLE__
52-
LOCAL_LDFLAGS += -L../external/android-libs/ -L../external/libs/armeabi/
48+
LOCAL_LDFLAGS += -L../external/android-libs/$(TARGET_ARCH_ABI) -L../external/libs/$(TARGET_ARCH_ABI)/
5349

5450
# libs from the NDK
5551
LOCAL_LDLIBS += -ldl -llog

jni/Application.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
APP_PROJECT_PATH := $(shell pwd)
2+
APP_ABI := armeabi x86
23
APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk
34
# fixes this error when building external/android-sqlite/android/sqlite3_android.cpp
45
# icu4c/common/unicode/std_string.h:39:18: error: string: No such file or directory

0 commit comments

Comments
 (0)