From fad79afc67dedca117d5badb8d642a3c2e122c3a Mon Sep 17 00:00:00 2001 From: hai Date: Wed, 27 Jan 2021 17:35:20 +0700 Subject: [PATCH] - Enable libetpan to build for android 23 base on implementation from pr #345. - remove libetpan_get_version_micro. --- build-android/build.sh | 19 +++++++++++-------- .../dependencies/cyrus-sasl/build.sh | 16 ++++++++-------- build-android/dependencies/iconv/build.sh | 11 ++--------- build-android/dependencies/openssl/build.sh | 3 ++- build-android/jni/Android.mk | 6 ++++-- src/main/libetpan_version.c | 5 ----- src/main/libetpan_version.h.in | 18 ------------------ 7 files changed, 27 insertions(+), 51 deletions(-) diff --git a/build-android/build.sh b/build-android/build.sh index 6388ca00..82b4bbb0 100755 --- a/build-android/build.sh +++ b/build-android/build.sh @@ -7,6 +7,9 @@ iconv_build_version=1 package_name=libetpan-android current_dir="`pwd`" +# find ../src -name *.h | xargs -0 cp --target-directory=./include/libetpan +find ../src -name "*.h" -type file -exec cp {} ./include/libetpan \; + if test "x$ANDROID_NDK" = x ; then echo should set ANDROID_NDK before running this script. @@ -62,14 +65,14 @@ mkdir -p "$current_dir/$package_name-$build_version/include" cp -r include/libetpan "$current_dir/$package_name-$build_version/include" # 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" +#ANDROID_PLATFORM=android-16 +archs="armeabi armeabi-v7a x86" #archs="armeabi armeabi-v7a x86" +for arch in $archs ; do #for arch in $archs ; do + TARGET_ARCH_ABI=$arch #TARGET_ARCH_ABI=$arch + build #build +done #done +ANDROID_PLATFORM=android-21 ANDROID_PLATFORM=android-23 +archs="arm64-v8a" archs="arm64-v8a armeabi-v7a x86 x86_64" for arch in $archs ; do TARGET_ARCH_ABI=$arch build diff --git a/build-android/dependencies/cyrus-sasl/build.sh b/build-android/dependencies/cyrus-sasl/build.sh index 3f5ef979..bbad6821 100755 --- a/build-android/dependencies/cyrus-sasl/build.sh +++ b/build-android/dependencies/cyrus-sasl/build.sh @@ -60,14 +60,14 @@ function build { } # 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" +#ANDROID_PLATFORM=android-16 +archs="armeabi armeabi-v7a x86" #archs="armeabi armeabi-v7a x86" +for arch in $archs ; do #for arch in $archs ; do + TARGET_ARCH_ABI=$arch # TARGET_ARCH_ABI=$arch + build # build +done #done +ANDROID_PLATFORM=android-21 ANDROID_PLATFORM=android-23 +archs="arm64-v8a" archs="arm64-v8a armeabi-v7a x86 x86_64" for arch in $archs ; do TARGET_ARCH_ABI=$arch build diff --git a/build-android/dependencies/iconv/build.sh b/build-android/dependencies/iconv/build.sh index d864722d..af000c17 100755 --- a/build-android/dependencies/iconv/build.sh +++ b/build-android/dependencies/iconv/build.sh @@ -47,15 +47,8 @@ if test ! -f $current_dir/$package_name-$build_version.zip; then mkdir -p "$current_dir/$package_name-$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" + ANDROID_PLATFORM=android-23 + ANDROID_PLATFORM=android-16 archs="arm64-v8a armeabi-v7a x86 x86_64" for arch in $archs ; do TARGET_ARCH_ABI=$arch build diff --git a/build-android/dependencies/openssl/build.sh b/build-android/dependencies/openssl/build.sh index 16903092..5adf9ae0 100755 --- a/build-android/dependencies/openssl/build.sh +++ b/build-android/dependencies/openssl/build.sh @@ -161,9 +161,10 @@ function build { # start building. current_dir="`pwd`" -build_armeabi +#build_armeabi build_armeabi_v7a build_x86 +build_x86_64 build_arm64_v8a cd "$current_dir" diff --git a/build-android/jni/Android.mk b/build-android/jni/Android.mk index 037c2671..f879ad82 100644 --- a/build-android/jni/Android.mk +++ b/build-android/jni/Android.mk @@ -144,7 +144,9 @@ src/driver/implementation/data-message \ src/driver/interface LOCAL_C_INCLUDES = $(addprefix ../../, $(c_includes)) \ - $(LOCAL_PATH)/../include $(LOCAL_PATH)/../include/libetpan \ - $(OPENSSL_PATH)/include $(CYRUS_SASL_PATH)/include $(ICONV_PATH)/include + libetpan-android-7/include \ + $(OPENSSL_PATH)/include $(CYRUS_SASL_PATH)/include $(ICONV_PATH)/include libetpan-android-7/include/libetpan \ + $(OPENSSL_PATH)/include \ + $(LOCAL_PATH)/../include $(LOCAL_PATH)/../include/libetpan include $(BUILD_STATIC_LIBRARY) diff --git a/src/main/libetpan_version.c b/src/main/libetpan_version.c index e2b78133..95714e0e 100644 --- a/src/main/libetpan_version.c +++ b/src/main/libetpan_version.c @@ -50,8 +50,3 @@ int libetpan_get_version_minor(void) { return LIBETPAN_VERSION_MINOR; } - -int libetpan_get_version_micro(void) -{ - return LIBETPAN_VERSION_MICRO; -} diff --git a/src/main/libetpan_version.h.in b/src/main/libetpan_version.h.in index bfe50c65..98a93e8e 100644 --- a/src/main/libetpan_version.h.in +++ b/src/main/libetpan_version.h.in @@ -41,31 +41,13 @@ #define LIBETPAN_VERSION_MINOR @VERSION_MINOR@ #endif -#ifndef LIBETPAN_VERSION_MICRO -#define LIBETPAN_VERSION_MICRO @VERSION_MICRO@ -#endif - #ifndef LIBETPAN_REENTRANT #if @REENTRANT@ #define LIBETPAN_REENTRANT 1 #endif - -#ifndef LIBETPAN_API_CURRENT -#define LIBETPAN_API_CURRENT @API_CURRENT@ -#endif - -#ifndef LIBETPAN_API_REVISION -#define LIBETPAN_API_REVISION @API_REVISION@ -#endif - -#ifndef LIBETPAN_API_COMPATIBILITY -#define LIBETPAN_API_COMPATIBILITY @API_COMPATIBILITY@ -#endif - #endif int libetpan_get_version_major(void); int libetpan_get_version_minor(void); -int libetpan_get_version_micro(void); #endif