From a18a4f42b96102cc054b73abf132b4e96f08c205 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 27 Nov 2015 13:08:53 -0800 Subject: [PATCH] makefile: Support clean builds of simulators with slirp support with older versions of gcc --- makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index bd127b81..3b238418 100644 --- a/makefile +++ b/makefile @@ -902,7 +902,15 @@ ifeq (HP-UX,$(OSTYPE)) CC_STD = -std=gnu99 else ifeq (,$(SUNC_VERSION)) - CC_STD = -std=c99 + ifneq (,$(findstring error,$(shell $(GCC) -std=c11 -version /dev/null 2>&1))) + CC_STD = -std=c11 + else + ifneq (,$(findstring error,$(shell $(GCC) -std=gnu99 -version /dev/null 2>&1))) + CC_STD = -std=gnu99 + else + CC_STD = -std=c99 -fms-extensions + endif + endif endif endif CC_OUTSPEC = -o $@