From 41c8c5821fc74efea8b086927a17aa3bc7aef6bb Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 18 Nov 2025 16:25:28 +0800
Subject: [PATCH] explicitly not generate phar.php during cross-compile

According to [1][2], Generating phar.php during cross-compile
can't be done, explicitly set TEST_PHP_EXECUTABLE_RES = 1
for target recipe to not generate phar.php for cross-compile

[1] https://github.com/php/php-src/issues/11099
[2] https://github.com/php/php-src/commit/93fa9613e162d1a0e8479ba83c4b6a399846e209

Upstream-Status: Inappropriate [OE specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 ext/phar/Makefile.frag | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/phar/Makefile.frag b/ext/phar/Makefile.frag
index 09d577d7..2f85847c 100644
--- a/ext/phar/Makefile.frag
+++ b/ext/phar/Makefile.frag
@@ -19,7 +19,7 @@ $(builddir)/phar/phar.inc: $(srcdir)/phar/phar.inc
 	-@test -f $(builddir)/phar/phar.inc || cp $(srcdir)/phar/phar.inc $(builddir)/phar/phar.inc
 
 TEST_PHP_EXECUTABLE = $(shell $(PHP_EXECUTABLE) -v 2>&1)
-TEST_PHP_EXECUTABLE_RES = $(shell echo "$(TEST_PHP_EXECUTABLE)" | grep -c 'Exec format error')
+TEST_PHP_EXECUTABLE_RES = "1"
 
 $(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php $(SAPI_CLI_PATH)
 	-@(echo "Generating phar.php"; \
-- 
2.34.1

