]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
config: Use compiler_check from conf struct
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 16 Jul 2011 13:33:37 +0000 (15:33 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 17 Jul 2011 09:57:52 +0000 (11:57 +0200)
ccache.c

index bfa6e1b26f98b1841fa108f47c113692a64d692b..108a3c77ac79e47f5e4598a4803c0da83a54342d 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -867,7 +867,6 @@ static void
 calculate_common_hash(struct args *args, struct mdfour *hash)
 {
        struct stat st;
-       const char *compilercheck;
        char *p;
 
        hash_string(hash, HASH_PREFIX);
@@ -888,22 +887,19 @@ calculate_common_hash(struct args *args, struct mdfour *hash)
        /*
         * Hash information about the compiler.
         */
-       compilercheck = getenv("CCACHE_COMPILERCHECK");
-       if (!compilercheck) {
-               compilercheck = "mtime";
-       }
-       if (str_eq(compilercheck, "none")) {
+       if (str_eq(conf->compiler_check, "none")) {
                /* Do nothing. */
-       } else if (str_eq(compilercheck, "content")) {
+       } else if (str_eq(conf->compiler_check, "content")) {
                hash_delimiter(hash, "cc_content");
                hash_file(hash, args->argv[0]);
-       } else if (str_eq(compilercheck, "mtime")) {
+       } 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);
        } else { /* command string */
-               if (!hash_multicommand_output(hash, compilercheck, orig_args->argv[0])) {
-                       fatal("Failure running compiler check command: %s", compilercheck);
+               if (!hash_multicommand_output(
+                           hash, conf->compiler_check, orig_args->argv[0])) {
+                       fatal("Failure running compiler check command: %s", conf->compiler_check);
                }
        }