From: Andrew Tridgell Date: Wed, 27 Mar 2002 06:30:31 +0000 (+0100) Subject: implemented the identargs idea from compilercache X-Git-Tag: v1.0~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4101c3fd395a5e47f985ecb2e8763e410c1aec16;p=thirdparty%2Fccache.git implemented the identargs idea from compilercache --- diff --git a/ccache.c b/ccache.c index cacecf3d3..27e2a4061 100644 --- a/ccache.c +++ b/ccache.c @@ -158,6 +158,26 @@ static void find_hash(ARGS *args) /* first the arguments */ for (i=0;iargc;i++) { + /* some arguments don't contribute to the hash. The + theory is that these arguments will change the + output of -E if they are going to have any effect + at all, or they only affect linking */ + if (i < args->argc-1) { + if (strcmp(args->argv[i], "-I") == 0 || + strcmp(args->argv[i], "-include") == 0 || + strcmp(args->argv[i], "-L") == 0 || + strcmp(args->argv[i], "-D") == 0 || + strcmp(args->argv[i], "-isystem") == 0) { + i++; + continue; + } + if (strncmp(args->argv[i], "-I", 2) == 0 || + strncmp(args->argv[i], "-L", 2) == 0 || + strncmp(args->argv[i], "-D", 2) == 0) { + continue; + } + } + hash_string(args->argv[i]); }