]> granicus.if.org Git - php/commitdiff
- Fix up some bits and pieces.
authorSteph Fox <sfox@php.net>
Mon, 7 Jul 2008 01:23:56 +0000 (01:23 +0000)
committerSteph Fox <sfox@php.net>
Mon, 7 Jul 2008 01:23:56 +0000 (01:23 +0000)
- Always report re2c version.
- Head towards making it possible for all platforms to have compiler info in phpinfo() output.
- Make it possible to switch off configure summary (--without-summary).

win32/build/config.w32
win32/build/confutils.js

index 764551c847f840ea45a8f99f67f57372f674b2b8..8be856cac1a0de94d55089c4f3fe15ab49d62fd6 100644 (file)
@@ -8,7 +8,7 @@ CL = PATH_PROG('cl');
 if (!CL) {
        ERROR("MS C++ compiler is required");
 }
-// Which version of the compiler do we have ?
+
 function probe_binary(EXE, what)
 {
        // tricky escapes to get stderr redirection to work
@@ -30,24 +30,26 @@ function probe_binary(EXE, what)
        return 0;
 }
 
-// Which version of the compiler do we have?
-VCVERS = probe_binary(CL);
-VCVERS = VCVERS.substr(0, 2) + VCVERS.substr(3, 2);
-STDOUT.WriteLine("Detected MS compiler version " + VCVERS);
+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)';
 
-// 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]);
+AC_DEFINE('COMPILER', VC_VERSIONS[VCVERS], "Detected compiler version");
 
 // do we use x64 or 80x86 version of compiler?
 X64 = probe_binary(CL, 64);
 if (X64) {
-       STDOUT.WriteLine("Detected 64-bit compiler");
+       STDOUT.WriteLine("  Detected 64-bit compiler");
 } else {
-       STDOUT.WriteLine("Detected 32-bit compiler");
+       STDOUT.WriteLine("  Detected 32-bit compiler");
 }
+AC_DEFINE('ARCHITECTURE', X64 ? 'x64' : 'x86', "Detected compiler architecture");
 
 // cygwin now ships with link.exe.  Avoid searching the cygwin path
 // for this, as we want the MS linker, not the fileutil
@@ -64,28 +66,19 @@ if (!PATH_PROG('bison')) {
 // There's a minimum requirement for re2c..
 MINRE2C = "0.13.4";
 
-function probe_re2c_version(RE2C)
-{
-       var command = "cmd /c " + RE2C + " -v";
-       var version = execute(command + '" 2>&1"');
-
-       if (version.match(/((\d+)\.(\d+)\.(\d+))/)) {
-               return RegExp.$1;
-       }
-       return 0;
-}
-
 RE2C = PATH_PROG('re2c');
 if (RE2C) {
        var intvers, intmin;
        var pattern = /\./g;
 
-       RE2CVERS = probe_re2c_version(RE2C);
+       RE2CVERS = probe_binary(RE2C, "version");
+       STDOUT.WriteLine('  Detected re2c version ' + RE2CVERS);
+
        intvers = RE2CVERS.replace(pattern, '') - 0;
        intmin = MINRE2C.replace(pattern, '') - 0;
 
        if (intvers < intmin) {
-               STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C + ', ' + RE2CVERS + ' detected');
+               STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C);
                STDOUT.WriteLine('Parsers will not be generated. Upgrade your copy at http://sf.net/projects/re2c');
                DEFINE('RE2C', '');
        } else {
@@ -101,7 +94,9 @@ PATH_PROG('lemon');
 PATH_PROG('mc', WshShell.Environment("Process").Item("PATH"));
 
 // Try locating manifest tool
-PATH_PROG('mt', WshShell.Environment("Process").Item("PATH"));
+if (VCVERS > 1200) {
+       PATH_PROG('mt', WshShell.Environment("Process").Item("PATH"));
+}
 
 // stick objects somewhere outside of the source tree
 ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', '');
@@ -389,3 +384,5 @@ if (PHP_SNAPSHOT_TEMPLATE == "no") {
 }
 
 DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE);
+
+ARG_WITH('summary', 'Skip configuration summary', 'yes');
index eaa2407939602dac7aa10ded9798cb0431d89312..67efaa8a73e686ed5d17bce9f3d4dd19524619b0 100644 (file)
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-// $Id: confutils.js,v 1.60.2.1.2.8.2.19 2008-07-05 19:53:04 pajoye Exp $
+// $Id: confutils.js,v 1.60.2.1.2.8.2.20 2008-07-07 01:23:56 sfox Exp $
 
 var STDOUT = WScript.StdOut;
 var STDERR = WScript.StdErr;
@@ -30,13 +30,6 @@ var PROGRAM_FILES = WshShell.Environment("Process").Item("ProgramFiles");
 var extensions_enabled = new Array();
 var sapi_enabled = new Array();
 
-var VC_VERSIONS = new Array();
-VC_VERSIONS[1200] = 'VC6';
-VC_VERSIONS[1300] = 'Visual C++ 2002';
-VC_VERSIONS[1310] = 'Visual C++ 2003';
-VC_VERSIONS[1400] = 'Visual C++ 2005';
-VC_VERSIONS[1500] = 'Visual C++ 2008';
-
 if (PROGRAM_FILES == null) {
        PROGRAM_FILES = "C:\\Program Files";
 }
@@ -446,7 +439,7 @@ can be built that way. \
        nicefile.WriteLine(nice +  " %*");
        nicefile.Close();
 
-       AC_DEFINE('CONFIGURE_COMMAND', nice);
+       AC_DEFINE('CONFIGURE_COMMAND', nice, "Configure line");
 }
 
 function DEFINE(name, value)
@@ -1311,6 +1304,7 @@ function output_as_table(header, ar_out)
                STDOUT.WriteLine("Invalid header argument, can't output the table " + l + " " + ar_out[0].length  );
                return;
        }
+
        for (j=0; j < l; j++) {
                var tmax, tmin;
 
@@ -1407,7 +1401,7 @@ function generate_files()
        if (!FSO.FolderExists(dir)) {
                FSO.CreateFolder(dir);
        }
-       
+
        for (i = 0; i < build_dirs.length; i++) {
                bd = FSO.BuildPath(dir, build_dirs[i]);
                if (bd == last) {
@@ -1419,7 +1413,7 @@ function generate_files()
                        FSO.CreateFolder(bd);
                }
        }
-       
+
        STDOUT.WriteLine("Generating files...");
        generate_makefile();
        generate_internal_functions();
@@ -1427,7 +1421,9 @@ function generate_files()
        STDOUT.WriteLine("Done.");
        STDOUT.WriteBlankLines(1);
 
-       write_summary();
+       if (PHP_SUMMARY != "no") {
+               write_summary();
+       }
 
        if (PHP_SNAPSHOT_BUILD != "no") {
                STDOUT.WriteLine("Type 'nmake snap' to build a PHP snapshot");