diff options
author | Wez Furlong <wez@php.net> | 2004-02-12 12:30:41 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2004-02-12 12:30:41 +0000 |
commit | 08a1b6c476ad0df7db0535e7ca451bfc46c51ac6 (patch) | |
tree | aa9ca78ae4c1d63cf887fe50a1cb0973e63eb79b /win32 | |
parent | 7d3215d33321173c58db4d86b7398e16c5c55d13 (diff) | |
download | php-git-08a1b6c476ad0df7db0535e7ca451bfc46c51ac6.tar.gz |
Tidy up "nmake clean" for people that don't have a PECL checkout.
Be paranoid when building a snapshot: if the module is not a core
module (eg: it comes from outside of ext or sapi) and it defaults to "yes",
then force it to become shared. This will prevent a pecl ext from
accidentally being compiled statically into the core, and prevent that
ext from breaking the core build. You can still manually force a static
build by explicitly specifying the args for that extension on your configure
line.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/build/Makefile | 20 | ||||
-rw-r--r-- | win32/build/buildconf.js | 29 | ||||
-rw-r--r-- | win32/build/confutils.js | 40 |
3 files changed, 75 insertions, 14 deletions
diff --git a/win32/build/Makefile b/win32/build/Makefile index be47eae2cf..54b1f53e2f 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -65,15 +65,15 @@ $(BUILD_DIR) $(BUILD_DIRS_SUB): clean-sapi: @echo Cleaning SAPI - @for %D in ($(EXT_TARGETS)) do @del /F /Q $(BUILD_DIR)\%D > NUL - @for %D in ($(PECL_TARGETS)) do @del /F /Q $(BUILD_DIR)\%D > NUL - @for %D in ($(SAPI_TARGETS)) do @del /F /Q $(BUILD_DIR)\%D > NUL - @del /F /Q $(BUILD_DIR)\$(PHPDLL) + @for %D in (_x $(EXT_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL + @for %D in (_x $(PECL_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL + @for %D in (_x $(SAPI_TARGETS)) do @if exist $(BUILD_DIR)\%D @del /F /Q $(BUILD_DIR)\%D > NUL + -@del /F /Q $(BUILD_DIR)\$(PHPDLL) clean: clean-sapi - @echo Cleaning - @for %D in ($(BUILD_DIRS_SUB)) do @del /F /Q %D\*.* > NUL - @del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING).zip > NUL + @echo Cleaning build dirs + @for %D in (_x $(BUILD_DIRS_SUB)) do @if exist @del /F /Q %D\*.* > NUL + -@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING).zip > NUL -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING) test: @@ -84,9 +84,9 @@ $(BUILD_DIR)\php.exe -d open_basedir= -d safe_mode=0 -d output_buffering=0 run-t build-snap: @$(MAKE) "$(BUILD_DIR)\$(PHPDLL)" - for %T in ($(SAPI_TARGETS)) do $(MAKE) /I /nologo "%T" - for %T in ($(EXT_TARGETS)) do $(MAKE) /I /nologo "%T" - for %T in ($(PECL_TARGETS)) do $(MAKE) /I /nologo "%T" + -for %T in ($(SAPI_TARGETS)) do $(MAKE) /I /nologo "%T" + -for %T in ($(EXT_TARGETS)) do $(MAKE) /I /nologo "%T" + -for %T in ($(PECL_TARGETS)) do $(MAKE) /I /nologo "%T" build-dist: $(BUILD_DIR)\deplister.exe -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING) diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js index b744fcd769..a73094258c 100644 --- a/win32/build/buildconf.js +++ b/win32/build/buildconf.js @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: buildconf.js,v 1.10 2004-01-08 21:53:48 wez Exp $ */ +/* $Id: buildconf.js,v 1.11 2004-02-12 12:30:41 wez Exp $ */ // This generates a configure script for win32 build WScript.StdOut.WriteLine("Rebuilding configure.js"); @@ -99,6 +99,30 @@ function find_config_w32(dirname) } } +// Emit core modules array. This is used by a snapshot +// build to override a default "yes" value so that external +// modules don't break the build by becoming statically compiled +function emit_core_module_list() +{ + var module_names = (new VBArray(MODULES.Keys())).toArray(); + var i, mod_name, j; + var item; + var output = ""; + + C.WriteLine("core_module_list = new Array("); + + // first, look for modules with empty deps; emit those first + for (i in module_names) { + mod_name = module_names[i]; + C.WriteLine("\"" + mod_name.replace(/_/g, "-") + "\","); + } + + C.WriteLine("false // dummy"); + + C.WriteLine(");"); +} + + function emit_module(item) { return item.dir_line + item.content; @@ -168,11 +192,14 @@ modules = file_get_contents("win32/build/config.w32"); find_config_w32("."); find_config_w32("sapi"); find_config_w32("ext"); +emit_core_module_list(); + find_config_w32("pecl"); find_config_w32("..\\pecl"); find_config_w32("pecl\\rpc"); find_config_w32("..\\pecl\\rpc"); + // Now generate contents of module based on MODULES, chasing dependencies // to ensure that dependent modules are emitted first modules += gen_modules(); diff --git a/win32/build/confutils.js b/win32/build/confutils.js index d74f59b4f2..7290996bda 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -// $Id: confutils.js,v 1.37 2004-01-09 15:11:19 wez Exp $ +// $Id: confutils.js,v 1.38 2004-02-12 12:30:41 wez Exp $ var STDOUT = WScript.StdOut; var STDERR = WScript.StdErr; @@ -340,7 +340,10 @@ can be built that way. \ } var snapshot_build_exclusions = new Array( - 'debug', 'crt-debug', 'lzf-better-compression', 'php-build', 'snapshot-template' + 'debug', 'crt-debug', 'lzf-better-compression', + 'php-build', 'snapshot-template', + 'pcre-regex', 'fastcgi', 'force-cgi-redirect', + 'path-info-check', 'zts', 'ipv6' ); // Now set any defaults we might have missed out earlier @@ -351,6 +354,37 @@ can be built that way. \ analyzed = analyze_arg(arg.defval); shared = analyzed[0]; argval = analyzed[1]; + + // Don't trust a default "yes" answer for a non-core module + // in a snapshot build + if (PHP_SNAPSHOT_BUILD != "no" && argval == "yes" && !shared) { + 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) { + /* now check if it is a core module */ + force = false; + for (j = 0; j < core_module_list.length; j++) { + if (core_module_list[j] == arg.optname) { + force = true; + break; + } + } + + if (!force) { + STDOUT.WriteLine("snapshot: forcing " + arg.arg + " shared"); + shared = true; + } + } + } + if (PHP_SNAPSHOT_BUILD != "no" && argval == "no") { var force; @@ -362,7 +396,7 @@ can be built that way. \ } } if (force) { - STDOUT.WriteLine("snapshot: forcing " + arg.arg + " on"); + STDOUT.WriteLine("snapshot: forcing " + arg.optname + " on"); argval = "yes"; shared = true; } |