scripts: waifulib: xcompile: add support for NDK 28, remove setting up custom PREFIX to not mess up installation path

This commit is contained in:
Alibek Omarov 2025-02-25 06:49:00 +03:00
parent d1c5862bab
commit a76236ac5a

View file

@ -20,12 +20,12 @@ import os
import sys
ANDROID_NDK_ENVVARS = ['ANDROID_NDK_HOME', 'ANDROID_NDK']
ANDROID_NDK_SUPPORTED = [10, 19, 20, 23, 25]
ANDROID_NDK_SUPPORTED = [10, 19, 20, 23, 25, 28]
ANDROID_NDK_HARDFP_MAX = 11 # latest version that supports hardfp
ANDROID_NDK_GCC_MAX = 17 # latest NDK that ships with GCC
ANDROID_NDK_UNIFIED_SYSROOT_MIN = 15
ANDROID_NDK_SYSROOT_FLAG_MAX = 19 # latest NDK that need --sysroot flag
ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16, 23: 16, 25: 19 } # minimal API level ndk revision supports
ANDROID_NDK_API_MIN = { 10: 3, 19: 16, 20: 16, 23: 16, 25: 19, 28: 19 } # minimal API level ndk revision supports
ANDROID_STPCPY_API_MIN = 21 # stpcpy() introduced in SDK 21
ANDROID_64BIT_API_MIN = 21 # minimal API level that supports 64-bit targets
@ -336,7 +336,7 @@ class Android:
ldflags += ['-lgcc']
if self.is_clang() or self.is_host():
ldflags += ['-stdlib=libstdc++']
ldflags += ['-stdlib=libstdc++', '-lc++abi']
else: ldflags += ['-no-canonical-prefixes']
if self.is_arm():
@ -521,6 +521,9 @@ def configure(conf):
valid_archs = ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'aarch64']
if values[0] == 'arm64-v8a':
values[0] = 'aarch64'
if values[0] not in valid_archs:
conf.fatal('Unknown arch: %s. Supported: %r' % (values[0], ', '.join(valid_archs)))
@ -538,8 +541,6 @@ def configure(conf):
conf.env.LIB_M = ['m_hard']
else: conf.env.LIB_M = ['m']
conf.env.PREFIX = '/lib/%s' % android.apk_arch()
conf.msg('Selected Android NDK', '%s, version: %d' % (android.ndk_home, android.ndk_rev))
# no need to print C/C++ compiler, as it would be printed by compiler_c/cxx
conf.msg('... C/C++ flags', ' '.join(android.cflags()).replace(android.ndk_home, '$NDK/'))