sfox            Sat Mar 22 09:07:59 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/win32/build        confutils.js template.rc 
  Log:
  Independent versioning for PECL extensions (and only PECL, for now)
  This affects the RC template used to ship information with the DLL in Windows 
distributions - nothing else.
  It will potentially affect 13 PECL modules at present (and yes I do know 
which ones!)
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/confutils.js?r1=1.60.2.1.2.8.2.3&r2=1.60.2.1.2.8.2.4&diff_format=u
Index: php-src/win32/build/confutils.js
diff -u php-src/win32/build/confutils.js:1.60.2.1.2.8.2.3 
php-src/win32/build/confutils.js:1.60.2.1.2.8.2.4
--- php-src/win32/build/confutils.js:1.60.2.1.2.8.2.3   Sun Feb 17 01:26:15 2008
+++ php-src/win32/build/confutils.js    Sat Mar 22 09:07:59 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-// $Id: confutils.js,v 1.60.2.1.2.8.2.3 2008/02/17 01:26:15 pajoye Exp $
+// $Id: confutils.js,v 1.60.2.1.2.8.2.4 2008/03/22 09:07:59 sfox Exp $
 
 var STDOUT = WScript.StdOut;
 var STDERR = WScript.StdErr;
@@ -835,14 +835,23 @@
 /* emits rule to generate version info for a SAPI
  * or extension.  Returns the name of the .res file
  * that will be generated */
-function generate_version_info_resource(makefiletarget, creditspath)
+function generate_version_info_resource(makefiletarget, basename, creditspath, 
sapi)
 {
        var resname = makefiletarget + ".res";
-       var res_desc = "PHP " + makefiletarget;
-       var res_prod_name = res_desc;
+       var res_desc = makefiletarget;
        var credits;
        var thanks = "";
        var logo = "";
+       var debug = "";
+       var project_url = "http://www.php.net";;
+       var project_header = creditspath + "/php_" + basename + ".h";
+       var versioning = "";
+
+       if (sapi) {
+               var internal_name = basename.toUpperCase() + " SAPI";
+       } else {
+               var internal_name = basename.toUpperCase() + " extension";
+       }
 
        if (FSO.FileExists(creditspath + '/CREDITS')) {
                credits = FSO.OpenTextFile(creditspath + '/CREDITS', 1);
@@ -860,8 +869,30 @@
                credits.Close();
        }
 
+       if (creditspath.match(new RegExp("pecl"))) {
+               project_url = "http://pecl.php.net/"; + basename;
+
+               /* keep independent versioning PECL-specific for now */
+               if (FSO.FileExists(project_header)) {
+                       if (header = FSO.OpenTextFile(project_header, 1)) {
+                               contents = header.ReadAll();
+                               /* allowed: x.x.x[-dev|-alpha|-beta][RCx] */
+                               if (contents.match(new RegExp('PHP_' + 
basename.toUpperCase() + 
'_VERSION(\\s+)"((\\d+\.\\d+(\.\\d+)?)(\-[a-z]{3,5})?(RC\\d+)?)'))) {
+                                       project_version = RegExp.$2;
+                                       file_version = RegExp.$3.split('.');
+                                       versioning = '\\"" /d 
EXT_FILE_VERSION=' + file_version[0] + ',' + file_version[1] + ',' + 
file_version[2] + ' /d EXT_VERSION="\\"' + project_version;
+                               }
+                               header.Close();
+                       }
+               }
+       }
+
        if (makefiletarget.match(new RegExp("\\.exe$"))) {
-               logo = " /D WANT_LOGO ";
+               logo = " /d WANT_LOGO ";
+       }
+
+       if (PHP_DEBUG != "no") {
+               debug = " /d _DEBUG";
        }
 
        /**
@@ -869,20 +900,22 @@
         */
        if (FSO.FileExists(creditspath + '\\template.rc')) {
                MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": " + creditspath + 
"\\template.rc");
-               MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname + logo +
-                       ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d 
FILE_NAME="\\"' + makefiletarget +
-                       '\\"" /d PRODUCT_NAME="\\"' + res_prod_name + '\\"" /d 
THANKS_GUYS="\\"' +
-                       thanks + '\\"" ' + creditspath + '\\template.rc');
+               MFO.WriteLine("\t$(RC) /n /fo $(BUILD_DIR)\\" + resname + logo 
+ debug +
+                       ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d 
FILE_NAME="\\"'
+                       + makefiletarget + '\\"" /d URL="\\"' + project_url
+                       + '\\"" /d INTERNAL_NAME="\\"' + internal_name + 
versioning + 
+                       '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" ' + 
creditspath + 
+                       '\\template.rc');
                return resname;
        }
 
        MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": 
win32\\build\\template.rc");
-       MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname + logo +
-               ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d 
FILE_NAME="\\"' + makefiletarget +
-               '\\"" /d PRODUCT_NAME="\\"' + res_prod_name + '\\"" /d 
THANKS_GUYS="\\"' +
-               thanks + '\\"" win32\\build\\template.rc');
+       MFO.WriteLine("\t$(RC) /n /fo $(BUILD_DIR)\\" + resname + logo + debug +
+               ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d 
FILE_NAME="\\"'
+               + makefiletarget + '\\"" /d URL="\\"' + project_url + 
+               '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning + 
+               '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" 
win32\\build\\template.rc');
        MFO.WriteBlankLines(1);
-       
        return resname;
 }
 
