From 9504fcfc0f15ae14238ae838b04f152b00be7296 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sat, 19 Oct 2024 15:26:53 +0200 Subject: [PATCH] Move ARG_ENABLE() "macros" out of confutils.js (GH-16398) While these "macros" work perfectly fine in confutils, it is somewhat strange to have these two there, while all others are in config.w32 files. In particular, there is no need for a `MODE_PHPIZE` guard, since there are already config.w32 and config.w32.phpize.in. However, we need to replace the semicolon in the helptext, because the regex which parses ARG_(ENABLE|WITH) calls is restricted, and does not accept semicolons. --- win32/build/config.w32 | 4 ++++ win32/build/config.w32.phpize.in | 2 ++ win32/build/confutils.js | 9 --------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 6735765de74..dd33e595a2e 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -396,3 +396,7 @@ ARG_ENABLE("native-intrinsics", "Comma separated list of intrinsic optimizations might not work properly, if the chosen instruction sets are not available on the target \ processor.", "no"); toolset_setup_intrinsic_cflags(); + +ARG_ENABLE('snapshot-build', 'Build a snapshot: turns on everything it can and ignores build errors', 'no'); + +ARG_ENABLE('vs-link-compat', 'Allow linking of libraries built with compatible versions of VS toolset', 'yes'); diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in index bb466cd7f58..82b97e1145e 100644 --- a/win32/build/config.w32.phpize.in +++ b/win32/build/config.w32.phpize.in @@ -143,3 +143,5 @@ ARG_ENABLE("native-intrinsics", "Comma separated list of intrinsic optimizations might not work properly, if the optimizations are not available on the target \ processor.", "no"); toolset_setup_intrinsic_cflags(); + +ARG_ENABLE('vs-link-compat', 'Allow linking of libraries built with compatible versions of VS toolset', 'yes'); diff --git a/win32/build/confutils.js b/win32/build/confutils.js index c8678792fb0..be4ee520fe5 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -2898,9 +2898,6 @@ function PHP_INSTALL_HEADERS(dir, headers_list) // and you can then build everything, ignoring fatal errors within a module // by running "nmake snap" PHP_SNAPSHOT_BUILD = "no"; -if (!MODE_PHPIZE) { - ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and ignores build errors', 'no'); -} function toolset_option_handle() { @@ -3766,9 +3763,3 @@ function setup_verbosity() CMD_MOD2 = "@"; } } - -try { - ARG_ENABLE('vs-link-compat', 'Allow linking of libraries built with compatible versions of VS toolset', 'yes'); -} catch (e) { - STDOUT.WriteLine("problem: " + e); -}