Blame SOURCES/gcc48-color-auto.patch

56d343
2013-09-20  Jakub Jelinek  <jakub@redhat.com>
56d343
56d343
	* common.opt (-fdiagnostics-color=): Default to auto.
56d343
	* toplev.c (process_options): Always default to
56d343
	-fdiagnostics-color=auto if no -f{,no-}diagnostics-color*.
56d343
	* doc/invoke.texi (-fdiagnostics-color*): Adjust documentation
56d343
	of the default.
56d343
56d343
--- gcc/common.opt.jj	2013-09-18 12:06:53.000000000 +0200
56d343
+++ gcc/common.opt	2013-09-20 10:00:00.935823900 +0200
56d343
@@ -1037,7 +1037,7 @@ Common Alias(fdiagnostics-color=,always,
56d343
 ;
56d343
 
56d343
 fdiagnostics-color=
56d343
-Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_NO)
56d343
+Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_AUTO)
56d343
 -fdiagnostics-color=[never|always|auto]	Colorize diagnostics
56d343
 
56d343
 ; Required for these enum values.
56d343
--- gcc/toplev.c.jj	2013-09-09 11:32:39.000000000 +0200
56d343
+++ gcc/toplev.c	2013-09-20 10:10:08.198721005 +0200
56d343
@@ -1229,10 +1229,8 @@ process_options (void)
56d343
 
56d343
   maximum_field_alignment = initial_max_fld_align * BITS_PER_UNIT;
56d343
 
56d343
-  /* Default to -fdiagnostics-color=auto if GCC_COLORS is in the environment,
56d343
-     otherwise default to -fdiagnostics-color=never.  */
56d343
-  if (!global_options_set.x_flag_diagnostics_show_color
56d343
-      && getenv ("GCC_COLORS"))
56d343
+  /* Default to -fdiagnostics-color=auto.  */
56d343
+  if (!global_options_set.x_flag_diagnostics_show_color)
56d343
     pp_show_color (global_dc->printer)
56d343
       = colorize_init (DIAGNOSTICS_COLOR_AUTO);
56d343
 
56d343
--- gcc/doc/invoke.texi.jj	2013-09-18 12:06:50.000000000 +0200
56d343
+++ gcc/doc/invoke.texi	2013-09-20 10:09:29.079904455 +0200
56d343
@@ -3046,8 +3046,7 @@ a message which is too long to fit on a
56d343
 @cindex highlight, color, colour
56d343
 @vindex GCC_COLORS @r{environment variable}
56d343
 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
56d343
-or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
56d343
-variable isn't present in the environment, and @samp{auto} otherwise.
56d343
+or @samp{auto}.  The default is @samp{auto}.
56d343
 @samp{auto} means to use color only when the standard error is a terminal.
56d343
 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
56d343
 aliases for @option{-fdiagnostics-color=always} and