Add support for include_files

Support include_files and local_include_files to pass -include arguments
to gcc.

Change-Id: Ie3f03218fcbc9732741da91671b20e240f3de3a6
diff --git a/cc/cc.go b/cc/cc.go
index e9d3884..2ade59c 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -218,10 +218,20 @@
 	// that module.
 	Include_dirs []string `android:"arch_variant"`
 
+	// list of files relative to the root of the source tree that will be included
+	// using -include.
+	// If possible, don't use this.
+	Include_files []string `android:"arch_variant"`
+
 	// list of directories relative to the Blueprints file that will
 	// be added to the include path using -I
 	Local_include_dirs []string `android:"arch_variant"`
 
+	// list of files relative to the Blueprints file that will be included
+	// using -include.
+	// If possible, don't use this.
+	Local_include_files []string `android:"arch_variant"`
+
 	// list of directories relative to the Blueprints file that will
 	// be added to the include path using -I for any module that links against this module
 	Export_include_dirs []string `android:"arch_variant"`
@@ -447,6 +457,13 @@
 		includeDirsToFlags(rootIncludeDirs),
 		includeDirsToFlags(localIncludeDirs))
 
+	rootIncludeFiles := pathtools.PrefixPaths(c.Properties.Include_files, ctx.AConfig().SrcDir())
+	localIncludeFiles := pathtools.PrefixPaths(c.Properties.Local_include_files, common.ModuleSrcDir(ctx))
+
+	flags.GlobalFlags = append(flags.GlobalFlags,
+		includeFilesToFlags(rootIncludeFiles),
+		includeFilesToFlags(localIncludeFiles))
+
 	if !c.Properties.No_default_compiler_flags {
 		if c.Properties.Sdk_version == "" || ctx.Host() {
 			flags.GlobalFlags = append(flags.GlobalFlags,
diff --git a/cc/util.go b/cc/util.go
index 9ce84ee..efc89f0 100644
--- a/cc/util.go
+++ b/cc/util.go
@@ -28,6 +28,10 @@
 	return common.JoinWithPrefix(dirs, "-I")
 }
 
+func includeFilesToFlags(dirs []string) string {
+	return common.JoinWithPrefix(dirs, "-include ")
+}
+
 func ldDirsToFlags(dirs []string) string {
 	return common.JoinWithPrefix(dirs, "-L")
 }