[ccache] [patch] fix DEPENDENCIES_OUTPUT with ccache

Martin Pool mbp at sourcefrog.net
Thu Aug 28 14:48:26 EST 2003


DEPENDENCIES_OUTPUT is an alternative way to get Makefile-style
dependencies used by some Makefiles.

Unfortunately when cc is invoked as separate cpp and cc1 passes, you
get dependencies for both of them.

This patch should fix it, please apply:

Index: ccache.c
===================================================================
RCS file: /data/cvs/ccache/ccache.c,v
retrieving revision 1.80
diff -u -c -r1.80 ccache.c
*** ccache.c	7 Mar 2003 12:09:19 -0000	1.80
--- ccache.c	28 Aug 2003 04:39:53 -0000
***************
*** 4,9 ****
--- 4,10 ----
    The idea is based on the shell-script compilercache by Erik Thiele <erikyyy at erikyyy.de>
  
     Copyright (C) Andrew Tridgell 2002
+    Copyright (C) Martin Pool 2003
     
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
***************
*** 153,158 ****
--- 154,167 ----
  
  	args_add(args, "-o");
  	args_add(args, tmp_hashname);
+ 
+ 	/* Turn off DEPENDENCIES_OUTPUT when running cc1, because
+ 	 * otherwise it will emit a line like
+ 	 *
+ 	 *  tmp.stdout.vexed.732.o: /home/mbp/.ccache/tmp.stdout.vexed.732.i
+ 	 *
+ 	 * unsetenv() is on BSD and Linux but not portable. */
+ 	putenv("DEPENDENCIES_OUTPUT");
  	
  	if (getenv("CCACHE_CPP2")) {
  		args_add(args, input_file);


-- 
Martin 



More information about the ccache mailing list