Merge "Uncanary the build." into ndk-r14-release
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0644adc..c365964 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,15 @@
 
 [Unified Headers]: docs/UnifiedHeaders.md
 
+APIs
+----
+
+ * `_BSD_SOURCE` will never be defined by the NDK when using unified headers;
+   the user's setting will be obeyed. When using the deprecated headers, whether
+   or not this was defined depended on which headers you included. To continue
+   using `_BSD_SOURCE`, `#define` it in your source files or pass it on the
+   command line as you would for typical Linux code.
+
 ndk-build
 ---------
 
diff --git a/checkbuild.py b/checkbuild.py
index 088107c..3187233 100755
--- a/checkbuild.py
+++ b/checkbuild.py
@@ -576,24 +576,28 @@
     name = 'cpufeatures'
     path = 'sources/android/cpufeatures'
     src = build_support.ndk_path('sources/android/cpufeatures')
+    create_repo_prop = True
 
 
 class NativeAppGlue(ndk.builds.PackageModule):
     name = 'native_app_glue'
     path = 'sources/android/native_app_glue'
     src = build_support.ndk_path('sources/android/native_app_glue')
+    create_repo_prop = True
 
 
 class NdkHelper(ndk.builds.PackageModule):
     name = 'ndk_helper'
     path = 'sources/android/ndk_helper'
     src = build_support.ndk_path('sources/android/ndk_helper')
+    create_repo_prop = True
 
 
 class Gtest(ndk.builds.PackageModule):
     name = 'gtest'
     path = 'sources/third_party/googletest'
     src = build_support.ndk_path('sources/third_party/googletest')
+    create_repo_prop = True
 
 
 class Sysroot(ndk.builds.Module):
@@ -739,6 +743,7 @@
     name = 'ndk-build'
     path = 'build'
     src = build_support.ndk_path('build')
+    create_repo_prop = True
 
 
 # TODO(danalbert): Why isn't this just PackageModule?
@@ -763,24 +768,28 @@
     name = 'gabi++'
     path = 'sources/cxx-stl/gabi++'
     src = build_support.ndk_path('sources/cxx-stl/gabi++')
+    create_repo_prop = True
 
 
 class SystemStl(ndk.builds.PackageModule):
     name = 'system-stl'
     path = 'sources/cxx-stl/system'
     src = build_support.ndk_path('sources/cxx-stl/system')
+    create_repo_prop = True
 
 
 class LibAndroidSupport(ndk.builds.PackageModule):
     name = 'libandroid_support'
     path = 'sources/android/support'
     src = build_support.ndk_path('sources/android/support')
+    create_repo_prop = True
 
 
 class Libcxxabi(ndk.builds.PackageModule):
     name = 'libc++abi'
     path = 'sources/cxx-stl/llvm-libc++abi'
     src = build_support.android_path('external/libcxxabi')
+    create_repo_prop = True
 
 
 class SimplePerf(ndk.builds.Module):
@@ -817,6 +826,7 @@
     name = 'renderscript-libs'
     path = 'sources/android/renderscript'
     src = build_support.ndk_path('sources/android/renderscript')
+    create_repo_prop = True
 
 
 class RenderscriptToolchain(ndk.builds.InvokeBuildModule):
diff --git a/ndk/builds.py b/ndk/builds.py
index 2a0bf3c..4faf155 100644
--- a/ndk/builds.py
+++ b/ndk/builds.py
@@ -93,11 +93,12 @@
         if not os.path.exists(repo_prop_file):
             raise RuntimeError(
                 '{} did not install a repo.prop file at {}'.format(
-                    self.name, license_file))
+                    self.name, repo_prop_file))
 
 
 class PackageModule(Module):
     src = None
+    create_repo_prop = False
 
     def validate(self):
         super(PackageModule, self).validate()
@@ -125,6 +126,9 @@
         install_path = install_paths[0]
         print 'Installing {} to {}'.format(self.src, install_path)
         install_directory(self.src, install_path)
+        if self.create_repo_prop:
+            build.lib.build_support.make_repo_prop(install_path)
+        self.validate_notice(install_path)
 
 
 class InvokeExternalBuildModule(Module):