Index: /autobuild/.config
===================================================================
--- /autobuild/.config	(revision 905)
+++ /autobuild/.config	(revision 905)
@@ -0,0 +1,26 @@
+#!/bin/sh
+# vim:syntax=sh
+
+snapshotCount=8
+
+setExtOutputDir() {
+	extOutputDir="$1"
+	snapshotOutputDir="$extOutputDir/snapshots"
+	releaseOutputDir="$extOutputDir/Releases"
+}
+
+topdir="$PWD"
+develDir="$topdir/php-devel"
+buildDir="$topdir/build"
+sourceDir="$topdir/php-src"
+scriptsDir="$topdir/scripts"
+
+mirror="cn.php.net"
+
+phpVersions=(5.1.6 5.2.17 5.3.13 5.4.3)
+arches=(x86 x64)
+compilers=(VC6 VC9)
+exts=(xcache)
+
+outputDir="$HOME/pub"
+setExtOutputDir "$outputDir/???"
Index: /autobuild/Makefile
===================================================================
--- /autobuild/Makefile	(revision 905)
+++ /autobuild/Makefile	(revision 905)
@@ -0,0 +1,297 @@
+topdir=/home/mOo/src/php-autobuild
+scriptsDir=/home/mOo/src/php-autobuild/scripts
+all: Makefile unpackphp alltargets
+
+$(topdir)/php-src/.stamp-download download: 
+	$(scriptsDir)/download $(PHP_VERSION)
+	touch $(topdir)/php-src/.stamp-download
+
+Makefile: .config $(topdir)/php-src/.stamp-download $(scriptsDir)/common $(scriptsDir)/utils $(scriptsDir)/autobuild
+	$(scriptsDir)/generateMakefile
+
+$(topdir)/php-devel/.stamp-unpack unpackphp:  $(topdir)/php-devel/php-5.1.6/.stamp-unpack $(topdir)/php-devel/php-5.2.17/.stamp-unpack $(topdir)/php-devel/php-5.3.13/.stamp-unpack $(topdir)/php-devel/php-5.4.3/.stamp-unpack
+
+$(topdir)/php-devel/php-5.1.6-Win32/.stamp-unpack: $(topdir)/php-src/php-5.1.6-Win32.zip
+	mkdir -p $(topdir)/php-devel/php-5.1.6-Win32
+	$(scriptsDir)/unpackphpbinary 5.1.6 $(topdir)/php-src/php-5.1.6-Win32.zip $(topdir)/php-devel/php-5.1.6-Win32
+	touch $(topdir)/php-devel/php-5.1.6-Win32/.stamp-unpack
+
+$(topdir)/php-devel/php-5.1.6/.stamp-unpack: $(topdir)/php-src/php-5.1.6.tar.bz2 $(topdir)/php-devel/php-5.1.6-Win32/.stamp-unpack
+	mkdir -p $(topdir)/php-devel/php-5.1.6
+	$(scriptsDir)/unpackphpsource 5.1.6 $(topdir)/php-src/php-5.1.6.tar.bz2 $(topdir)/php-devel/php-5.1.6
+	touch $(topdir)/php-devel/php-5.1.6/.stamp-unpack
+
+$(topdir)/php-devel/php-5.2.17-nts-Win32-VC6-x86/.stamp-unpack: $(topdir)/php-src/php-5.2.17-nts-Win32-VC6-x86.zip
+	mkdir -p $(topdir)/php-devel/php-5.2.17-nts-Win32-VC6-x86
+	$(scriptsDir)/unpackphpbinary 5.2.17 $(topdir)/php-src/php-5.2.17-nts-Win32-VC6-x86.zip $(topdir)/php-devel/php-5.2.17-nts-Win32-VC6-x86
+	touch $(topdir)/php-devel/php-5.2.17-nts-Win32-VC6-x86/.stamp-unpack
+
+$(topdir)/php-devel/php-5.2.17-Win32/.stamp-unpack: $(topdir)/php-src/php-5.2.17-Win32.zip
+	mkdir -p $(topdir)/php-devel/php-5.2.17-Win32
+	$(scriptsDir)/unpackphpbinary 5.2.17 $(topdir)/php-src/php-5.2.17-Win32.zip $(topdir)/php-devel/php-5.2.17-Win32
+	touch $(topdir)/php-devel/php-5.2.17-Win32/.stamp-unpack
+
+$(topdir)/php-devel/php-5.2.17-Win32-VC6-x86/.stamp-unpack: $(topdir)/php-src/php-5.2.17-Win32-VC6-x86.zip
+	mkdir -p $(topdir)/php-devel/php-5.2.17-Win32-VC6-x86
+	$(scriptsDir)/unpackphpbinary 5.2.17 $(topdir)/php-src/php-5.2.17-Win32-VC6-x86.zip $(topdir)/php-devel/php-5.2.17-Win32-VC6-x86
+	touch $(topdir)/php-devel/php-5.2.17-Win32-VC6-x86/.stamp-unpack
+
+$(topdir)/php-devel/php-5.2.17/.stamp-unpack: $(topdir)/php-src/php-5.2.17.tar.bz2 $(topdir)/php-devel/php-5.2.17-nts-Win32-VC6-x86/.stamp-unpack $(topdir)/php-devel/php-5.2.17-Win32/.stamp-unpack $(topdir)/php-devel/php-5.2.17-Win32-VC6-x86/.stamp-unpack
+	mkdir -p $(topdir)/php-devel/php-5.2.17
+	$(scriptsDir)/unpackphpsource 5.2.17 $(topdir)/php-src/php-5.2.17.tar.bz2 $(topdir)/php-devel/php-5.2.17
+	touch $(topdir)/php-devel/php-5.2.17/.stamp-unpack
+
+$(topdir)/php-devel/php-5.3.13-nts-Win32-VC9-x86/.stamp-unpack: $(topdir)/php-src/php-5.3.13-nts-Win32-VC9-x86.zip
+	mkdir -p $(topdir)/php-devel/php-5.3.13-nts-Win32-VC9-x86
+	$(scriptsDir)/unpackphpbinary 5.3.13 $(topdir)/php-src/php-5.3.13-nts-Win32-VC9-x86.zip $(topdir)/php-devel/php-5.3.13-nts-Win32-VC9-x86
+	touch $(topdir)/php-devel/php-5.3.13-nts-Win32-VC9-x86/.stamp-unpack
+
+$(topdir)/php-devel/php-5.3.13-Win32-VC9-x86/.stamp-unpack: $(topdir)/php-src/php-5.3.13-Win32-VC9-x86.zip
+	mkdir -p $(topdir)/php-devel/php-5.3.13-Win32-VC9-x86
+	$(scriptsDir)/unpackphpbinary 5.3.13 $(topdir)/php-src/php-5.3.13-Win32-VC9-x86.zip $(topdir)/php-devel/php-5.3.13-Win32-VC9-x86
+	touch $(topdir)/php-devel/php-5.3.13-Win32-VC9-x86/.stamp-unpack
+
+$(topdir)/php-devel/php-5.3.13/.stamp-unpack: $(topdir)/php-src/php-5.3.13.tar.bz2 $(topdir)/php-devel/php-5.3.13-nts-Win32-VC9-x86/.stamp-unpack $(topdir)/php-devel/php-5.3.13-Win32-VC9-x86/.stamp-unpack
+	mkdir -p $(topdir)/php-devel/php-5.3.13
+	$(scriptsDir)/unpackphpsource 5.3.13 $(topdir)/php-src/php-5.3.13.tar.bz2 $(topdir)/php-devel/php-5.3.13
+	touch $(topdir)/php-devel/php-5.3.13/.stamp-unpack
+
+$(topdir)/php-devel/php-5.4.3-nts-Win32-VC9-x86/.stamp-unpack: $(topdir)/php-src/php-5.4.3-nts-Win32-VC9-x86.zip
+	mkdir -p $(topdir)/php-devel/php-5.4.3-nts-Win32-VC9-x86
+	$(scriptsDir)/unpackphpbinary 5.4.3 $(topdir)/php-src/php-5.4.3-nts-Win32-VC9-x86.zip $(topdir)/php-devel/php-5.4.3-nts-Win32-VC9-x86
+	touch $(topdir)/php-devel/php-5.4.3-nts-Win32-VC9-x86/.stamp-unpack
+
+$(topdir)/php-devel/php-5.4.3-Win32-VC9-x86/.stamp-unpack: $(topdir)/php-src/php-5.4.3-Win32-VC9-x86.zip
+	mkdir -p $(topdir)/php-devel/php-5.4.3-Win32-VC9-x86
+	$(scriptsDir)/unpackphpbinary 5.4.3 $(topdir)/php-src/php-5.4.3-Win32-VC9-x86.zip $(topdir)/php-devel/php-5.4.3-Win32-VC9-x86
+	touch $(topdir)/php-devel/php-5.4.3-Win32-VC9-x86/.stamp-unpack
+
+$(topdir)/php-devel/php-5.4.3/.stamp-unpack: $(topdir)/php-src/php-5.4.3.tar.bz2 $(topdir)/php-devel/php-5.4.3-nts-Win32-VC9-x86/.stamp-unpack $(topdir)/php-devel/php-5.4.3-Win32-VC9-x86/.stamp-unpack
+	mkdir -p $(topdir)/php-devel/php-5.4.3
+	$(scriptsDir)/unpackphpsource 5.4.3 $(topdir)/php-src/php-5.4.3.tar.bz2 $(topdir)/php-devel/php-5.4.3
+	touch $(topdir)/php-devel/php-5.4.3/.stamp-unpack
+
+update: update-xcache
+
+update-xcache: update-xcache-trunk
+
+update-xcache-trunk $(topdir)/xcache/.stamp.trunk: 
+	$(scriptsDir)/extupdate xcache trunk
+
+$(topdir)/build/XCache-trunk-php-5.1.6-Win32/.stamp-update: $(topdir)/php-devel/php-5.1.6/.stamp-unpack $(topdir)/xcache/.stamp.trunk
+	rm -rf $(topdir)/build/XCache-trunk-php-5.1.6-Win32/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php
+	rsync -v -au $(topdir)/php-devel/php-5.1.6/ $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/
+	test -f $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/win32/build/ || rsync -v -au $(topdir)/php-devel/win32build/build/ $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/win32/build/
+	$(scriptsDir)/fixsource $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Release_TS/
+	cp -v -au $(topdir)/php-devel/php-5.1.6-Win32/php*.lib $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Release_TS/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.1.6-Win32/xcache
+	rsync -v -Cau $(topdir)/xcache/xcache-trunk/ $(topdir)/build/XCache-trunk-php-5.1.6-Win32/xcache/
+	touch $(topdir)/build/XCache-trunk-php-5.1.6-Win32/.stamp-update
+
+$(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/configure.js: $(topdir)/build/XCache-trunk-php-5.1.6-Win32/.stamp-update
+	cd $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php && VC6x86env.cmd cscript /nologo win32/build/buildconf.js --add-modules-dir=../
+	mv -f $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/configure.js $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/configure.js.tmp
+	$(scriptsDir)/fixconfigure $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/configure.js.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/configure.js.tmp $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/configure.js
+
+$(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Makefile: $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/configure.js
+	cd $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php && VC6x86env.cmd cscript.exe /nologo configure.js --enable-xcache-coverager --enable-xcache-constant --enable-xcache-disassembler --enable-zts \
+				--with-php-build="$$(cygpath -wa $(topdir)/win32build)" \
+				--disable-all --enable-object-out-dir=. --enable-debug-pack \
+				--enable-xcache=yes,shared
+	mv -f $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Makefile $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Makefile.tmp
+	$(scriptsDir)/fixmakefile $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Makefile.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Makefile.tmp $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Makefile
+
+$(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Release_TS/php_xcache.dll: $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Makefile
+	cd $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php && MAKEFLAGS= VC6x86env.cmd nmake.exe /nologo php_xcache.dll
+
+$(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/.stamp-update: $(topdir)/php-devel/php-5.2.17/.stamp-unpack $(topdir)/xcache/.stamp.trunk
+	rm -rf $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php
+	rsync -v -au $(topdir)/php-devel/php-5.2.17/ $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/
+	test -f $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/win32/build/ || rsync -v -au $(topdir)/php-devel/win32build/build/ $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/win32/build/
+	$(scriptsDir)/fixsource $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Release_TS/
+	cp -v -au $(topdir)/php-devel/php-5.2.17-Win32-VC6-x86/php*.lib $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Release_TS/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/xcache
+	rsync -v -Cau $(topdir)/xcache/xcache-trunk/ $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/xcache/
+	touch $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/.stamp-update
+
+$(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/configure.js: $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/.stamp-update
+	cd $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php && VC6x86env.cmd cscript /nologo win32/build/buildconf.js --add-modules-dir=../
+	mv -f $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/configure.js $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/configure.js.tmp
+	$(scriptsDir)/fixconfigure $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/configure.js.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/configure.js.tmp $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/configure.js
+
+$(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Makefile: $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/configure.js
+	cd $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php && VC6x86env.cmd cscript.exe /nologo configure.js --enable-xcache-coverager --enable-xcache-constant --enable-xcache-disassembler --enable-zts \
+				--with-php-build="$$(cygpath -wa $(topdir)/win32build)" \
+				--disable-all --enable-object-out-dir=. --enable-debug-pack \
+				--enable-xcache=yes,shared
+	mv -f $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Makefile $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Makefile.tmp
+	$(scriptsDir)/fixmakefile $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Makefile.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Makefile.tmp $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Makefile
+
+$(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Release_TS/php_xcache.dll: $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Makefile
+	cd $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php && MAKEFLAGS= VC6x86env.cmd nmake.exe /nologo php_xcache.dll
+
+$(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/.stamp-update: $(topdir)/php-devel/php-5.2.17/.stamp-unpack $(topdir)/xcache/.stamp.trunk
+	rm -rf $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php
+	rsync -v -au $(topdir)/php-devel/php-5.2.17/ $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/
+	test -f $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/win32/build/ || rsync -v -au $(topdir)/php-devel/win32build/build/ $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/win32/build/
+	$(scriptsDir)/fixsource $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Release/
+	cp -v -au $(topdir)/php-devel/php-5.2.17-nts-Win32-VC6-x86/php*.lib $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Release/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/xcache
+	rsync -v -Cau $(topdir)/xcache/xcache-trunk/ $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/xcache/
+	touch $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/.stamp-update
+
+$(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/configure.js: $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/.stamp-update
+	cd $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php && VC6x86env.cmd cscript /nologo win32/build/buildconf.js --add-modules-dir=../
+	mv -f $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/configure.js $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/configure.js.tmp
+	$(scriptsDir)/fixconfigure $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/configure.js.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/configure.js.tmp $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/configure.js
+
+$(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Makefile: $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/configure.js
+	cd $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php && VC6x86env.cmd cscript.exe /nologo configure.js --enable-xcache-coverager --enable-xcache-constant --enable-xcache-disassembler --disable-zts \
+				--with-php-build="$$(cygpath -wa $(topdir)/win32build)" \
+				--disable-all --enable-object-out-dir=. --enable-debug-pack \
+				--enable-xcache=yes,shared
+	mv -f $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Makefile $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Makefile.tmp
+	$(scriptsDir)/fixmakefile $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Makefile.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Makefile.tmp $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Makefile
+
+$(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Release/php_xcache.dll: $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Makefile
+	cd $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php && MAKEFLAGS= VC6x86env.cmd nmake.exe /nologo php_xcache.dll
+
+$(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/.stamp-update: $(topdir)/php-devel/php-5.3.13/.stamp-unpack $(topdir)/xcache/.stamp.trunk
+	rm -rf $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php
+	rsync -v -au $(topdir)/php-devel/php-5.3.13/ $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/
+	test -f $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/win32/build/ || rsync -v -au $(topdir)/php-devel/win32build/build/ $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/win32/build/
+	$(scriptsDir)/fixsource $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Release_TS/
+	cp -v -au $(topdir)/php-devel/php-5.3.13-Win32-VC9-x86/php*.lib $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Release_TS/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/xcache
+	rsync -v -Cau $(topdir)/xcache/xcache-trunk/ $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/xcache/
+	touch $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/.stamp-update
+
+$(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/configure.js: $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/.stamp-update
+	cd $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php && VC9x86env.cmd cscript /nologo win32/build/buildconf.js --add-modules-dir=../
+	mv -f $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/configure.js $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/configure.js.tmp
+	$(scriptsDir)/fixconfigure $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/configure.js.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/configure.js.tmp $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/configure.js
+
+$(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Makefile: $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/configure.js
+	cd $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php && VC9x86env.cmd cscript.exe /nologo configure.js --enable-xcache-coverager --enable-xcache-constant --enable-xcache-disassembler --enable-zts \
+				--with-php-build="$$(cygpath -wa $(topdir)/win32build)" \
+				--disable-all --enable-object-out-dir=. --enable-debug-pack \
+				--enable-xcache=yes,shared
+	mv -f $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Makefile $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Makefile.tmp
+	$(scriptsDir)/fixmakefile $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Makefile.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Makefile.tmp $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Makefile
+
+$(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Release_TS/php_xcache.dll: $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Makefile
+	cd $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php && MAKEFLAGS= VC9x86env.cmd nmake.exe /nologo php_xcache.dll
+
+$(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/.stamp-update: $(topdir)/php-devel/php-5.3.13/.stamp-unpack $(topdir)/xcache/.stamp.trunk
+	rm -rf $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php
+	rsync -v -au $(topdir)/php-devel/php-5.3.13/ $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/
+	test -f $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/win32/build/ || rsync -v -au $(topdir)/php-devel/win32build/build/ $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/win32/build/
+	$(scriptsDir)/fixsource $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Release/
+	cp -v -au $(topdir)/php-devel/php-5.3.13-nts-Win32-VC9-x86/php*.lib $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Release/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/xcache
+	rsync -v -Cau $(topdir)/xcache/xcache-trunk/ $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/xcache/
+	touch $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/.stamp-update
+
+$(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/configure.js: $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/.stamp-update
+	cd $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php && VC9x86env.cmd cscript /nologo win32/build/buildconf.js --add-modules-dir=../
+	mv -f $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/configure.js $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/configure.js.tmp
+	$(scriptsDir)/fixconfigure $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/configure.js.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/configure.js.tmp $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/configure.js
+
+$(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Makefile: $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/configure.js
+	cd $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php && VC9x86env.cmd cscript.exe /nologo configure.js --enable-xcache-coverager --enable-xcache-constant --enable-xcache-disassembler --disable-zts \
+				--with-php-build="$$(cygpath -wa $(topdir)/win32build)" \
+				--disable-all --enable-object-out-dir=. --enable-debug-pack \
+				--enable-xcache=yes,shared
+	mv -f $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Makefile $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Makefile.tmp
+	$(scriptsDir)/fixmakefile $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Makefile.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Makefile.tmp $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Makefile
+
+$(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Release/php_xcache.dll: $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Makefile
+	cd $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php && MAKEFLAGS= VC9x86env.cmd nmake.exe /nologo php_xcache.dll
+
+$(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/.stamp-update: $(topdir)/php-devel/php-5.4.3/.stamp-unpack $(topdir)/xcache/.stamp.trunk
+	rm -rf $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php
+	rsync -v -au $(topdir)/php-devel/php-5.4.3/ $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/
+	test -f $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/win32/build/ || rsync -v -au $(topdir)/php-devel/win32build/build/ $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/win32/build/
+	$(scriptsDir)/fixsource $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Release_TS/
+	cp -v -au $(topdir)/php-devel/php-5.4.3-Win32-VC9-x86/php*.lib $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Release_TS/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/xcache
+	rsync -v -Cau $(topdir)/xcache/xcache-trunk/ $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/xcache/
+	touch $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/.stamp-update
+
+$(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/configure.js: $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/.stamp-update
+	cd $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php && VC9x86env.cmd cscript /nologo win32/build/buildconf.js --add-modules-dir=../
+	mv -f $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/configure.js $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/configure.js.tmp
+	$(scriptsDir)/fixconfigure $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/configure.js.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/configure.js.tmp $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/configure.js
+
+$(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Makefile: $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/configure.js
+	cd $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php && VC9x86env.cmd cscript.exe /nologo configure.js --enable-xcache-coverager --enable-xcache-constant --enable-xcache-disassembler --enable-zts \
+				--with-php-build="$$(cygpath -wa $(topdir)/win32build)" \
+				--disable-all --enable-object-out-dir=. --enable-debug-pack \
+				--enable-xcache=yes,shared
+	mv -f $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Makefile $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Makefile.tmp
+	$(scriptsDir)/fixmakefile $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Makefile.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Makefile.tmp $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Makefile
+
+$(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Release_TS/php_xcache.dll: $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Makefile
+	cd $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php && MAKEFLAGS= VC9x86env.cmd nmake.exe /nologo php_xcache.dll
+
+$(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/.stamp-update: $(topdir)/php-devel/php-5.4.3/.stamp-unpack $(topdir)/xcache/.stamp.trunk
+	rm -rf $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php
+	rsync -v -au $(topdir)/php-devel/php-5.4.3/ $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/
+	test -f $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/win32/build/ || rsync -v -au $(topdir)/php-devel/win32build/build/ $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/win32/build/
+	$(scriptsDir)/fixsource $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Release/
+	cp -v -au $(topdir)/php-devel/php-5.4.3-nts-Win32-VC9-x86/php*.lib $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Release/
+	mkdir -p $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/xcache
+	rsync -v -Cau $(topdir)/xcache/xcache-trunk/ $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/xcache/
+	touch $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/.stamp-update
+
+$(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/configure.js: $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/.stamp-update
+	cd $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php && VC9x86env.cmd cscript /nologo win32/build/buildconf.js --add-modules-dir=../
+	mv -f $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/configure.js $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/configure.js.tmp
+	$(scriptsDir)/fixconfigure $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/configure.js.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/configure.js.tmp $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/configure.js
+
+$(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Makefile: $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/configure.js
+	cd $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php && VC9x86env.cmd cscript.exe /nologo configure.js --enable-xcache-coverager --enable-xcache-constant --enable-xcache-disassembler --disable-zts \
+				--with-php-build="$$(cygpath -wa $(topdir)/win32build)" \
+				--disable-all --enable-object-out-dir=. --enable-debug-pack \
+				--enable-xcache=yes,shared
+	mv -f $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Makefile $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Makefile.tmp
+	$(scriptsDir)/fixmakefile $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Makefile.tmp
+	mv -f $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Makefile.tmp $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Makefile
+
+$(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Release/php_xcache.dll: $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Makefile
+	cd $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php && MAKEFLAGS= VC9x86env.cmd nmake.exe /nologo php_xcache.dll
+
+package: all
+	scripts/updatepackage
+
+alltargets:  $(topdir)/build/XCache-trunk-php-5.1.6-Win32/php/Release_TS/php_xcache.dll $(topdir)/build/XCache-trunk-php-5.2.17-Win32-VC6-x86/php/Release_TS/php_xcache.dll $(topdir)/build/XCache-trunk-php-5.2.17-nts-Win32-VC6-x86/php/Release/php_xcache.dll $(topdir)/build/XCache-trunk-php-5.3.13-Win32-VC9-x86/php/Release_TS/php_xcache.dll $(topdir)/build/XCache-trunk-php-5.3.13-nts-Win32-VC9-x86/php/Release/php_xcache.dll $(topdir)/build/XCache-trunk-php-5.4.3-Win32-VC9-x86/php/Release_TS/php_xcache.dll $(topdir)/build/XCache-trunk-php-5.4.3-nts-Win32-VC9-x86/php/Release/php_xcache.dll
+
+clean: 
+
Index: /autobuild/README
===================================================================
--- /autobuild/README	(revision 905)
+++ /autobuild/README	(revision 905)
@@ -0,0 +1,32 @@
+======================================
+step 1:
+	mkdir xcache-trunk
+	cd xcache-trunk
+	svn co svn://svn.lighttpd.net/xcache/trunk xcache
+outputs:
+	xcache-trunk/xcache/ (xcache source)
+
+======================================
+step 2 files:
+	win32build.zip (simplified win32build.zip)
+	get (script to get source)
+	prepare (script to simplify php source)
+outputs:
+	win32build/ (unzip manually)
+	php-x.y.z-prepare.log (simplify log)
+	php-x.y.z/ (simplified php source, with php5+ win32 building system)
+
+======================================
+step 3 files:
+	snapshot (script to make snapshot)
+outputs:
+	xcache-r$REV.svn.log (`svn up` log)
+	xcache-r$REV.tar.gz (snapshot)
+
+======================================
+step 4 files:
+	rules.mak (makefile-alike sh script)
+	run (script to run builders, run snapshot)
+	build (builder script)
+outputs:
+	build-for-php-x.y.z-Win32-XCache-r$REV.zip (win32 autobuild zip file)
Index: /autobuild/bootstrap
===================================================================
--- /autobuild/bootstrap	(revision 905)
+++ /autobuild/bootstrap	(revision 905)
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec scripts/bootstrap "$@"
Index: /autobuild/run
===================================================================
--- /autobuild/run	(revision 905)
+++ /autobuild/run	(revision 905)
@@ -0,0 +1,2 @@
+#!/bin/sh
+./bootstrap && make
Index: /autobuild/scripts/autobuild
===================================================================
--- /autobuild/scripts/autobuild	(revision 905)
+++ /autobuild/scripts/autobuild	(revision 905)
@@ -0,0 +1,126 @@
+#!/bin/sh
+
+isTest() { # {{{1
+	[[ ! -z "$isTest" ]]
+}
+
+cd() { # {{{1
+	builtin cd "$@"
+	if isTest ; then
+		if [[ $OLDPWD != $PWD ]]; then
+			echo cd "$PWD"
+		fi
+	fi
+}
+
+getOutputDir() { # {{{1
+	valueof "$1"OutputDir
+}
+
+getSubdirs() { # {{{1
+	pushd "$1" >/dev/null 2>&1
+	local dir
+	for dir in *; do
+		[[ -d $dir ]] && echo "$dir"
+	done
+	popd >/dev/null 2>&1
+}
+# }}}
+
+getExtVersions() { # {{{1
+	local ext=$1
+	local len=${#ext}
+	local dir
+	((len=len+1))
+	getSubdirs "$topdir/$1" | while read dir; do
+		echo ${dir:$len}
+	done
+}
+
+loadExt() { # {{{1
+	ext="$1"
+	extDir="$topdir/$ext"
+
+	phpVersions=("${phpVersions[@]}")
+	extVersions=($(getExtVersions "$ext"))
+
+	configFile="$extDir/.config"
+	if [[ ! -f $configFile ]]; then
+		die "$configFile not found"
+	fi
+	. "$configFile"
+	unset configFile
+}
+
+foreachExt() { # {{{1
+	local ext
+	for ext in "${exts[@]}"; do (
+			loadExt "$ext"
+			"$@"
+	); done
+}
+
+loadExtVersion() { # {{{1
+	extVersion="$1"
+	extDirVersioned="$topdir/$ext/$ext-$extVersion"
+	configFile="$extDirVersioned/.config"
+	if [[ -f $configFile ]]; then
+		. "$configFile"
+	fi
+	unset configFile
+}
+
+foreachExtVersion() { # {{{1
+	local extVersion
+	for extVersion in "${extVersions[@]}"; do (
+			loadExtVersion "$extVersion"
+		"$@"
+	); done
+}
+
+loadPhpVersion() { # {{{1
+	phpVersion="$1"
+	phpSourcePackage="$sourceDir/php-$phpVersion.tar.bz2"
+	develDirVersioned="$develDir/php-$phpVersion"
+}
+
+foreachPhpVersion() { # {{{1
+	local phpVersion
+	for phpVersion in "${phpVersions[@]}"; do (
+		loadPhpVersion "$phpVersion"
+		"$@"
+	); done
+}
+foreachPhpReleaseVersion() { # {{{1
+	local arch
+	local compiler
+	local nts
+	local phpReleaseVersion
+	local phpReleaseDir
+
+	for nts in '' '-nts'; do
+		case "$phpVersion" in
+		4.*|5.0.*|5.1.*)
+			phpReleaseVersion="php-$phpVersion-Win32"
+			phpReleaseDir="$develDir/$phpReleaseVersion"
+			arch=x86
+			compiler=VC6
+			nts=
+			"$@"
+			break
+			;;
+		*)
+			for compiler in "${compilers[@]}"; do
+				for arch in "${arches[@]}"; do
+					phpReleaseVersion=php-$phpVersion$nts-Win32-$compiler-$arch$snapVersion
+					phpReleaseDir="$develDir/$phpReleaseVersion"
+					phpReleaseFile="$sourceDir/$phpReleaseVersion"
+					if [[ -d $phpReleaseDir || -f $phpReleaseFile ]]; then
+						"$@"
+					fi
+				done
+			done
+		esac
+	done
+}
+# }}}
Index: /autobuild/scripts/bootstrap
===================================================================
--- /autobuild/scripts/bootstrap	(revision 905)
+++ /autobuild/scripts/bootstrap	(revision 905)
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec scripts/generateMakefile
Index: /autobuild/scripts/common
===================================================================
--- /autobuild/scripts/common	(revision 905)
+++ /autobuild/scripts/common	(revision 905)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+if [[ ! -f .config ]]; then
+	echo "Missing .config in ./" >&2
+	exit 1
+fi
+
+if [[ -f ./"test" ]]; then
+	isTest=1
+	. ./test
+	VERBOSE=-v
+else
+	isTest=""
+	VERBOSE=
+fi
+
+. scripts/utils
+. scripts/autobuild
+. .config
Index: /autobuild/scripts/download
===================================================================
--- /autobuild/scripts/download	(revision 905)
+++ /autobuild/scripts/download	(revision 905)
@@ -0,0 +1,106 @@
+#!/bin/sh
+. scripts/common
+
+download() {
+	local file="$1"
+	local url="$2"
+	local ret
+	if [[ -f $file ]]; then
+		return 0
+	fi
+	begin "Downloading $url to $file"; {
+		if type aria2c >/dev/null 2>/dev/null; then
+			(
+			builtin cd "$(dirname "$file")"
+			aria2c -j4 -o "$(basename "$file.tmp")" "$url" && mv "$file.tmp" "$file"
+			)
+			ret=$?
+		elif type wget >/dev/null 2>/dev/null; then
+			wget -c -O "$file.tmp" "$url" && mv "$file.tmp" "$file"
+			ret=$?
+		else
+			curl -C - -o "$file.tmp" "$url" && mv "$file.tmp" "$file"
+			ret=$?
+		fi
+		rm -f "$file.tmp"
+	};
+	[[ -z $ret ]] && end || end "not found"
+	
+	return $ret
+}
+
+cleanup() {
+	local file
+	for file in "$sourceDir/"*.bz2 "$sourceDir/"*.zip; do
+		if [[ -f $file && ! -s $file ]]; then
+			rm -f "$file"
+		fi
+	done
+	exit
+}
+
+downloadPhp() {
+	local filename
+	local arch
+	local compiler
+	local nts
+	local downloaded
+	local type
+	local snapVersion
+
+	case "$phpVersion" in
+	*-dev-*)
+		type="snaps"
+		snapVersion=-${phpVersion##*-}
+		phpVersion=${phpVersion%-*}
+		filename="php$phpVersion$snapVersion.tar.bz2"
+		filename=${filename/0.-dev-/-}
+		download "$sourceDir/php-$phpVersion$snapVersion.tar.bz2" "http://snaps.php.net/$filename"
+		;;
+	*)
+		type="releases"
+		filename="php-$phpVersion.tar.bz2"
+		target="$sourceDir/$filename"
+		download "$target" "http://$mirror/get/$filename/from/$mirror/mirror" \
+		|| download "$target" "http://museum.php.net/php5/$filename"
+		;;
+	esac
+
+	downloaded=
+	for nts in '' '-nts'; do
+		case "$phpVersion" in
+		4.*|5.0.*|5.1.*)
+			;;
+		*)
+			for compiler in "${compilers[@]}"; do
+				for arch in "${arches[@]}"; do
+					filename=php-$phpVersion$nts-Win32-$compiler-$arch$snapVersion.zip
+					download "$sourceDir/$filename" "http://windows.php.net/downloads/$type/$filename"
+					if [[ -s "$sourceDir/$filename" ]]; then
+						downloaded=1
+					fi
+				done
+			done
+		esac
+	done
+	if [[ -z $downloaded ]]; then
+		filename=php-$phpVersion-Win32.zip
+		target="$sourceDir/$filename"
+		download "$target" "http://$mirror/get/$filename/from/$mirror/mirror" \
+		|| download "$target" "http://museum.php.net/php5/$filename"
+	fi
+}
+
+trap cleanup exit
+
+case $# in
+0)
+	foreachPhpVersion downloadPhp
+	;;
+1)
+	loadPhpVersion "$1"
+	downloadPhp
+	;;
+esac
+
+exit 0
Index: /autobuild/scripts/extupdate
===================================================================
--- /autobuild/scripts/extupdate	(revision 905)
+++ /autobuild/scripts/extupdate	(revision 905)
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+. scripts/common
+. scripts/svn
+
+[[ $# != 2 ]] && die "Usage: $0 <extensionName> <extensionVersion>"
+
+loadExt "$1"
+loadExtVersion "$2"
+
+[[ ! -d "$extDirVersioned" ]] && die "$extDirVersioned not found"
+
+stamp="$extDir/.stamp.${extVersion}"
+
+svnUp "$extDirVersioned" || die
+svnRevOf "$extDirVersioned" > "$stamp.tmp"
+cmp "$stamp.tmp" "$stamp" >/dev/null 2>&1 || mv "$stamp.tmp" "$stamp"
+rm -f "$stamp.tmp"
Index: /autobuild/scripts/fixconfigure
===================================================================
--- /autobuild/scripts/fixconfigure	(revision 905)
+++ /autobuild/scripts/fixconfigure	(revision 905)
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+. scripts/common
+
+[[ $# -lt 1 ]] && die "Usage: $0 <path/to/configure.js>"
+
+sed -i -e 's/"php[456]/"php" + PHP_VERSION + "/' "$@" || die
+sed -i -e "s#ERROR(.bison#// \\0/#" -e "s#ERROR(.flex#// \\0#" -e 's#\[\\\\\\\\\/\.]#[^a-zA-Z0-9_]#g' "$@" || die
+sed -i -e "s#ERROR(.No SAPI selected#// \\0/#" -e '/output_as_table.*sapi_enabled/d' "$@" || die
+# ignore icu checking
+sed -i -e 's#\(ADD_FLAG(.*icuuc.lib\)[^"'"'"']*#\1#' "$@" || die
Index: /autobuild/scripts/fixmakefile
===================================================================
--- /autobuild/scripts/fixmakefile	(revision 905)
+++ /autobuild/scripts/fixmakefile	(revision 905)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+. scripts/common
+
+[[ $# -lt 1 ]] && die "Usage: $0 <path/to/Makefile>"
+
+sed -i -e '/$(PHPDLL):/d' -e '/$(PHPLIB):/d' "$@" || die
Index: /autobuild/scripts/fixsource
===================================================================
--- /autobuild/scripts/fixsource	(revision 905)
+++ /autobuild/scripts/fixsource	(revision 905)
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+. scripts/common
+
+[[ $# -lt 1 ]] && die "Usage: $0 <path/to/phpsource>"
+
+src="$1"
+
+f="$src/ext/date/lib/timelib_structs.h"
+if [[ -f $f ]]; then
+	sed -i 's/<timelib_config.h>/"timelib_config.h"/' "$f"
+
+	f="$src/ext/date/lib/timelib_config.h"
+	if [[ ! -f $f ]]; then
+		cat > "$f" <<EOF
+#ifdef PHP_WIN32
+# include "config.w32.h"
+#else
+# include <php_config.h>
+#endif
+EOF
+	fi
+	echo "Added ext/date/lib/timelib_config.h"
+fi
+
+f="$src/main/snprintf.h"
+if [[ -f $f ]]; then
+	sed -i 's/#if SIZEOF_LONG_LONG_INT/#ifdef PHP_WIN32\n# define WIDE_INT       __int64\n#elif SIZEOF_LONG_LONG_INT/' "$f"
+fi
+
+f="$src/win32/build/config.w32.h.in"
+sed -i 's/^#define HAVE_SOCKLEN_T 1$/#if defined(_MSC_VER) \&\& _MSC_VER > 1299\n\0\n#endif/' "$f"
Index: /autobuild/scripts/generateMakefile
===================================================================
--- /autobuild/scripts/generateMakefile	(revision 905)
+++ /autobuild/scripts/generateMakefile	(revision 905)
@@ -0,0 +1,157 @@
+#!/bin/sh
+# vim:syntax=sh:sw=2:ts=2
+. scripts/common
+
+exec 3>Makefile.tmp
+exec 4>all.tmp
+exec 5>clean.tmp
+
+rule() {
+	local target="$1"
+	local source="$2"
+	shift 2
+	echo "$target: $source" >&3
+	local command
+	for command in "$@"; do
+		echo -ne "\t" >&3
+		echo "$command" >&3
+	done
+	echo >&3
+}
+
+addAllRule() {
+	echo -n " $@" >&4
+}
+
+addCleanRule() {
+	echo -n " $@" >&5
+}
+
+rule all 'Makefile unpackphp alltargets'
+begin "Generating rule for download"; {
+	rule "$sourceDir/.stamp-download download" '' \
+		"$scriptsDir/download \$(PHP_VERSION)" \
+		"touch $sourceDir/.stamp-download"
+	rule "Makefile" ".config $sourceDir/.stamp-download $(echo "$scriptsDir"/{common,utils,autobuild})" \
+		"$scriptsDir/generateMakefile"
+}; end
+
+rule "$develDir/.stamp-unpack unpackphp" "$(printf " $develDir/php-%s/.stamp-unpack" "${phpVersions[@]}")"
+
+rulePhpVersion() {
+	begin "Generating rule for devel/$phpVersion"; {
+		cleararray binaryPackageStamp
+		local binaryPackage
+		for binaryPackage in "$sourceDir/php-$phpVersion"*Win32*.zip; do
+			if [[ -s $binaryPackage ]]; then
+				local binaryPackageDir="$develDir/$(basename "$binaryPackage" .zip)"
+				local stampFile="$binaryPackageDir/.stamp-unpack"
+				rule "$stampFile" "$binaryPackage" \
+					"mkdir -p $binaryPackageDir" \
+					"$scriptsDir/unpackphpbinary $phpVersion $binaryPackage $binaryPackageDir" \
+					"touch $stampFile"
+				pushv binaryPackageStamp "$stampFile"
+			fi
+		done
+
+		rule "$develDirVersioned/.stamp-unpack" "$phpSourcePackage ${binaryPackageStamps[*]}" \
+			"mkdir -p $develDirVersioned" \
+			"$scriptsDir/unpackphpsource $phpVersion $phpSourcePackage $develDirVersioned" \
+			"touch $develDirVersioned/.stamp-unpack"
+	}; end
+}
+
+foreachPhpVersion rulePhpVersion
+
+ruleBuild() {
+	local extVersionedStamp
+	extVersionedStamp="$extDir/.stamp.${extVersion}"
+	local name
+	local buildDirVersioned
+
+	begin "Generating rule for $ext-$extVersion build for $phpReleaseVersion"; {
+		name="$extNiceName-$extVersion-$phpReleaseVersion"
+		buildDirVersioned="$buildDir/$name"
+
+		local _TS=
+		[[ ! -z $nts ]] && _TS=
+		[[ -z $nts ]] && _TS=_TS
+
+		rule "$buildDirVersioned/.stamp-update" "$develDirVersioned/.stamp-unpack $extVersionedStamp" \
+			"rm -rf $buildDirVersioned/" \
+			"mkdir -p $buildDirVersioned/php" \
+			"rsync $VERBOSE -au $develDirVersioned/ $buildDirVersioned/php/" \
+			"test -f $buildDirVersioned/php/win32/build/ || rsync $VERBOSE -au $develDir/win32build/build/ $buildDirVersioned/php/win32/build/" \
+			"$scriptsDir/fixsource $buildDirVersioned/php/" \
+			"mkdir -p $buildDirVersioned/php/Release${_TS}/" \
+			"cp $VERBOSE -au $phpReleaseDir/php*.lib $buildDirVersioned/php/Release${_TS}/" \
+			"mkdir -p $buildDirVersioned/$ext" \
+			"rsync $VERBOSE -Cau $extDirVersioned/ $buildDirVersioned/$ext/" \
+			"touch $buildDirVersioned/.stamp-update"
+
+		rule "$buildDirVersioned/php/configure.js" "$buildDirVersioned/.stamp-update" \
+			"cd $buildDirVersioned/php && ${compiler}${arch}env.cmd cscript /nologo win32/build/buildconf.js --add-modules-dir=../" \
+			"mv -f $buildDirVersioned/php/configure.js $buildDirVersioned/php/configure.js.tmp" \
+			"$scriptsDir/fixconfigure $buildDirVersioned/php/configure.js.tmp" \
+			"mv -f $buildDirVersioned/php/configure.js.tmp $buildDirVersioned/php/configure.js"
+
+		local args=("${configureFlags[@]}")
+		local phpMajorVersion=$(getVersionPart 0 "$phpVersion")
+		[[ $phpMajorVersion -ge 6 ]] && pushv arg --with-static-icu
+		[[ ! -z $nts ]] && pushv arg --disable-zts
+		[[ -z $nts ]] && pushv arg --enable-zts
+		rule "$buildDirVersioned/php/Makefile" "$buildDirVersioned/php/configure.js" \
+			"cd $buildDirVersioned/php && ${compiler}${arch}env.cmd cscript.exe /nologo configure.js ${args[*]} \\
+				--with-php-build=\"\$\$(cygpath -wa $topdir/win32build)\" \\
+				--disable-all --enable-object-out-dir=. --enable-debug-pack \\
+				--enable-$ext=yes,shared" \
+			"mv -f $buildDirVersioned/php/Makefile $buildDirVersioned/php/Makefile.tmp" \
+			"$scriptsDir/fixmakefile $buildDirVersioned/php/Makefile.tmp" \
+			"mv -f $buildDirVersioned/php/Makefile.tmp $buildDirVersioned/php/Makefile"
+
+		local extDll="$buildDirVersioned/php/Release${_TS}/php_${ext}.dll"
+		rule "$extDll" "$buildDirVersioned/php/Makefile" \
+			"cd $buildDirVersioned/php && MAKEFLAGS= ${compiler}${arch}env.cmd nmake.exe /nologo php_${ext}.dll" \
+
+		addAllRule "$extDll"
+	}; end
+}
+
+forExtVersion() {
+	local extVersionedStamp
+	extVersionedStamp="$extDir/.stamp.${extVersion}"
+
+	rule "update-$ext" "update-$ext-$extVersion"
+	rule "update-$ext-$extVersion $extVersionedStamp" "" \
+		"$scriptsDir/extupdate $ext $extVersion"
+}
+
+forExt() {
+	begin "Generating svn update rule for $ext-$extVersion"; {
+		rule update update-$ext
+		foreachExtVersion forExtVersion
+	}; end
+	foreachExtVersion foreachPhpVersion foreachPhpReleaseVersion ruleBuild
+}
+
+foreachExt forExt
+
+rule "package" "all" "scripts/updatepackage"
+
+exec 4>&-
+rule alltargets "$(cat all.tmp)"
+rm -f all.tmp
+
+exec 5>&-
+rule clean "$(cat clean.tmp)"
+rm -f clean.tmp
+
+exec 3>&-
+{
+	echo "topdir=$topdir"
+	echo "scriptsDir=$scriptsDir"
+	sed Makefile.tmp \
+		-e "s#$scriptsDir#\$(scriptsDir)#g" \
+		-e "s#$topdir#\$(topdir)#g"
+	rm -f Makefile.tmp
+} > Makefile
Index: /autobuild/scripts/svn
===================================================================
--- /autobuild/scripts/svn	(revision 905)
+++ /autobuild/scripts/svn	(revision 905)
@@ -0,0 +1,14 @@
+# vim:ts=2:sw=2:syntax=sh
+
+svnRevOf() {
+	LANG=C svn info "$@" | grep 'Last Changed Rev:' | cut -d' ' -f 4
+}
+
+svnUp() {
+	if [[ ! -z $nonet ]]; then
+		return
+	fi
+
+	LANG=C svn up "$@"
+}
+
Index: /autobuild/scripts/unpackphpbinary
===================================================================
--- /autobuild/scripts/unpackphpbinary	(revision 905)
+++ /autobuild/scripts/unpackphpbinary	(revision 905)
@@ -0,0 +1,65 @@
+#!/bin/bash
+. scripts/common
+
+[[ $# != 3 ]] && "Usage: $0 <phpVersion> <binaryPackage> <directory>"
+phpVersion="$1"
+binaryPackage="$2"
+[[ -s $binaryPackage ]] || die "$binaryPackage not found as a file"
+binaryPackageDir="$3"
+[[ -d $binaryPackageDir ]] || die "$binaryPackageDir not found as a directory"
+
+
+begin "Cleaning $binaryPackageDir"; {
+	rm -rf "$binaryPackageDir"
+	mkdir "$binaryPackageDir/"
+}; end
+
+phpVersionMajor=$(getVersionPart 0 $phpVersion)
+phpVersionMinor=$(getVersionPart 1 $phpVersion)
+
+case "$(basename "$binaryPackage")" in
+*-nts-*)
+	ts=
+	;;
+*)
+	ts=ts
+	;;
+esac
+
+if [[ $phpVersionMajor -lt 5 ]]; then
+	binaryFiles=($(printf " php-$phpVersion/%s" "${binaryFiles[@]}"))
+fi
+
+echo "Unpacking $binaryFiles ..."; {
+	rm -rf "$binaryPackageDir.tmp"
+	mkdir "$binaryPackageDir.tmp" || die "failed chdir $binaryPackageDir"
+	cd "$binaryPackageDir.tmp" || die "failed chdir $binaryPackageDir"
+	unzip -o "$binaryPackage" || die "failed unpacking"
+
+	if [[ -d $binaryPackageDir.tmp/php-$phpVersion ]]; then
+		mv "$binaryPackageDir.tmp/php-$phpVersion"/* "$binaryPackageDir.tmp/"
+		rmdir "$binaryPackageDir.tmp/php-$phpVersion"
+	fi
+
+	for subdir in sapi dev; do
+		if [[ -d $binaryPackageDir.tmp/$subdir/ ]]; then
+			mv -v "$binaryPackageDir.tmp/$subdir"/* "$binaryPackageDir.tmp/"
+		fi
+	done
+
+	if [[ ! -f $binaryPackageDir.tmp/php-cgi.exe ]]; then
+		mv "$binaryPackageDir.tmp/php.exe" "$binaryPackageDir.tmp/php-cgi.exe"
+	fi
+
+	if [[ -f $binaryPackageDir.tmp/cli/php.exe ]]; then
+		mv "$binaryPackageDir.tmp/cli/php.exe" "$binaryPackageDir.tmp/php.exe"
+	fi
+
+	for filename in "php${phpVersionMajor}${ts}.dll" "php${phpVersionMajor}${ts}.lib" php-cgi.exe php.exe; do
+		mv -v "$binaryPackageDir.tmp/$filename" "$binaryPackageDir/" || die
+	done
+	mv -v "$binaryPackageDir.tmp/"php${phpVersionMajor}apache*.dll "$binaryPackageDir/"
+
+	cd ..
+	rm -rf "$binaryPackageDir.tmp"
+}
Index: /autobuild/scripts/unpackphpsource
===================================================================
--- /autobuild/scripts/unpackphpsource	(revision 905)
+++ /autobuild/scripts/unpackphpsource	(revision 905)
@@ -0,0 +1,68 @@
+#!/bin/bash
+. scripts/common
+
+[[ $# != 3 ]] && die "Usage: $0 <phpVersion> <phpSourcePackage> <directory>"
+phpVersion="$1"
+phpSourcePackage="$2"
+[[ -s $phpSourcePackage ]] || die "$phpSourcePackage not found as a file"
+unpackDir="$3"
+[[ -d $unpackDir ]] || die "$unpackDir not found as a directory"
+
+
+begin "Cleaning $unpackDir"; {
+	rm -rf "$unpackDir"
+	rm -rf "$unpackDir.tmp"
+	mkdir "$unpackDir/"
+}; end
+
+phpVersionMajor=$(getVersionPart 0 $phpVersion)
+phpVersionMinor=$(getVersionPart 1 $phpVersion)
+
+sourceFiles=(configure.in main/internal_functions.c.in)
+if [[ $phpVersionMajor -ge 5 ]]; then
+	pushv sourceFile "win32/build"
+fi
+
+headerDirs=(main TSRM Zend win32 ext/standard)
+if [[ $phpVersionMajor -gt 5 ]] || [[ $phpVersionMajor -eq 5 && $phpVersionMinor -gt 0 ]]; then
+	pushv headerDir ext/date
+fi
+if [[ $phpVersionMajor -lt 5 ]] || [[ $phpVersionMajor -eq 5 && $phpVersionMinor -lt 2 ]] || [[ $phpVersionMajor -eq 6 ]]; then
+	pushv sourceFile README.CVS-RULES 
+else
+	pushv sourceFile README.SVN-RULES 
+fi
+if [[ $phpVersionMajor -lt 5 ]] || [[ $phpVersionMajor -eq 5 && $phpVersionMinor -lt 3 ]]; then
+	pushv headerDir regex
+fi
+for headerDir in "${headerDirs[@]}"; do
+	pushv sourceFile "$headerDir/*.h"
+done
+
+case "$phpVersion" in
+*-dev-*)
+	prefix="php${phpVersion/.0-dev-/-}"
+	prefix="${prefix%-*}-*"
+	;;
+*)
+	prefix="php-$phpVersion"
+	;;
+esac
+sourcePaths=()
+for sourceFile in "${sourceFiles[@]}"; do
+	pushv sourcePath "$prefix/$sourceFile"
+done
+echo "Unpacking ${sourceFiles[@]} ..."; {
+	rm -rf "$unpackDir.tmp" || die
+	mkdir "$unpackDir.tmp" || die
+	cd "$unpackDir.tmp" || die
+	tar --wildcards -jxvf "$phpSourcePackage" "${sourcePaths[@]}" || die "failed unpacking"
+	mv "$unpackDir.tmp/"$prefix/* "$unpackDir/"
+	cd ..
+	rm -rf "$unpackDir.tmp"
+}
+
+if [[ $phpVersionMajor -ge 5 ]] && [[ ! -d $develDir/win32build/build ]]; then
+	mkdir -p "$develDir/win32build"
+	cp -v -uaR "$unpackDir"/win32/build $develDir/win32build/build
+fi
Index: /autobuild/scripts/updatepackage
===================================================================
--- /autobuild/scripts/updatepackage	(revision 905)
+++ /autobuild/scripts/updatepackage	(revision 905)
@@ -0,0 +1,95 @@
+#!/bin/bash
+. scripts/common
+. scripts/svn
+
+packSource() {
+	local args="$1"
+	local suffix="$2"
+	local file="$outputDir/$ext-$extVersion$rev$suffix"
+
+	if [[ ! -f $file ]]; then
+		pushd "$extDir" >/dev/null || die
+		tar $VERBOSE --exclude tags --exclude .svn "$args" "$file.tmp" $ext-$extVersion || die
+		popd >/dev/null
+		mv "$file.tmp" "$file"
+		md5sum "$file" | sed 's#/.*/##' > "$file.md5.txt"
+	fi
+}
+
+packBinary() {
+	local buildDirVersioned="$buildDir/$extNiceName-$extVersion-$phpReleaseVersion"
+	[[ ! -d "$buildDirVersioned" ]] && return
+	local output="$outputDir$rev/"
+	local _TS=
+	[[ ! -z $nts ]] && _TS=
+	[[ -z $nts ]] && _TS=_TS
+	local distDir="$buildDirVersioned/php/Release${_TS}"
+
+	local -a files
+	local outputFile="$outputDir/$extNiceName-$extVersion$rev-$phpReleaseVersion"
+	if [[ ! -f $outputFile.zip || ! -f $outputFile-pdb.zip ]]; then
+		pushd "$buildDirVersioned/php" >/dev/null || die
+		pushv file "Release${_TS}/php_$ext.dll"
+		local i
+		for i in "${packageFiles[@]}" ; do
+			local f="$buildDirVersioned/$ext/$i"
+			if [[ -e $f ]]; then
+				dstdir="$distDir/"$(dirname "$i")
+				if [[ ! -d $dstdir ]]; then
+					mkdir -p "$dstdir"
+				fi
+				rm -rf "$distDir/$i"
+				cp -a "$f" "$distDir/$i"
+				pushv file "Release${_TS}/$i"
+			fi
+		done
+
+		zip tmp.zip $(find "${files[@]}") || die
+		mv tmp.zip "$outputFile.zip"
+		md5sum "$outputFile.zip" > "$outputFile.zip.md5.txt"
+
+		zip tmp.zip "Release${_TS}/php_$ext.pdb"
+		mv tmp.zip "$outputFile-pdb.zip"
+		md5sum "$outputFile-pdb.zip" > "$outputFile-pdb.zip.md5.txt"
+		popd >/dev/null
+	fi
+}
+
+pack() {
+	local prefix=
+	if [[ -z $release ]]; then
+		rev=-r$(svnRevOf $extDirVersioned)
+		prefix="$snapshotOutputDir/$extVersion"
+	else
+		prefix="$releaseOutputDir/$extVersion"
+	fi
+	local outputDir="$prefix$rev"
+	mkdir -p "$outputDir"
+
+	packSource -jcf .tar.bz2
+	packSource -zcf .tar.gz
+	foreachPhpVersion foreachPhpReleaseVersion packBinary
+	
+	local files=$(shopt -s nullglob; echo "$prefix"*)
+	if [[ ! -z $files ]]; then
+		rm $VERBOSE -rf `ls -td $files | sed -n ${snapshotCount:-8}',$p'`
+	fi
+}
+
+case $# in
+0)
+	foreachExt foreachExtVersion pack
+	;;
+1)
+	loadExt "$1"
+	foreachExtVersion pack
+	;;
+2)
+	loadExt "$1"
+	loadExtVersion "$2"
+	pack
+	;;
+*)
+	die "Usage: $0 [ext [extVersion]]"
+	;;
+esac
Index: /autobuild/scripts/utils
===================================================================
--- /autobuild/scripts/utils	(revision 905)
+++ /autobuild/scripts/utils	(revision 905)
@@ -0,0 +1,137 @@
+#!/bin/sh
+
+# variable functions
+valueof() { # {{{1
+	eval echo '"$'$1'"'
+}
+valuesof() { # {{{1
+	eval echo '"${'$1'[@]}"'
+}
+storevalueof() { # {{{1
+	eval $1'="$'$2'"'
+}
+storevaluesof() { # {{{1
+	eval $1'="${'$2'[@]}"'
+}
+cleararray() { # {{{1
+	unset "${1}s"
+}
+pushv() { # {{{1
+	local name=$1
+	shift
+	local n=$(sizeof "$name")
+	while [[ $# -gt 0 ]]; do
+		eval "${name}s[$n]"='"$1"'
+		((n=n+1))
+		shift
+	done
+}
+push() { # {{{1
+	local n=$(sizeof "$1")
+	eval "${1}s[$n]=$""${1}"
+	eval "${1}="
+}
+pop() { # {{{1
+	local n=$(($(sizeof "$1") - 1))
+	eval $1='${'"${1}s[$n]}"
+	eval unset "'${1}s[$n]'"
+}
+sizeof() { # {{{1
+	eval echo '${#'"${1}s[@]}"
+}
+# }}}
+
+filter_in() { # {{{1
+	local pattern="$1"
+	shift
+	local value
+	for value in "$@"; do
+		eval '
+		case "$value" in
+		'$pattern')
+			echo "$value"
+			;;
+		esac
+		'
+	done
+}
+filter_out() { # {{{1
+	local pattern="$1"
+	shift
+	local value
+	for value in "$@"; do
+		eval '
+		case "$value" in
+		'$pattern')
+			;;
+		*)
+			echo "$value"
+			;;
+		esac
+		'
+	done
+}
+getVersionPart() { # {{{1
+	local part="$1"
+	local version="$2"
+	local parts="${version//./ }"
+	parts="${parts//-/ }"
+	parts=($parts)
+	echo "${parts[$part]}"
+}
+# }}}
+
+# shell functions
+die() { # {{{1
+	echo "*** ERROR: $*" >&2
+	exit 1
+}
+
+do_textfile() { # {{{1
+	if isTest; then
+		unix2dos -D "$@"
+	else
+		unix2dos -D "$@" >/dev/null 2>&1
+	fi
+}
+namize() { # {{{1
+	local args='s#[^a-zA-Z0-9]#_#g'
+	if [[ $# == 0 ]]; then
+		sed $args
+	else
+		echo "$*" | sed $args
+	fi
+}
+# }}}
+toupper() { # {{{1
+	local args='[:lower:] [:upper:]'
+	if [[ $# == 0 ]]; then
+		tr $args
+	else
+		echo "$*" | tr $args
+	fi
+}
+
+tolower() { # {{{1
+	local args='[:upper:] [:lower:]'
+	if [[ $# == 0 ]]; then
+		tr $args
+	else
+		echo "$*" | tr $args
+	fi
+}
+# }}}
+
+begin() { # {{{1
+	printf "%s" "$* ..."
+}
+
+end() { # {{{1
+	if [[ $# == 0 ]]; then
+		echo " done"
+	else
+		echo " $*"
+	fi
+	return 0
+}
+# }}}
Index: /autobuild/win32build/include/arpa/nameser.h
===================================================================
--- /autobuild/win32build/include/arpa/nameser.h	(revision 905)
+++ /autobuild/win32build/include/arpa/nameser.h	(revision 905)
@@ -0,0 +1,396 @@
+/*
+ * ++Copyright++ 1983, 1989, 1993
+ * -
+ * Copyright (c) 1983, 1989, 1993
+ *    The Regents of the University of California.  All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ * 	This product includes software developed by the University of
+ * 	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ * 
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * -
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software.  No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE.  IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ * --Copyright--
+ */
+
+/*
+ *      @(#)nameser.h	8.1 (Berkeley) 6/2/93
+ *	$Id: nameser.h,v 8.11 1996/10/08 04:51:02 vixie Exp $
+ */
+
+#ifndef _NAMESER_H_
+#define _NAMESER_H_
+
+#ifndef WINNT
+#include <sys/param.h>
+#endif
+#if (!defined(BSD)) || (BSD < 199306)
+# include <sys/bitypes.h>
+#else
+# include <sys/types.h>
+#endif
+#include <sys/cdefs.h>
+
+#ifdef _AUX_SOURCE
+# include <sys/types.h>
+#endif
+
+/*
+ * revision information.  this is the release date in YYYYMMDD format.
+ * it can change every day so the right thing to do with it is use it
+ * in preprocessor commands such as "#if (__BIND > 19931104)".  do not
+ * compare for equality; rather, use it to determine whether your resolver
+ * is new enough to contain a certain feature.
+ */
+
+#define __BIND		19960801	/* interface version stamp */
+
+/*
+ * Define constants based on rfc883
+ */
+#define PACKETSZ	512		/* maximum packet size */
+#define MAXDNAME	1025		/* maximum presentation domain name */
+#define MAXCDNAME	255		/* maximum compressed domain name */
+#define MAXLABEL	63		/* maximum length of domain label */
+#define HFIXEDSZ	12		/* #/bytes of fixed data in header */
+#define QFIXEDSZ	4		/* #/bytes of fixed data in query */
+#define RRFIXEDSZ	10		/* #/bytes of fixed data in r record */
+#define INT32SZ		4		/* for systems without 32-bit ints */
+#define INT16SZ		2		/* for systems without 16-bit ints */
+#define INADDRSZ	4		/* IPv4 T_A */
+#define IN6ADDRSZ	16		/* IPv6 T_AAAA */
+
+/*
+ * Internet nameserver port number
+ */
+#define NAMESERVER_PORT	53
+
+/*
+ * Currently defined opcodes
+ */
+#define QUERY		0x0		/* standard query */
+#define IQUERY		0x1		/* inverse query */
+#define STATUS		0x2		/* nameserver status query */
+/*#define xxx		0x3*/		/* 0x3 reserved */
+#define NS_NOTIFY_OP	0x4		/* notify secondary of SOA change */
+/*
+ * Currently defined response codes
+ */
+#if !(defined(WINNT) && defined(NOERROR))
+#define NOERROR		0		/* no error */
+#endif
+#define FORMERR		1		/* format error */
+#define SERVFAIL	2		/* server failure */
+#define NXDOMAIN	3		/* non existent domain */
+#define NOTIMP		4		/* not implemented */
+#define REFUSED		5		/* query refused */
+
+/*
+ * Type values for resources and queries
+ */
+#define T_A		1		/* host address */
+#define T_NS		2		/* authoritative server */
+#define T_MD		3		/* mail destination */
+#define T_MF		4		/* mail forwarder */
+#define T_CNAME		5		/* canonical name */
+#define T_SOA		6		/* start of authority zone */
+#define T_MB		7		/* mailbox domain name */
+#define T_MG		8		/* mail group member */
+#define T_MR		9		/* mail rename name */
+#define T_NULL		10		/* null resource record */
+#define T_WKS		11		/* well known service */
+#define T_PTR		12		/* domain name pointer */
+#define T_HINFO		13		/* host information */
+#define T_MINFO		14		/* mailbox information */
+#define T_MX		15		/* mail routing information */
+#define T_TXT		16		/* text strings */
+#define T_RP		17		/* responsible person */
+#define T_AFSDB		18		/* AFS cell database */
+#define T_X25		19		/* X_25 calling address */
+#define T_ISDN		20		/* ISDN calling address */
+#define T_RT		21		/* router */
+#define T_NSAP		22		/* NSAP address */
+#define T_NSAP_PTR	23		/* reverse NSAP lookup (deprecated) */
+#define T_SIG		24		/* security signature */
+#define T_KEY		25		/* security key */
+#define T_PX		26		/* X.400 mail mapping */
+#define T_GPOS		27		/* geographical position (withdrawn) */
+#define T_AAAA		28		/* IP6 Address */
+#define T_LOC		29		/* Location Information */
+#define T_NXT		30		/* Next Valid Name in Zone */
+#define T_EID		31		/* Endpoint identifier */
+#define T_NIMLOC	32		/* Nimrod locator */
+#define T_SRV		33		/* Server selection */
+#define T_ATMA		34		/* ATM Address */
+#define T_NAPTR		35		/* Naming Authority PoinTeR */
+	/* non standard */
+#define T_UINFO		100		/* user (finger) information */
+#define T_UID		101		/* user ID */
+#define T_GID		102		/* group ID */
+#define T_UNSPEC	103		/* Unspecified format (binary data) */
+	/* Query type values which do not appear in resource records */
+#define	T_IXFR		251		/* incremental zone transfer */
+#define T_AXFR		252		/* transfer zone of authority */
+#define T_MAILB		253		/* transfer mailbox records */
+#define T_MAILA		254		/* transfer mail agent records */
+#define T_ANY		255		/* wildcard match */
+
+/*
+ * Values for class field
+ */
+
+#define C_IN		1		/* the arpa internet */
+#define C_CHAOS		3		/* for chaos net (MIT) */
+#define C_HS		4		/* for Hesiod name server (MIT) (XXX) */
+	/* Query class values which do not appear in resource records */
+#define C_ANY		255		/* wildcard match */
+
+/*
+ * Flags field of the KEY RR rdata
+ */
+#define	KEYFLAG_TYPEMASK	0xC000	/* Mask for "type" bits */
+#define	KEYFLAG_TYPE_AUTH_CONF	0x0000	/* Key usable for both */
+#define	KEYFLAG_TYPE_CONF_ONLY	0x8000	/* Key usable for confidentiality */
+#define	KEYFLAG_TYPE_AUTH_ONLY	0x4000	/* Key usable for authentication */
+#define	KEYFLAG_TYPE_NO_KEY	0xC000	/* No key usable for either; no key */
+/* The type bits can also be interpreted independently, as single bits: */
+#define	KEYFLAG_NO_AUTH		0x8000	/* Key not usable for authentication */
+#define	KEYFLAG_NO_CONF		0x4000	/* Key not usable for confidentiality */
+
+#define	KEYFLAG_EXPERIMENTAL	0x2000	/* Security is *mandatory* if bit=0 */
+#define	KEYFLAG_RESERVED3	0x1000  /* reserved - must be zero */
+#define	KEYFLAG_RESERVED4	0x0800  /* reserved - must be zero */
+#define	KEYFLAG_USERACCOUNT	0x0400	/* key is assoc. with a user acct */
+#define	KEYFLAG_ENTITY		0x0200	/* key is assoc. with entity eg host */
+#define	KEYFLAG_ZONEKEY		0x0100	/* key is zone key for the zone named */
+#define	KEYFLAG_IPSEC		0x0080  /* key is for IPSEC use (host or user)*/
+#define	KEYFLAG_EMAIL		0x0040  /* key is for email (MIME security) */
+#define	KEYFLAG_RESERVED10	0x0020  /* reserved - must be zero */
+#define	KEYFLAG_RESERVED11	0x0010  /* reserved - must be zero */
+#define	KEYFLAG_SIGNATORYMASK	0x000F	/* key can sign DNS RR's of same name */
+
+#define  KEYFLAG_RESERVED_BITMASK ( KEYFLAG_RESERVED3 | \
+				    KEYFLAG_RESERVED4 | \
+				    KEYFLAG_RESERVED10| KEYFLAG_RESERVED11) 
+
+/* The Algorithm field of the KEY and SIG RR's is an integer, {1..254} */
+#define	ALGORITHM_MD5RSA	1	/* MD5 with RSA */
+#define	ALGORITHM_EXPIRE_ONLY	253	/* No alg, no security */
+#define	ALGORITHM_PRIVATE_OID	254	/* Key begins with OID indicating alg */
+
+/* Signatures */
+					/* Size of a mod or exp in bits */
+#define	MIN_MD5RSA_KEY_PART_BITS	 512
+#define	MAX_MD5RSA_KEY_PART_BITS	2552
+					/* Total of binary mod and exp, bytes */
+#define	MAX_MD5RSA_KEY_BYTES		((MAX_MD5RSA_KEY_PART_BITS+7/8)*2+3)
+					/* Max length of text sig block */
+#define	MAX_KEY_BASE64			(((MAX_MD5RSA_KEY_BYTES+2)/3)*4)
+
+/*
+ * Status return codes for T_UNSPEC conversion routines
+ */
+#define CONV_SUCCESS	0
+#define CONV_OVERFLOW	(-1)
+#define CONV_BADFMT	(-2)
+#define CONV_BADCKSUM	(-3)
+#define CONV_BADBUFLEN	(-4)
+
+#ifndef BYTE_ORDER
+#if (BSD >= 199103)
+# include <machine/endian.h>
+#else
+#ifdef linux
+# include <endian.h>
+#else
+#define LITTLE_ENDIAN	1234	/* least-significant byte first (vax, pc) */
+#define BIG_ENDIAN	4321	/* most-significant byte first (IBM, net) */
+#define PDP_ENDIAN	3412	/* LSB first in word, MSW first in long (pdp)*/
+
+#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
+    defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
+    defined(__alpha__) || defined(__alpha)
+#define BYTE_ORDER	LITTLE_ENDIAN
+#endif
+
+#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
+    defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
+    defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
+    defined(apollo) || defined(__convex__) || defined(_CRAY) || \
+    defined(__hppa) || defined(__hp9000) || \
+    defined(__hp9000s300) || defined(__hp9000s700) || \
+    defined (BIT_ZERO_ON_LEFT) || defined(m68k)
+#define BYTE_ORDER	BIG_ENDIAN
+#endif
+#endif /* linux */
+#endif /* BSD */
+#endif /* BYTE_ORDER */
+
+#if !defined(BYTE_ORDER) || \
+    (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN && \
+    BYTE_ORDER != PDP_ENDIAN)
+	/* you must determine what the correct bit order is for
+	 * your compiler - the next line is an intentional error
+	 * which will force your compiles to bomb until you fix
+	 * the above macros.
+  error "Undefined or invalid BYTE_ORDER";
+	 */
+#endif
+
+/*
+ * Structure for query header.  The order of the fields is machine- and
+ * compiler-dependent, depending on the byte/bit order and the layout
+ * of bit fields.  We use bit fields only in int variables, as this
+ * is all ANSI requires.  This requires a somewhat confusing rearrangement.
+ */
+
+typedef struct {
+	unsigned	id :16;		/* query identification number */
+#if BYTE_ORDER == BIG_ENDIAN
+			/* fields in third byte */
+	unsigned	qr: 1;		/* response flag */
+	unsigned	opcode: 4;	/* purpose of message */
+	unsigned	aa: 1;		/* authoritive answer */
+	unsigned	tc: 1;		/* truncated message */
+	unsigned	rd: 1;		/* recursion desired */
+			/* fields in fourth byte */
+	unsigned	ra: 1;		/* recursion available */
+	unsigned	unused :1;	/* unused bits (MBZ as of 4.9.3a3) */
+	unsigned	ad: 1;		/* authentic data from named */
+	unsigned	cd: 1;		/* checking disabled by resolver */
+	unsigned	rcode :4;	/* response code */
+#endif
+#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+			/* fields in third byte */
+	unsigned	rd :1;		/* recursion desired */
+	unsigned	tc :1;		/* truncated message */
+	unsigned	aa :1;		/* authoritive answer */
+	unsigned	opcode :4;	/* purpose of message */
+	unsigned	qr :1;		/* response flag */
+			/* fields in fourth byte */
+	unsigned	rcode :4;	/* response code */
+	unsigned	cd: 1;		/* checking disabled by resolver */
+	unsigned	ad: 1;		/* authentic data from named */
+	unsigned	unused :1;	/* unused bits (MBZ as of 4.9.3a3) */
+	unsigned	ra :1;		/* recursion available */
+#endif
+			/* remaining bytes */
+	unsigned	qdcount :16;	/* number of question entries */
+	unsigned	ancount :16;	/* number of answer entries */
+	unsigned	nscount :16;	/* number of authority entries */
+	unsigned	arcount :16;	/* number of resource entries */
+} HEADER;
+
+/*
+ * Defines for handling compressed domain names
+ */
+#define INDIR_MASK	0xc0
+
+extern	u_int16_t	_getshort __P((const u_char *));
+extern	u_int32_t	_getlong __P((const u_char *));
+
+/*
+ * Inline versions of get/put short/long.  Pointer is advanced.
+ *
+ * These macros demonstrate the property of C whereby it can be
+ * portable or it can be elegant but rarely both.
+ */
+#define GETSHORT(s, cp) { \
+	register u_char *t_cp = (u_char *)(cp); \
+	(s) = ((u_int16_t)t_cp[0] << 8) \
+	    | ((u_int16_t)t_cp[1]) \
+	    ; \
+	(cp) += INT16SZ; \
+}
+
+#define GETLONG(l, cp) { \
+	register u_char *t_cp = (u_char *)(cp); \
+	(l) = ((u_int32_t)t_cp[0] << 24) \
+	    | ((u_int32_t)t_cp[1] << 16) \
+	    | ((u_int32_t)t_cp[2] << 8) \
+	    | ((u_int32_t)t_cp[3]) \
+	    ; \
+	(cp) += INT32SZ; \
+}
+
+#define PUTSHORT(s, cp) { \
+	register u_int16_t t_s = (u_int16_t)(s); \
+	register u_char *t_cp = (u_char *)(cp); \
+	*t_cp++ = (char) (t_s >> 8); \
+	*t_cp   = (char) t_s; \
+	(cp) += INT16SZ; \
+}
+
+#define PUTLONG(l, cp) { \
+	register u_int32_t t_l = (u_int32_t)(l); \
+	register u_char *t_cp = (u_char *)(cp); \
+	*t_cp++ = t_l >> 24; \
+	*t_cp++ = t_l >> 16; \
+	*t_cp++ = t_l >> 8; \
+	*t_cp   = t_l; \
+	(cp) += INT32SZ; \
+}
+
+#endif /* !_NAMESER_H_ */
Index: /autobuild/xcache/.config
===================================================================
--- /autobuild/xcache/.config	(revision 905)
+++ /autobuild/xcache/.config	(revision 905)
@@ -0,0 +1,22 @@
+# vim:syntax=sh
+extName="xcache"
+extNiceName="XCache"
+configureFlags=(--enable-xcache-coverager --enable-xcache-constant --enable-xcache-disassembler)
+packageFiles=(
+AUTHORS
+COPYING
+Decompiler.class.php
+INSTALL
+NEWS
+ChangeLog
+README
+THANKS
+admin/
+coverager/
+phpdc.phpr
+phpdop.phpr
+xcache-zh-gb2312.ini
+xcache.ini
+)
+
+setExtOutputDir "$outputDir/$extNiceName"
