diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2012-12-13 19:27:16 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2012-12-13 19:27:16 +0000 |
commit | 44487224252ad91c448373cd1974f1ef6c53579f (patch) | |
tree | 071234531497f70f215725b363b7b06835f8e7f2 | |
parent | c87cbe565580975bf8300578ec556931a5f5a409 (diff) | |
download | netsurf-44487224252ad91c448373cd1974f1ef6c53579f.tar.gz netsurf-44487224252ad91c448373cd1974f1ef6c53579f.tar.bz2 |
allow flags to be selected based on compiler version
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | Makefile.sources.javascript | 1 | ||||
-rw-r--r-- | monkey/Makefile.target | 1 |
3 files changed, 12 insertions, 4 deletions
@@ -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 diff --git a/Makefile.sources.javascript b/Makefile.sources.javascript index 1ece3b683..76a6ff145 100644 --- a/Makefile.sources.javascript +++ b/Makefile.sources.javascript @@ -54,7 +54,6 @@ S_JAVASCRIPT += content.c jsapi.c $(addprefix jsapi/,$(S_JSAPI)) $(eval $(foreach V,$(filter JSAPI_BINDING_%,$(.VARIABLES)),$(call convert_jsapi_binding,$($(V)),$(OBJROOT)/$(patsubst JSAPI_BINDING_%,%,$(V)).c,$(patsubst JSAPI_BINDING_%,%,$(V))_jsapi))) - else S_JAVASCRIPT += none.c endif diff --git a/monkey/Makefile.target b/monkey/Makefile.target index 4e8ac81ee..fa15a50f2 100644 --- a/monkey/Makefile.target +++ b/monkey/Makefile.target @@ -33,7 +33,6 @@ $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript)) # no pkg-config for this library $(eval $(call feature_enabled,WEBP,-DWITH_WEBP,-lwebp -lvpx,WebP (libwebp))) -#-Wno-unused-but-set-variable WARNFLAGS += -Werror MONKEYCFLAGS := -std=c99 -Dmonkey -Dnsmonkey \ |