From 2154c51a8618d6366cb1bd49af51bd1c39b048a7 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Tue, 5 Mar 2024 16:40:03 +0100 Subject: [PATCH] package/php: add libucontext optional dependency Select libucontext if the toolchain doesn't support ucontext to allow building php on musl Signed-off-by: Fabrice Fontaine Signed-off-by: Peter Korsgaard (cherry picked from commit 2824aa8a23a765b660219c129d4980f1b7c7691c) Signed-off-by: Peter Korsgaard --- package/php/Config.in | 3 +++ package/php/php.mk | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/package/php/Config.in b/package/php/Config.in index 69b4268c1d..af8574ac75 100644 --- a/package/php/Config.in +++ b/package/php/Config.in @@ -9,6 +9,7 @@ config BR2_PACKAGE_PHP_ARCH_SUPPORTS default y if BR2_RISCV_64 default y if BR2_s390x default y if BR2_TOOLCHAIN_HAS_UCONTEXT + default y if BR2_PACKAGE_LIBUCONTEXT_ARCH_SUPPORTS config BR2_PACKAGE_PHP bool "php" @@ -25,6 +26,8 @@ config BR2_PACKAGE_PHP BR2_USE_MMU select BR2_PACKAGE_PHP_SAPI_CLI if !BR2_USE_MMU select BR2_PACKAGE_PCRE2 + select BR2_PACKAGE_LIBUCONTEXT if \ + BR2_PACKAGE_LIBUCONTEXT_ARCH_SUPPORTS help PHP is a widely-used general-purpose scripting language that is especially suited for Web development diff --git a/package/php/php.mk b/package/php/php.mk index 4daf7f633d..28893be4c6 100644 --- a/package/php/php.mk +++ b/package/php/php.mk @@ -40,6 +40,11 @@ ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y) PHP_EXTRA_LIBS += -latomic endif +ifeq ($(BR2_PACKAGE_LIBUCONTEXT),y) +PHP_DEPENDENCIES += libucontext +PHP_EXTRA_LIBS += -lucontext +endif + ifeq ($(call qstrip,$(BR2_TARGET_LOCALTIME)),) PHP_LOCALTIME = UTC else