@@ -916,7 +949,7 @@
        MFO.WriteBlankLines(1);
 
        /* generate a .res file containing version information */
-       resname = generate_version_info_resource(makefiletarget, 
configure_module_dirname);
+       resname = generate_version_info_resource(makefiletarget, sapiname, 
configure_module_dirname, true);
        
        MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);
        MFO.WriteLine("[EMAIL PROTECTED] SAPI " + sapiname_for_printing + " 
build complete");
@@ -1065,7 +1098,7 @@
                }
                var libname = dllname.substring(0, dllname.length-4) + ".lib";
 
-               var resname = generate_version_info_resource(dllname, 
configure_module_dirname);
+               var resname = generate_version_info_resource(dllname, extname, 
configure_module_dirname, false);
                var ld = "@$(CC)";
 
                MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + 
dllname);
http://cvs.php.net/viewvc.cgi/php-src/win32/build/template.rc?r1=1.7.2.2.2.1&r2=1.7.2.2.2.1.2.1&diff_format=u
Index: php-src/win32/build/template.rc
diff -u php-src/win32/build/template.rc:1.7.2.2.2.1 
php-src/win32/build/template.rc:1.7.2.2.2.1.2.1
--- php-src/win32/build/template.rc:1.7.2.2.2.1 Mon Jan  1 19:32:09 2007
+++ php-src/win32/build/template.rc     Sat Mar 22 09:07:59 2008
@@ -1,5 +1,5 @@
 /* This is a template RC file.
- * $Id: template.rc,v 1.7.2.2.2.1 2007/01/01 19:32:09 iliaa Exp $
+ * $Id: template.rc,v 1.7.2.2.2.1.2.1 2008/03/22 09:07:59 sfox Exp $
  * Do not edit with MSVC */
 #ifdef APSTUDIO_INVOKED
 # error dont edit with MSVC
@@ -19,18 +19,32 @@
 0 ICON win32\build\php.ico
 #endif
 
-#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build
-#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel
-#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build)
-#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel)
+#ifndef INTERNAL_NAME /* e.g. 'PHAR extension', 'CGI SAPI' */
+# ifdef FILE_DESCRIPTION
+#define INTERNAL_NAME FILE_DESCRIPTION /* e.g. 'PHP Script Interpreter', 'GD 
imaging' */
+# else
+#define INTERNAL_NAME FILE_NAME /* e.g. 'php5ts.dll', 'php_bz2.dll' */
+# endif
+#endif
+
+#ifndef URL
+#define URL "http://www.php.net";
+#endif
+
+#ifndef EXT_VERSION
+#define EXT_VERSION PHP_VERSION
+#endif
+
+#ifndef EXT_FILE_VERSION
+#define EXT_FILE_VERSION 
PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION
+#endif
 
-//Version
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 
PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION
- PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0
+ FILEVERSION EXT_FILE_VERSION
+ PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
- FILEFLAGS VS_FF_DEBUG
+ FILEFLAGS (VS_FF_DEBUG|VS_FF_SPECIALBUILD)
 #else
  FILEFLAGS 0x0L
 #endif
@@ -42,19 +56,24 @@
     BEGIN
         BLOCK "040904b0"
         BEGIN
-            VALUE "Comments", THANKS_GUYS "\0"
-            VALUE "CompanyName", "The PHP Group\0"
-            VALUE "FileDescription", FILE_DESCRIPTION "\0"
-            VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, 
PHP_RELEASE_VERSION, PHP_RELEASE_VERSION)
-            VALUE "InternalName", FILE_NAME "\0"
-            VALUE "LegalCopyright", "Copyright © 1997-2007 The PHP Group\0"
-            VALUE "LegalTrademarks", "PHP\0"
-            VALUE "OriginalFilename", FILE_NAME "\0"
-            VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", PRODUCT_NAME "\0"
-            VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, 
PHP_MINOR_VERSION, PHP_RELEASE_VERSION)
-            VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0"
-                       VALUE "URL", "http://www.php.net";
+            VALUE "Comments", THANKS_GUYS
+            VALUE "CompanyName", "The PHP Group"
+#ifdef _DEBUG
+            VALUE "FileDescription", FILE_DESCRIPTION " (DEBUG)"
+#else
+            VALUE "FileDescription", FILE_DESCRIPTION
+#endif
+            VALUE "FileVersion", EXT_VERSION
+            VALUE "InternalName", INTERNAL_NAME
+            VALUE "LegalCopyright", "Copyright © 1997-2008 The PHP Group"
+            VALUE "LegalTrademarks", "PHP"
+            VALUE "OriginalFilename", FILE_NAME
+            VALUE "ProductName", "PHP"
+            VALUE "ProductVersion", PHP_VERSION
+#ifdef _DEBUG
+            VALUE "SpecialBuild", "Debug build"
+#endif
+            VALUE "URL", URL
         END
     END
     BLOCK "VarFileInfo"
@@ -66,4 +85,3 @@
 #ifdef MC_INCLUDE
 #include MC_INCLUDE
 #endif
-

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

Reply via email to