boost: refresh GCC options in Makefile
authorTony Butler <spudz76@gmail.com>
Thu, 22 Dec 2022 23:01:37 +0000 (15:01 -0800)
committerRosen Penev <rosenp@gmail.com>
Fri, 23 Dec 2022 02:11:51 +0000 (18:11 -0800)
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>
libs/boost/Makefile

index 4fe77be5ccbe82b6a8cd3e633baa102396f151a6..9180e9ecb67ecad438a464054fa395ac36d6da2c 100644 (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