mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 14:46:02 +00:00
Bug 1360291 - Detect NDK version number; r=nalexander
Detect the NDK major/minor version numbers, and feed that to Breakpad. For AArch64, some Breakpad headers try to workaround NDK oddities by checking the ANDROID_NDK_MAJOR_VERSION and ANDROID_NDK_MINOR_VERSION macros.
This commit is contained in:
parent
5a39ae87ca
commit
055a903128
@ -57,6 +57,47 @@ def ndk(value, build_project):
|
||||
set_config('ANDROID_NDK', ndk)
|
||||
add_old_configure_assignment('android_ndk', ndk)
|
||||
|
||||
@depends(ndk)
|
||||
@checking('for android ndk version')
|
||||
@imports(_from='__builtin__', _import='open')
|
||||
def ndk_version(ndk):
|
||||
if not ndk:
|
||||
# Building 'js/src' for non-Android.
|
||||
return
|
||||
with open(os.path.join(ndk, 'source.properties'), 'r') as f:
|
||||
for line in f:
|
||||
if not line.startswith('Pkg.Revision'):
|
||||
continue
|
||||
(_, version) = line.split('=')
|
||||
if version:
|
||||
return version.strip()
|
||||
die('Unexpected Pkg.Revision line in source.properties')
|
||||
die('Cannot determine NDK version from source.properties')
|
||||
|
||||
@depends(ndk_version)
|
||||
def ndk_major_version(ndk_version):
|
||||
if not ndk_version:
|
||||
# Building 'js/src' for non-Android.
|
||||
return
|
||||
(major, minor, revision) = ndk_version.split('.')
|
||||
if major:
|
||||
return major
|
||||
die('Unexpected NDK version string: ' + ndk_version)
|
||||
|
||||
set_config('ANDROID_NDK_MAJOR_VERSION', ndk_major_version);
|
||||
|
||||
@depends(ndk_version)
|
||||
def ndk_minor_version(ndk_version):
|
||||
if not ndk_version:
|
||||
# Building 'js/src' for non-Android.
|
||||
return
|
||||
(major, minor, revision) = ndk_version.split('.')
|
||||
if minor:
|
||||
return minor
|
||||
die('Unexpected NDK version string: ' + ndk_version)
|
||||
|
||||
set_config('ANDROID_NDK_MINOR_VERSION', ndk_minor_version);
|
||||
|
||||
@depends(target, android_version, ndk)
|
||||
@checking('for android platform directory')
|
||||
@imports(_from='os.path', _import='isdir')
|
||||
|
@ -24,6 +24,8 @@ if CONFIG['OS_TARGET'] == 'Linux' or CONFIG['OS_TARGET'] == 'Android':
|
||||
DEFINES['COMMON_LINUX_GUID_CREATOR_H__'] = 1
|
||||
|
||||
if CONFIG['OS_TARGET'] == 'Android':
|
||||
DEFINES['ANDROID_NDK_MAJOR_VERSION'] = CONFIG['ANDROID_NDK_MAJOR_VERSION']
|
||||
DEFINES['ANDROID_NDK_MINOR_VERSION'] = CONFIG['ANDROID_NDK_MINOR_VERSION']
|
||||
LOCAL_INCLUDES += [
|
||||
'/toolkit/crashreporter/google-breakpad/src/common/android/include',
|
||||
]
|
||||
|
@ -38,6 +38,8 @@ HOST_CXXFLAGS += [
|
||||
]
|
||||
|
||||
if CONFIG['OS_TARGET'] == 'Android':
|
||||
DEFINES['ANDROID_NDK_MAJOR_VERSION'] = CONFIG['ANDROID_NDK_MAJOR_VERSION']
|
||||
DEFINES['ANDROID_NDK_MINOR_VERSION'] = CONFIG['ANDROID_NDK_MINOR_VERSION']
|
||||
LOCAL_INCLUDES += [
|
||||
'/toolkit/crashreporter/google-breakpad/src/common/android/include',
|
||||
]
|
||||
|
@ -83,6 +83,8 @@ include('/ipc/chromium/chromium-config.mozbuild')
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
if CONFIG['OS_TARGET'] == 'Android':
|
||||
DEFINES['ANDROID_NDK_MAJOR_VERSION'] = CONFIG['ANDROID_NDK_MAJOR_VERSION']
|
||||
DEFINES['ANDROID_NDK_MINOR_VERSION'] = CONFIG['ANDROID_NDK_MINOR_VERSION']
|
||||
DEFINES['ANDROID_PACKAGE_NAME'] = '"%s"' % CONFIG['ANDROID_PACKAGE_NAME']
|
||||
# NDK5 workarounds
|
||||
DEFINES['_STLP_CONST_CONSTRUCTOR_BUG'] = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user