From 580ef3bd8d9e514e50c77ab4f7910998d5f246f8 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 5 Aug 2024 01:03:30 +0200 Subject: [PATCH] Autotools: Check for cross_compiling=yes The cross_compiling variable can initially be "yes", "no", or "maybe" (when only --host option is added). Autoconf otherwise after AC_PROG_CC resets it to "no" in such case but to be sure, this checks for value "yes" instead. The HAVE_FNMATCH template can be also set after the AC_DEFINE as autoheader scans the templates overall the source code. --- ext/standard/config.m4 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 3da9add124a5..314151726d1b 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -285,9 +285,10 @@ int main(void) { AC_DEFINE([PHP_USE_PHP_CRYPT_R], [0]) ]) -AS_VAR_IF([cross_compiling], [no], [AC_FUNC_FNMATCH], +AS_VAR_IF([cross_compiling], [yes], [AS_CASE([$host_alias], [*linux*], - [AC_DEFINE([HAVE_FNMATCH], [1])])]) + [AC_DEFINE([HAVE_FNMATCH], [1])])], + [AC_FUNC_FNMATCH]) dnl dnl Check if there is a support means of creating a new process and defining