diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-04-16 10:12:52 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-04-22 08:34:33 +0200 |
commit | f149acaf1236c3ff8ff0d5f4709be85a118c4c0c (patch) | |
tree | 8f0a62c4324b71ae0fc074c67afaf54071f2b136 /config | |
parent | 6a3348b52d65f13648929ca4def560b15fd56f47 (diff) |
android: Allow to use 4.7 and x86-64 toolchains if available
Also update the CFLAGS and LDFLAGS from latest Android NDK
Diffstat (limited to 'config')
-rw-r--r-- | config/android.config | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/config/android.config b/config/android.config index d1bb647..2b57289 100644 --- a/config/android.config +++ b/config/android.config @@ -6,20 +6,39 @@ import os from cerbero.config import Architecture, DistroVersion +if not toolchain_prefix: + toolchain_prefix = os.path.expanduser('~/cerbero/android-ndk-r8b') + +toolchain_path = None + if target_arch == Architecture.ARM or target_arch == Architecture.ARMv7: tools_prefix = 'arm-linux-androideabi' arch = 'arm' - tc_path = 'arm-linux-androideabi-4.6' + + for tc_version in ['4.8', '4.7', '4.6']: + for tc_arch in ['linux-x86', 'linux-x86_64']: + tmp = '%s/toolchains/arm-linux-androideabi-%s/prebuilt/%s/bin' % (toolchain_prefix, tc_version, tc_arch) + if os.path.exists(tmp): + toolchain_path = tmp + break + if toolchain_path: + break elif target_arch == Architecture.X86: tools_prefix = 'i686-linux-android' arch = 'x86' - tc_path = 'x86-4.6' + for tc_version in ['4.8', '4.7', '4.6']: + for tc_arch in ['linux-x86', 'linux-x86_64']: + tmp = '%s/toolchains/x86-%s/prebuilt/%s/bin' % (toolchain_prefix, tc_version, tc_arch) + if os.path.exists(tmp): + toolchain_path = tmp + break + if toolchain_path: + break else: raise FatalError("Arch not supported") -if not toolchain_prefix: - toolchain_prefix = os.path.expanduser('~/cerbero/android-ndk-r8b') -toolchain_path = '%s/toolchains/%s/prebuilt/linux-x86/bin' % (toolchain_prefix, tc_path) +if not toolchain_path: + raise FatalError("Toolchain not found") if target_distro_version == DistroVersion.ANDROID_GINGERBREAD: v = '9' @@ -40,13 +59,13 @@ os.environ['OBJCFLAGS'] = '-Wall -g -Os ' ccache = use_ccache and 'ccache ' or '' defines = '-DANDROID -DPIC' -cflags = '--sysroot=%s -I%s/usr/include -ffunction-sections -funwind-tables -fPIC' % (sysroot, sysroot) -ldflags = '--sysroot=%s -fPIC -Wl,-no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,-z,nocopyreloc -Wl,-dynamic-linker,/system/bin/linker -L%s/usr/lib ' % (sysroot, sysroot) +cflags = '--sysroot=%s -I%s/usr/include -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fPIC' % (sysroot, sysroot) +ldflags = '--sysroot=%s -fPIC -no-canonical-prefixes -Wl,-no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--gc-sections -Wl,-z,nocopyreloc -Wl,-dynamic-linker,/system/bin/linker -L%s/usr/lib ' % (sysroot, sysroot) # from android-ndk-r8b/toolchains/$NAME-$VERSION/setup.mk if target_arch in [Architecture.ARM, Architecture.ARMv7]: defines += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ ' - cflags += ' -mthumb -fstack-protector -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 ' + cflags += ' -mthumb -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 ' if target_arch == Architecture.ARM: cflags += ' -march=armv5te -mtune=xscale -msoft-float' elif target_arch == Architecture.ARMv7: |