Respect Clang version override env vars.

Bazel fails to respect the environment variables $LLVM_PREBUILTS_VERSION
and $LLVM_RELEASE_VERSION, which are commonly used by LLVM developers
to build using a custom compiler. Fix it.

Bug: 272408039
Change-Id: I3cf18e7814ff52d526017e4fe34b17ab3d8f1080
diff --git a/android/config_bp2build.go b/android/config_bp2build.go
index 2beeb51..830890d 100644
--- a/android/config_bp2build.go
+++ b/android/config_bp2build.go
@@ -95,6 +95,15 @@
 	return ev.pctx.VariableConfigMethod(name, method)
 }
 
+func (ev ExportedVariables) ExportStringStaticVariableWithEnvOverride(name, envVar, defaultVal string) {
+	ev.ExportVariableConfigMethod(name, func(config Config) string {
+		if override := config.Getenv(envVar); override != "" {
+			return override
+		}
+		return defaultVal
+	})
+}
+
 // ExportSourcePathVariable declares a static "source path" variable and exports
 // it to Bazel's toolchain.
 func (ev ExportedVariables) ExportSourcePathVariable(name string, value string) {