Add support to build with ccache in the build system

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5297 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c
index aee8696..b7c7a01 100644
--- a/util/romcc/romcc.c
+++ b/util/romcc/romcc.c
@@ -24968,10 +24968,14 @@
 	state.errout = stderr;
 	state.dbgout = stdout;
 	/* Remember the output filename */
-	state.output    = fopen(state.compiler->ofilename, "w");
-	if (!state.output) {
-		error(&state, 0, "Cannot open output file %s\n",
-			state.compiler->ofilename);
+	if ((state.compiler->flags & COMPILER_PP_ONLY) && (strcmp("auto.inc",state.compiler->ofilename) == 0)) {
+		state.output    = stdout;
+	} else {
+		state.output    = fopen(state.compiler->ofilename, "w");
+		if (!state.output) {
+			error(&state, 0, "Cannot open output file %s\n",
+				state.compiler->ofilename);
+		}
 	}
 	/* Make certain a good cleanup happens */
 	exit_state = &state;
@@ -25146,6 +25150,12 @@
 			else if (strncmp(argv[1], "-m", 2) == 0) {
 				result = arch_encode_flag(&arch, argv[1]+2);
 			}
+			else if (strncmp(argv[1], "-c", 2) == 0) {
+				result = 0;
+			}
+			else if (strncmp(argv[1], "-S", 2) == 0) {
+				result = 0;
+			}
 			else if (strncmp(argv[1], "-include", 10) == 0) {
 				struct filelist *old_head = include_filelist;
 				include_filelist = malloc(sizeof(struct filelist));