|
| 1 | +diff --git a/mozjs/build/moz.configure/android-ndk.configure b/mozjs/build/moz.configure/android-ndk.configure |
| 2 | +index 5193332f3..21f7e2767 100644 |
| 3 | +--- a/mozjs/build/moz.configure/android-ndk.configure |
| 4 | ++++ b/mozjs/build/moz.configure/android-ndk.configure |
| 5 | +@@ -8,6 +8,15 @@ |
| 6 | + js_option('--with-android-ndk', nargs=1, |
| 7 | + help='location where the Android NDK can be found') |
| 8 | + |
| 9 | ++js_option('--with-android-ndk-version', nargs=1, |
| 10 | ++ help='android NDK version') |
| 11 | ++ |
| 12 | ++js_option('--with-android-platform', nargs=1, |
| 13 | ++ help='location of the Android platform') |
| 14 | ++ |
| 15 | ++js_option('--with-android-clang', nargs=1, |
| 16 | ++ help='location of the Android clang compiler') |
| 17 | ++ |
| 18 | + js_option('--with-android-toolchain', nargs=1, |
| 19 | + help='location of the Android toolchain') |
| 20 | + |
| 21 | +@@ -66,13 +75,17 @@ set_config('ANDROID_NDK', ndk) |
| 22 | + add_old_configure_assignment('android_ndk', ndk) |
| 23 | + |
| 24 | + |
| 25 | +-@depends(ndk) |
| 26 | ++@depends('--with-android-ndk-version', ndk) |
| 27 | + @checking('for android ndk version') |
| 28 | + @imports(_from='__builtin__', _import='open') |
| 29 | +-def ndk_version(ndk): |
| 30 | ++def ndk_version(value, ndk): |
| 31 | + if not ndk: |
| 32 | + # Building 'js/src' for non-Android. |
| 33 | + return |
| 34 | ++ |
| 35 | ++ if value: |
| 36 | ++ return value[0] |
| 37 | ++ |
| 38 | + with open(os.path.join(ndk, 'source.properties'), 'r') as f: |
| 39 | + for line in f: |
| 40 | + if not line.startswith('Pkg.Revision'): |
| 41 | +@@ -112,13 +125,16 @@ def ndk_minor_version(ndk_version): |
| 42 | + set_config('ANDROID_NDK_MINOR_VERSION', ndk_minor_version) |
| 43 | + |
| 44 | + |
| 45 | +-@depends(target, android_version, ndk, '--help') |
| 46 | ++@depends('--with-android-platform', target, android_version, ndk, '--help') |
| 47 | + @checking('for android platform directory') |
| 48 | + @imports(_from='os.path', _import='isdir') |
| 49 | +-def android_platform(target, android_version, ndk, _): |
| 50 | ++def android_platform(value, target, android_version, ndk, _): |
| 51 | + if target.os != 'Android': |
| 52 | + return |
| 53 | + |
| 54 | ++ if value: |
| 55 | ++ return value[0] |
| 56 | ++ |
| 57 | + if 'mips' in target.cpu: |
| 58 | + target_dir_name = 'mips' |
| 59 | + elif 'aarch64' == target.cpu: |
| 60 | +@@ -257,7 +273,7 @@ option(env='STLPORT_CPPFLAGS', |
| 61 | + @imports(_from='os.path', _import='isdir') |
| 62 | + def stlport_cppflags(value, ndk, _): |
| 63 | + if value and len(value): |
| 64 | +- return value.split() |
| 65 | ++ return value[0].split() |
| 66 | + if not ndk: |
| 67 | + return |
| 68 | + |
| 69 | +@@ -339,13 +355,16 @@ def bindgen_cflags_defaults(toolchain_flags, toolchain, toolchain_prefix, _): |
| 70 | + os.path.join(gcc_include, 'include-fixed')) |
| 71 | + |
| 72 | + |
| 73 | +-@depends(host, ndk) |
| 74 | ++@depends('--with-android-clang', host, ndk) |
| 75 | + @imports(_from='os.path', _import='exists') |
| 76 | + @imports(_from='os.path', _import='isdir') |
| 77 | +-def android_clang_compiler(host, ndk): |
| 78 | ++def android_clang_compiler(value, host, ndk): |
| 79 | + if not ndk: |
| 80 | + return |
| 81 | + |
| 82 | ++ if value: |
| 83 | ++ return value[0] |
| 84 | ++ |
| 85 | + llvm_path = '%s/toolchains/llvm/prebuilt/%s-%s/bin' % (ndk, |
| 86 | + host.kernel.lower(), |
| 87 | + host.cpu) |
0 commit comments