From eb61c8b8f8610c5720ac992db7d390e7f2283ffe Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Wed, 14 Oct 2009 04:06:20 -0700 Subject: makefile: detect if GCC is >= 4.3.0 before adding -Wno-array-bounds GCC versions less than 4.3.0 had a compiler error because the -Wno-array-bounds flag wasn't valid. Signed-off-by: Steven Noonan --- crawl-ref/source/makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/makefile') diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile index a6246b1b0a..3fdb42db58 100644 --- a/crawl-ref/source/makefile +++ b/crawl-ref/source/makefile @@ -213,6 +213,8 @@ GCC := gcc GXX := g++ endif +GCC_GTE_4_3_0 := $(shell util/gcc-gte.pl $(GCC) 4.3.0) + RLTILES = rltiles # @@ -340,9 +342,14 @@ endif # MacOS endif # TILES -CFWARN_L := -D_FORTIFY_SOURCE=0 -Wno-array-bounds -Wno-parentheses -Wwrite-strings -Wshadow -pedantic +CFWARN_L := -D_FORTIFY_SOURCE=0 -Wno-parentheses -Wwrite-strings -Wshadow -pedantic CFOTHERS_L = $(EXTERNAL_FLAGS) $(EXTRA_FLAGS) $(DEFINES) -DCLUA_BINDINGS $(SDL_CFLAGS) +ifeq ($(GCC_GTE_4_3_0),Yes) +CFWARN_L += -Wno-array-bounds +endif + + # # Figure out the build settings for this type of build # -- cgit v1.2.3-54-g00ecf