]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Pass -fdiagnostics-color=auto to the compiler even if stderr is redirected
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 19 Nov 2014 20:23:20 +0000 (21:23 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 19 Nov 2014 20:23:20 +0000 (21:23 +0100)
This fixes a problem when e.g. a configure test probes if the compiler
(wrapped via ccache) supports -fdiagnostics-color=auto. If ccache discards
the option since configure redirects stderr, then configure will
erroneously think that the compiler supports the option and the build will
fail later on (if stderr refers to a TTY).

ccache.c

index f3a6a0383aeadf23886adfd2b8e44f68c6904a97..9e2f4d81fa177030fd7c581b0ab2755bac56b8f0 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1999,6 +1999,8 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                                /* Output is redirected, so color output must be forced. */
                                args_add(stripped_args, "-fdiagnostics-color=always");
                                cc_log("Automatically forcing colors");
+                       } else {
+                               args_add(stripped_args, argv[i]);
                        }
                        found_color_diagnostics = true;
                        continue;