From 5d04f639deb37a6b7c36b15f2f51df5054c09380 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Mon, 7 Jul 2008 13:32:55 +0000 Subject: [PATCH] - move common functions to confutils - rename the summary option to reflect its usage (Enable Sumamry, yes) --- win32/build/config.w32 | 36 +++++++----------------------------- win32/build/confutils.js | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 8be856cac1..65a732337f 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -9,34 +9,12 @@ if (!CL) { ERROR("MS C++ compiler is required"); } -function probe_binary(EXE, what) -{ - // tricky escapes to get stderr redirection to work - var command = 'cmd /c ""' + EXE; - if (what == "version") { - command = command + '" -v"'; - } - var version = execute(command + '" 2>&1"'); - - if (what == "64") { - if (version.match(/x64/)) { - return 1; - } - } else { - if (version.match(/(\d+\.\d+(\.\d+)?(\.\d+)?)/)) { - return RegExp.$1; - } - } - return 0; -} - -var VC_VERSIONS = new Array(); -VC_VERSIONS[1200] = 'MSVC6 (Visual C++ 6.0)'; -VC_VERSIONS[1300] = 'MSVC7 (Visual C++ 2002)'; -VC_VERSIONS[1310] = 'MSVC7.1 (Visual C++ 2003)'; -VC_VERSIONS[1400] = 'MSVC8 (Visual C++ 2005)'; -VC_VERSIONS[1500] = 'MSVC9 (Visual C++ 2008)'; - +/* For the record here: */ +// 1200 is VC6 +// 1300 is vs.net 2002 +// 1310 is vs.net 2003 +// 1400 is vs.net 2005 +// 1500 is vs.net 2008 // Which version of the compiler do we have? VCVERS = probe_binary(CL).substr(0, 5).replace('.', ''); STDOUT.WriteLine(" Detected compiler " + VC_VERSIONS[VCVERS]); @@ -385,4 +363,4 @@ if (PHP_SNAPSHOT_TEMPLATE == "no") { DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE); -ARG_WITH('summary', 'Skip configuration summary', 'yes'); +ARG_WITH('summary', 'Enable configuration summary', 'yes'); diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 67efaa8a73..707e8d52e6 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -// $Id: confutils.js,v 1.60.2.1.2.8.2.20 2008-07-07 01:23:56 sfox Exp $ +// $Id: confutils.js,v 1.60.2.1.2.8.2.21 2008-07-07 13:32:55 pajoye Exp $ var STDOUT = WScript.StdOut; var STDERR = WScript.StdErr; @@ -27,9 +27,20 @@ var MFO = null; var SYSTEM_DRIVE = WshShell.Environment("Process").Item("SystemDrive"); var PROGRAM_FILES = WshShell.Environment("Process").Item("ProgramFiles"); +/* Store the enabled extensions (summary + QA check) */ var extensions_enabled = new Array(); + +/* Store the SAPI enabled (summary + QA check) */ var sapi_enabled = new Array(); +/* Mapping CL version > human readable name */ +var VC_VERSIONS = new Array(); +VC_VERSIONS[1200] = 'MSVC6 (Visual C++ 6.0)'; +VC_VERSIONS[1300] = 'MSVC7 (Visual C++ 2002)'; +VC_VERSIONS[1310] = 'MSVC7.1 (Visual C++ 2003)'; +VC_VERSIONS[1400] = 'MSVC8 (Visual C++ 2005)'; +VC_VERSIONS[1500] = 'MSVC9 (Visual C++ 2008)'; + if (PROGRAM_FILES == null) { PROGRAM_FILES = "C:\\Program Files"; } @@ -101,6 +112,27 @@ function execute(command_line) return ret; } +function probe_binary(EXE, what) +{ + // tricky escapes to get stderr redirection to work + var command = 'cmd /c ""' + EXE; + if (what == "version") { + command = command + '" -v"'; + } + var version = execute(command + '" 2>&1"'); + + if (what == "64") { + if (version.match(/x64/)) { + return 1; + } + } else { + if (version.match(/(\d+\.\d+(\.\d+)?(\.\d+)?)/)) { + return RegExp.$1; + } + } + return 0; +} + function condense_path(path) { path = FSO.GetAbsolutePathName(path); -- 2.40.0