From b4e9988c00b336a511741c418cfe0db7599fdc9d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 20 Jan 2017 11:19:30 +0100 Subject: [PATCH] Add arm64 support for Android. --- CMakeLists.txt | 3 +++ coreapi/message_storage.c | 2 +- coreapi/sqlite3_bctbx_vfs.c | 2 +- java/CMakeLists.txt | 2 +- tester/log_collection_tester.c | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41919c8b4..40979d3f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,6 +207,9 @@ include_directories( ${MEDIASTREAMER2_INCLUDE_DIRS} ${BCTOOLBOX_CORE_INCLUDE_DIRS} ) +if(ANDROID) + include_directories(${CMAKE_CURRENT_BINARY_DIR}/java) +endif() if(ENABLE_TUNNEL) include_directories(${TUNNEL_INCLUDE_DIRS}) endif() diff --git a/coreapi/message_storage.c b/coreapi/message_storage.c index ba7c66911..ab9fedbe9 100644 --- a/coreapi/message_storage.c +++ b/coreapi/message_storage.c @@ -50,7 +50,7 @@ static char *utf8_convert(const char *filename){ wchar_t db_file_utf16[MAX_PATH_SIZE]={0}; MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, filename, -1, db_file_utf16, MAX_PATH_SIZE); WideCharToMultiByte(CP_UTF8, 0, db_file_utf16, -1, db_file_utf8, sizeof(db_file_utf8), NULL, NULL); -#elif defined(__QNXNTO__) +#elif defined(__QNXNTO__) || (defined(ANDROID) && defined(__LP64__)) strncpy(db_file_utf8, filename, MAX_PATH_SIZE - 1); #else char db_file_locale[MAX_PATH_SIZE] = {'\0'}; diff --git a/coreapi/sqlite3_bctbx_vfs.c b/coreapi/sqlite3_bctbx_vfs.c index 24cab5bed..4f1469ad7 100755 --- a/coreapi/sqlite3_bctbx_vfs.c +++ b/coreapi/sqlite3_bctbx_vfs.c @@ -259,7 +259,7 @@ static char* ConvertFromUtf8Filename(const char* fName){ } bctbx_free(wideFilename); return convertedFilename; -#elif defined(__QNXNTO__) +#elif defined(__QNXNTO__) || (defined(ANDROID) && defined(__LP64__)) return bctbx_strdup(fName); #else #define MAX_PATH_SIZE 1024 diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index b6a4b8e40..94c8c1796 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -58,6 +58,6 @@ if(ANDROID) # HACK: accessing mediastreamer2 source directory from here is just wrong! add_custom_target(linphonecore-jni-header - COMMAND ${Java_JAVAH_EXECUTABLE} -o "${CMAKE_BINARY_DIR}/linphonecore_jni.h" -classpath "${CMAKE_CURRENT_SOURCE_DIR}/impl:${CMAKE_CURRENT_SOURCE_DIR}/common:${CMAKE_CURRENT_SOURCE_DIR}/../mediastreamer2/java/src" ${JNI_CLASSES} + COMMAND ${Java_JAVAH_EXECUTABLE} -o "${CMAKE_CURRENT_BINARY_DIR}/linphonecore_jni.h" -classpath "${CMAKE_CURRENT_SOURCE_DIR}/impl:${CMAKE_CURRENT_SOURCE_DIR}/common:${CMAKE_CURRENT_SOURCE_DIR}/../mediastreamer2/java/src" ${JNI_CLASSES} ) endif() diff --git a/tester/log_collection_tester.c b/tester/log_collection_tester.c index 491f67feb..5a43c46d0 100644 --- a/tester/log_collection_tester.c +++ b/tester/log_collection_tester.c @@ -30,7 +30,7 @@ /*getline is POSIX 2008, not available on many systems.*/ -#if defined(ANDROID) || defined(_WIN32) || defined(__QNX__) +#if (defined(ANDROID) && !defined(__LP64__)) || defined(_WIN32) || defined(__QNX__) /* This code is public domain -- Will Hartung 4/9/09 */ static ssize_t getline(char **lineptr, size_t *n, FILE *stream) { char *bufptr = NULL;