diff options
author | Max Kellermann <max@musicpd.org> | 2016-10-26 11:55:38 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-10-26 17:00:17 +0200 |
commit | 307964d8741d9d37e0ba54c6ddcbc1c84a4a17e1 (patch) | |
tree | 78d8063947cf6af2eb67543572de06d9d9a7e473 | |
parent | f3dd50de871828a87375477d884259bd5950a6b4 (diff) |
android/build.py: always build with clang
Support for GCC has been dropped from NDK r13. Let's switch
everything to clang before they really remove GCC completely.
-rwxr-xr-x | android/build.py | 20 | ||||
-rw-r--r-- | python/build/project.py | 3 |
2 files changed, 8 insertions, 15 deletions
diff --git a/android/build.py b/android/build.py index a699275e3..ac68ba47c 100755 --- a/android/build.py +++ b/android/build.py @@ -39,7 +39,7 @@ build_arch = 'linux-x86_64' class AndroidNdkToolchain: def __init__(self, tarball_path, src_path, build_path, - use_cxx, use_clang): + use_cxx): self.tarball_path = tarball_path self.src_path = src_path self.build_path = build_path @@ -67,14 +67,10 @@ class AndroidNdkToolchain: common_flags = '-march=armv7-a -mfloat-abi=softfp' toolchain_bin = os.path.join(toolchain_path, 'bin') - if use_clang: - llvm_bin = os.path.join(llvm_path, 'bin') - self.cc = os.path.join(llvm_bin, 'clang') - self.cxx = os.path.join(llvm_bin, 'clang++') - common_flags += ' -target ' + llvm_triple + ' -integrated-as -gcc-toolchain ' + toolchain_path - else: - self.cc = os.path.join(toolchain_bin, arch + '-gcc') - self.cxx = os.path.join(toolchain_bin, arch + '-g++') + llvm_bin = os.path.join(llvm_path, 'bin') + self.cc = os.path.join(llvm_bin, 'clang') + self.cxx = os.path.join(llvm_bin, 'clang++') + common_flags += ' -target ' + llvm_triple + ' -integrated-as -gcc-toolchain ' + toolchain_path self.ar = os.path.join(toolchain_bin, arch + '-ar') self.ranlib = os.path.join(toolchain_bin, arch + '-ranlib') @@ -93,8 +89,6 @@ class AndroidNdkToolchain: libstdcxx_path = os.path.join(ndk_path, 'sources/cxx-stl/gnu-libstdc++', gcc_version) libstdcxx_cppflags = '-isystem ' + os.path.join(libstdcxx_path, 'include') + ' -isystem ' + os.path.join(libstdcxx_path, 'libs', android_abi, 'include') - if use_clang: - libstdcxx_cppflags += ' -D__STRICT_ANSI__' libstdcxx_ldadd = os.path.join(libstdcxx_path, 'libs', android_abi, 'libgnustl_static.a') if use_cxx: @@ -124,13 +118,13 @@ thirdparty_libs = [ # build the third-party libraries for x in thirdparty_libs: toolchain = AndroidNdkToolchain(tarball_path, src_path, build_path, - use_cxx=x.use_cxx, use_clang=x.use_clang) + use_cxx=x.use_cxx) if not x.is_installed(toolchain): x.build(toolchain) # configure and build MPD toolchain = AndroidNdkToolchain(tarball_path, src_path, build_path, - use_cxx=True, use_clang=True) + use_cxx=True) configure = [ os.path.join(mpd_path, 'configure'), diff --git a/python/build/project.py b/python/build/project.py index 9a04e9ce4..c79c4f5a1 100644 --- a/python/build/project.py +++ b/python/build/project.py @@ -7,7 +7,7 @@ from build.tar import untar class Project: def __init__(self, url, md5, installed, name=None, version=None, base=None, - use_cxx=False, use_clang=False): + use_cxx=False): if base is None: basename = os.path.basename(url) m = re.match(r'^(.+)\.(tar(\.(gz|bz2|xz|lzma))?|zip)$', basename) @@ -29,7 +29,6 @@ class Project: self.installed = installed self.use_cxx = use_cxx - self.use_clang = use_clang def download(self, toolchain): return download_and_verify(self.url, self.md5, toolchain.tarball_path) |