From 03e848d0e8ae95b6795d2d2816cd059dd7b1c84d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 19 Jan 2018 15:33:04 +0100 Subject: [PATCH] [Switch submodule branch] Update cmake-builder submodule. --- cmake_builder/CMakeLists.txt | 25 +++++++++++++++++++++++++ prepare.py | 34 +++++++++++++++++++++++++++++++--- submodules/cmake-builder | 2 +- 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 cmake_builder/CMakeLists.txt diff --git a/cmake_builder/CMakeLists.txt b/cmake_builder/CMakeLists.txt new file mode 100644 index 000000000..4b1c79c12 --- /dev/null +++ b/cmake_builder/CMakeLists.txt @@ -0,0 +1,25 @@ +############################################################################ +# CMakeLists.txt +# Copyright (C) 2018 Belledonne Communications, Grenoble France +# +############################################################################ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +############################################################################ + +# Blacklist these dependencies because they are useless for now +lcb_blacklist_dependencies("libxsd" "xerces-c" "soci") + diff --git a/prepare.py b/prepare.py index 07e1ca57d..992d8fd0a 100755 --- a/prepare.py +++ b/prepare.py @@ -50,6 +50,10 @@ class AndroidTarget(prepare.Target): self.toolchain_file = 'toolchains/toolchain-android-' + arch + '.cmake' self.output = 'liblinphone-sdk/android-' + arch self.external_source_path = os.path.join(current_path, 'submodules') + external_builders_path = os.path.join(current_path, 'cmake_builder') + self.additional_args = [ + "-DLINPHONE_BUILDER_EXTERNAL_BUILDERS_PATH=" + external_builders_path + ] class AndroidArmTarget(AndroidTarget): @@ -140,7 +144,7 @@ class AndroidPreparator(prepare.Preparator): retval = True ndk_build = find_executable('ndk-build') ndk_path = os.path.dirname(ndk_build) - # NDK prior to r11 had a RELEASE.TXT file holding the version number + # NDK prior to r11 had a RELEASE.TXT file holding the version number release_file = os.path.join(ndk_path, 'RELEASE.TXT') if os.path.isfile(release_file): version = open(release_file).read().strip() @@ -156,8 +160,19 @@ class AndroidPreparator(prepare.Preparator): if len(python_config_files) > 0: version = open(python_config_files[0]).readlines()[0] res = re.match('^.*/(aosp-)?ndk-r(\d+).*$', version) - version = int(res.group(2)) - retval = False + if res is not None: # Will be if NDK < 16 + version = int(res.group(2)) + retval = False + else: + release_file = os.path.join(ndk_path, 'source.properties') # Since NDK 16 + if os.path.isfile(release_file): + version = open(release_file).read().strip() + res = re.findall(r'(?:(\d+))', version) + version = int(res[0]) + retval = False + else: + error("Could not get Android NDK version!") + sys.exit(-1) else: error("Could not get Android NDK version!") sys.exit(-1) @@ -238,6 +253,7 @@ $(TOPDIR)/res/raw/rootca.pem: copy-libs: \trm -rf libs-debug/armeabi \trm -rf libs/armeabi +\trm -rf src/linphone-wrapper && mkdir -p src/linphone-wrapper/ \tif test -d "liblinphone-sdk/android-arm"; then \\ \t\tmkdir -p libs-debug/armeabi && \\ \t\tcp -f liblinphone-sdk/android-arm/lib/lib*.so libs-debug/armeabi && \\ @@ -304,6 +320,18 @@ copy-libs: \t\tcp -f liblinphone-sdk/android-x86/bin/gdbserver libs/x86 && \\ \t\tcp -f liblinphone-sdk/android-x86/bin/gdb.setup libs/x86; \\ \tfi +\tif test -d "liblinphone-sdk/android-arm/share/linphonej"; then \\ +\t\tcp -R liblinphone-sdk/android-arm/share/linphonej/java/* src/linphone-wrapper; \\ +\tfi +\tif test -d "liblinphone-sdk/android-armv7/share/linphonej"; then \\ +\t\tcp -R liblinphone-sdk/android-armv7/share/linphonej/java/* src/linphone-wrapper; \\ +\tfi +\tif test -d "liblinphone-sdk/android-arm64/share/linphonej"; then \\ +\t\tcp -R liblinphone-sdk/android-arm64/share/linphonej/java/* src/linphone-wrapper; \\ +\tfi +\tif test -d "liblinphone-sdk/android-x86/share/linphonej"; then \\ +\t\tcp -R liblinphone-sdk/android-x86/share/linphonej/java/* src/linphone-wrapper; \\ +\tfi copy-libs-mediastreamer: \trm -rf submodules/mediastreamer2/java/libs/armeabi diff --git a/submodules/cmake-builder b/submodules/cmake-builder index a6dff67cc..bd9735547 160000 --- a/submodules/cmake-builder +++ b/submodules/cmake-builder @@ -1 +1 @@ -Subproject commit a6dff67cc8e5bb1e930cf1629dec835f94d6d626 +Subproject commit bd973554739e1e991a8726e6a9b80ba0e78950fa