Skip to content

Commit c14bc7b

Browse files
authored
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.
1 parent 1ff68f5 commit c14bc7b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

win32/build/phpize.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@echo off
22
SET PHP_BUILDCONF_PATH=%~dp0
33
cscript /nologo /e:jscript %PHP_BUILDCONF_PATH%\script\phpize.js %*
4+
IF ERRORLEVEL 0 exit /b 3
45
IF NOT EXIST configure.bat (
56
echo Error generating configure script, configure script was not copied
67
exit /b 3

win32/build/phpize.js.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
// This generates a configure script for win32 build
1818

1919
var STDOUT = WScript.StdOut;
20+
var STDERR = WScript.StdErr;
2021

2122
var FSO = WScript.CreateObject("Scripting.FileSystemObject");
2223
var C = FSO.CreateTextFile("configure.js", true);
@@ -201,6 +202,13 @@ function buildconf_process_args()
201202
if (buildconf_process_args() == 0) {
202203
WScript.Quit(3);
203204
}
205+
206+
if (FSO.FileExists("config.w32")) {
207+
STDERR.WriteLine("Cannot find config.w32");
208+
STDERR.WriteLine("Must be run from the root of the extension source");
209+
WScript.Quit(10);
210+
}
211+
204212
STDOUT.WriteLine("Rebuilding configure.js");
205213
STDOUT.WriteLine(PHP_DIR);
206214

0 commit comments

Comments
 (0)