summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorEdin Kadribasic <edink@php.net>2006-12-19 10:26:01 +0000
committerEdin Kadribasic <edink@php.net>2006-12-19 10:26:01 +0000
commit7e77d79b3c9198a26610448589093241255e7684 (patch)
treec1f14ed083c4273e419dbfd104e6265c0a336ba1 /win32
parentb12e3e14753882137f013aadfedd0f3ae7ae0bee (diff)
downloadphp-git-7e77d79b3c9198a26610448589093241255e7684.tar.gz
Enable full build with newer Microsoft compilers
Diffstat (limited to 'win32')
-rw-r--r--win32/build/Makefile5
-rw-r--r--win32/build/config.w323
-rw-r--r--win32/build/confutils.js12
-rw-r--r--win32/build/mkdist.php11
4 files changed, 29 insertions, 2 deletions
diff --git a/win32/build/Makefile b/win32/build/Makefile
index 045af3b852..39b59109a7 100644
--- a/win32/build/Makefile
+++ b/win32/build/Makefile
@@ -20,6 +20,7 @@
CC="$(CL)"
LD="$(LINK)"
MC="$(MC)"
+MT="$(MT)"
MCFILE=$(BUILD_DIR)\wsyslog.rc
@@ -54,6 +55,9 @@ $(MCFILE): win32\build\wsyslog.mc
# $(RC) /fo $(MCFILE) $(BUILD_DIR)\wsyslog.rc
+_VC_MANIFEST_EMBED_EXE= $(MT) -manifest $@.manifest -outputresource:$@;1
+_VC_MANIFEST_EMBED_DLL= $(MT) -manifest $@.manifest -outputresource:$@;2
+
$(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\"" \
@@ -62,6 +66,7 @@ $(PHPDLL_RES): win32\build\template.rc
$(BUILD_DIR)\$(PHPDLL): generated_files $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) $(MCFILE)
@$(CC) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /link /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS)
+ -@$(_VC_MANIFEST_EMBED_DLL)
$(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL)
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 4c983a346c..ffd108534f 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -49,6 +49,9 @@ PATH_PROG('lemon');
// avoid picking up midnight commander from cygwin
PATH_PROG('mc', WshShell.Environment("Process").Item("PATH"));
+// Try locating manifest tool
+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', '');
if (PHP_OBJECT_OUT_DIR.length) {
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 78c1be6993..96d7a59c7b 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-// $Id: confutils.js,v 1.60.2.1.2.3 2006-11-10 10:38:07 dmitry Exp $
+// $Id: confutils.js,v 1.60.2.1.2.4 2006-12-19 10:26:01 edink Exp $
var STDOUT = WScript.StdOut;
var STDERR = WScript.StdErr;
@@ -877,6 +877,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
var ldflags;
var resname;
var ld;
+ var manifest;
if (typeof(obj_dir) == "undefined") {
sapiname_for_printing = configure_module_dirname;
@@ -908,11 +909,13 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
if (makefiletarget.match(new RegExp("\\.dll$"))) {
ldflags = "/dll $(LDFLAGS)";
+ manifest = "-@$(_VC_MANIFEST_EMBED_DLL)";
} else if (makefiletarget.match(new RegExp("\\.lib$"))) {
ldflags = "$(LDFLAGS)";
ld = "$(MAKE_LIB)";
} else {
ldflags = "$(LDFLAGS)";
+ manifest = "-@$(_VC_MANIFEST_EMBED_EXE)";
}
if (ld) {
@@ -922,6 +925,10 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir)
MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");
}
+ if (manifest) {
+ MFO.WriteLine("\t" + manifest);
+ }
+
DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')');
if (configure_module_dirname.match("pecl")) {
@@ -998,7 +1005,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
var objs = null;
var EXT = extname.toUpperCase();
var extname_for_printing;
-
+
if (shared == null) {
eval("shared = PHP_" + EXT + "_SHARED;");
}
@@ -1040,6 +1047,7 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir)
MFO.WriteLine("$(BUILD_DIR)\\" + dllname + " $(BUILD_DIR)\\" + libname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);
MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");
+ MFO.WriteLine("\t-@$(_VC_MANIFEST_EMBED_DLL)");
MFO.WriteBlankLines(1);
if (configure_module_dirname.match("pecl")) {
diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php
index 51c304909d..546af8b0f2 100644
--- a/win32/build/mkdist.php
+++ b/win32/build/mkdist.php
@@ -401,6 +401,17 @@ if (file_exists($snapshot_template)) {
}
}
}
+
+ /* copy c++ runtime */
+ $items = glob("$snapshot_template/dlls/*.CRT");
+
+ foreach ($items as $item) {
+ $bi = basename($item);
+ if (is_dir($item)) {
+ copy_dir($item, "$dist_dir/$bi");
+ copy_dir($item, "$dist_dir/ext/$bi");
+ }
+ }
} else {
echo "WARNING: you don't have a snapshot template\n";
echo " your dist will not be complete\n";