boost: refresh GCC options in Makefile

this Makefile still used `CONFIG_GCC_USE_VERSION_*` to select various
compilation options, for GCC versions that are antiquated

convert to parsing the major from the `CONFIG_GCC_VERSION` which will
always exist and can also be used with range logic

intent seemed to be:
* `-std=gnu++20` for "=10" (and newer, probably)
* `-std=gnu++14` for "=5"
* `-std=gnu++17` for "not =10 and not =5"

GCC 11 or 12 would likely revert to the default (6 through 9) option
with those, because 10 was the newest at the time, and 11 and 12 are
"not =10 and not =5"

probably the GCC 5 support could be removed, not sure about 9 and 10

Signed-off-by: Tony Butler <spudz76@gmail.com>
This commit is contained in:
Tony Butler 2022-12-22 15:01:37 -08:00 committed by Rosen Penev
parent 55d521af4b
commit 8d638fe835
1 changed files with 7 additions and 1 deletions

View File

@ -384,7 +384,13 @@ TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--gc-sections,--as-needed,--print-g
TARGET_CFLAGS += \
$(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC -ffunction-sections -fdata-sections -flto
EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_USE_VERSION_10),-std=gnu++20,$(if $(CONFIG_GCC_USE_VERSION_5),-std=gnu++14,-std=gnu++17))
ifeq ($(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION)))),5)
EXTRA_CXXFLAGS += -std=gnu++14
else ifneq ($(filter-out 6 7 8 9,$(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION))))),)
EXTRA_CXXFLAGS += -std=gnu++17
else
EXTRA_CXXFLAGS += -std=gnu++20
endif
ifneq ($(findstring mips,$(ARCH)),)
BOOST_ABI = o32