diff options
| -rw-r--r-- | win32/build/Makefile | 10 | ||||
| -rw-r--r-- | win32/build/config.w32 | 5 | ||||
| -rw-r--r-- | win32/build/confutils.js | 70 |
3 files changed, 73 insertions, 12 deletions
diff --git a/win32/build/Makefile b/win32/build/Makefile index 951e8466eb..5b8a68bd7c 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -80,7 +80,12 @@ set TEST_PHP_EXECUTABLE=$(BUILD_DIR)\php.exe $(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 @@ dist: all -$(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)" diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 1c1052839f..b4829d972c 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -17,11 +17,6 @@ PATH_PROG('re2c'); 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'); diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 7cb4f2ec93..bd9c0ef458 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -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 @@ can be built that way. \ 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 @@ can be built that way. \ 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 @@ function SAPI(sapiname, file_list, makefiletarget, cflags) } 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 @@ function file_get_contents(filename) 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 @@ function EXTENSION(extname, file_list, shared, cflags) 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 @@ function generate_files() 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 @@ function copy_and_subst(srcname, destname, subst_array) 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'); + + |
