servo/python/servo
bors-servo a3b85cbd6c Auto merge of #18031 - jhlin:android-build-on-macos, r=mbrubeck
Fix Android build errors on macOS.

- Add sysroot path to environment variable 'CPPFLAGS':
  When checking C preprocessor, the 'configure' script of libbacktrace uses 'CPPFLAGS' rather than 'CFLAGS' and doesn't get the correct search path. (#15758)
  This check passes on Linux because the '/lib/cpp' fallback is available there.

- Introduce CMake toolchain file for Android cross compiling:
  CMake needs several variables [1] to cross compile for Android.
  It works (accidentally) on Linux because cmake-rs sets compilers correctly and binutils for Linux & Android are pretty much the same.

[1] https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html#cross-compiling-for-android-with-the-ndk

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15758 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it's a fix to build errors.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18031)
<!-- Reviewable:end -->
2017-09-15 14:05:00 -05:00
..
lints Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444 2017-04-22 14:17:10 +02:00
__init__.py Fix tidy issues with Python files in python/ 2015-06-02 19:51:41 -04:00
bootstrap.py Bootstrap: Fix cmake version parsing 2017-05-09 22:38:12 +02:00
bootstrap_commands.py Get rustc commit hash from channel manifest 2017-09-12 11:42:11 +02:00
build_commands.py Fix Android build errors on macOS. 2017-08-10 12:12:54 +08:00
command_base.py Switch back to pinning Rust by Nightly date instead of commit hash… 2017-08-31 14:30:28 +02:00
devenv_commands.py './mach rustup': Use alternate S3 URL that doesn’t require SNI 2017-09-12 11:42:12 +02:00
package_commands.py Use new ARM target for nightly upload. 2017-06-12 08:58:47 -04:00
packages.py Remove more deprecated Windows GNU code/docs 2017-04-16 22:12:17 -04:00
post_build_commands.py Android life cycle improvements and Gradle integration 2017-04-21 18:24:10 +02:00
servo-binary-formula.rb.in Fix ./mach upload-nightly macbrew 2017-05-30 14:27:27 -04:00
testing_commands.py Remove testing feature from style crate 2017-08-07 14:30:31 -07:00
util.py Handle aarch64 cpu_type 2017-08-24 14:05:16 +00:00
win32_toast.py Add proper Win32 notification for builds 2016-08-17 09:50:58 -04:00