#
# CFLAGS for gcc
#
-ifneq ($(shell test $(GCC_MAJOR_VERSION) -le 4 -a $(GCC_MINOR_VERSION) -le 3 && echo 1), 1)
+ifeq ($(shell test $(GCC_VERSION) -ge 440 && echo 1), 1)
CFLAGS += -Wno-deprecated
endif
CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value
CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args
-ifeq ($(shell test $(GCC_MAJOR_VERSION) -ge 4 -a $(GCC_MINOR_VERSION) -ge 6 && echo 1), 1)
+ifeq ($(shell test $(GCC_VERSION) -ge 460 && echo 1), 1)
CFLAGS_ixgbe_common.o += -Wno-unused-but-set-variable
CFLAGS_ixgbe_x550.o += -Wno-unused-but-set-variable -Wno-maybe-uninitialized
endif
-ifeq ($(shell test $(GCC_MAJOR_VERSION) -le 4 -a $(GCC_MINOR_VERSION) -le 6 && echo 1), 1)
+ifeq ($(shell test $(GCC_VERSION) -le 460 && echo 1), 1)
CFLAGS_ixgbe_x550.o += -Wno-uninitialized
CFLAGS_ixgbe_phy.o += -Wno-uninitialized
endif
#find out GCC version
-GCC_MAJOR_VERSION = $(shell $(CC) -dumpversion | cut -f1 -d.)
+GCC_VERSION = $(subst .,,$(shell $(CC) -dumpversion))
-# if GCC is not 4.x
-ifneq ($(GCC_MAJOR_VERSION),4)
+# if GCC is older than 4.x
+ifeq ($(shell test $(GCC_VERSION) -lt 400 && echo 1), 1)
MACHINE_CFLAGS =
-$(warning You are not using GCC 4.x. This is neither supported, nor tested.)
+$(warning You are using GCC < 4.x. This is neither supported, nor tested.)
else
- GCC_MINOR_VERSION = $(shell $(CC) -dumpversion | cut -f2 -d.)
-
# GCC graceful degradation
# GCC 4.2.x - added support for generic target
# GCC 4.3.x - added support for core2, ssse3, sse4.1, sse4.2
# GCC 4.6.x - added support for corei7, corei7-avx
# GCC 4.7.x - added support for fsgsbase, rdrnd, f16c, core-avx-i, core-avx2
- ifeq ($(shell test $(GCC_MINOR_VERSION) -le 7 && echo 1), 1)
+ ifeq ($(shell test $(GCC_VERSION) -le 470 && echo 1), 1)
MACHINE_CFLAGS := $(patsubst -march=core-avx-i,-march=corei7-avx,$(MACHINE_CFLAGS))
MACHINE_CFLAGS := $(patsubst -march=core-avx2,-march=core-avx2,$(MACHINE_CFLAGS))
endif
- ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 6 && echo 1), 1)
+ ifeq ($(shell test $(GCC_VERSION) -lt 460 && echo 1), 1)
MACHINE_CFLAGS := $(patsubst -march=corei7-avx,-march=core2 -maes -mpclmul -mavx,$(MACHINE_CFLAGS))
MACHINE_CFLAGS := $(patsubst -march=corei7,-march=core2 -maes -mpclmul,$(MACHINE_CFLAGS))
endif
- ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 5 && echo 1), 1)
+ ifeq ($(shell test $(GCC_VERSION) -lt 450 && echo 1), 1)
MACHINE_CFLAGS := $(patsubst -march=atom,-march=core2 -mssse3,$(MACHINE_CFLAGS))
endif
- ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 4 && echo 1), 1)
+ ifeq ($(shell test $(GCC_VERSION) -lt 440 && echo 1), 1)
MACHINE_CFLAGS := $(filter-out -mavx -mpclmul -maes,$(MACHINE_CFLAGS))
ifneq ($(findstring SSE4_2, $(CPUFLAGS)),)
MACHINE_CFLAGS += -msse4.2
MACHINE_CFLAGS += -msse4.1
endif
endif
- ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 3 && echo 1), 1)
+ ifeq ($(shell test $(GCC_VERSION) -lt 430 && echo 1), 1)
MACHINE_CFLAGS := $(filter-out -msse% -mssse%,$(MACHINE_CFLAGS))
MACHINE_CFLAGS := $(patsubst -march=core2,-march=generic,$(MACHINE_CFLAGS))
MACHINE_CFLAGS += -msse3
endif
- ifeq ($(shell test $(GCC_MINOR_VERSION) -lt 2 && echo 1), 1)
+ ifeq ($(shell test $(GCC_VERSION) -lt 420 && echo 1), 1)
MACHINE_CFLAGS := $(filter-out -march% -mtune% -msse%,$(MACHINE_CFLAGS))
endif
endif