Switch cc's use of bison and flex to prebuilt_build_tool

Test: treehugger
Change-Id: I6150f0f39151e8073d5d59fe189f614140fed57b
diff --git a/cc/compiler.go b/cc/compiler.go
index d5ea2c3..ba14dd5 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -251,6 +251,14 @@
 		deps.StaticLibs = append(deps.StaticLibs, "libomp")
 	}
 
+	if compiler.hasSrcExt(".y") || compiler.hasSrcExt(".yy") {
+		deps.Tools = append(deps.Tools, "bison", "m4")
+	}
+
+	if compiler.hasSrcExt(".l") || compiler.hasSrcExt(".ll") {
+		deps.Tools = append(deps.Tools, "flex", "m4")
+	}
+
 	return deps
 }
 
@@ -581,7 +589,7 @@
 
 	srcs := append(android.Paths(nil), compiler.srcsBeforeGen...)
 
-	srcs, genDeps := genSources(ctx, srcs, buildFlags)
+	srcs, genDeps := genSources(ctx, srcs, buildFlags, deps.Tools)
 	pathDeps = append(pathDeps, genDeps...)
 
 	compiler.pathDeps = pathDeps