From 44487224252ad91c448373cd1974f1ef6c53579f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Dec 2012 19:27:16 +0000 Subject: allow flags to be selected based on compiler version --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a1c6e5dbc..1f83cba58 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ else TARGET := beos endif # BeOS still uses gcc2 - GCCVER := 2 + CC_MAJOR := 2 else ifeq ($(HOST),AmigaOS) HOST := amiga @@ -282,6 +282,12 @@ else endif endif +# compiler versioning to adjust warning flags +CC_MAJOR := $(shell $(CC) -dumpversion | cut -f1 -d. ) +CC_MINOR := $(shell $(CC) -dumpversion | cut -f2 -d. ) +define cc_ver_ge +$(shell expr $(CC_MAJOR) \>= $(1) \& $(CC_MINOR) \>= $(2)) +endef # CCACHE ifeq ($(origin CCACHE),undefined) @@ -401,9 +407,13 @@ WARNFLAGS = -W -Wall -Wundef -Wpointer-arith \ -Wcast-align -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \ -Wnested-externs -Wuninitialized -ifneq ($(GCCVER),2) +ifneq ($(CC_MAJOR),2) WARNFLAGS += -Wno-unused-parameter endif +# deal with lots of unwanted warnings from javascript +ifeq ($(call cc_ver_ge,4,6),1) + WARNFLAGS += -Wno-unused-but-set-variable +endif # Pull in the configuration include Makefile.defaults -- cgit v1.2.3