Permalink
Browse files

Search for pecl extensions under php-src/pecl as a convenience for

pecl developers.
Add automatic version info resource generation for SAPI and extension
modules, based on PHP version numbers and info found in the CREDITS file.
As a nice side effect, this lets us add a logo icon to .exe files.
  • Loading branch information...
1 parent e846891 commit fb84259217927e60e96f1c2bf59141def3236c21 @wez wez committed Dec 4, 2003
Showing with 119 additions and 9 deletions.
  1. +8 −2 win32/build/Makefile
  2. +3 −2 win32/build/buildconf.js
  3. +45 −5 win32/build/confutils.js
  4. BIN win32/build/php.ico
  5. +63 −0 win32/build/template.rc
View
@@ -45,9 +45,15 @@ Zend\zend_language_scanner.c: Zend\flex.skl Zend\zend_language_scanner.l
ext\standard\parsedate.c ext\standard\parsedate.h: ext\standard\parsedate.y
bison --output=ext/standard/parsedate.c -v -d ext/standard/parsedate.y
+PHPDLL_RES=$(BUILD_DIR)\$(PHPDLL).res
-$(BUILD_DIR)\$(PHPDLL): $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS)
- $(LD) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS)
+$(PHPDLL_RES): win32\build\template.rc
+ $(RC) /fo $(PHPDLL_RES) /d FILE_DESCRIPTION="\"PHP Script Interpreter\"" \
+ /d FILE_NAME="\"$(PHPDLL)\"" /d PRODUCT_NAME="\"PHP Script Interpreter\"" \
+ win32\build\template.rc
+
+$(BUILD_DIR)\$(PHPDLL): $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES)
+ $(LD) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES)
$(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL)
View
@@ -1,4 +1,4 @@
-// $Id: buildconf.js,v 1.2 2003-12-03 14:55:03 wez Exp $
+// $Id: buildconf.js,v 1.3 2003-12-04 01:37:52 wez Exp $
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: buildconf.js,v 1.2 2003-12-03 14:55:03 wez Exp $ */
+/* $Id: buildconf.js,v 1.3 2003-12-04 01:37:52 wez Exp $ */
// This generates a configure script for win32 build
WScript.StdOut.WriteLine("Rebuilding configure.js");
@@ -64,6 +64,7 @@ C.Write(file_get_contents("win32/build/confutils.js"));
modules = file_get_contents("win32/build/config.w32");
find_config_w32("sapi");
find_config_w32("ext");
+find_config_w32("pecl");
// Look for ARG_ENABLE or ARG_WITH calls
re = new RegExp("(ARG_(ENABLE|WITH)\([^;]+\);)", "gm");
View
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-// $Id: confutils.js,v 1.10 2003-12-03 23:48:02 fmk Exp $
+// $Id: confutils.js,v 1.11 2003-12-04 01:37:52 wez Exp $
var STDOUT = WScript.StdOut;
var STDERR = WScript.StdErr;
@@ -415,10 +415,44 @@ function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env
return p;
}
+/* 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)
+{
+ var resname = makefiletarget + ".res";
+ var res_desc = "PHP " + makefiletarget;
+ var res_prod_name = res_desc;
+ var credits;
+ var thanks = "";
+
+ if (FSO.FileExists(creditspath + '/CREDITS')) {
+ credits = FSO.OpenTextFile(creditspath + '/CREDITS', 1);
+ res_desc = credits.ReadLine();
+ thanks = credits.ReadLine();
+ if (thanks == null) {
+ thanks = "";
+ } else {
+ thanks = "Thanks to " + thanks;
+ }
+ credits.Close();
+ }
+
+ MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc");
+ MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname +
+ ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' + makefiletarget +
+ '\\"" /d PRODUCT_NAME="\\"' + res_prod_name + '\\"" /d THANKS_GUYS="\\"' +
+ thanks + '\\"" win32\\build\\template.rc');
+ MFO.WriteBlankLines(1);
+
+ return resname;
+}
+
function SAPI(sapiname, file_list, makefiletarget, cflags)
{
var SAPI = sapiname.toUpperCase();
var ldflags;
+ var resname;
STDOUT.WriteLine("Enabling sapi/" + sapiname);
@@ -434,17 +468,21 @@ function SAPI(sapiname, file_list, makefiletarget, cflags)
MFO.WriteBlankLines(1);
MFO.WriteLine("# SAPI " + sapiname);
MFO.WriteBlankLines(1);
+
+ /* generate a .res file containing version information */
+ resname = generate_version_info_resource(makefiletarget, "sapi/" + sapiname);
+
MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);
MFO.WriteLine("\t@echo SAPI " + sapiname + " build complete");
- MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB)");
+ MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
if (makefiletarget.match(new RegExp("\\.dll$"))) {
ldflags = "/dll $(LDFLAGS)";
} else {
ldflags = "$(LDFLAGS)";
}
- MFO.WriteLine("\t$(LD) /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ")");
+ MFO.WriteLine("\t$(LD) /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);
DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')');
ADD_FLAG("SAPI_TARGETS", makefiletarget);
@@ -492,8 +530,10 @@ function EXTENSION(extname, file_list, shared, cflags)
if (shared) {
dllname = "php_" + extname + ".dll";
- MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB)");
- MFO.WriteLine("\t$(LD) /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS)");
+ var resname = generate_version_info_resource(makefiletarget, "ext/" + extname);
+
+ MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
+ MFO.WriteLine("\t$(LD) /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname);
MFO.WriteBlankLines(1);
ADD_FLAG("EXT_TARGETS", dllname);
View
Binary file not shown.
View
@@ -0,0 +1,63 @@
+/* This is a template RC file.
+ * $Id$
+ * Do not edit with MSVC */
+#ifdef APSTUDIO_INVOKED
+# error dont edit with MSVC
+#endif
+
+#include "resource.h"
+#include "winres.h"
+#include "main/php_version.h"
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+
+#ifndef THANKS_GUYS
+# define THANKS_GUYS ""
+#endif
+
+0 ICON win32\build\php.ico
+
+#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)
+
+//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
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ 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 � 2002 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"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END

0 comments on commit fb84259

Please sign in to comment.