makefile: Generalize the gcc -std tests to work for both MinGW and unix environments. Fix #250

This commit is contained in:
Mark Pizzolato 2015-11-29 04:46:54 -08:00
parent 0938d31e59
commit 01c410ab32

View file

@ -902,10 +902,10 @@ ifeq (HP-UX,$(OSTYPE))
CC_STD = -std=gnu99 CC_STD = -std=gnu99
else else
ifeq (,$(SUNC_VERSION)) ifeq (,$(SUNC_VERSION))
ifneq (,$(findstring error,$(shell $(GCC) -std=c11 -version /dev/null 2>&1))) ifeq (,$(findstring error,$(shell $(GCC) -std=c11 --version 2>&1)))
CC_STD = -std=c11 CC_STD = -std=c11
else else
ifneq (,$(findstring error,$(shell $(GCC) -std=gnu99 -version /dev/null 2>&1))) ifeq (,$(findstring error,$(shell $(GCC) -std=gnu99 --version 2>&1)))
CC_STD = -std=gnu99 CC_STD = -std=gnu99
else else
CC_STD = -std=c99 -fms-extensions CC_STD = -std=c99 -fms-extensions