aboutsummaryrefslogtreecommitdiffhomepage
path: root/build-android
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2016-11-23 10:11:20 -0800
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2016-11-23 10:11:20 -0800
commit26b68dd43ceec71db8fcf95cf48177acdbef82cf (patch)
tree504c3b24e622dad15af8779241551951242f2c4b /build-android
parent947b6e7f77b421cd3feb96fcaa7ce3de78706391 (diff)
Fixed build with ndk 13
Diffstat (limited to 'build-android')
-rwxr-xr-xbuild-android/build.sh30
-rw-r--r--build-android/jni/Android.mk13
2 files changed, 29 insertions, 14 deletions
diff --git a/build-android/build.sh b/build-android/build.sh
index 1ca775dc..274bb632 100755
--- a/build-android/build.sh
+++ b/build-android/build.sh
@@ -1,16 +1,14 @@
#!/bin/sh
-build_version=3
-ANDROID_PLATFORM=android-16
-archs="armeabi armeabi-v7a x86"
+build_version=4
package_name=mailcore2-android
-ctemplate_build_version=2
-cyrus_sasl_build_version=2
-icu4c_build_version=2
-libetpan_build_version=4
-libxml2_build_version=2
-tidy_html5_build_version=2
-openssl_build_version=2
+ctemplate_build_version=3
+cyrus_sasl_build_version=4
+icu4c_build_version=3
+libetpan_build_version=6
+libxml2_build_version=3
+tidy_html5_build_version=3
+openssl_build_version=3
current_dir="`pwd`"
@@ -53,7 +51,8 @@ function build {
mkdir -p "$current_dir/bin/jni/$TARGET_ARCH_ABI"
cp "$current_dir/libs/$TARGET_ARCH_ABI/libMailCore.so" "$current_dir/bin/jni/$TARGET_ARCH_ABI"
- cp "$ANDROID_NDK/sources/cxx-stl/llvm-libc++/libs/$TARGET_ARCH_ABI/libc++_shared.so" "$current_dir/bin/jni/$TARGET_ARCH_ABI"
+ # cp "$ANDROID_NDK/sources/cxx-stl/llvm-libc++/libs/$TARGET_ARCH_ABI/libc++_shared.so" "$current_dir/bin/jni/$TARGET_ARCH_ABI"
+ cp "$ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/4.9/libs/$TARGET_ARCH_ABI/libgnustl_shared.so" "$current_dir/bin/jni/$TARGET_ARCH_ABI"
rm -rf "$current_dir/obj"
rm -rf "$current_dir/libs"
}
@@ -76,11 +75,20 @@ download_dep "openssl-android" $openssl_build_version
download_dep "cyrus-sasl-android" $cyrus_sasl_build_version
# Start building.
+ANDROID_PLATFORM=android-16
+archs="armeabi armeabi-v7a x86"
+for arch in $archs ; do
+ TARGET_ARCH_ABI=$arch
+ build
+done
+ANDROID_PLATFORM=android-21
+archs="arm64-v8a"
for arch in $archs ; do
TARGET_ARCH_ABI=$arch
build
done
+ANDROID_PLATFORM=android-16
cd "$current_dir/../src/java"
mkdir -p "$current_dir/bin"
javac -d "$current_dir/bin" -source 1.6 -target 1.6 -classpath $ANDROID_SDK/platforms/$ANDROID_PLATFORM/android.jar com/libmailcore/*.java
diff --git a/build-android/jni/Android.mk b/build-android/jni/Android.mk
index a7581c99..9b47cf0e 100644
--- a/build-android/jni/Android.mk
+++ b/build-android/jni/Android.mk
@@ -28,13 +28,17 @@ includes = \
$(LIBXML2_PATH)/include \
$(TIDY_HTML5_PATH)/include \
$(OPENSSL_PATH)/include \
- $(ANDROID_NDK)/sources/cxx-stl/llvm-libc++/libcxx/include \
- $(ANDROID_NDK)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include \
+ $(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/include \
+ $(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(TARGET_ARCH_ABI)/include \
$(addprefix $(src_dir)/, $(subdirs))
+# $(ANDROID_NDK)/sources/cxx-stl/llvm-libc++/libcxx/include
+# $(ANDROID_NDK)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include
+
core_excludes = MCWin32.cpp MCStringWin32.cpp MCMainThreadWin32.cpp MCMainThreadGTK.cpp
core_src_files := $(filter-out \
$(addprefix $(src_dir)/core/basetypes/, $(core_excludes)), \
$(wildcard $(src_dir)/core/basetypes/*.cpp) $(wildcard $(src_dir)/core/basetypes/*.c))
+
abstract_src_files := $(wildcard $(src_dir)/core/abstract/*.cpp)
imap_src_files := $(wildcard $(src_dir)/core/imap/*.cpp)
nntp_src_files := $(wildcard $(src_dir)/core/nntp/*.cpp)
@@ -117,7 +121,10 @@ LOCAL_SRC_FILES := \
$(async_imap_src_files) $(async_nntp_src_files) $(async_pop_src_files) $(async_smtp_src_files)
LOCAL_CPPFLAGS := -frtti
LOCAL_CFLAGS := -DNOCRYPT
+# LOCAL_LDLIBS := -lz -llog \
+# -lc++_shared -L$(ANDROID_NDK)/sources/cxx-stl/llvm-libc++/libs/$(TARGET_ARCH_ABI)
LOCAL_LDLIBS := -lz -llog \
- -lc++_shared -L$(ANDROID_NDK)/sources/cxx-stl/llvm-libc++/libs/$(TARGET_ARCH_ABI)
+ -lgnustl_shared -L$(ANDROID_NDK)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(TARGET_ARCH_ABI)
+LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true
LOCAL_STATIC_LIBRARIES := etpan sasl2 ssl crypto icu4c xml2 tidy ctemplate
include $(BUILD_SHARED_LIBRARY)