trojan-plus: Optimize whether to automatically configure boost-system based on the boost version (#497)

* trojan-plus: Optimize whether to automatically configure `boost-system` based on the `boost version`
This commit is contained in:
zxl hhyccc
2025-08-28 07:25:51 +08:00
committed by GitHub
parent e8628f1f83
commit 3c53404aa9
2 changed files with 13 additions and 10 deletions

View File

@@ -25,6 +25,7 @@ PKG_MAINTAINER:=Trojan-Plus-Group
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
include ./boost-version.mk
TARGET_CXXFLAGS += -Wall -Wextra
TARGET_CXXFLAGS += $(FPIC)
@@ -59,16 +60,7 @@ define Package/trojan-plus
DEPENDS:= \
+libpthread +libstdcpp +libopenssl \
+boost +boost-program_options \
+@TROJAN_PLUS_BOOST_SYSTEM:boost-system
endef
define Package/trojan-plus/config
config TROJAN_PLUS_BOOST_SYSTEM
bool "Include boost-system depends (required for Boost < 1.89.0)"
default y if PACKAGE_boost-system
help
Select this option if your Boost version is lower than 1.89.0.
For Boost versions 1.89.0 and above, the system library is integrated into the main boost library.
$(if $(filter y,$(BOOST_SYSTEM)),,+boost-system)
endef
define Package/trojan-plus/install

View File

@@ -0,0 +1,11 @@
# boost-version.mk
BOOST_MAKEFILE:= $(TOPDIR)/feeds/packages/libs/boost/Makefile
BOOST_VER := $(shell grep '^PKG_VERSION' $(BOOST_MAKEFILE) 2>/dev/null | sed -E 's/^PKG_VERSION[^0-9]*//')
BOOST_VER_MAJOR := $(word 1,$(subst ., ,$(BOOST_VER)))
BOOST_VER_MINOR := $(word 2,$(subst ., ,$(BOOST_VER)))
BOOST_VER_PATCH := $(word 3,$(subst ., ,$(BOOST_VER)))
BOOST_VERSION := $(shell echo $$(($(BOOST_VER_MAJOR)*100000 + $(BOOST_VER_MINOR)*100 + $(BOOST_VER_PATCH))))
BOOST_SYSTEM := $(if $(shell [ $(BOOST_VERSION) -ge 108900 ] && echo y),y,n)