wez Mon Dec 22 08:13:39 2003 EDT
Modified files:
/php-src/win32/build Makefile config.w32 confutils.js
Log:
Add --enable-snapshot-build configure option for win32 build.
Using it will attempt to switch on any configure options that
were left to their default value of "no".
Add a "snap" target to the makefile which will run a sub-process
to make each SAPI and EXT independently, so that the whole process
does not bail out if a particular extension is broken.
Add a way to specify dependencies between extensions in the
config.w32 files so that the makefile will include appropriate rules
and linkage.
Index: php-src/win32/build/Makefile
diff -u php-src/win32/build/Makefile:1.9 php-src/win32/build/Makefile:1.10
--- php-src/win32/build/Makefile:1.9 Fri Dec 19 07:50:11 2003
+++ php-src/win32/build/Makefile Mon Dec 22 08:13:39 2003
@@ -14,7 +14,7 @@
# | Author: Wez Furlong <[EMAIL PROTECTED]> |
# +----------------------------------------------------------------------+
#
-# $Id: Makefile,v 1.9 2003/12/19 12:50:11 wez Exp $
+# $Id: Makefile,v 1.10 2003/12/22 13:13:39 wez Exp $
# This is the makefile template for the win32 build
CC="$(CL)"
@@ -80,7 +80,12 @@
$(BUILD_DIR)\php.exe -d open_basedir= -d safe_mode=0 -d output_buffering=0
run-tests.php $(TESTS)
<<NOKEEP
-dist: all
+build-snap:
+ @$(MAKE) "$(BUILD_DIR)\$(PHPDLL)"
+ for %T in ($(SAPI_TARGETS)) do $(MAKE) /nologo "%T"
+ for %T in ($(EXT_TARGETS)) do $(MAKE) /nologo "%T"
+
+build-dist:
-rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)
-del /f /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING).zip
$(BUILD_DIR)\php.exe win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)"
"$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(SNAPSHOT_TEMPLATE)"
@@ -88,6 +93,9 @@
-$(ZIP) -9 -r ..\php-$(PHP_VERSION_STRING).zip .
cd ..\..
+dist: all build-dist
+snap: build-snap build-dist
+
msi-installer: dist
$(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)"
"$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)"
Index: php-src/win32/build/config.w32
diff -u php-src/win32/build/config.w32:1.16 php-src/win32/build/config.w32:1.17
--- php-src/win32/build/config.w32:1.16 Fri Dec 19 15:39:02 2003
+++ php-src/win32/build/config.w32 Mon Dec 22 08:13:39 2003
@@ -1,5 +1,5 @@
// vim:ft=javascript
-// $Id: config.w32,v 1.16 2003/12/19 20:39:02 wez Exp $
+// $Id: config.w32,v 1.17 2003/12/22 13:13:39 wez Exp $
// "Master" config file; think of it as a configure.in
// equivalent.
@@ -17,11 +17,6 @@
PATH_PROG('zip');
PATH_PROG('lemon');
-// one-shot build optimizes build by asking compiler to build
-// several objects at once, reducing overhead of starting new
-// compiler processes.
-ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot
builders, not so hot for edit-and-rebuild hacking', 'no');
-
ARG_ENABLE('debug', 'Compile with debugging symbols', "no");
ARG_ENABLE('zts', 'Thread safety', 'yes');
Index: php-src/win32/build/confutils.js
diff -u php-src/win32/build/confutils.js:1.23 php-src/win32/build/confutils.js:1.24
--- php-src/win32/build/confutils.js:1.23 Fri Dec 19 18:19:18 2003
+++ php-src/win32/build/confutils.js Mon Dec 22 08:13:39 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-// $Id: confutils.js,v 1.23 2003/12/19 23:19:18 wez Exp $
+// $Id: confutils.js,v 1.24 2003/12/22 13:13:39 wez Exp $
var STDOUT = WScript.StdOut;
var STDERR = WScript.StdErr;
@@ -318,6 +318,10 @@
WScript.Quit(1);
}
+ var snapshot_build_exclusions = new Array(
+ 'debug', 'crt-debug', 'lzf-better-compression', 'php-build',
'snapshot-template'
+ );
+
// Now set any defaults we might have missed out earlier
for (i = 0; i < configure_args.length; i++) {
arg = configure_args[i];
@@ -326,6 +330,22 @@
analyzed = analyze_arg(arg.defval);
shared = analyzed[0];
argval = analyzed[1];
+ if (PHP_SNAPSHOT_BUILD != "no" && argval == "no") {
+ var force;
+
+ force = true;
+ for (j = 0; j < snapshot_build_exclusions.length; j++) {
+ if (snapshot_build_exclusions[j] == arg.optname) {
+ force = false;
+ break;
+ }
+ }
+ if (force) {
+ STDOUT.WriteLine("snapshot: forcing " + arg.arg + "
on");
+ argval = "yes";
+ shared = true;
+ }
+ }
eval("PHP_" + arg.symval + " = argval;");
eval("PHP_" + arg.symval + "_SHARED = shared;");
}
@@ -611,7 +631,7 @@
} else {
ldflags = "$(LDFLAGS)";
}
-
+
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 + ')');
@@ -628,6 +648,26 @@
return c;
}
+// Add a dependency on another extension, so that
+// the dependencies are built before extname
+function ADD_EXTENSION_DEP(extname, dependson)
+{
+ var EXT = extname.toUpperCase();
+ var DEP = dependson.toUpperCase();
+
+ var dep_shared = eval("PHP_" + DEP + "_SHARED");
+ var ext_shared = eval("PHP_" + EXT + "_SHARED");
+
+ if (dep_shared) {
+ if (!ext_shared) {
+ ERROR("static " + extname + " cannot depend on shared " +
dependson);
+ }
+ ADD_FLAG("LDFLAGS_" + EXT, "/libpath:$(BUILD_DIR)");
+ ADD_FLAG("LIBS_" + EXT, "php_" + dependson + ".lib");
+ ADD_FLAG("DEPS_" + EXT, "$(BUILD_DIR)\\php_" + dependson + ".lib");
+ }
+}
+
function EXTENSION(extname, file_list, shared, cflags)
{
var objs = null;
@@ -661,9 +701,11 @@
if (shared) {
dllname = "php_" + extname + ".dll";
var resname = generate_version_info_resource(dllname,
configure_module_dirname);
-
- 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);
+ var ld = "$(LD)";
+ var libname = "php_" + extname + ".lib";
+
+ MFO.WriteLine("$(BUILD_DIR)\\" + dllname + " $(BUILD_DIR)\\" + libname
+ ": $(DEPS_" + EXT + ") $(" + 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);
@@ -844,7 +886,11 @@
STDOUT.WriteLine("Done.");
STDOUT.WriteBlankLines(1);
- STDOUT.WriteLine("Type 'nmake' to build PHP");
+ if (PHP_SNAPSHOT_BUILD != "no") {
+ STDOUT.WriteLine("Type 'nmake snap' to build a PHP snapshot");
+ } else {
+ STDOUT.WriteLine("Type 'nmake' to build PHP");
+ }
}
function generate_config_h()
@@ -1008,3 +1054,15 @@
f.Close();
}
+// for snapshot builders, this option will attempt to enable everything
+// and you can then build everything, ignoring fatal errors within a module
+// by running "nmake snap"
+PHP_SNAPSHOT_BUILD = "no";
+ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and
ignores build errors', 'no');
+
+// one-shot build optimizes build by asking compiler to build
+// several objects at once, reducing overhead of starting new
+// compiler processes.
+ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot
builders, not so hot for edit-and-rebuild hacking', 'no');
+
+
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php