From 516a2a7bfaee5d4aa4d1e7e5ff52d3038513c82f Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 25 Mar 2010 21:45:25 +0000 Subject: Add support to build with ccache in the build system Signed-off-by: Patrick Georgi Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5297 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/romcc/romcc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'util/romcc/romcc.c') diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c index aee86968af..b7c7a01d35 100644 --- a/util/romcc/romcc.c +++ b/util/romcc/romcc.c @@ -24968,10 +24968,14 @@ static void compile(const char *filename, 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 @@ int main(int argc, char **argv) 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)); -- cgit v1.2.3