From: Johannes Berg Date: Mon, 4 Feb 2019 13:32:36 +0000 (+0100) Subject: iw: make it build with older compilers again X-Git-Tag: v5.0.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6439859e0efe4e10c2af814c0b527ee92b34474b;p=thirdparty%2Fiw.git iw: make it build with older compilers again There's no reason to require a newer compiler that understands -Wstringop-overflow=4, make that optional. Signed-off-by: Johannes Berg --- diff --git a/Makefile b/Makefile index 46d3030..33aaf6a 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,14 @@ MKDIR ?= mkdir -p INSTALL ?= install CC ?= "gcc" +cc-option = $(shell set -e ; $(CC) $(1) -c -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo '$(1)') + +CFLAGS_EVAL := $(call cc-option,-Wstringop-overflow=4) + CFLAGS ?= -O2 -g CFLAGS += -Wall -Wextra -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common \ -Werror-implicit-function-declaration -Wsign-compare -Wno-unused-parameter \ - -Wstringop-overflow=4 + $(CFLAGS_EVAL) OBJS = iw.o genl.o event.o info.o phy.o \ interface.o ibss.o station.o survey.o util.o ocb.o \