|
8 | 8 | js_option('--with-android-ndk', nargs=1, |
9 | 9 | help='location where the Android NDK can be found') |
10 | 10 |
|
| 11 | +js_option('--with-android-ndk-version', nargs=1, |
| 12 | + help='android NDK version') |
| 13 | + |
| 14 | +js_option('--with-android-platform', nargs=1, |
| 15 | + help='location of the Android platform') |
| 16 | + |
| 17 | +js_option('--with-android-clang', nargs=1, |
| 18 | + help='location of the Android clang compiler') |
| 19 | + |
11 | 20 | js_option('--with-android-toolchain', nargs=1, |
12 | 21 | help='location of the Android toolchain') |
13 | 22 |
|
@@ -63,13 +72,17 @@ set_config('ANDROID_NDK', ndk) |
63 | 72 | add_old_configure_assignment('android_ndk', ndk) |
64 | 73 |
|
65 | 74 |
|
66 | | -@depends(ndk) |
| 75 | +@depends('--with-android-ndk-version', ndk) |
67 | 76 | @checking('for android ndk version') |
68 | 77 | @imports(_from='__builtin__', _import='open') |
69 | | -def ndk_version(ndk): |
| 78 | +def ndk_version(value, ndk): |
70 | 79 | if not ndk: |
71 | 80 | # Building 'js/src' for non-Android. |
72 | 81 | return |
| 82 | + |
| 83 | + if value: |
| 84 | + return value[0] |
| 85 | + |
73 | 86 | with open(os.path.join(ndk, 'source.properties'), 'r') as f: |
74 | 87 | for line in f: |
75 | 88 | if not line.startswith('Pkg.Revision'): |
@@ -109,13 +122,16 @@ def ndk_minor_version(ndk_version): |
109 | 122 | set_config('ANDROID_NDK_MINOR_VERSION', ndk_minor_version) |
110 | 123 |
|
111 | 124 |
|
112 | | -@depends(target, android_version, ndk) |
| 125 | +@depends('--with-android-platform', target, android_version, ndk) |
113 | 126 | @checking('for android platform directory') |
114 | 127 | @imports(_from='os.path', _import='isdir') |
115 | | -def android_platform(target, android_version, ndk): |
| 128 | +def android_platform(value, target, android_version, ndk): |
116 | 129 | if target.os != 'Android': |
117 | 130 | return |
118 | 131 |
|
| 132 | + if value: |
| 133 | + return value[0] |
| 134 | + |
119 | 135 | if 'aarch64' == target.cpu: |
120 | 136 | target_dir_name = 'arm64' |
121 | 137 | else: |
@@ -252,7 +268,7 @@ js_option(env='STLPORT_CPPFLAGS', |
252 | 268 | @imports(_from='os.path', _import='isdir') |
253 | 269 | def stlport_cppflags(value, ndk): |
254 | 270 | if value and len(value): |
255 | | - return value.split() |
| 271 | + return value[0].split() |
256 | 272 | if not ndk: |
257 | 273 | return |
258 | 274 |
|
@@ -296,6 +312,8 @@ def extra_toolchain_flags(android_system, android_sysroot, toolchain_dir, |
296 | 312 | android_system, |
297 | 313 | '-isystem', |
298 | 314 | os.path.join(android_sysroot, 'usr', 'include'), |
| 315 | + '--sysroot', |
| 316 | + android_sysroot, |
299 | 317 | '-gcc-toolchain', |
300 | 318 | toolchain_dir, |
301 | 319 | '-D__ANDROID_API__=%d' % android_version] |
@@ -332,13 +350,16 @@ def bindgen_cflags_android(toolchain_flags, toolchain, toolchain_prefix): |
332 | 350 | ] |
333 | 351 |
|
334 | 352 |
|
335 | | -@depends(host, ndk) |
| 353 | +@depends('--with-android-clang', host, ndk) |
336 | 354 | @imports(_from='os.path', _import='exists') |
337 | 355 | @imports(_from='os.path', _import='isdir') |
338 | | -def android_clang_compiler(host, ndk): |
| 356 | +def android_clang_compiler(value, host, ndk): |
339 | 357 | if not ndk: |
340 | 358 | return |
341 | 359 |
|
| 360 | + if value: |
| 361 | + return value[0] |
| 362 | + |
342 | 363 | llvm_format = '%s/toolchains/llvm/prebuilt/%s-%s/bin' |
343 | 364 | llvm_path = llvm_format % (ndk, host.kernel.lower(), host.cpu) |
344 | 365 | if not isdir(llvm_path) and host.cpu == 'x86_64': |
|
0 commit comments