]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Merge branch 'master' into config
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 6 Jan 2012 16:03:38 +0000 (17:03 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 6 Jan 2012 16:03:38 +0000 (17:03 +0100)
* master:
  Merge branch 'maint'
  Sync mdfour.c license header with other files, notably fixing FSF's address.

Conflicts:
ccache.c

1  2 
MANUAL.txt
ccache.c
ccache.h
execute.c
test.sh

diff --cc MANUAL.txt
Simple merge
diff --cc ccache.c
index 234dd6a23773ec5aad7c24022245ee060a240c59,2b0fce065d84b1aec29de52c1705f3bd7d7ac624..ddc919b7cc0b12adf92af4d2a04a47cc1bc1051e
+++ b/ccache.c
@@@ -866,6 -891,36 +869,31 @@@ update_cached_result_globals(struct fil
        free(object_name);
  }
  
 -      const char *compilercheck;
 -
 -      compilercheck = getenv("CCACHE_COMPILERCHECK");
 -      if (!compilercheck) {
 -              compilercheck = "mtime";
 -      }
 -      if (str_eq(compilercheck, "none")) {
+ /*
+  * Hash mtime or content of a file, or the output of a command, according to
+  * the CCACHE_COMPILERCHECK setting.
+  */
+ static void
+ hash_compiler(struct mdfour *hash, struct stat *st, const char *path,
+               bool allow_command)
+ {
 -      } else if (str_eq(compilercheck, "mtime")) {
++      if (str_eq(conf->compiler_check, "none")) {
+               /* Do nothing. */
 -      } else if (str_eq(compilercheck, "content") || !allow_command) {
++      } else if (str_eq(conf->compiler_check, "mtime")) {
+               hash_delimiter(hash, "cc_mtime");
+               hash_int(hash, st->st_size);
+               hash_int(hash, st->st_mtime);
 -              if (!hash_multicommand_output(hash, compilercheck, orig_args->argv[0])) {
 -                      fatal("Failure running compiler check command: %s", compilercheck);
++      } else if (str_eq(conf->compiler_check, "content") || !allow_command) {
+               hash_delimiter(hash, "cc_content");
+               hash_file(hash, path);
+       } else { /* command string */
++              if (!hash_multicommand_output(
++                          hash, conf->compiler_check, orig_args->argv[0])) {
++                      fatal("Failure running compiler check command: %s", conf->compiler_check);
+               }
+       }
+ }
  /*
   * Update a hash sum with information common for the direct and preprocessor
   * modes.
@@@ -1046,7 -1094,25 +1065,25 @@@ calculate_object_hash(struct args *args
        }
  
        if (direct_mode) {
 -              if (!(sloppiness & SLOPPY_FILE_MACRO)) {
+               /* Hash environment variables that affect the preprocessor output. */
+               const char **p;
+               const char *envvars[] = {
+                       "CPATH",
+                       "C_INCLUDE_PATH",
+                       "CPLUS_INCLUDE_PATH",
+                       "OBJC_INCLUDE_PATH",
+                       "OBJCPLUS_INCLUDE_PATH", /* clang */
+                       NULL
+               };
+               for (p = envvars; *p != NULL ; ++p) {
+                       char *v = getenv(*p);
+                       if (v) {
+                               hash_delimiter(hash, *p);
+                               hash_string(hash, v);
+                       }
+               }
 +              if (!(conf->sloppiness & SLOPPY_FILE_MACRO)) {
                        /*
                         * The source code file or an include file may contain
                         * __FILE__, so make sure that the hash is unique for
diff --cc ccache.h
Simple merge
diff --cc execute.c
Simple merge
diff --cc test.sh
Simple merge