linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] build: Do not force diagnostics-color flag
@ 2014-12-05  0:49 Mike Auty
  2014-12-16 20:46 ` Lucas De Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Auty @ 2014-12-05  0:49 UTC (permalink / raw)
  To: linux-modules

The -fdiagnostics-color flag is only available on GCC >= 4.9, for
older versions this could raise an error in certain circumstances
(such as when using ccache).  Instead, since -fdiagnostic-color=auto
by default  in gcc-4.9, simply set the required environment variable
to the default one if it's undefined.

Based mostly on the systemd commit f44541bc by Michal Schmidt.
---
 Makefile.am  | 3 +++
 configure.ac | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index ea5cbac..51825f0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,6 +11,9 @@ BUILT_FILES =
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 AM_MAKEFLAGS = --no-print-directory

+GCC_COLORS ?=
'error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
+export GCC_COLORS
+
 AM_CPPFLAGS = \
 	-include $(top_builddir)/config.h \
 	-I$(top_srcdir)/libkmod \
diff --git a/configure.ac b/configure.ac
index 2709f08..f28bfed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -201,7 +201,6 @@ CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
 		       -Wuninitialized \
 		       -fno-common \
 		       -fdiagnostics-show-option \
-		       -fdiagnostics-color=auto \
 		       -fvisibility=hidden \
 		       -ffunction-sections \
 		       -fdata-sections])
-- 
2.2.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-17  2:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05  0:49 [PATCH] build: Do not force diagnostics-color flag Mike Auty
2014-12-16 20:46 ` Lucas De Marchi
2014-12-16 23:27   ` Mike Auty
2014-12-17  2:44     ` Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).