Merge "Install support headers to usr/local/include."
diff --git a/build/tools/make_standalone_toolchain.py b/build/tools/make_standalone_toolchain.py
index c63936b..baf2feb 100755
--- a/build/tools/make_standalone_toolchain.py
+++ b/build/tools/make_standalone_toolchain.py
@@ -376,6 +376,16 @@
cxx_headers = os.path.join(install_path, 'include/c++', gcc_ver)
+ # Historically these were installed to the same directory as the C++
+ # headers, but with the updated libc++ we have copies of a lot of those
+ # headers in libc++ itself that we end up clobbering.
+ #
+ # This problem should go away with unified headers, but those aren't ready
+ # yet. For the time being, install the libandroid_support headers to a
+ # different builtin include path. usr/local/include seems to be the least
+ # objectionable option.
+ support_headers = os.path.join(install_path, 'sysroot/usr/local/include')
+
if stl == 'gnustl':
gnustl_dir = os.path.join(NDK_DIR, 'sources/cxx-stl/gnu-libstdc++/4.9')
shutil.copytree(os.path.join(gnustl_dir, 'include'), cxx_headers)
@@ -394,7 +404,7 @@
copy_directory_contents(os.path.join(libcxx_dir, 'include'),
cxx_headers)
copy_directory_contents(os.path.join(support_dir, 'include'),
- cxx_headers)
+ support_headers)
# I have no idea why we need this, but the old one does it too.
copy_directory_contents(
diff --git a/tests/build/standalone-toolchain/foo.cpp b/tests/build/standalone-toolchain/foo.cpp
index 7b60c57..256218b 100644
--- a/tests/build/standalone-toolchain/foo.cpp
+++ b/tests/build/standalone-toolchain/foo.cpp
@@ -1,5 +1,9 @@
#include <stdio.h>
+// Make sure we're not clobbering libc++ headers with libandroid_support.
+#include <cmath>
+
+// If std::strings don't work then there's really no point :)
#include <string>
void foo(const std::string& s) {