Allow libnativehelper to be missing

Some branches may not include libnativehelper, or anything that depends
on jni.h

Change-Id: Id8bb9c101aecfacc5d62048818ea0c1c88b7d77c
diff --git a/cc/cc.go b/cc/cc.go
index 6e7eb5c..ce3a464 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -137,6 +137,10 @@
 			"frameworks/av/include",
 			"frameworks/base/include",
 		})
+	// This is used by non-NDK modules to get jni.h. export_include_dirs doesn't help
+	// with this, since there is no associated library.
+	pctx.PrefixedPathsForOptionalSourceVariable("commonNativehelperInclude", "-I",
+		[]string{"libnativehelper/include/nativehelper"})
 
 	pctx.SourcePathVariable("clangPath", "prebuilts/clang/host/${HostPrebuiltTag}/3.8/bin")
 }
@@ -502,7 +506,7 @@
 			flags.GlobalFlags = append(flags.GlobalFlags,
 				"${commonGlobalIncludes}",
 				toolchain.IncludeFlags(),
-				"-I"+common.PathForSource(ctx, "libnativehelper/include/nativehelper").String())
+				"${commonNativehelperInclude}")
 		}
 
 		flags.GlobalFlags = append(flags.GlobalFlags, []string{