pajoye          Wed Jul  2 20:49:13 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/win32/build        config.w32 
  Log:
  - MFH: re2c detection, PHP_VERSION
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.40.2.8.2.10.2.17&r2=1.40.2.8.2.10.2.18&diff_format=u
Index: php-src/win32/build/config.w32
diff -u php-src/win32/build/config.w32:1.40.2.8.2.10.2.17 
php-src/win32/build/config.w32:1.40.2.8.2.10.2.18
--- php-src/win32/build/config.w32:1.40.2.8.2.10.2.17   Sun Jun 29 08:21:21 2008
+++ php-src/win32/build/config.w32      Wed Jul  2 20:49:12 2008
@@ -1,5 +1,5 @@
 // vim:ft=javascript
-// $Id: config.w32,v 1.40.2.8.2.10.2.17 2008/06/29 08:21:21 hirokawa Exp $
+// $Id: config.w32,v 1.40.2.8.2.10.2.18 2008/07/02 20:49:12 pajoye Exp $
 // "Master" config file; think of it as a configure.in
 // equivalent.
 
@@ -8,7 +8,7 @@
 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
@@ -33,9 +33,11 @@
 // Which version of the compiler do we have?
 VCVERS = probe_binary(CL).substr(0, 2);
 STDOUT.WriteLine("Detected MS compiler version " + VCVERS);
+
 // 12 is VC6
 // 13 is vs.net 2003
 // 14 is vs.net 2005
+// 15 is vs.net 2008
 
 // do we use x64 or 80x86 version of compiler?
 X64 = probe_binary(CL, 64);
@@ -60,12 +62,23 @@
 // 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_binary(RE2C, "version");
+       RE2CVERS = probe_re2c_version(RE2C);
        intvers = RE2CVERS.replace(pattern, '') - 0;
        intmin = MINRE2C.replace(pattern, '') - 0;
 
@@ -200,20 +213,20 @@
 // set up the build dir and DLL name
 if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
        DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");
-       DEFINE("PHPDLL", "php5ts_debug.dll");
-       DEFINE("PHPLIB", "php5ts_debug.lib");
+       DEFINE("PHPDLL", "php" + PHP_VERSION + "ts_debug.dll");
+       DEFINE("PHPLIB", "php" + PHP_VERSION + "ts_debug.lib");
 } else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") {
        DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug");
-       DEFINE("PHPDLL", "php5_debug.dll");
-       DEFINE("PHPLIB", "php5_debug.lib");
+       DEFINE("PHPDLL", "php" + PHP_VERSION + "_debug.dll");
+       DEFINE("PHPLIB", "php" + PHP_VERSION + "_debug.lib");
 } else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") {
        DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release_TS");
-       DEFINE("PHPDLL", "php5ts.dll");
-       DEFINE("PHPLIB", "php5ts.lib");
+       DEFINE("PHPDLL", "php" + PHP_VERSION + "ts.dll");
+       DEFINE("PHPLIB", "php" + PHP_VERSION + "ts.lib");
 } else if (PHP_DEBUG == "no" && PHP_ZTS == "no") {
        DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release");
-       DEFINE("PHPDLL", "php5.dll");
-       DEFINE("PHPLIB", "php5.lib");
+       DEFINE("PHPDLL", "php" + PHP_VERSION + ".dll");
+       DEFINE("PHPLIB", "php" + PHP_VERSION + ".lib");
 }
 
 // Find the php_build dir - it contains headers and libraries



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to