build: colorize gcc only if on tty

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.
This commit is contained in:
Michal Schmidt 2014-08-15 16:33:03 +02:00
parent 20755373b1
commit f44541bc93
2 changed files with 3 additions and 1 deletions

View 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

View 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 \