diff options
Diffstat (limited to 'win32/build')
-rw-r--r-- | win32/build/Makefile | 115 | ||||
-rw-r--r-- | win32/build/buildconf.js | 200 | ||||
-rw-r--r-- | win32/build/config.w32 | 227 | ||||
-rw-r--r-- | win32/build/config.w32.h.in | 141 | ||||
-rw-r--r-- | win32/build/configure.tail | 6 | ||||
-rw-r--r-- | win32/build/confutils.js | 1357 | ||||
-rw-r--r-- | win32/build/cvsclean.js | 118 | ||||
-rw-r--r-- | win32/build/deplister.c | 60 | ||||
-rw-r--r-- | win32/build/mkdist.php | 306 | ||||
-rw-r--r-- | win32/build/php.ico | bin | 1718 -> 0 bytes | |||
-rw-r--r-- | win32/build/template.rc | 64 |
11 files changed, 0 insertions, 2594 deletions
diff --git a/win32/build/Makefile b/win32/build/Makefile deleted file mode 100644 index be47eae2cf..0000000000 --- a/win32/build/Makefile +++ /dev/null @@ -1,115 +0,0 @@ -# +----------------------------------------------------------------------+ -# | PHP Version 5 | -# +----------------------------------------------------------------------+ -# | Copyright (c) 1997-2004 The PHP Group | -# +----------------------------------------------------------------------+ -# | This source file is subject to version 3.0 of the PHP license, | -# | that is bundled with this package in the file LICENSE, and is | -# | available through the world-wide-web at the following url: | -# | http://www.php.net/license/3_0.txt. | -# | If you did not receive a copy of the PHP license and are unable to | -# | obtain it through the world-wide-web, please send a note to | -# | license@php.net so we can mail you a copy immediately. | -# +----------------------------------------------------------------------+ -# | Author: Wez Furlong <wez@thebrainroom.com> | -# +----------------------------------------------------------------------+ -# -# $Id$ -# This is the makefile template for the win32 build - -CC="$(CL)" -LD="$(LINK)" - -all: $(BUILD_DIR) $(BUILD_DIRS_SUB) generated_files $(EXT_TARGETS) $(PECL_TARGETS) $(SAPI_TARGETS) - -generated_files: Zend\zend_ini_parser.c \ - Zend\zend_language_parser.c Zend\zend_ini_scanner.c \ - Zend\zend_language_scanner.c \ - ext\standard\parsedate.c \ - $(PHPDEF) - -$(BUILD_DIR)\$(PHPDLL).def: $(PHP_DLL_DEF_SOURCES) - type $(PHP_DLL_DEF_SOURCES) > $(BUILD_DIR)\$(PHPDLL).def - -Zend\zend_ini_parser.c Zend\zend_ini_parser.h: Zend\zend_ini_parser.y - $(BISON) --output=Zend/zend_ini_parser.c -v -d -p ini_ Zend/zend_ini_parser.y - -Zend\zend_language_parser.c Zend\zend_language_parser.h: Zend\zend_language_parser.y - $(BISON) --output=Zend/zend_language_parser.c -v -d -p zend Zend/zend_language_parser.y - -Zend\zend_ini_scanner.c: Zend\flex.skl Zend\zend_ini_scanner.l - $(FLEX) -B -i -SZend/flex.skl -Pini_ -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l - -Zend\zend_language_scanner.c: Zend\flex.skl Zend\zend_language_scanner.l - $(FLEX) -i -SZend/flex.skl -Pzend -oZend/zend_language_scanner.c Zend/zend_language_scanner.l - -ext\standard\parsedate.c ext\standard\parsedate.h: ext\standard\parsedate.y - $(BISON) --output=ext/standard/parsedate.c -v -d ext/standard/parsedate.y - -PHPDLL_RES=$(BUILD_DIR)\$(PHPDLL).res - -$(PHPDLL_RES): win32\build\template.rc - $(RC) /fo $(PHPDLL_RES) /d FILE_DESCRIPTION="\"PHP Script Interpreter\"" \ - /d FILE_NAME="\"$(PHPDLL)\"" /d PRODUCT_NAME="\"PHP Script Interpreter\"" \ - win32\build\template.rc - -$(BUILD_DIR)\$(PHPDLL): $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) - $(LD) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) - -$(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL) - -$(BUILD_DIR) $(BUILD_DIRS_SUB): - @echo Recreating build dirs - @if not exist $(BUILD_DIR) mkdir $(BUILD_DIR) - @for %D in ($(BUILD_DIRS_SUB)) do @if not exist %D @mkdir %D > NUL - -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) - -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 - -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING) - -test: - <<test_suite_uses_lame_env_vars.bat -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 - -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" - -build-dist: $(BUILD_DIR)\deplister.exe - -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING) - -rmdir /s /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-pecl - -del /f /q $(BUILD_DIR)\php-$(PHP_VERSION_STRING).zip - $(BUILD_DIR)\php.exe -n win32/build/mkdist.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)" "$(SNAPSHOT_TEMPLATE)" - cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING) - -$(ZIP) -9 -r ..\php-$(PHP_VERSION_STRING).zip . - cd ..\.. - cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-pecl - -$(ZIP) -9 -r ..\php-$(PHP_VERSION_STRING)-pecl.zip . - cd ..\.. - -dist: all build-dist -snap: build-snap build-dist - -$(BUILD_DIR)\deplister.exe: win32\build\deplister.c - $(CL) /Fo$(BUILD_DIR)\ /Fd$(BUILD_DIR)\ /Fp$(BUILD_DIR)\ /FR$(BUILD_DIR) -o$(BUILD_DIR)\deplister.exe win32\build\deplister.c imagehlp.lib - -msi-installer: dist - $(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)" - -install: all - @copy $(BUILD_DIR)\*.exe $(PHP_PREFIX) /y >nul - @copy $(BUILD_DIR)\*.dll $(PHP_PREFIX) /y >nul - diff --git a/win32/build/buildconf.js b/win32/build/buildconf.js deleted file mode 100644 index b744fcd769..0000000000 --- a/win32/build/buildconf.js +++ /dev/null @@ -1,200 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong <wez@thebrainroom.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id: buildconf.js,v 1.10 2004-01-08 21:53:48 wez Exp $ */ -// This generates a configure script for win32 build - -WScript.StdOut.WriteLine("Rebuilding configure.js"); -var FSO = WScript.CreateObject("Scripting.FileSystemObject"); -var C = FSO.CreateTextFile("configure.js", true); - -var modules = ""; -var MODULES = WScript.CreateObject("Scripting.Dictionary"); - -function file_get_contents(filename) -{ - var F = FSO.OpenTextFile(filename, 1); - var t = F.ReadAll(); - F.Close(); - return t; -} - -function Module_Item(module_name, config_path, dir_line, deps, content) -{ - this.module_name = module_name; - this.config_path = config_path; - this.dir_line = dir_line; - this.deps = deps; - this.content = content; -} - -function find_config_w32(dirname) -{ - if (!FSO.FolderExists(dirname)) { - return; - } - - var f = FSO.GetFolder(dirname); - var fc = new Enumerator(f.SubFolders); - var c, i, ok, n; - var item = null; - var re_dep_line = new RegExp("ADD_EXTENSION_DEP\\([^,]*\\s*,\\s*['\"]([^'\"]+)['\"].*\\);", "gm"); - - for (; !fc.atEnd(); fc.moveNext()) - { - ok = true; - /* check if we already picked up a module with the same dirname; - * if we have, don't include it here */ - n = FSO.GetFileName(fc.item()); - - if (n == 'CVS' || n == 'tests') - continue; - - // WScript.StdOut.WriteLine("checking " + dirname + "/" + n); - if (MODULES.Exists(n)) { - WScript.StdOut.WriteLine("Skipping " + dirname + "/" + n + " -- already have a module with that name"); - continue; - } - - - c = FSO.BuildPath(fc.item(), "config.w32"); - if (FSO.FileExists(c)) { -// WScript.StdOut.WriteLine(c); - - var dir_line = "configure_module_dirname = condense_path(FSO.GetParentFolderName('" - + c.replace(new RegExp('(["\\\\])', "g"), '\\$1') + "'));\r\n"; - var contents = file_get_contents(c); - var deps = new Array(); - - // parse out any deps from the file - var calls = contents.match(re_dep_line); - if (calls != null) { - for (i = 0; i < calls.length; i++) { - // now we need the extension name out of this thing - if (calls[i].match(re_dep_line)) { -// WScript.StdOut.WriteLine("n depends on " + RegExp.$1); - deps[deps.length] = RegExp.$1; - } - } - } - - item = new Module_Item(n, c, dir_line, deps, contents); - MODULES.Add(n, item); - } - } -} - -function emit_module(item) -{ - return item.dir_line + item.content; -} - -function emit_dep_modules(module_names) -{ - var i, mod_name, j; - var output = ""; - var item = null; - - for (i in module_names) { - mod_name = module_names[i]; - - if (MODULES.Exists(mod_name)) { - item = MODULES.Item(mod_name); - MODULES.Remove(mod_name); - if (item.deps.length) { - output += emit_dep_modules(item.deps); - } - output += emit_module(item); - } - } - - return output; -} - -function gen_modules() -{ - var module_names = (new VBArray(MODULES.Keys())).toArray(); - var i, mod_name, j; - var item; - var output = ""; - - // first, look for modules with empty deps; emit those first - for (i in module_names) { - mod_name = module_names[i]; - item = MODULES.Item(mod_name); - if (item.deps.length == 0) { - MODULES.Remove(mod_name); - output += emit_module(item); - } - } - - // now we are left with modules that have dependencies on other modules - module_names = (new VBArray(MODULES.Keys())).toArray(); - output += emit_dep_modules(module_names); - - return output; -} - -if (FSO.FileExists("ZendEngine2\\OBJECTS2_HOWTO")) { - if (FSO.FolderExists("Zend")) { - FSO.MoveFolder("Zend", "ZendEngine1"); - } - FSO.MoveFolder("ZendEngine2", "Zend"); -} - -// Write the head of the configure script -C.WriteLine("/* This file automatically generated from win32/build/confutils.js */"); -C.Write(file_get_contents("win32/build/confutils.js")); - -// Pull in code from sapi and extensions -modules = file_get_contents("win32/build/config.w32"); - -// Pick up confs from TSRM and Zend if present -find_config_w32("."); -find_config_w32("sapi"); -find_config_w32("ext"); -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(); - -// Look for ARG_ENABLE or ARG_WITH calls -re = new RegExp("(ARG_(ENABLE|WITH)\([^;]+\);)", "gm"); -calls = modules.match(re); -for (i = 0; i < calls.length; i++) { - item = calls[i]; - C.WriteLine(item); -} - -C.WriteBlankLines(1); -C.WriteLine("conf_process_args();"); -C.WriteBlankLines(1); - -// Comment out the calls from their original positions -modules = modules.replace(re, "/* $1 */"); -C.Write(modules); - -C.WriteBlankLines(1); -C.Write(file_get_contents("win32/build/configure.tail")); - -WScript.StdOut.WriteLine("Now run 'cscript /nologo configure.js --help'"); - diff --git a/win32/build/config.w32 b/win32/build/config.w32 deleted file mode 100644 index 457b8dcec6..0000000000 --- a/win32/build/config.w32 +++ /dev/null @@ -1,227 +0,0 @@ -// vim:ft=javascript -// $Id$ -// "Master" config file; think of it as a configure.in -// equivalent. - -ARG_WITH('cygwin', 'Path to cygwin utilities on your system', '\\cygwin'); - -PATH_PROG('cl'); -PATH_PROG('link'); -PATH_PROG('nmake'); -// we don't want to define LIB, as that will override the default library path -// that is set in that env var -PATH_PROG('lib', null, 'MAKE_LIB'); -PATH_PROG('bison'); -PATH_PROG('flex'); -PATH_PROG('re2c'); -PATH_PROG('zip'); -PATH_PROG('lemon'); - -ARG_ENABLE('debug', 'Compile with debugging symbols', "no"); -ARG_ENABLE('zts', 'Thread safety', 'yes'); - -// Configures the hard-coded installation dir -ARG_ENABLE('prefix', 'where PHP will be installed', ''); -if (PHP_PREFIX == '') { - PHP_PREFIX = "C:\\php" + PHP_VERSION; - if (PHP_DEBUG == "yes") - PHP_PREFIX += "\\debug"; -} -DEFINE('PHP_PREFIX', PHP_PREFIX); - -DEFINE("BASE_INCLUDES", "/I . /I main /I regex /I Zend /I TSRM "); - -// CFLAGS for building the PHP dll -DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \ -/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x400"); - -DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)'); - -// General CFLAGS for building objects -DEFINE("CFLAGS", "/nologo /YX /FD $(BASE_INCLUDES) /D _WINDOWS \ -/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS"); - -// General link flags -DEFINE("LDFLAGS", "/nologo /version:" + - PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION); - -// General DLL link flags -DEFINE("DLL_LDFLAGS", "/dll "); - -// PHP DLL link flags -DEFINE("PHP_LDFLAGS", "$(DLL_LDFLAGS)"); - -// General libs -// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib -DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib"); - -// Set some debug/release specific options -if (PHP_DEBUG == "yes") { - ADD_FLAG("CFLAGS", "/LDd /MDd /Gm /ZI /Od /GZ /D _DEBUG /D ZEND_DEBUG=1"); - ADD_FLAG("LDFLAGS", "/debug"); - // Avoid problems when linking to release libraries that use the release - // version of the libc - ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt"); -} else { - // Equivalent to Release_TSInline build -> best optimization - ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG \ -/D ZEND_WIN32_FORCE_INLINE /GB /GF /D ZEND_DEBUG=0"); - // if you have VS.Net /GS hardens the binary against buffer overruns - // ADD_FLAG("CFLAGS", "/GS"); -} - -if (PHP_ZTS == "yes") { - ADD_FLAG("CFLAGS", "/D ZTS=1"); -} - -// we want msvcrt in the PHP DLL -ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt"); - -// set up the build dir and DLL name -if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") { - DEFINE("BUILD_DIR", "Debug_TS"); - DEFINE("PHPDLL", "php5ts_debug.dll"); - DEFINE("PHPLIB", "php5ts_debug.lib"); -} else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") { - DEFINE("BUILD_DIR", "Debug"); - DEFINE("PHPDLL", "php5_debug.dll"); - DEFINE("PHPLIB", "php5_debug.lib"); -} else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") { - DEFINE("BUILD_DIR", "Release_TS"); - DEFINE("PHPDLL", "php5ts.dll"); - DEFINE("PHPLIB", "php5ts.lib"); -} else if (PHP_DEBUG == "no" && PHP_ZTS == "no") { - DEFINE("BUILD_DIR", "Release"); - DEFINE("PHPDLL", "php5.dll"); - DEFINE("PHPLIB", "php5.lib"); -} - -// Find the php_build dir - it contains headers and libraries -// that we need -ARG_WITH('php-build', 'Path to where you extracted http://www.php.net/extra/win32build.zip. Assumes that it is a sibling of this source dir (..\\php_build) if not specified', 'no'); - -if (PHP_PHP_BUILD == 'no') { - if (FSO.FolderExists("..\\php_build")) { - PHP_PHP_BUILD = "..\\php_build"; - } else if (FSO.FolderExists("..\\win32build")) { - PHP_PHP_BUILD = "..\\win32build"; - } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) { - PHP_PHP_BUILD = "..\\php-win32-dev\\php_build"; - } -} - -ARG_WITH('extra-includes', 'Extra include path to use when building everything', ''); -ARG_WITH('extra-libs', 'Extra library path to use when linking everything', ''); - -var php_usual_include_suspects = "..\\php_build\\include;..\\win32build\\include;..\\bindlib_w32"; -var php_usual_lib_suspects = "..\\php_build\\lib;..\\win32build\\lib;..\\bindlib_w32"; - -// Poke around for some headers -function probe_basic_headers() -{ - var p; - - if (PHP_PHP_BUILD != "no") { - php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include"; - php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib"; - } - - p = CHECK_HEADER_ADD_INCLUDE("arpa\\nameser.h", "CFLAGS", php_usual_include_suspects); - - // hack to catch common location of libs - if (typeof(p) == "string") { - p = p.replace(new RegExp("include$"), "lib"); - ADD_FLAG("LDFLAGS", '/libpath:"' + p + '" '); - php_usual_lib_suspects += ";" + p; - } else if (!p) { - ERROR("We really need that arpa\\nameser.h file - it is part of the win32build package"); - } -} - -function add_extra_dirs() -{ - var path, i, f; - - if (PHP_EXTRA_INCLUDES.length) { - path = PHP_EXTRA_INCLUDES.split(';'); - for (i = 0; i < path.length; i++) { - f = FSO.GetAbsolutePathName(path[i]); - if (FSO.FolderExists(f)) { - ADD_FLAG("CFLAGS", '/I "' + f + '" '); - } - } - } - if (PHP_EXTRA_LIBS.length) { - path = PHP_EXTRA_LIBS.split(';'); - for (i = 0; i < path.length; i++) { - f = FSO.GetAbsolutePathName(path[i]); - if (FSO.FolderExists(f)) { - ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" '); - } - } - } - -} - -probe_basic_headers(); -add_extra_dirs(); -CHECK_LIB("resolv.lib"); - -//DEFINE("PHP_BUILD", PHP_PHP_BUILD); - -STDOUT.WriteBlankLines(1); -STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR')); -STDOUT.WriteLine("PHP Core: " + get_define('PHPDLL') + " and " + get_define('PHPLIB')); - -ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \ - zend_ini_parser.c zend_ini_scanner.c zend_alloc.c zend_compile.c \ - zend_constants.c zend_dynamic_array.c zend_execute_API.c zend_highlight.c \ - zend_llist.c zend_opcode.c zend_operators.c zend_ptr_stack.c \ - zend_stack.c zend_variables.c zend.c zend_API.c zend_extensions.c \ - zend_hash.c zend_list.c zend_indent.c zend_builtin_functions.c \ - zend_sprintf.c zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c \ - zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \ - zend_object_handlers.c zend_objects_API.c \ - zend_mm.c zend_default_classes.c zend_reflection_api.c zend_execute.c"); - -ADD_SOURCES("main", "main.c snprintf.c spprintf.c safe_mode.c fopen_wrappers.c \ - php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \ - strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \ - php_open_temporary_file.c php_logos.c output.c internal_functions.c"); - -ADD_SOURCES("main/streams", "streams.c cast.c memory.c filter.c plain_wrapper.c \ - userspace.c transports.c xp_socket.c mmap.c"); - -ADD_SOURCES("win32", "crypt_win32.c flock.c glob.c md5crypt.c pwd.c readdir.c \ - registry.c select.c sendmail.c time.c wfile.c winutil.c wsyslog.c"); - -ADD_SOURCES("regex", "regcomp.c regerror.c regexec.c regfree.c"); - -STDOUT.WriteBlankLines(1); - -/* Can we build with IPv6 support? */ -ARG_ENABLE("ipv6", "Disable IPv6 support (default is turn it on if available)", "yes"); - -var main_network_has_ipv6 = 0; -if (PHP_IPV6 == "yes") { - main_network_has_ipv6 = CHECK_HEADER_ADD_INCLUDE("wspiapi.h", "CFLAGS") ? 1 : 0; -} -if (main_network_has_ipv6) { - STDOUT.WriteLine("Enabling IPv6 support"); -} -AC_DEFINE('HAVE_GETADDRINFO', main_network_has_ipv6); -AC_DEFINE('HAVE_GAI_STRERROR', main_network_has_ipv6); -AC_DEFINE('HAVE_IPV6', main_network_has_ipv6); - -/* For snapshot builders, where can we find the additional - * files that make up the snapshot template? */ -ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no"); - -if (PHP_SNAPSHOT_TEMPLATE == "no") { - /* default is as a sibling of the php_build dir */ - if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) { - PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template"); - } -} - -DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE); diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in deleted file mode 100644 index 4aabd98f11..0000000000 --- a/win32/build/config.w32.h.in +++ /dev/null @@ -1,141 +0,0 @@ -/* - Build Configuration Template for Win32. - $Id$ -*/ - -/* Default PHP / PEAR directories */ -#define PHP_CONFIG_FILE_PATH (getenv("SystemRoot"))?getenv("SystemRoot"):"" -#define CONFIGURATION_FILE_PATH "php.ini" -#define PEAR_INSTALLDIR "@PREFIX@\\pear" -#define PHP_BINDIR "@PREFIX@" -#define PHP_DATADIR "@PREFIX@" -#define PHP_EXTENSION_DIR "@PREFIX@" -#define PHP_INCLUDE_PATH ".;@PREFIX@\\pear" -#define PHP_LIBDIR "@PREFIX@" -#define PHP_LOCALSTATEDIR "@PREFIX@" -#define PHP_PREFIX "@PREFIX@" -#define PHP_SYSCONFDIR "@PREFIX@" - -/* Enable / Disable crypt() function (default: enabled) */ -#define HAVE_CRYPT 1 -#define PHP_STD_DES_CRYPT 1 -#define PHP_EXT_DES_CRYPT 0 -#define PHP_MD5_CRYPT 1 -#define PHP_BLOWFISH_CRYPT 0 - -/* PHP Runtime Configuration */ -#define PHP_URL_FOPEN 1 -#define PHP_SAFE_MODE 0 -#define MAGIC_QUOTES 0 -#define USE_CONFIG_FILE 1 -#define DEFAULT_SHORT_OPEN_TAG "1" -#define ENABLE_PATHINFO_CHECK 1 - -/* Platform-Specific Configuration. Should not be changed. */ -#define PHP_SIGCHILD 0 -#define HAVE_LIBBIND 1 -#define HAVE_GETSERVBYNAME 1 -#define HAVE_GETSERVBYPORT 1 -#define HAVE_GETPROTOBYNAME 1 -#define HAVE_GETPROTOBYNUMBER 1 -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 -#define HAVE_ERRMSG_H 0 -#undef HAVE_ADABAS -#undef HAVE_SOLID -#undef HAVE_LINK -#undef HAVE_SYMLINK - -/* its in win32/time.c */ -#define HAVE_USLEEP 1 - -#define HAVE_GETCWD 1 -#define HAVE_POSIX_READDIR_R 1 -#define NEED_ISBLANK 1 -#define DISCARD_PATH 0 -#undef HAVE_SETITIMER -#undef HAVE_IODBC -#define HAVE_LIBDL 1 -#define HAVE_SENDMAIL 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_PUTENV 1 -#define HAVE_LIMITS_H 1 -#define HAVE_TZSET 1 -#define HAVE_TZNAME 1 -#undef HAVE_FLOCK -#define HAVE_ALLOCA 1 -#undef HAVE_SYS_TIME_H -#define HAVE_SIGNAL_H 1 -#undef HAVE_ST_BLKSIZE -#undef HAVE_ST_BLOCKS -#define HAVE_ST_RDEV 1 -#define HAVE_UTIME_NULL 1 -#define HAVE_VPRINTF 1 -#define STDC_HEADERS 1 -#define REGEX 1 -#define HSREGEX 1 -#define HAVE_GCVT 1 -#define HAVE_GETLOGIN 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_PUTENV 1 -#define HAVE_REGCOMP 1 -#define HAVE_SETLOCALE 1 -#define HAVE_LOCALECONV 1 -#define HAVE_LOCALE_H 1 -#ifndef HAVE_LIBBIND -# define HAVE_SETVBUF 1 -#endif -#define HAVE_SHUTDOWN 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_STRCASECMP 1 -#define HAVE_STRDUP 1 -#define HAVE_STRERROR 1 -#define HAVE_STRSTR 1 -#define HAVE_TEMPNAM 1 -#define HAVE_UTIME 1 -#undef HAVE_DIRENT_H -#define HAVE_ASSERT_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_GRP_H 0 -#define HAVE_PWD_H 1 -#define HAVE_STRING_H 1 -#undef HAVE_SYS_FILE_H -#undef HAVE_SYS_SOCKET_H -#undef HAVE_SYS_WAIT_H -#define HAVE_SYSLOG_H 1 -#undef HAVE_UNISTD_H -#define HAVE_LIBDL 1 -#define HAVE_LIBM 1 -#define HAVE_CUSERID 0 -#undef HAVE_RINT -#define HAVE_STRFTIME 1 -/* int and long are stll 32bit in 64bit compiles */ -#define SIZEOF_INT 4 -#define SIZEOF_LONG 4 -/* MSVC.6/NET don't allow 'long long' or know 'intmax_t' */ -#define SIZEOF_LONG_LONG_INT 0 -#define SIZEOF_LONG_LONG 0 -#define SIZEOF_INTMAX_T 0 -#define ssize_t SSIZE_T -#ifdef _WIN64 -# define SIZEOF_SIZE_T 8 -# define SIZEOF_PTRDIFF_T 8 -#else -# define SIZEOF_SIZE_T 4 -# define SIZEOF_PTRDIFF_T 4 -#endif -#define HAVE_GLOB -#define PHP_SHLIB_SUFFIX "dll" -#define HAVE_SQLDATASOURCES - -/* Win32 supports strcoll */ -#define HAVE_STRCOLL 1 - -/* Win32 support proc_open */ -#define PHP_CAN_SUPPORT_PROC_OPEN 1 - -#define HAVE_MBLEN diff --git a/win32/build/configure.tail b/win32/build/configure.tail deleted file mode 100644 index e74287d2aa..0000000000 --- a/win32/build/configure.tail +++ /dev/null @@ -1,6 +0,0 @@ -// vim:ft=javascript -// $Id$ -// tail end of configure - -generate_files(); - diff --git a/win32/build/confutils.js b/win32/build/confutils.js deleted file mode 100644 index d74f59b4f2..0000000000 --- a/win32/build/confutils.js +++ /dev/null @@ -1,1357 +0,0 @@ -// Utils for configure script -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong <wez@thebrainroom.com> | - +----------------------------------------------------------------------+ -*/ - -// $Id: confutils.js,v 1.37 2004-01-09 15:11:19 wez Exp $ - -var STDOUT = WScript.StdOut; -var STDERR = WScript.StdErr; -var WshShell = WScript.CreateObject("WScript.Shell"); -var FSO = WScript.CreateObject("Scripting.FileSystemObject"); -var MFO = null; -var SYSTEM_DRIVE = WshShell.Environment("Process").Item("SystemDrive"); -var PROGRAM_FILES = WshShell.Environment("Process").Item("ProgramFiles"); - -if (PROGRAM_FILES == null) { - PROGRAM_FILES = "C:\\Program Files"; -} - -if (!FSO.FileExists("README.CVS-RULES")) { - STDERR.WriteLine("Must be run from the root of the php source"); - WScript.Quit(10); -} - -var CWD = WshShell.CurrentDirectory; - -if (typeof(CWD) == "undefined") { - CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.CVS-RULES")); -} - -/* defaults; we pick up the precise versions from configure.in */ -var PHP_VERSION = 5; -var PHP_MINOR_VERSION = 0; -var PHP_RELEASE_VERSION = 0; -var PHP_EXTRA_VERSION = ""; -var PHP_VERSION_STRING = "5.0.0"; - -function get_version_numbers() -{ - var cin = file_get_contents("configure.in"); - - if (cin.match(new RegExp("MAJOR_VERSION=(\\d+)"))) { - PHP_VERSION = RegExp.$1; - } - if (cin.match(new RegExp("MINOR_VERSION=(\\d+)"))) { - PHP_MINOR_VERSION = RegExp.$1; - } - if (cin.match(new RegExp("RELEASE_VERSION=(\\d+)"))) { - PHP_RELEASE_VERSION = RegExp.$1; - } - PHP_VERSION_STRING = PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION; - - if (cin.match(new RegExp("EXTRA_VERSION=\"([^\"]+)\""))) { - PHP_EXTRA_VERSION = RegExp.$1; - if (PHP_EXTRA_VERSION.length) { - PHP_VERSION_STRING += PHP_EXTRA_VERSION; - } - } - DEFINE('PHP_VERSION_STRING', PHP_VERSION_STRING); -} - -configure_args = new Array(); -configure_subst = WScript.CreateObject("Scripting.Dictionary"); - -configure_hdr = WScript.CreateObject("Scripting.Dictionary"); -build_dirs = new Array(); - -extension_include_code = ""; -extension_module_ptrs = ""; - -get_version_numbers(); - -/* execute a command and return the output as a string */ -function execute(command_line) -{ - var e = WshShell.Exec(command_line); - var ret = ""; - - ret = e.StdOut.ReadAll(); - -//STDOUT.WriteLine("command " + command_line); -//STDOUT.WriteLine(ret); - - return ret; -} - -function condense_path(path) -{ - path = FSO.GetAbsolutePathName(path); - - if (path.substr(0, CWD.length).toLowerCase() - == CWD.toLowerCase() && - (path.charCodeAt(CWD.length) == 92 || path.charCodeAt(CWD.length) == 47)) { - return path.substr(CWD.length + 1); - } - - var a = CWD.split("\\"); - var b = path.split("\\"); - var i, j; - - for (i = 0; i < b.length; i++) { - if (a[i].toLowerCase() == b[i].toLowerCase()) - continue; - if (i > 0) { - /* first difference found */ - path = ""; - for (j = 0; j < a.length - i; j++) { - path += "..\\"; - } - for (j = i; j < b.length; j++) { - path += b[j]; - if (j < b.length - 1) - path += "\\"; - } - return path; - } - /* on a different drive */ - break; - } - - return path; -} - -function ConfigureArg(type, optname, helptext, defval) -{ - var opptype = type == "enable" ? "disable" : "without"; - - if (defval == "yes") { - this.arg = "--" + opptype + "-" + optname; - this.imparg = "--" + type + "-" + optname; - } else { - this.arg = "--" + type + "-" + optname; - this.imparg = "--" + opptype + "-" + optname; - } - - this.optname = optname; - this.helptext = helptext; - this.defval = defval; - this.symval = optname.toUpperCase().replace(new RegExp("-", "g"), "_"); - this.seen = false; - this.argval = defval; -} - -function ARG_WITH(optname, helptext, defval) -{ - configure_args[configure_args.length] = new ConfigureArg("with", optname, helptext, defval); -} - -function ARG_ENABLE(optname, helptext, defval) -{ - configure_args[configure_args.length] = new ConfigureArg("enable", optname, helptext, defval); -} - -function analyze_arg(argval) -{ - var ret = new Array(); - var shared = false; - - if (argval == "shared") { - shared = true; - argval = "yes"; - } else if (argval == null) { - /* nothing */ - } else if (arg_match = argval.match(new RegExp("^shared,(.*)"))) { - shared = true; - argval = arg_match[1]; - } else if (arg_match = argval.match(new RegExp("^(.*),shared$"))) { - shared = true; - argval = arg_match[1]; - } - - ret[0] = shared; - ret[1] = argval; - return ret; -} - -function word_wrap_and_indent(indent, text, line_suffix, indent_char) -{ - if (text == null) { - return ""; - } - - var words = text.split(new RegExp("\\s+", "g")); - var i = 0; - var ret_text = ""; - var this_line = ""; - var t; - var space = ""; - var lines = 0; - - if (line_suffix == null) { - line_suffix = ""; - } - - if (indent_char == null) { - indent_char = " "; - } - - for (i = 0; i < indent; i++) { - space += indent_char; - } - - for (i = 0; i < words.length; i++) { - if (this_line.length) { - t = this_line + " " + words[i]; - } else { - t = words[i]; - } - - if (t.length + indent > 78) { - if (lines++) { - ret_text += space; - } - ret_text += this_line + line_suffix + "\r\n"; - this_line = ""; - } - - if (this_line.length) { - this_line += " " + words[i]; - } else { - this_line = words[i]; - } - } - - if (this_line.length) { - if (lines) - ret_text += space; - ret_text += this_line; - } - - return ret_text; -} - -function conf_process_args() -{ - var i, j; - var configure_help_mode = false; - var analyzed = false; - var nice = "cscript /nologo configure.js "; - - args = WScript.Arguments; - for (i = 0; i < args.length; i++) { - arg = args(i); - nice += ' "' + arg + '"'; - if (arg == "--help") { - configure_help_mode = true; - break; - } - // If it is --foo=bar, split on the equals sign - arg = arg.split("=", 2); - argname = arg[0]; - if (arg.length > 1) { - argval = arg[1]; - } else { - argval = null; - } - - // Find the arg - found = false; - for (j = 0; j < configure_args.length; j++) { - if (argname == configure_args[j].imparg || argname == configure_args[j].arg) { - found = true; - - arg = configure_args[j]; - arg.seen = true; - - analyzed = analyze_arg(argval); - shared = analyzed[0]; - argval = analyzed[1]; - - if (argname == arg.imparg) { - /* we matched the implicit, or default arg */ - if (argval == null) { - argval = arg.defval; - } - } else { - /* we matched the non-default arg */ - if (argval == null) { - argval = arg.defval == "no" ? "yes" : "no"; - } - } - - arg.argval = argval; - eval("PHP_" + arg.symval + " = argval;"); - eval("PHP_" + arg.symval + "_SHARED = shared;"); - break; - } - } - if (!found) { - STDERR.WriteLine("Unknown option " + argname + "; please try configure.js --help for a list of valid options"); - WScript.Quit(2); - } - } - - if (configure_help_mode) { - STDOUT.WriteLine(word_wrap_and_indent(0, -"Options that enable extensions and SAPI will accept \ -'yes' or 'no' as a parameter. They also accept 'shared' \ -as a synonym for 'yes' and request a shared build of that \ -module. Not all modules can be built as shared modules; \ -configure will display [shared] after the module name if \ -can be built that way. \ -" - )); - STDOUT.WriteBlankLines(1); - - // Measure width to pretty-print the output - max_width = 0; - for (i = 0; i < configure_args.length; i++) { - arg = configure_args[i]; - if (arg.arg.length > max_width) - max_width = arg.arg.length; - } - - for (i = 0; i < configure_args.length; i++) { - arg = configure_args[i]; - - n = max_width - arg.arg.length; - pad = " "; - for (j = 0; j < n; j++) { - pad += " "; - } - STDOUT.WriteLine(" " + arg.arg + pad + word_wrap_and_indent(max_width + 5, arg.helptext)); - } - 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]; - if (arg.seen) - continue; - 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;"); - } - - MFO = FSO.CreateTextFile("Makefile.objects", true); - - STDOUT.WriteLine("Saving configure options to config.nice.bat"); - var nicefile = FSO.CreateTextFile("config.nice.bat", true); - nicefile.WriteLine(nice); - nicefile.Close(); - - AC_DEFINE('CONFIGURE_COMMAND', nice); -} - -function DEFINE(name, value) -{ - if (configure_subst.Exists(name)) { - configure_subst.Remove(name); - } - configure_subst.Add(name, value); -} - -// Searches a set of paths for a file; -// returns the dir in which the file was found, -// true if it was found in the default env path, -// or false if it was not found at all. -// env_name is the optional name of an env var -// specifying the default path to search -function search_paths(thing_to_find, explicit_path, env_name) -{ - var i, found = false, place = false, file, env; - - STDOUT.Write("Checking for " + thing_to_find + " ... "); - - thing_to_find = thing_to_find.replace(new RegExp("/", "g"), "\\"); - - if (explicit_path != null) { - if (typeof(explicit_path) == "string") { - explicit_path = explicit_path.split(";"); - } - - for (i = 0; i < explicit_path.length; i++) { - file = glob(explicit_path[i] + "\\" + thing_to_find); - if (file) { - found = true; - place = file[0]; - place = place.substr(0, place.length - thing_to_find.length - 1); - break; - } - } - } - - if (!found && env_name != null) { - env = WshShell.Environment("Process").Item(env_name); - env = env.split(";"); - for (i = 0; i < env.length; i++) { - file = glob(env[i] + "\\" + thing_to_find); - if (file) { - found = true; - place = true; - break; - } - } - } - - if (found && place == true) { - STDOUT.WriteLine(" <in default path>"); - } else if (found) { - STDOUT.WriteLine(" " + place); - } else { - STDOUT.WriteLine(" <not found>"); - } - return place; -} - -function PATH_PROG(progname, additional_paths, symbol) -{ - var exe; - var place; - var cyg_path = PHP_CYGWIN + "\\bin;" + PHP_CYGWIN + "\\usr\\local\\bin"; - - exe = progname + ".exe"; - - if (additional_paths == null) { - additional_paths = cyg_path; - } else { - additional_paths += ";" + cyg_path; - } - - place = search_paths(exe, additional_paths, "PATH"); - - if (place == true) { - place = exe; - } else if (place != false) { - place = place + "\\" + exe; - } - - if (place) { - if (symbol == null) { - symbol = progname.toUpperCase(); - } - DEFINE(symbol, place); - } - return place; -} - -function find_pattern_in_path(pattern, path) -{ - if (path == null) { - return false; - } - - var dirs = path.split(';'); - var i; - var items; - - for (i = 0; i < dirs.length; i++) { - items = glob(dirs[i] + "\\" + pattern); - if (items) { - return condense_path(items[0]); - } - } - return false; -} - -function CHECK_LIB(libnames, target, path_to_check, common_name) -{ - STDOUT.Write("Checking for library " + libnames + " ... "); - - if (common_name == null && target != null) { - common_name = target; - } - - if (path_to_check == null) { - path_to_check = ""; - } - - // if they specified a common name for the package that contains - // the library, tag some useful defaults on to the end of the - // path to be searched - if (common_name != null) { - path_to_check += ";" + PHP_PHP_BUILD + "\\" + common_name + "*"; - path_to_check += ";" + PHP_PHP_BUILD + "\\lib\\" + common_name + "*"; - path_to_check += ";..\\" + common_name + "*"; - } - - // Determine target for build flags - if (target == null) { - target = ""; - } else { - target = "_" + target.toUpperCase(); - } - - // Expand path to include general dirs - path_to_check += ";" + php_usual_lib_suspects; - - // It is common practice to put libs under one of these dir names - var subdirs = new Array(PHP_DEBUG == "yes" ? "Debug" : "Release", "lib", "libs", "libexec"); - - // libnames can be ; separated list of accepted library names - libnames = libnames.split(';'); - - var i, j, k, libname; - var location = false; - var path = path_to_check.split(';'); - - for (i = 0; i < libnames.length; i++) { - libname = libnames[i]; - - for (k = 0; k < path.length; k++) { - location = glob(path[k] + "\\" + libname); - if (location) { - location = location[0]; - break; - } - for (j = 0; j < subdirs.length; j++) { - location = glob(path[k] + "\\" + subdirs[j] + "\\" + libname); - if (location) { - location = location[0]; - break; - } - } - if (location) - break; - } - - if (location) { - location = condense_path(location); - var libdir = FSO.GetParentFolderName(location); - libname = FSO.GetFileName(location); - ADD_FLAG("LDFLAGS" + target, '/libpath:"' + libdir + '" '); - ADD_FLAG("LIBS" + target, libname); - - STDOUT.WriteLine(location); - - return location; - } - - // Check in their standard lib path - location = find_pattern_in_path(libname, WshShell.Environment("Process").Item("LIB")); - - if (location) { - location = condense_path(location); - libname = FSO.GetFileName(location); - ADD_FLAG("LIBS" + target, libname); - - STDOUT.WriteLine("<in LIB path> " + libname); - return location; - } - - // Check in their general extra libs path - location = find_pattern_in_path(libname, PHP_EXTRA_LIBS); - if (location) { - location = condense_path(location); - libname = FSO.GetFileName(location); - ADD_FLAG("LIBS" + target, libname); - STDOUT.WriteLine("<in extra libs path>"); - return location; - } - } - - STDOUT.WriteLine("<not found>"); - - return false; -} - -function OLD_CHECK_LIB(libnames, target, path_to_check) -{ - if (target == null) { - target = ""; - } else { - target = "_" + target.toUpperCase(); - } - - if (path_to_check == null) { - path_to_check = php_usual_lib_suspects; - } else { - path_to_check += ";" + php_usual_lib_suspects; - } - var have = 0; - var p; - var i; - var libname; - - var subdir = PHP_DEBUG == "yes" ? "Debug" : "Release"; - - libnames = libnames.split(';'); - for (i = 0; i < libnames.length; i++) { - libname = libnames[i]; - p = search_paths(libname, path_to_check, "LIB"); - - if (!p) { - p = search_paths(subdir + "\\" + libname, path_to_check, "LIB"); - if (p) { - p += "\\" + subdir; - } - } - - if (typeof(p) == "string") { - ADD_FLAG("LDFLAGS" + target, '/libpath:"' + p + '" '); - ADD_FLAG("LIBS" + target, libname); - have = 1; - } else if (p == true) { - ADD_FLAG("LIBS" + target, libname); - have = 1; - } else { - /* not found in the defaults or the explicit paths, - * so check the general extra libs; if we find - * it here, no need to add another /libpath: for it as we - * already have it covered, but we need to add the lib - * to LIBS_XXX */ - if (false != search_paths(libname, PHP_EXTRA_LIBS, null)) { - ADD_FLAG("LIBS" + target, libname); - have = 1; - } - } - - if (have) { - break; - } - } - -// AC_DEFINE("HAVE_" + header_name.toUpperCase().replace(new RegExp("/\\\\-\.", "g"), "_"), have); - - return have; - -} - -function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env, add_dir_part) -{ - var dir_part_to_add = ""; - - if (use_env == null) { - use_env = true; - } - - // if true, add the dir part of the header_name to the include path - if (add_dir_part == null) { - add_dir_part = false; - } else if (add_dir_part) { - var basename = FSO.GetFileName(header_name); - dir_part_to_add = "\\" + header_name.substr(0, header_name.length - basename.length - 1); - } - - if (path_to_check == null) { - path_to_check = php_usual_include_suspects; - } else { - path_to_check += ";" + php_usual_include_suspects; - } - - var p = search_paths(header_name, path_to_check, use_env ? "INCLUDE" : null); - var have = 0; - var sym; - - if (typeof(p) == "string") { - ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" '); - } else if (p == false) { - /* not found in the defaults or the explicit paths, - * so check the general extra includes; if we find - * it here, no need to add another /I for it as we - * already have it covered, unless we are adding - * the dir part.... */ - p = search_paths(header_name, PHP_EXTRA_INCLUDES, null); - if (typeof(p) == "string" && add_dir_part) { - ADD_FLAG(flag_name, '/I "' + p + dir_part_to_add + '" '); - } - } - have = p ? 1 : 0 - - sym = header_name.toUpperCase(); - sym = sym.replace(new RegExp("[\\\\/\.-]", "g"), "_"); - - AC_DEFINE("HAVE_" + sym, have); - - return p; -} - -/* emits rule to generate version info for a SAPI - * or extension. Returns the name of the .res file - * that will be generated */ -function generate_version_info_resource(makefiletarget, creditspath) -{ - var resname = makefiletarget + ".res"; - var res_desc = "PHP " + makefiletarget; - var res_prod_name = res_desc; - var credits; - var thanks = ""; - var logo = ""; - - if (FSO.FileExists(creditspath + '/CREDITS')) { - credits = FSO.OpenTextFile(creditspath + '/CREDITS', 1); - res_desc = credits.ReadLine(); - try { - thanks = credits.ReadLine(); - } catch (e) { - thanks = null; - } - if (thanks == null) { - thanks = ""; - } else { - thanks = "Thanks to " + thanks; - } - credits.Close(); - } - - if (makefiletarget.match(new RegExp("\\.exe$"))) { - logo = " /D WANT_LOGO "; - } - - MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc"); - MFO.WriteLine("\t$(RC) /fo $(BUILD_DIR)\\" + resname + logo + - ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"' + makefiletarget + - '\\"" /d PRODUCT_NAME="\\"' + res_prod_name + '\\"" /d THANKS_GUYS="\\"' + - thanks + '\\"" win32\\build\\template.rc'); - MFO.WriteBlankLines(1); - - return resname; -} - -function SAPI(sapiname, file_list, makefiletarget, cflags) -{ - var SAPI = sapiname.toUpperCase(); - var ldflags; - var resname; - var ld = "$(LD)"; - - STDOUT.WriteLine("Enabling SAPI " + configure_module_dirname); - - MFO.WriteBlankLines(1); - MFO.WriteLine("# objects for SAPI " + sapiname); - MFO.WriteBlankLines(1); - - if (cflags) { - ADD_FLAG('CFLAGS_' + SAPI, cflags); - } - - ADD_SOURCES(configure_module_dirname, file_list, sapiname); - MFO.WriteBlankLines(1); - MFO.WriteLine("# SAPI " + sapiname); - MFO.WriteBlankLines(1); - - /* generate a .res file containing version information */ - resname = generate_version_info_resource(makefiletarget, configure_module_dirname); - - MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget); - MFO.WriteLine("\t@echo SAPI " + configure_module_dirname + " build complete"); - MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname); - - if (makefiletarget.match(new RegExp("\\.dll$"))) { - ldflags = "/dll $(LDFLAGS)"; - } else if (makefiletarget.match(new RegExp("\\.lib$"))) { - ldflags = "$(LDFLAGS)"; - ld = "$(MAKE_LIB)"; - } 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 + ')'); - - if (configure_module_dirname.match("pecl")) { - ADD_FLAG("PECL_TARGETS", makefiletarget); - } else { - ADD_FLAG("SAPI_TARGETS", makefiletarget); - } - - MFO.WriteBlankLines(1); -} - -function file_get_contents(filename) -{ - var f, c; - f = FSO.OpenTextFile(filename, 1); - c = f.ReadAll(); - f.Close(); - return c; -} - -// Add a dependency on another extension, so that -// the dependencies are built before extname -function ADD_EXTENSION_DEP(extname, dependson, optional) -{ - var EXT = extname.toUpperCase(); - var DEP = dependson.toUpperCase(); - var dep_present = false; - var dep_shared = false; - - try { - dep_present = eval("PHP_" + DEP); - dep_shared = eval("PHP_" + DEP + "_SHARED"); - } catch (e) { - dep_present = "no"; - dep_shared = false; - } - - if (optional) { - if (dep_present == "no") - return; - } - - var ext_shared = eval("PHP_" + EXT + "_SHARED"); - - if (dep_shared) { - if (!ext_shared) { - if (optional) { - return; - } - 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, dllname) -{ - var objs = null; - var EXT = extname.toUpperCase(); - - if (shared == null) { - eval("shared = PHP_" + EXT + "_SHARED;"); - } - if (cflags == null) { - cflags = ""; - } - - if (shared) { - STDOUT.WriteLine("Enabling extension " + configure_module_dirname + " [shared]"); - cflags = "/D COMPILE_DL_" + EXT + " /D " + EXT + "_EXPORTS=1 " + cflags; - ADD_FLAG("CFLAGS_PHP", "/D COMPILE_DL_" + EXT); - } else { - STDOUT.WriteLine("Enabling extension " + configure_module_dirname); - } - - MFO.WriteBlankLines(1); - MFO.WriteLine("# objects for EXT " + extname); - MFO.WriteBlankLines(1); - - - ADD_SOURCES(configure_module_dirname, file_list, extname); - - MFO.WriteBlankLines(1); - - if (shared) { - if (dllname == null) { - dllname = "php_" + extname + ".dll"; - } - var libname = dllname.substring(0, dllname.length-4) + ".lib"; - - var resname = generate_version_info_resource(dllname, configure_module_dirname); - var ld = "$(LD)"; - - 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); - - if (configure_module_dirname.match("pecl")) { - ADD_FLAG("PECL_TARGETS", dllname); - } else { - ADD_FLAG("EXT_TARGETS", dllname); - } - MFO.WriteLine(dllname + ": $(BUILD_DIR)\\" + dllname); - MFO.WriteLine("\t@echo EXT " + extname + " build complete"); - MFO.WriteBlankLines(1); - - DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_' + EXT + ')'); - } else { - ADD_FLAG("STATIC_EXT_OBJS", "$(" + EXT + "_GLOBAL_OBJS)"); - ADD_FLAG("STATIC_EXT_LIBS", "$(LIBS_" + EXT + ")"); - ADD_FLAG("STATIC_EXT_LDFLAGS", "$(LDFLAGS_" + EXT + ")"); - ADD_FLAG("STATIC_EXT_CFLAGS", "$(CFLAGS_" + EXT + ")"); - - /* find the header that declares the module pointer, - * so we can include it in internal_functions.c */ - var ext_dir = FSO.GetFolder(configure_module_dirname); - var fc = new Enumerator(ext_dir.Files); - var re = /\.h$/; - var s, c; - for (; !fc.atEnd(); fc.moveNext()) { - s = fc.item() + ""; - if (s.match(re)) { - c = file_get_contents(s); - if (c.match("phpext_")) { - extension_include_code += '#include "' + configure_module_dirname + '/' + FSO.GetFileName(s) + '"\r\n'; - } - } - } - - extension_module_ptrs += '\tphpext_' + extname + '_ptr,\r\n'; - - DEFINE('CFLAGS_' + EXT + '_OBJ', '$(CFLAGS_PHP) $(CFLAGS_' + EXT + ')'); - } - ADD_FLAG("CFLAGS_" + EXT, cflags); -} - -function ADD_SOURCES(dir, file_list, target) -{ - var i; - var tv; - var src, obj, sym, flags; - - if (target == null) { - target = "php"; - } - - sym = target.toUpperCase() + "_GLOBAL_OBJS"; - flags = "CFLAGS_" + target.toUpperCase() + '_OBJ'; - - if (configure_subst.Exists(sym)) { - tv = configure_subst.Item(sym); - } else { - tv = ""; - } - - file_list = file_list.split(new RegExp("\\s+")); - file_list.sort(); - - var re = new RegExp("\.[a-z0-9A-Z]+$"); - - dir = dir.replace(new RegExp("/", "g"), "\\"); - var objs_line = ""; - var srcs_line = ""; - - var sub_build = "$(BUILD_DIR)\\"; - - /* if module dir is not a child of the main source dir, - * we need to tweak it; we should have detected such a - * case in condense_path and rewritten the path to - * be relative. - * This probably breaks for non-sibling dirs, but that - * is not a problem as buildconf only checks for pecl - * as either a child or a sibling */ - var build_dir = dir.replace(new RegExp("^..\\\\"), ""); - - var mangle_dir = build_dir.replace(new RegExp("[\\\\/.]", "g"), "_"); - var bd_flags_name = "CFLAGS_BD_" + mangle_dir.toUpperCase(); - - var dirs = build_dir.split("\\"); - var i, d = ""; - for (i = 0; i < dirs.length; i++) { - d += dirs[i]; - build_dirs[build_dirs.length] = d; - d += "\\"; - } - sub_build += d; - - - DEFINE(bd_flags_name, "/Fo" + sub_build + " /Fd" + sub_build + " /Fp" + sub_build + " /FR" + sub_build + " "); - - for (i in file_list) { - src = file_list[i]; - obj = src.replace(re, ".obj"); - tv += " " + sub_build + obj; - - if (PHP_ONE_SHOT == "yes") { - if (i > 0) { - objs_line += " " + sub_build + obj; - srcs_line += " " + dir + "\\" + src; - } else { - objs_line = sub_build + obj; - srcs_line = dir + "\\" + src; - } - } else { - MFO.WriteLine(sub_build + obj + ": " + dir + "\\" + src); - MFO.WriteLine("\t$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") -c " + dir + "\\" + src + " -o " + sub_build + obj); - } - } - - if (PHP_ONE_SHOT == "yes") { - MFO.WriteLine(objs_line + ": " + srcs_line); - MFO.WriteLine("\t$(CC) $(" + flags + ") $(CFLAGS) $(" + bd_flags_name + ") -c " + srcs_line); - } - - DEFINE(sym, tv); -} - -function generate_internal_functions() -{ - var infile, outfile; - var indata; - - STDOUT.WriteLine("Generating main/internal_functions.c"); - - infile = FSO.OpenTextFile("main/internal_functions.c.in", 1); - indata = infile.ReadAll(); - infile.Close(); - - indata = indata.replace("@EXT_INCLUDE_CODE@", extension_include_code); - indata = indata.replace("@EXT_MODULE_PTRS@", extension_module_ptrs); - - if (FSO.FileExists("main/internal_functions.c")) { - var origdata = file_get_contents("main/internal_functions.c"); - - if (origdata == indata) { - STDOUT.WriteLine("\t[content unchanged; skipping]"); - return; - } - } - - outfile = FSO.CreateTextFile("main/internal_functions.c", true); - outfile.Write(indata); - outfile.Close(); -} - -function generate_files() -{ - var i, dir, bd, last; - - STDOUT.WriteBlankLines(1); - STDOUT.WriteLine("Creating build dirs..."); - dir = get_define("BUILD_DIR"); - build_dirs.sort(); - last = null; - - if (!FSO.FolderExists(dir)) { - FSO.CreateFolder(dir); - } - - for (i = 0; i < build_dirs.length; i++) { - bd = FSO.BuildPath(dir, build_dirs[i]); - if (bd == last) { - continue; - } - last = bd; - ADD_FLAG("BUILD_DIRS_SUB", bd); - if (!FSO.FolderExists(bd)) { - FSO.CreateFolder(bd); - } - } - - STDOUT.WriteLine("Generating files..."); - generate_makefile(); - generate_internal_functions(); - generate_config_h(); - - - STDOUT.WriteLine("Done."); - STDOUT.WriteBlankLines(1); - 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() -{ - var infile, outfile; - var indata; - var prefix; - - prefix = PHP_PREFIX.replace(new RegExp("\\\\", "g"), "\\\\"); - - STDOUT.WriteLine("Generating main/config.w32.h"); - - infile = FSO.OpenTextFile("win32/build/config.w32.h.in", 1); - indata = infile.ReadAll(); - infile.Close(); - - outfile = FSO.CreateTextFile("main/config.w32.h", true); - - indata = indata.replace(new RegExp("@PREFIX@", "g"), prefix); - outfile.Write(indata); - - var keys = (new VBArray(configure_hdr.Keys())).toArray(); - var i; - var item; - - outfile.WriteBlankLines(1); - outfile.WriteLine("/* values determined by configure.js */"); - - for (i in keys) { - item = configure_hdr.Item(keys[i]); - outfile.WriteBlankLines(1); - outfile.WriteLine("/* " + item[1] + " */"); - outfile.WriteLine("#define " + keys[i] + " " + item[0]); - } - - outfile.Close(); -} - -function generate_makefile() -{ - STDOUT.WriteLine("Generating Makefile"); - var MF = FSO.CreateTextFile("Makefile", true); - - MF.WriteLine("# Generated by configure.js"); - - /* spit out variable definitions */ - var keys = (new VBArray(configure_subst.Keys())).toArray(); - var i; - - for (i in keys) { - // The trailing space is needed to prevent the trailing backslash - // that is part of the build dir flags (CFLAGS_BD_XXX) from being - // seen as a line continuation character - MF.WriteLine(keys[i] + "=" + - //word_wrap_and_indent(1, configure_subst.Item(keys[i]), ' \\', '\t') + " " - configure_subst.Item(keys[i]) + " " - ); - MF.WriteBlankLines(1); - } - - MF.WriteBlankLines(1); - - var TF = FSO.OpenTextFile("win32/build/Makefile", 1); - MF.Write(TF.ReadAll()); - TF.Close(); - - MF.WriteBlankLines(2); - - MFO.Close(); - TF = FSO.OpenTextFile("Makefile.objects", 1); - MF.Write(TF.ReadAll()); - TF.Close(); - - MF.Close(); -} - -function ADD_FLAG(name, flags, target) -{ - if (target != null) { - name = target.toUpperCase() + "_" + name; - } - if (configure_subst.Exists(name)) { - var curr_flags = configure_subst.Item(name); - - if (curr_flags.indexOf(flags) >= 0) { - return; - } - - flags = curr_flags + " " + flags; - configure_subst.Remove(name); - } - configure_subst.Add(name, flags); -} - -function get_define(name) -{ - return configure_subst.Item(name); -} - -// Add a .def to the core to export symbols -function ADD_DEF_FILE(name) -{ - if (!configure_subst.Exists("PHPDEF")) { - DEFINE("PHPDEF", "$(BUILD_DIR)\\$(PHPDLL).def"); - ADD_FLAG("PHP_LDFLAGS", "/def:$(PHPDEF)"); - } - ADD_FLAG("PHP_DLL_DEF_SOURCES", name); -} - -function AC_DEFINE(name, value, comment, quote) -{ - if (quote == null) { - quote = true; - } - if (quote && typeof(value) == "string") { - value = '"' + value.replace(new RegExp('(["\\\\])', "g"), '\\$1') + '"'; - } else if (value.length == 0) { - value = '""'; - } - var item = new Array(value, comment); - if (configure_hdr.Exists(name)) { - var orig_item = configure_hdr.Item(name); - STDOUT.WriteLine("AC_DEFINE[" + name + "]=" + value + ": is already defined to " + item[0]); - } else { - configure_hdr.Add(name, item); - } -} - -function ERROR(msg) -{ - STDERR.WriteLine("ERROR: " + msg); - WScript.Quit(3); -} - -function WARNING(msg) -{ - STDERR.WriteLine("WARNING: " + msg); - STDERR.WriteBlankLines(1); -} - -function copy_and_subst(srcname, destname, subst_array) -{ - if (!FSO.FileExists(srcname)) { - srcname = configure_module_dirname + "\\" + srcname; - destname = configure_module_dirname + "\\" + destname; - } - - var content = file_get_contents(srcname); - var i; - - for (i = 0; i < subst_array.length; i+=2) { - var re = subst_array[i]; - var rep = subst_array[i+1]; - - content = content.replace(re, rep); - } - - var f = FSO.CreateTextFile(destname, true); - f.Write(content); - f.Close(); -} - -// glob using simple filename wildcards -// returns an array of matches that are found -// in the filesystem -function glob(path_pattern) -{ - var path_parts = path_pattern.replace(new RegExp("/", "g"), "\\").split("\\"); - var p; - var base = ""; - var is_pat_re = /\*/; - -//STDOUT.WriteLine("glob: " + path_pattern); - - if (FSO.FileExists(path_pattern)) { - return new Array(path_pattern); - } - - // first, build as much as possible that doesn't have a pattern - for (p = 0; p < path_parts.length; p++) { - if (path_parts[p].match(is_pat_re)) - break; - if (p) - base += "\\"; - base += path_parts[p]; - } - - return _inner_glob(base, p, path_parts); -} - -function _inner_glob(base, p, parts) -{ - var pat = parts[p]; - var full_name = base + "\\" + pat; - var re = null; - var items = null; - - if (p == parts.length) { - return false; - } - -//STDOUT.WriteLine("inner: base=" + base + " p=" + p + " pat=" + pat); - - if (FSO.FileExists(full_name)) { - if (p < parts.length - 1) { - // we didn't reach the full extent of the pattern - return false; - } - return new Array(full_name); - } - - if (FSO.FolderExists(full_name) && p == parts.length - 1) { - // we have reached the end of the pattern; no need to recurse - return new Array(full_name); - } - - // Convert the pattern into a regexp - re = new RegExp("^" + pat.replace(/\./g, '\\.').replace(/\*/g, '.*').replace(/\?/g, '.') + "$", "i"); - - items = new Array(); - - if (!FSO.FolderExists(base)) { - return false; - } - - var folder = FSO.GetFolder(base); - var fc = null; - var subitems = null; - var item_name = null; - var j; - - fc = new Enumerator(folder.SubFolders); - for (; !fc.atEnd(); fc.moveNext()) { - item_name = FSO.GetFileName(fc.item()); - - if (item_name.match(re)) { - // got a match; if we are at the end of the pattern, just add these - // things to the items array - if (p == parts.length - 1) { - items[items.length] = fc.item(); - } else { - // we should recurse and do more matches - subitems = _inner_glob(base + "\\" + item_name, p + 1, parts); - if (subitems) { - for (j = 0; j < subitems.length; j++) { - items[items.length] = subitems[j]; - } - } - } - } - } - - // if we are at the end of the pattern, we should match - // files too - if (p == parts.length - 1) { - fc = new Enumerator(folder.Files); - for (; !fc.atEnd(); fc.moveNext()) { - item_name = FSO.GetFileName(fc.item()); - if (item_name.match(re)) { - items[items.length] = fc.item(); - } - } - } - - if (items.length == 0) - return false; - - return items; -} - - -// 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'); - - diff --git a/win32/build/cvsclean.js b/win32/build/cvsclean.js deleted file mode 100644 index d16863652e..0000000000 --- a/win32/build/cvsclean.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong <wez@thebrainroom.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id: cvsclean.js,v 1.2 2004-01-08 17:33:29 sniper Exp $ */ -// Cleans up files that do not belong in CVS - -var FSO = WScript.CreateObject("Scripting.FileSystemObject"); - -function find_cvsignore(dirname) -{ - if (!FSO.FolderExists(dirname)) - return; - - var f = FSO.GetFolder(dirname); - var fc = new Enumerator(f.SubFolders); - - for (; !fc.atEnd(); fc.moveNext()) { - find_cvsignore(fc.item()); - } - - if (FSO.FileExists(dirname + "\\.cvsignore")) { - kill_from_cvsignore(dirname + "\\.cvsignore"); - } -} - -/* recursive remove using cvsignore style wildcard matching; - * note that FSO.DeleteFolder and FSO.DeleteFile methods both - * accept wildcards, but that they are dangerous to use eg: - * "*.php" will match "*.phpt" */ -function rm_r(filename) -{ - if (FSO.FolderExists(filename)) { - var fc = new Enumerator(FSO.GetFolder(filename).SubFolders); - - for (; !fc.atEnd(); fc.moveNext()) { - rm_r(fc.item()); - } - - fc = new Enumerator(FSO.GetFolder(filename).Files); - - for (; !fc.atEnd(); fc.moveNext()) { - FSO.DeleteFile(fc.item(), true); - } - - FSO.DeleteFolder(filename, true); - } else if (FSO.FileExists(filename)) { - FSO.DeleteFile(filename, true); - } else { - /* we need to handle wildcards here */ - var foldername = FSO.GetParentFolderName(filename); - - if (foldername == "") - foldername = "."; - - var filename = FSO.GetFileName(filename); - - var retext = filename.replace(/\./g, '\\.'); - retext = '^' + retext.replace(/\*/g, '.*') + "$"; - var re = new RegExp(retext); - - var folder = FSO.GetFolder(foldername); - var fc = new Enumerator(folder.SubFolders); - for (; !fc.atEnd(); fc.moveNext()) { - - var item = FSO.GetFileName(fc.item()); - - if (item.match(re)) { - rm_r(fc.item()); - } - } - var fc = new Enumerator(folder.Files); - for (; !fc.atEnd(); fc.moveNext()) { - item = FSO.GetFileName(fc.item()); - - if (item.match(re)) { - FSO.DeleteFile(fc.item(), true); - } - } - } -} - -function kill_from_cvsignore(igfile) -{ - var dir = FSO.GetParentFolderName(igfile) + "\\"; - var t = FSO.OpenTextFile(igfile, 1); - var l; - - if (dir == ".\\") { - dir = ""; - } - - while (!t.atEndOfStream) { - l = t.ReadLine(); - // don't kill their config.nice file(s) - if (l.match("config\.nice.*")) - continue; - rm_r(dir + l); - } - -} - -find_cvsignore("."); - diff --git a/win32/build/deplister.c b/win32/build/deplister.c deleted file mode 100644 index ddff277151..0000000000 --- a/win32/build/deplister.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2004 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Wez Furlong <wez@thebrainroom.com> | - +----------------------------------------------------------------------+ -*/ - -/* $Id$ */ - -/* This little application will list the DLL dependencies for a PE - * module to it's stdout for use by distro/installer building tools */ - -#include <windows.h> -#include <imagehlp.h> - -BOOL CALLBACK StatusRoutine(IMAGEHLP_STATUS_REASON reason, - PSTR image_name, PSTR dll_name, - ULONG va, ULONG param) -{ - switch (reason) { - case BindImportModuleFailed: - printf("%s,NOTFOUND\n", dll_name); - return TRUE; - - case BindImportModule: - printf("%s,OK\n", dll_name); - return TRUE; - } - return TRUE; -} - -/* usage: - * deplister.exe path\to\module.exe path\to\symbols\root - * */ - -int main(int argc, char *argv[]) -{ - return BindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES, - argv[1], NULL, argv[2], StatusRoutine); -} - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php deleted file mode 100644 index c7121bda15..0000000000 --- a/win32/build/mkdist.php +++ /dev/null @@ -1,306 +0,0 @@ -<?php # $Id$ -/* piece together a windows binary distro */ - -$build_dir = $argv[1]; -$phpdll = $argv[2]; -$sapi_targets = explode(" ", $argv[3]); -$ext_targets = explode(" ", $argv[4]); -$pecl_targets = explode(" ", $argv[5]); -$snapshot_template = $argv[6]; - -$is_debug = preg_match("/^debug/i", $build_dir); - -echo "Making dist for $build_dir\n"; - -$dist_dir = $build_dir . "/php-" . phpversion(); -$pecl_dir = $dist_dir . "-pecl"; - -@mkdir($dist_dir); -@mkdir("$dist_dir/ext"); -@mkdir("$dist_dir/dev"); -@mkdir("$dist_dir/extras"); -@mkdir($pecl_dir); - -/* figure out additional DLL's that are required */ -$extra_dll_deps = array(); -$per_module_deps = array(); -$pecl_dll_deps = array(); - -function get_depends($module) -{ - static $no_dist = array( - /* windows system dlls that should not be bundled */ - 'advapi32.dll', 'comdlg32.dll', 'gdi32.dll', 'kernel32.dll', 'ntdll.dll', - 'odbc32.dll', 'ole32.dll', 'oleaut32.dll', 'rpcrt4.dll', - 'shell32.dll', 'shlwapi.dll', 'user32.dll', 'ws2_32.dll', 'ws2help.dll', - 'comctl32.dll', 'winmm.dll', 'wsock32.dll', 'winspool.drv', 'msasn1.dll', - 'secur32.dll', 'netapi32.dll', - - /* apache */ - 'apachecore.dll', - - /* apache 2 */ - 'libhttpd.dll', 'libapr.dll', 'libaprutil.dll', - - /* pi3web */ - 'piapi.dll', 'pi3api.dll', - - /* nsapi */ - 'ns-httpd30.dll', 'ns-httpd35.dll', 'ns-httpd36.dll', 'ns-httpd40.dll', - - /* oracle */ - 'oci.dll', 'ociw32.dll', - - /* sybase */ - 'libcs.dll', 'libct.dll', - - /* visual C++; mscvrt.dll is present on everyones system, - * but the debug version (msvcrtd.dll) and those from visual studio.net - * (msvcrt7x.dll) are not */ - 'msvcrt.dll', - - ); - global $build_dir, $extra_dll_deps, $ext_targets, $sapi_targets, $pecl_targets, $phpdll, $per_module_deps, $pecl_dll_deps; - - $bd = strtolower(realpath($build_dir)); - - $is_pecl = in_array($module, $pecl_targets); - - $cmd = "$GLOBALS[build_dir]\\deplister.exe \"$module\" \"$GLOBALS[build_dir]\""; - $proc = proc_open($cmd, - array(1 => array("pipe", "w")), - $pipes); - - $n = 0; - while (($line = fgetcsv($pipes[1]))) { - $n++; - - $dep = strtolower($line[0]); - $depbase = basename($dep); - /* ignore stuff in our build dir, but only if it is - * one of our targets */ - if (((in_array($depbase, $sapi_targets) || - in_array($depbase, $ext_targets) || in_array($depbase, $pecl_targets)) || - $depbase == $phpdll) && file_exists($GLOBALS['build_dir'] . "/$depbase")) { - continue; - } - /* ignore some well-known system dlls */ - if (in_array(basename($dep), $no_dist)) { - continue; - } - - if ($is_pecl) { - if (!in_array($dep, $pecl_dll_deps)) { - $pecl_dll_deps[] = $dep; - } - } else { - if (!in_array($dep, $extra_dll_deps)) { - $extra_dll_deps[] = $dep; - } - } - - $per_module_deps[basename($module)][] = $dep; - } - fclose($pipes[1]); - proc_close($proc); -//echo "Module $module [$n lines]\n"; -} - -function copy_file_list($source_dir, $dest_dir, $list) -{ - global $is_debug, $dist_dir; - - foreach ($list as $item) { - echo "Copying $item from $source_dir to $dest_dir\n"; - copy($source_dir . DIRECTORY_SEPARATOR . $item, $dest_dir . DIRECTORY_SEPARATOR . $item); - if ($is_debug) { - $itemdb = preg_replace("/\.(exe|dll|lib)$/i", ".pdb", $item); - if (file_exists("$source_dir/$itemdb")) { - copy("$source_dir/$itemdb", "$dist_dir/dev/$itemdb"); - } - } - if (preg_match("/\.(exe|dll)$/i", $item)) { - get_depends($source_dir . '/' . $item); - } - } -} - -function copy_text_file($source, $dest) -{ - $text = file_get_contents($source); - $text = preg_replace("/[^\r]\n$/", "\r\n", $text); - $fp = fopen($dest, "w"); - fwrite($fp, $text); - fclose($fp); -} - -/* the core dll */ -copy("$build_dir/php.exe", "$dist_dir/php.exe"); -copy("$build_dir/$phpdll", "$dist_dir/$phpdll"); - -/* and the .lib goes into dev */ -$phplib = str_replace(".dll", ".lib", $phpdll); -copy("$build_dir/$phplib", "$dist_dir/dev/$phplib"); -/* debug builds; copy the symbols too */ -if ($is_debug) { - $phppdb = str_replace(".dll", ".pdb", $phpdll); - copy("$build_dir/$phppdb", "$dist_dir/dev/$phppdb"); -} -/* copy the sapi */ -copy_file_list($build_dir, "$dist_dir", $sapi_targets); - -/* copy the extensions */ -copy_file_list($build_dir, "$dist_dir/ext", $ext_targets); - -/* pecl sapi and extensions */ -copy_file_list($build_dir, $pecl_dir, $pecl_targets); - -/* populate reading material */ -$text_files = array( - "LICENSE" => "license.txt", - "NEWS" => "news.txt", - "php.ini-dist" => "php.ini-dist", - "php.ini-recommended" => "php.ini-recommended", -); - -foreach ($text_files as $src => $dest) { - copy_text_file($src, $dist_dir . '/' . $dest); -} - -/* general other files */ -$general_files = array( - "win32/install.txt" => "install.txt", - "php.gif" => "php.gif", -); - -foreach ($general_files as $src => $dest) { - copy($src, $dist_dir . '/' . $dest); -} - -/* include a snapshot identifier */ -$branch = "HEAD"; // TODO - determine this from CVS/Entries -$fp = fopen("$dist_dir/snapshot.txt", "w"); -$now = date("r"); -$version = phpversion(); -fwrite($fp, <<<EOT -This snapshot was automatically generated on -$now - -Version: $version -Branch: $branch -Build: $build_dir - -EOT -); -/* list build-in extensions */ -$exts = get_loaded_extensions(); -fprintf($fp, "\r\nBuilt-in Extensions\r\n"); -fwrite($fp, "===========================\r\n"); -foreach ($exts as $ext) { - fprintf($fp, "%s\r\n", $ext); -} -fwrite($fp, "\r\n\r\n"); - -/* list dependencies */ -fprintf($fp, "Dependency information:\r\n"); -foreach ($per_module_deps as $modulename => $deps) { - if (in_array($modulename, $pecl_targets)) - continue; - - fprintf($fp, "Module: %s\r\n", $modulename); - fwrite($fp, "===========================\r\n"); - foreach ($deps as $dll) { - fprintf($fp, "\t%s\r\n", basename($dll)); - } - fwrite($fp, "\r\n"); -} -fclose($fp); - -/* Now add those dependencies */ -foreach ($extra_dll_deps as $dll) { - if (!file_exists($dll)) { - /* try template dir */ - $tdll = $snapshot_template . "/dlls/" . basename($dll); - if (!file_exists($tdll)) { - echo "WARNING: distro depends on $dll, but could not find it on your system\n"; - continue; - } - $dll = $tdll; - } - copy($dll, "$dist_dir/" . basename($dll)); -} -/* and those for pecl */ -foreach ($pecl_dll_deps as $dll) { - if (in_array($dll, $extra_dll_deps)) { - /* already in main distro */ - continue; - } - if (!file_exists($dll)) { - /* try template dir */ - $tdll = $snapshot_template . "/dlls/" . basename($dll); - if (!file_exists($tdll)) { - echo "WARNING: distro depends on $dll, but could not find it on your system\n"; - continue; - } - $dll = $tdll; - } - copy($dll, "$pecl_dir/" . basename($dll)); -} - -function copy_dir($source, $dest) -{ - if (!is_dir($dest)) { - if (!mkdir($dest)) { - return false; - } - } - - $d = opendir($source); - while (($f = readdir($d)) !== false) { - if ($f == '.' || $f == '..' || $f == 'CVS') { - continue; - } - $fs = $source . '/' . $f; - $fd = $dest . '/' . $f; - if (is_dir($fs)) { - copy_dir($fs, $fd); - } else { - copy($fs, $fd); - } - } - closedir($d); -} - -/* add extras from the template dir */ -if (file_exists($snapshot_template)) { - $items = glob("$snapshot_template/*"); - print_r($items); - - foreach ($items as $item) { - $bi = basename($item); - if (is_dir($item)) { - if ($bi == 'dlls' || $bi == 'symbols') { - continue; - } else if ($bi == 'PEAR') { - /* copy to top level */ - copy_dir($item, "$dist_dir/$bi"); - } else { - /* copy that dir into extras */ - copy_dir($item, "$dist_dir/extras/$bi"); - } - } else { - if ($bi == 'go-pear.bat') { - /* copy to top level */ - copy($item, "$dist_dir/$bi"); - } else { - /* copy to extras */ - copy($item, "$dist_dir/extras/$bi"); - } - } - } -} else { - echo "WARNING: you don't have a snapshot template\n"; - echo " your dist will not be complete\n"; -} - -?> diff --git a/win32/build/php.ico b/win32/build/php.ico Binary files differdeleted file mode 100644 index 43bf0027de..0000000000 --- a/win32/build/php.ico +++ /dev/null diff --git a/win32/build/template.rc b/win32/build/template.rc deleted file mode 100644 index 1a6b04cbfe..0000000000 --- a/win32/build/template.rc +++ /dev/null @@ -1,64 +0,0 @@ -/* This is a template RC file. - * $Id$ - * Do not edit with MSVC */ -#ifdef APSTUDIO_INVOKED -# error dont edit with MSVC -#endif - -#include "winres.h" -#include "main/php_version.h" - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -#ifndef THANKS_GUYS -# define THANKS_GUYS "" -#endif - -#ifdef WANT_LOGO -0 ICON win32\build\php.ico -#endif - -#define XSTRVER4(maj, min, rel, build) #maj "." #min "." #rel "." #build -#define XSTRVER3(maj, min, rel) #maj "." #min "." #rel -#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build) -#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel) - -//Version -VS_VERSION_INFO VERSIONINFO - FILEVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION - PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", THANKS_GUYS "\0" - VALUE "CompanyName", "The PHP Group\0" - VALUE "FileDescription", FILE_DESCRIPTION "\0" - VALUE "FileVersion", STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_RELEASE_VERSION) - VALUE "InternalName", FILE_NAME "\0" - VALUE "LegalCopyright", "Copyright © 1997-2004 The PHP Group\0" - VALUE "LegalTrademarks", "PHP\0" - VALUE "OriginalFilename", FILE_NAME "\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", PRODUCT_NAME "\0" - VALUE "ProductVersion", STRVER3(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION) - VALUE "SpecialBuild", PHP_EXTRA_VERSION "\0" - VALUE "URL", "http://www.php.net" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END |