Fail phpize early if config.w32 is missing (GH-17100)

On Windows, phpize happily builds configure even if there is no
config.w32, but running configure then error with "Must be run from the
root of the extension source".  This is confusing.

We bring phpize's behavior on par with POSIX systems, where the missing
config.m4 is detected and reported right away.
This commit is contained in:
Christoph M. Becker 2024-12-15 12:02:19 +01:00 committed by GitHub
parent 1ff68f58f7
commit c14bc7b10f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -1,6 +1,7 @@
@echo off
SET PHP_BUILDCONF_PATH=%~dp0
cscript /nologo /e:jscript %PHP_BUILDCONF_PATH%\script\phpize.js %*
IF ERRORLEVEL 0 exit /b 3
IF NOT EXIST configure.bat (
echo Error generating configure script, configure script was not copied
exit /b 3

View file

@ -17,6 +17,7 @@
// This generates a configure script for win32 build
var STDOUT = WScript.StdOut;
var STDERR = WScript.StdErr;
var FSO = WScript.CreateObject("Scripting.FileSystemObject");
var C = FSO.CreateTextFile("configure.js", true);
@ -201,6 +202,13 @@ function buildconf_process_args()
if (buildconf_process_args() == 0) {
WScript.Quit(3);
}
if (FSO.FileExists("config.w32")) {
STDERR.WriteLine("Cannot find config.w32");
STDERR.WriteLine("Must be run from the root of the extension source");
WScript.Quit(10);
}
STDOUT.WriteLine("Rebuilding configure.js");
STDOUT.WriteLine(PHP_DIR);