* make it compile on Debian/Sarge with a gcc-3.3.5
authorBernd Petrovitsch <bernd@firmix.at>
Fri, 27 Apr 2007 11:45:31 +0000 (11:45 +0000)
committerBernd Petrovitsch <bernd@firmix.at>
Fri, 27 Apr 2007 11:45:31 +0000 (11:45 +0000)
Makefile.inc

index f3bee6a..2704b13 100644 (file)
@@ -18,16 +18,22 @@ EXENAME ?= olsrd
 
 INCLUDES =     -Isrc -I$(TOPDIR)/src 
 
+GCC_VERSION := $(shell v=$$($(CC) -dumpversion); echo $${v//./ })
+
 # add gcc warnings and optimizations if CFLAGS not set
 ifndef CFLAGS
 CFLAGS +=      -Wall
+# gcc-3.3.5 on Debian sarge doesn't know the following warnings
+ifneq ("$(GCC_VERSION)","3 3 5")
 CFLAGS +=      -Wextra
+CFLAGS +=      -Wold-style-definition
+CFLAGS +=      -Wdeclaration-after-statement
+endif
 CFLAGS +=      -Wmissing-prototypes
 CFLAGS +=      -Wstrict-prototypes
 CFLAGS +=      -Wmissing-declarations
 CFLAGS +=      -Wsign-compare
 CFLAGS +=      -Waggregate-return
-CFLAGS +=      -Wold-style-definition
 CFLAGS +=      -Wmissing-noreturn
 CFLAGS +=      -Wmissing-format-attribute
 CFLAGS +=      -Wno-multichar