chiark / gitweb /
build: colorize gcc only if on tty
authorMichal Schmidt <mschmidt@redhat.com>
Fri, 15 Aug 2014 14:33:03 +0000 (16:33 +0200)
committerMichal Schmidt <mschmidt@redhat.com>
Mon, 15 Sep 2014 14:08:50 +0000 (16:08 +0200)
Rather than forcing gcc to always produce colorized error messages
whether on tty or not, enable automatic colorization by ensuring
GCC_COLORS is set to a non-empty string.

Doing it this way removes the need for workarounds in ~/.emacs or
~/.vimrc for "M-x compile" or ":make", respectively, to work.

Makefile.am
configure.ac

index de40043c5bb439263ab9854d64013c9fe766167c..5dc17f8fe765e93e3062b7187e35ed2dd1118b9c 100644 (file)
@@ -24,6 +24,9 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 AM_MAKEFLAGS = --no-print-directory
 AUTOMAKE_OPTIONS = color-tests parallel-tests
 
+GCC_COLORS ?= 'ooh, shiny!'
+export GCC_COLORS
+
 SUBDIRS = . po
 
 # remove targets if the command fails
index 99c01d2487ab28317b303193a9222959a397729f..fb169042d87dc8e6e06e6099ad4aee50d45baeed 100644 (file)
@@ -190,7 +190,6 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
         -ffast-math \
         -fno-common \
         -fdiagnostics-show-option \
-        -fdiagnostics-color \
         -fno-strict-aliasing \
         -fvisibility=hidden \
         -ffunction-sections \