diff --git a/src/config/makefile.h b/src/config/makefile.h index bdbb82bb95..812b147ca8 100644 --- a/src/config/makefile.h +++ b/src/config/makefile.h @@ -194,7 +194,7 @@ else endif ifeq ($(GA_LDFLAGS),) - GA_LDFLAGS := $(shell ${GA_PATH}/bin/ga-config --ldflags ) + GA_LDFLAGS := $(shell ${GA_PATH}/bin/ga-config --ldflags ) endif #extract GA libs location from last word in GA_LDLFLAGS @@ -1332,6 +1332,7 @@ ifeq ($(TARGET),MACX64) GNU_GE_4_8 := $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true) GNU_GE_6 := $(shell [ $(GNUMAJOR) -ge 6 ] && echo true) GNU_GE_8 := $(shell [ $(GNUMAJOR) -ge 8 ] && echo true) + GNU_GE_14 := $(shell [ $(GNUMAJOR) -ge 14 ] && echo true) ifeq ($(GNU_GE_4_6),true) DEFINES += -DGCC46 @@ -1552,6 +1553,12 @@ ifeq ($(TARGET),$(findstring $(TARGET),LINUX CYGNUS CYGWIN)) endif DEFINES += -DGFORTRAN + GCCMAJOR := $(shell $(CC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-) + ifdef GCCMAJOR + GCCMINOR := $(shell $(CC) -dM -E - < /dev/null 2> /dev/null | grep __VERS | cut -c24) + GCC_GE_14 := $(shell [ $(GCCMAJOR) -ge 14 ] && echo true) + endif + GNUMAJOR := $(shell $(FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-) ifdef GNUMAJOR @@ -2180,6 +2187,11 @@ ifneq ($(TARGET),LINUX) FFLAGS_FORGA = -mcmodel=medium endif else + GCCMAJOR := $(shell $(CC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-) + ifdef GCCMAJOR + GCCMINOR := $(shell $(CC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC_MINOR | cut -c24-) + GCC_GE_14 := $(shell [ $(GCCMAJOR) -ge 14 ] && echo true) + endif GNUMAJOR := $(shell $(FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-) ifdef GNUMAJOR GNUMINOR := $(shell $(FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC_MINOR | cut -c24) diff --git a/src/tools/GNUmakefile b/src/tools/GNUmakefile index 05a7251b40..0c349a8e00 100644 --- a/src/tools/GNUmakefile +++ b/src/tools/GNUmakefile @@ -558,6 +558,9 @@ endif ifeq ($(GNU_GE_8),true) FFLAGS_FORGA += -std=legacy endif +ifeq ($(GCC_GE_14),true) + CFLAGS_FORGA += -std=gnu17 +endif #detect clang GOTCLANG := $(shell $(CC) -dM -E - /dev/null |grep __clang__|head -1|cut -c19) GOTFREEBSD := $(shell uname -o 2>&1|awk ' /FreeBSD/ {print "1";exit}')