ADD_FLAG('CFLAGS_DATE', "/wd4244");
+PHP_INSTALL_HEADERS("ext/date/", "php_date.h lib/timelib.h lib/timelib_structs.h lib/timelib_config.h");
+
var tl_config = FSO.CreateTextFile("ext/date/lib/timelib_config.h", true);
tl_config.WriteLine("#include \"config.w32.h\"");
tl_config.Close();
if (!PHP_DOM_SHARED) {
ADD_FLAG("CFLAGS_DOM", "/D LIBXML_STATIC ");
}
+ PHP_INSTALL_HEADERS("ext/dom", "xml_common.h");
} else {
WARNING("dom support can't be enabled, libxml is not enabled")
PHP_DOM = "no"
ADD_SOURCES("ext/ereg/regex", "regcomp.c regexec.c regerror.c regfree.c", "ereg");
AC_DEFINE('REGEX', 1, 'Bundled regex');
AC_DEFINE('HSREGEX', 1, 'Bundled regex');
-}
\ No newline at end of file
+ PHP_INSTALL_HEADERS("ext/ereg", "php_ereg.h php_regex.h regex/");
+}
if (PHP_FILTER == "yes") {
EXTENSION("filter", "filter.c sanitizing_filters.c logical_filters.c callback_filter.c");
+ PHP_INSTALL_HEADERS("ext/filter", "php_filter.h");
}
/D USE_GD_IOCTX \
/D MSWIN32 \
");
+
+ PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" );
} else {
WARNING("gd not enabled; libraries and headers not found");
}
AC_DEFINE('HAVE_HASH_EXT', 1);
EXTENSION("hash", "hash.c hash_md.c hash_sha.c hash_ripemd.c hash_haval.c "
+ "hash_tiger.c hash_gost.c hash_snefru.c hash_whirlpool.c "
- + "hash_adler32.c hash_crc32.c hash_salsa.c");
+ + "hash_adler32.c hash_crc32.c hash_salsa.c hash_joaat.c hash_fnv.c");
+
+ PHP_INSTALL_HEADERS("ext/hash/", "php_hash.h php_hash_md.h php_hash_sha.h php_hash_ripemd.h " +
+ "php_hash_haval.h php_hash_tiger.h php_hash_gost.h php_hash_snefru.h " +
+ "php_hash_whirlpool.h php_hash_adler32.h php_hash_crc32.h php_hash_salsa.h " +
+ "php_hash_types.h");
}
if (!PHP_ICONV_SHARED) {
ADD_DEF_FILE("ext\\iconv\\php_iconv.def");
}
+ PHP_INSTALL_HEADERS("", "ext/iconv");
} else {
WARNING("iconv support can't be enabled, libraries or headers are missing")
PHP_ICONV = "no";
if (!PHP_LIBXML_SHARED) {
ADD_DEF_FILE("ext\\libxml\\php_libxml2.def");
}
+ PHP_INSTALL_HEADERS("ext/libxml/", "php_libxml.h");
} else {
WARNING("libxml support can't be enabled, iconv or libxml are missing")
PHP_LIBXML = "no"
AC_DEFINE('HAVE_MBSTR_RU', 1, 'RU');
AC_DEFINE('HAVE_MBSTR_TW', 1, 'TW');
+ PHP_INSTALL_HEADERS("ext/mbstring", "mbstring.h oniguruma/oniguruma.h php_mbregex.h php_onig_compat.h libmbfl/config.h libmbfl/mbfl/eaw_table.h libmbfl/mbfl/mbfilter.h libmbfl/mbfl/mbfilter_8bit.h libmbfl/mbfl/mbfilter_pass.h libmbfl/mbfl/mbfilter_wchar.h libmbfl/mbfl/mbfl_allocators.h libmbfl/mbfl/mbfl_consts.h libmbfl/mbfl/mbfl_convert.h libmbfl/mbfl/mbfl_defs.h libmbfl/mbfl/mbfl_encoding.h libmbfl/mbfl/mbfl_filter_output.h libmbfl/mbfl/mbfl_ident.h libmbfl/mbfl/mbfl_language.h libmbfl/mbfl/mbfl_memory_device.h libmbfl/mbfl/mbfl_string.h");
+
if (PHP_MBREGEX != "no") {
AC_DEFINE('HAVE_STDARG_PROTOTYPES', 1, 'have stdarg.h');
AC_DEFINE('HAVE_MBREGEX', 1);
koi8.c koi8_r.c sjis.c utf8.c unicode.c utf16_be.c utf16_le.c \
utf32_be.c utf32_le.c gb18030.c", "mbstring");
ADD_SOURCES("ext/mbstring", "php_mbregex.c", "mbstring");
+ PHP_INSTALL_HEADERS("ext/mbstring", "php_mbregex.h");
}
}
AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
ADD_EXTENSION_DEP('mysqli', 'mysqlnd', true);
MESSAGE("\tmysqlnd build");
+ PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h");
} else {
if (CHECK_LIB("libmysql.lib", "mysqli", PHP_MYSQLI) &&
CHECK_HEADER_ADD_INCLUDE("mysql.h", "CFLAGS_MYSQLI", PHP_MYSQLI +
EXTENSION("mysqli", mysqli_source);
AC_DEFINE('HAVE_MYSQLILIB', 1, 'Have MySQLi library');
MESSAGE("\tlibmysql build");
+ PHP_INSTALL_HEADERS("ext/mysqli", "php_mysqli_structs.h");
} else {
WARNING("mysqli not enabled; libraries and headers not found");
PHP_MYSQLI = "no"
{
AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Compression support");
}
+ PHP_INSTALL_HEADERS("", "ext/mysqlnd");
}
}
AC_DEFINE('HAVE_BUNDLED_PCRE', 1, 'Using bundled PCRE library');
AC_DEFINE('HAVE_PCRE', 1, 'Have PCRE library');
PHP_PCRE="yes";
+PHP_INSTALL_HEADERS("ext/pcre", "php_pcre.h pcrelib/");
if (PHP_PDO != "no") {
EXTENSION('pdo', 'pdo.c pdo_dbh.c pdo_stmt.c pdo_sql_parser.c pdo_sqlstate.c', false /* force static, PHP_PDO_SHARED is broken yet somehow */);
ADD_EXTENSION_DEP('pdo', 'spl', true);
+ PHP_INSTALL_HEADERS("ext/pdo", "php_pdo.h php_pdo_driver.h");
}
if (PHP_SESSION == "yes") {
EXTENSION("session", "session.c mod_files.c mod_mm.c mod_user.c", false /* never shared */);
AC_DEFINE("HAVE_PHP_SESSION", 1, "Session support");
+ PHP_INSTALL_HEADERS("ext/session/", "mod_mm.h");
}
&& CHECK_HEADER_ADD_INCLUDE("winsock.h", "CFLAGS_SOCKETS")) {
EXTENSION('sockets', 'sockets.c');
AC_DEFINE('HAVE_SOCKETS', 1);
+ PHP_INSTALL_HEADERS("ext/sockets", "php_sockets.h");
} else {
WARNING("sockets not enabled; libraries and headers not found");
}
EXTENSION("spl", "php_spl.c spl_functions.c spl_engine.c spl_iterators.c spl_array.c spl_directory.c spl_exceptions.c spl_observer.c spl_dllist.c spl_heap.c spl_fixedarray.c", false /*never shared */);
AC_DEFINE('HAVE_SPL', 1);
PHP_SPL="yes";
+PHP_INSTALL_HEADERS("ext/spl", "php_spl.h spl_array.h spl_directory.h spl_engine.h spl_exceptions.h spl_functions.h spl_iterators.h spl_observer.h spl_dllist.h spl_heap.h spl_fixedarray.h");
ADD_SOURCES(configure_module_dirname + "/libsqlite", "sqlite3.c", "sqlite3");
AC_DEFINE("HAVE_SQLITE3", 1, "SQLite support");
+ PHP_INSTALL_HEADERS("ext/sqlite3", "libsqlite/sqlite3.h");
}
php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
user_filters.c uuencode.c filters.c proc_open.c \
streamsfuncs.c http.c flock_compat.c", false /* never shared */);
-
+ PHP_INSTALL_HEADERS("", "ext/standard");
if (PHP_MBREGEX != "no") {
CHECK_HEADER_ADD_INCLUDE("oniguruma.h", "CFLAGS_STANDARD", PHP_MBREGEX + ";ext\\mbstring\\oniguruma")
}
+PHP_INSTALL_HEADERS("", "ext/standard");
if (!PHP_XML_SHARED) {
ADD_FLAG("CFLAGS_XML", "/D LIBXML_STATIC ");
}
+ PHP_INSTALL_HEADERS("", "ext/xml");
} else {
WARNING("xml support can't be enabled, libraries or headers are missing")
PHP_ZLIB = "no"
static zend_class_entry *zip_class_entry;
static zend_object_handlers zip_object_handlers;
-static HashTable zip_prop_handlers;
-
typedef int (*zip_read_int_t)(struct zip *za TSRMLS_DC);
typedef char *(*zip_read_const_char_t)(struct zip *za, int *len TSRMLS_DC);
typedef char *(*zip_read_const_char_from_ze_t)(ze_zip_object *obj TSRMLS_DC);
$(BUILD_DIR)\php.exe ..\php-installer\build-installer.php "$(BUILD_DIR)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS)" "$(PECL_TARGETS)"
# need to redirect, since INSTALL is a file in the root...
-install: really-install
+install: really-install install-devel install-lib
+
+install-lib:
+ @if not exist $(PHP_PREFIX)\lib mkdir $(PHP_PREFIX)\lib >nul
+ @copy $(BUILD_DIR)\$(PHPLIB) $(PHP_PREFIX)\lib /y >nul
+
+install-devel: install-headers
+ @if not exist $(PHP_PREFIX)\script mkdir $(PHP_PREFIX)\script >nul
+ @if not exist $(PHP_PREFIX)\build mkdir $(PHP_PREFIX)\build >nul
+ @copy win32\build\confutils.js $(PHP_PREFIX)\script\ /y >nul
+ @copy win32\build\configure.tail $(PHP_PREFIX)\script\ /y >nul
+ @copy win32\build\config.w32.phpize.in $(PHP_PREFIX)\script\ /y >nul
+ @copy win32\build\Makefile.phpize $(PHP_PREFIX)\script\ /y >nul
+ @copy win32\build\phpize.bat $(PHP_PREFIX)\ /y >nul
+ @copy win32\build\template.rc $(PHP_PREFIX)\build\ /y >nul
+ @copy $(BUILD_DIR)\devel\config.phpize.js $(PHP_PREFIX)\script\ /y >nul
+ @copy $(BUILD_DIR)\devel\phpize.js $(PHP_PREFIX)\script\ /y >nul
really-install:
@if not exist $(PHP_PREFIX) mkdir $(PHP_PREFIX)
@echo Registering event source with syslog (requires admin rights)
@echo It's okay for this step to fail:
-$(PHP_PREFIX)\php.exe -n -dextension_dir=$(PHP_PREFIX) win32/build/registersyslog.php $(PHP_PREFIX)\$(PHPDLL)
-
-
--- /dev/null
+CC="$(PHP_CL)"\r
+LD="$(LINK)"\r
+MC="$(MC)"\r
+MT="$(MT)"\r
+\r
+PHPSDK_DIR=$(PHP_DIR)\r
+PHPLIB=$(PHPSDK_DIR)\lib\$(PHPLIB)\r
+LDFLAGS=/libpath:"$(PHPSDK_DIR)\lib\;$(PHPSDK_DIR)"\r
+\r
+CFLAGS=/nologo /FD $(BASE_INCLUDES) /D _WINDOWS /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D_USE_32BIT_TIME_T=1 /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0 /D ZTS=1 /D FD_SETSIZE=256 \r
+CFLAGS_PHP=/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x500 /D COMPILE_DL_AJAXMIN \r
+\r
+all: $(EXT_TARGETS) $(PECL_TARGETS)\r
+\r
+build_dirs: $(BUILD_DIR) $(BUILD_DIRS_SUB)\r
+\r
+clean-pecl:\r
+ @echo Cleaning PECL targets only\r
+ -rd /s /q $(BUILD_DIR)\pecl\r
+\r
+clean-all:\r
+ @echo Cleaning standard build dirs\r
+ @for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @rd /s /q %D\r
+ -@del /f /q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.manifest $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\*.rc $(BUILD_DIR)\*.dbg $(BUILD_DIR)\*.bin $(BUILD_DIR)\php*.dll $(BUILD_DIR)\php*.exe > NUL\r
+\r
+clean: clean-pecl\r
+ @echo Cleaning distribution build dirs\r
+ @for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL\r
+ -@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)-Win32.zip $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip > NUL\r
+\r
+!if $(MT) == ""\r
+_VC_MANIFEST_EMBED_EXE=\r
+_VC_MANIFEST_EMBED_DLL=\r
+!else\r
+_VC_MANIFEST_EMBED_EXE= if exist $@.manifest $(MT) -nologo -manifest $@.manifest -outputresource:$@;1\r
+_VC_MANIFEST_EMBED_DLL= if exist $@.manifest $(MT) -nologo -manifest $@.manifest -outputresource:$@;2\r
+!endif\r
+\r
\r
// Write the head of the configure script\r
C.WriteLine("/* This file automatically generated from win32/build/confutils.js */");\r
+C.WriteLine("MODE_PHPIZE=false;");\r
C.Write(file_get_contents("win32/build/confutils.js"));\r
\r
// If project files were requested, pull in the code to generate them\r
}
ARG_ENABLE('zts', 'Thread safety', 'yes');
// Configures the hard-coded installation dir
-ARG_ENABLE('prefix', 'where PHP will be installed', '');
+ARG_WITH('prefix', 'where PHP will be installed', '');
if (PHP_PREFIX == '') {
PHP_PREFIX = "C:\\php";
if (PHP_DEBUG == "yes")
if (PHP_ZTS == "yes") {
ADD_FLAG("CFLAGS", "/D ZTS=1");
+ ADD_FLAG("ZTS", "1");
+} else {
+ ADD_FLAG("ZTS", "0");
}
DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts");
ADD_SOURCES("win32", "glob.c readdir.c \
registry.c select.c sendmail.c time.c winutil.c wsyslog.c globals.c");
+PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/streams/ win32/");
+
STDOUT.WriteBlankLines(1);
/* Can we build with IPv6 support? */
--- /dev/null
+// vim:ft=javascript\r
+// $Id: config.w32 305923 2010-12-02 23:23:14Z pajoye $\r
+// "Master" config file; think of it as a configure.in\r
+// equivalent.\r
+\r
+var PHP_CYGWIN="notset";\r
+PHP_CL = PATH_PROG('cl', null, 'PHP_CL');\r
+if (!PHP_CL) {\r
+ ERROR("MS C++ compiler is required");\r
+}\r
+/* For the record here: */\r
+// 1200 is VC6\r
+// 1300 is vs.net 2002\r
+// 1310 is vs.net 2003\r
+// 1400 is vs.net 2005\r
+// 1500 is vs.net 2008\r
+// 1600 is vs.net 2010\r
+// Which version of the compiler do we have?\r
+VCVERS = probe_binary(PHP_CL).substr(0, 5).replace('.', '');\r
+STDOUT.WriteLine(" Detected compiler " + VC_VERSIONS[VCVERS]);\r
+AC_DEFINE('COMPILER', VC_VERSIONS[VCVERS], "Detected compiler version");\r
+DEFINE("PHP_COMPILER_SHORT", VC_VERSIONS_SHORT[VCVERS]);\r
+AC_DEFINE('PHP_COMPILER_ID', VC_VERSIONS_SHORT[VCVERS], "Compiler compatibility ID");\r
+\r
+// do we use x64 or 80x86 version of compiler?\r
+X64 = probe_binary(PHP_CL, 64, null, 'PHP_CL');\r
+if (X64) {\r
+ STDOUT.WriteLine(" Detected 64-bit compiler");\r
+} else {\r
+ STDOUT.WriteLine(" Detected 32-bit compiler");\r
+}\r
+AC_DEFINE('ARCHITECTURE', X64 ? 'x64' : 'x86', "Detected compiler architecture");\r
+DEFINE("PHP_ARCHITECTURE", X64 ? 'x64' : 'x86');\r
+\r
+// cygwin now ships with link.exe. Avoid searching the cygwin path\r
+// for this, as we want the MS linker, not the fileutil\r
+PATH_PROG('link', WshShell.Environment("Process").Item("PATH"));\r
+PATH_PROG('nmake');\r
+\r
+// we don't want to define LIB, as that will override the default library path\r
+// that is set in that env var\r
+PATH_PROG('lib', null, 'MAKE_LIB');\r
+if (!PATH_PROG('bison')) {\r
+ ERROR('bison is required')\r
+}\r
+\r
+// There's a minimum requirement for re2c..\r
+MINRE2C = "0.13.4";\r
+\r
+RE2C = PATH_PROG('re2c');\r
+if (RE2C) {\r
+ var intvers, intmin;\r
+ var pattern = /\./g;\r
+\r
+ RE2CVERS = probe_binary(RE2C, "version");\r
+ STDOUT.WriteLine(' Detected re2c version ' + RE2CVERS);\r
+\r
+ intvers = RE2CVERS.replace(pattern, '') - 0;\r
+ intmin = MINRE2C.replace(pattern, '') - 0;\r
+\r
+ if (intvers < intmin) {\r
+ STDOUT.WriteLine('WARNING: The minimum RE2C version requirement is ' + MINRE2C);\r
+ STDOUT.WriteLine('Parsers will not be generated. Upgrade your copy at http://sf.net/projects/re2c');\r
+ DEFINE('RE2C', '');\r
+ } else {\r
+ DEFINE('RE2C_FLAGS', '');\r
+ }\r
+} else {\r
+ STDOUT.WriteLine('Parsers will not be regenerated');\r
+}\r
+PATH_PROG('zip');\r
+PATH_PROG('lemon');\r
+\r
+// avoid picking up midnight commander from cygwin\r
+PATH_PROG('mc', WshShell.Environment("Process").Item("PATH"));\r
+\r
+// Try locating manifest tool\r
+if (VCVERS > 1200) {\r
+ PATH_PROG('mt', WshShell.Environment("Process").Item("PATH"));\r
+}\r
+\r
+// stick objects somewhere outside of the source tree\r
+ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', '');\r
+if (PHP_OBJECT_OUT_DIR.length) {\r
+ PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(PHP_OBJECT_OUT_DIR);\r
+ if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) {\r
+ ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist');\r
+ }\r
+ PHP_OBJECT_OUT_DIR += '\\';\r
+} else if (X64) {\r
+ if (!FSO.FolderExists("x64")) {\r
+ FSO.CreateFolder("x64");\r
+ }\r
+ PHP_OBJECT_OUT_DIR = 'x64\\';\r
+}\r
+\r
+ARG_ENABLE('debug', 'Compile with debugging symbols', "no");\r
+ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no');\r
+if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") {\r
+ ERROR("Use of both --enable-debug and --enable-debug-pack not allowed.");\r
+}\r
+\r
+DEFINE('PHP_PREFIX', PHP_PREFIX);\r
+\r
+DEFINE("BASE_INCLUDES", "/I " + PHP_DIR + "/include /I " + PHP_DIR + "/include/main /I " + PHP_DIR + "/include/Zend /I " + PHP_DIR + "/include/TSRM /I " + PHP_DIR + "/include/ext ");\r
+\r
+// CFLAGS for building the PHP dll\r
+DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP5DLLTS_EXPORTS /D PHP_EXPORTS \\r
+/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=0x500");\r
+\r
+DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');\r
+\r
+// General CFLAGS for building objects\r
+DEFINE("CFLAGS", "/nologo /FD $(BASE_INCLUDES) /D _WINDOWS \\r
+/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 ");\r
+\r
+if (VCVERS < 1400) {\r
+ // Enable automatic precompiled headers\r
+ ADD_FLAG('CFLAGS', ' /YX ');\r
+\r
+ if (PHP_DEBUG == "yes") {\r
+ // Set some debug/release specific options\r
+ ADD_FLAG('CFLAGS', ' /GZ ');\r
+ }\r
+}\r
+\r
+if (VCVERS >= 1400) {\r
+ // fun stuff: MS deprecated ANSI stdio and similar functions\r
+ // disable annoying warnings. In addition, time_t defaults\r
+ // to 64-bit. Ask for 32-bit.\r
+ if (X64) {\r
+ ADD_FLAG('CFLAGS', ' /wd4996 /Wp64 ');\r
+ } else {\r
+ ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 ');\r
+ }\r
+\r
+ if (PHP_DEBUG == "yes") {\r
+ // Set some debug/release specific options\r
+ ADD_FLAG('CFLAGS', ' /RTC1 ');\r
+ }\r
+}\r
+\r
+ARG_WITH('prefix', 'PHP installation prefix', '');\r
+ARG_WITH('mp', 'Tell VC9+ use up to [n,auto,disable] processes for compilation', 'auto');\r
+if (VCVERS >= 1500 && PHP_MP != 'disable') {\r
+ // no from disable-all \r
+ if(PHP_MP == 'auto' || PHP_MP == 'no') {\r
+ ADD_FLAG('CFLAGS', ' /MP ');\r
+ } else {\r
+ if(parseInt(PHP_MP) != 0) {\r
+ ADD_FLAG('CFLAGS', ' /MP'+ PHP_MP +' ');\r
+ } else {\r
+ STDOUT.WriteLine('WARNING: Invalid argument for MP: ' + PHP_MP);\r
+ }\r
+ }\r
+}\r
+\r
+/* For snapshot builders, where can we find the additional\r
+ * files that make up the snapshot template? */\r
+ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no");\r
+\r
+// General DLL link flags\r
+DEFINE("DLL_LDFLAGS", "/dll ");\r
+\r
+// PHP DLL link flags\r
+DEFINE("PHP_LDFLAGS", "$(DLL_LDFLAGS)");\r
+\r
+// General libs\r
+// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib\r
+DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib");\r
+\r
+// Set some debug/release specific options\r
+if (PHP_DEBUG == "yes") {\r
+ ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +\r
+ (X64?"/Zi":"/ZI"));\r
+ ADD_FLAG("LDFLAGS", "/debug");\r
+ // Avoid problems when linking to release libraries that use the release\r
+ // version of the libc\r
+ ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");\r
+} else {\r
+ // Generate external debug files when --enable-debug-pack is specified\r
+ if (PHP_DEBUG_PACK == "yes") {\r
+ ADD_FLAG("CFLAGS", "/Zi");\r
+ ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");\r
+ }\r
+ // Equivalent to Release_TSInline build -> best optimization\r
+ ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0");\r
+\r
+ // if you have VS.Net /GS hardens the binary against buffer overruns\r
+ // ADD_FLAG("CFLAGS", "/GS");\r
+}\r
+\r
+if (PHP_ZTS == "yes") {\r
+ ADD_FLAG("CFLAGS", "/D ZTS=1");\r
+}\r
+\r
+DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts");\r
+\r
+\r
+// we want msvcrt in the PHP DLL\r
+ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");\r
+\r
+// set up the build dir and DLL name\r
+if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {\r
+ DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");\r
+ DEFINE("PHPDLL", "php" + PHP_VERSION + "ts_debug.dll");\r
+ DEFINE("PHPLIB", "php" + PHP_VERSION + "ts_debug.lib");\r
+} else if (PHP_DEBUG == "yes" && PHP_ZTS == "no") {\r
+ DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug");\r
+ DEFINE("PHPDLL", "php" + PHP_VERSION + "_debug.dll");\r
+ DEFINE("PHPLIB", "php" + PHP_VERSION + "_debug.lib");\r
+} else if (PHP_DEBUG == "no" && PHP_ZTS == "yes") {\r
+ DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release_TS");\r
+ DEFINE("PHPDLL", "php" + PHP_VERSION + "ts.dll");\r
+ DEFINE("PHPLIB", "php" + PHP_VERSION + "ts.lib");\r
+} else if (PHP_DEBUG == "no" && PHP_ZTS == "no") {\r
+ DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Release");\r
+ DEFINE("PHPDLL", "php" + PHP_VERSION + ".dll");\r
+ DEFINE("PHPLIB", "php" + PHP_VERSION + ".lib");\r
+}\r
+\r
+// Find the php_build dir - it contains headers and libraries\r
+// that we need\r
+ARG_WITH('php-build', 'Path to where you extracted the development libraries (http://wiki.php.net/internals/windows/libs). Assumes that it is a sibling of this source dir (..\\deps) if not specified', 'no');\r
+\r
+if (PHP_PHP_BUILD == 'no') {\r
+ if (FSO.FolderExists("..\\deps")) {\r
+ PHP_PHP_BUILD = "..\\deps";\r
+ } else {\r
+ if (FSO.FolderExists("..\\php_build")) {\r
+ PHP_PHP_BUILD = "..\\php_build";\r
+ } else {\r
+ if (X64) {\r
+ if (FSO.FolderExists("..\\win64build")) {\r
+ PHP_PHP_BUILD = "..\\win64build";\r
+ } else if (FSO.FolderExists("..\\php-win64-dev\\php_build")) {\r
+ PHP_PHP_BUILD = "..\\php-win64-dev\\php_build";\r
+ }\r
+ } else {\r
+ if (FSO.FolderExists("..\\win32build")) {\r
+ PHP_PHP_BUILD = "..\\win32build";\r
+ } else if (FSO.FolderExists("..\\php-win32-dev\\php_build")) {\r
+ PHP_PHP_BUILD = "..\\php-win32-dev\\php_build";\r
+ }\r
+ }\r
+ }\r
+ }\r
+ PHP_PHP_BUILD = FSO.GetAbsolutePathName(PHP_PHP_BUILD);\r
+}\r
+DEFINE("PHP_BUILD", PHP_PHP_BUILD);\r
+\r
+ARG_WITH('extra-includes', 'Extra include path to use when building everything', '');\r
+ARG_WITH('extra-libs', 'Extra library path to use when linking everything', '');\r
+\r
+var php_usual_include_suspects = PHP_PHP_BUILD+"\\include";\r
+var php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib";\r
+\r
+ADD_FLAG("CFLAGS", '/I "' + php_usual_include_suspects + '" ');\r
+ADD_FLAG("LDFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" ');\r
+\r
+// Poke around for some headers\r
+function probe_basic_headers()\r
+{\r
+ var p;\r
+\r
+ if (PHP_PHP_BUILD != "no") {\r
+ php_usual_include_suspects += ";" + PHP_PHP_BUILD + "\\include";\r
+ php_usual_lib_suspects += ";" + PHP_PHP_BUILD + "\\lib";\r
+ }\r
+}\r
+\r
+function add_extra_dirs()\r
+{\r
+ var path, i, f;\r
+\r
+ if (PHP_EXTRA_INCLUDES.length) {\r
+ path = PHP_EXTRA_INCLUDES.split(';');\r
+ for (i = 0; i < path.length; i++) {\r
+ f = FSO.GetAbsolutePathName(path[i]);\r
+ if (FSO.FolderExists(f)) {\r
+ ADD_FLAG("CFLAGS", '/I "' + f + '" ');\r
+ }\r
+ }\r
+ }\r
+ if (PHP_EXTRA_LIBS.length) {\r
+ path = PHP_EXTRA_LIBS.split(';');\r
+ for (i = 0; i < path.length; i++) {\r
+ f = FSO.GetAbsolutePathName(path[i]);\r
+ if (FSO.FolderExists(f)) {\r
+ if (VCVERS <= 1200 && f.indexOf(" ") >= 0) {\r
+ ADD_FLAG("LDFLAGS", '/libpath:"\\"' + f + '\\"" ');\r
+ } else {\r
+ ADD_FLAG("LDFLAGS", '/libpath:"' + f + '" ');\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+}\r
+\r
+probe_basic_headers();\r
+add_extra_dirs();\r
+\r
+//DEFINE("PHP_BUILD", PHP_PHP_BUILD);\r
+\r
+STDOUT.WriteBlankLines(1);\r
+STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR'));\r
+STDOUT.WriteLine("PHP Core: " + get_define('PHPDLL') + " and " + get_define('PHPLIB'));\r
+\r
+\r
+if (VCVERS == 1200) {\r
+ AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);\r
+}\r
+\r
+if (VCVERS >= 1400) {\r
+ AC_DEFINE('HAVE_STRNLEN', 1);\r
+}\r
+\r
+STDOUT.WriteBlankLines(1);\r
+\r
+if (PHP_SNAPSHOT_TEMPLATE == "no") {\r
+ /* default is as a sibling of the php_build dir */\r
+ if (FSO.FolderExists(PHP_PHP_BUILD + "\\template")) {\r
+ PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\template");\r
+ } else if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) {\r
+ PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template");\r
+ }\r
+}\r
+\r
+DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE);\r
+\r
+if (PHP_DSP != "no") {\r
+ if (FSO.FolderExists("tmp")) {\r
+ FSO.DeleteFolder("tmp");\r
+ }\r
+ FSO.CreateFolder("tmp");\r
+}\r
+\r
+AC_DEFINE("PHP_DIR", PHP_DIR);\r
+DEFINE("PHP_DIR", PHP_DIR);\r
// $Id$
// tail end of configure
-if (sapi_enabled.length < 1) {
+if (!MODE_PHPIZE && sapi_enabled.length < 1) {
MESSAGE("");
ERROR("No SAPI selected, please enable at least one SAPI.");
}
/* Store the SAPI enabled (summary + QA check) */\r
var sapi_enabled = new Array();\r
\r
+/* Store the headers to install */\r
+var headers_install = new Array();\r
+\r
/* Mapping CL version > human readable name */\r
var VC_VERSIONS = new Array();\r
VC_VERSIONS[1200] = 'MSVC6 (Visual C++ 6.0)';\r
PROGRAM_FILES = "C:\\Program Files";\r
}\r
\r
-if (!FSO.FileExists("README.SVN-RULES")) {\r
- STDERR.WriteLine("Must be run from the root of the php source");\r
- WScript.Quit(10);\r
+if (MODE_PHPIZE) {\r
+ if (!FSO.FileExists("config.w32")) {\r
+ STDERR.WriteLine("Must be run from the root of the extension source");\r
+ WScript.Quit(10);\r
+ }\r
+} else {\r
+ if (!FSO.FileExists("README.SVN-RULES")) {\r
+ STDERR.WriteLine("Must be run from the root of the php source");\r
+ WScript.Quit(10);\r
+ }\r
}\r
- \r
+\r
var CWD = WshShell.CurrentDirectory;\r
\r
if (typeof(CWD) == "undefined") {\r
extension_include_code = "";\r
extension_module_ptrs = "";\r
\r
-get_version_numbers();\r
+if (!MODE_PHPIZE) {\r
+ get_version_numbers();\r
+}\r
\r
/* execute a command and return the output as a string */\r
function execute(command_line)\r
arg.seen = true;\r
\r
analyzed = analyze_arg(argval);\r
- shared = analyzed[0];\r
+\r
+ /* Force shared when called after phpize */\r
+ if (MODE_PHPIZE) {\r
+ shared = "shared";\r
+ } else {\r
+ shared = analyzed[0];\r
+ }\r
argval = analyzed[1];\r
\r
if (argname == arg.imparg) {\r
creditspath + '\\template.rc');\r
return resname;\r
}\r
-\r
- MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc");\r
- MFO.WriteLine("\t$(RC) /n /fo $(BUILD_DIR)\\" + resname + logo + debug +\r
- ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'\r
- + makefiletarget + '\\"" /d URL="\\"' + project_url + \r
- '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning + \r
- '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" win32\\build\\template.rc');\r
+ if (MODE_PHPIZE) {\r
+ MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": $(PHP_DIR)\\build\\template.rc");\r
+ MFO.WriteLine("\t$(RC) /I $(PHP_DIR)/include /n /fo $(BUILD_DIR)\\" + resname + logo + debug +\r
+ ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'\r
+ + makefiletarget + '\\"" /d URL="\\"' + project_url + \r
+ '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning + \r
+ '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" $(PHP_DIR)\\build\\template.rc');\r
+ } else {\r
+ MFO.WriteLine("$(BUILD_DIR)\\" + resname + ": win32\\build\\template.rc");\r
+ MFO.WriteLine("\t$(RC) /n /fo $(BUILD_DIR)\\" + resname + logo + debug +\r
+ ' /d FILE_DESCRIPTION="\\"' + res_desc + '\\"" /d FILE_NAME="\\"'\r
+ + makefiletarget + '\\"" /d URL="\\"' + project_url + \r
+ '\\"" /d INTERNAL_NAME="\\"' + internal_name + versioning + \r
+ '\\"" /d THANKS_GUYS="\\"' + thanks + '\\"" win32\\build\\template.rc');\r
+ }\r
MFO.WriteBlankLines(1);\r
return resname;\r
}\r
\r
MFO.WriteLine(makefiletarget + ": $(BUILD_DIR)\\" + makefiletarget);\r
MFO.WriteLine("\t@echo SAPI " + sapiname_for_printing + " build complete");\r
- MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);\r
+ if (MODE_PHPIZE) {\r
+ MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);\r
+ } else {\r
+ MFO.WriteLine("$(BUILD_DIR)\\" + makefiletarget + ": $(DEPS_" + SAPI + ") $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);\r
+ }\r
\r
if (makefiletarget.match(new RegExp("\\.dll$"))) {\r
ldflags = "/dll $(LDFLAGS)";\r
manifest = "-@$(_VC_MANIFEST_EMBED_EXE)";\r
}\r
\r
- if (ld) {\r
- MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);\r
+ if (MODE_PHPIZE) {\r
+ if (ld) {\r
+ MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);\r
+ } else {\r
+ ld = "@$(CC)";\r
+ MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");\r
+ }\r
} else {\r
- ld = "@$(CC)";\r
- MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");\r
+ if (ld) {\r
+ MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname);\r
+ } else {\r
+ ld = "@$(CC)";\r
+ MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")");\r
+ }\r
}\r
\r
if (manifest) {\r
\r
MFO.WriteLine("$(BUILD_DIR)\\" + libname + ": $(BUILD_DIR)\\" + dllname);\r
MFO.WriteBlankLines(1);\r
- MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);\r
- MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");\r
+ if (MODE_PHPIZE) {\r
+ MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(BUILD_DIR)\\" + resname);\r
+ MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");\r
+ } else {\r
+ MFO.WriteLine("$(BUILD_DIR)\\" + dllname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname);\r
+ MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")");\r
+ }\r
MFO.WriteLine("\t-@$(_VC_MANIFEST_EMBED_DLL)");\r
MFO.WriteBlankLines(1);\r
\r
obj = src.replace(re, ".obj");\r
tv += " " + sub_build + obj;\r
\r
- if (PHP_ONE_SHOT == "yes") {\r
+ if (!MODE_PHPIZE && PHP_ONE_SHOT == "yes") {\r
if (i > 0) {\r
objs_line += " " + sub_build + obj; \r
srcs_line += " " + dir + "\\" + src;\r
}\r
}\r
\r
- if (PHP_ONE_SHOT == "yes") {\r
+ if (!MODE_PHPIZE && PHP_ONE_SHOT == "yes") {\r
MFO.WriteLine(objs_line + ": " + srcs_line);\r
MFO.WriteLine("\t$(CC) $(" + flags + ") $(CFLAGS) /Fo" + sub_build + " $(" + bd_flags_name + ") /c " + srcs_line);\r
}\r
STDOUT.WriteLine("Enabled extensions:");\r
output_as_table(["Extension", "Mode"], extensions_enabled.sort());\r
STDOUT.WriteBlankLines(2);\r
-\r
- STDOUT.WriteLine("Enabled SAPI:");\r
- output_as_table(["Sapi Name"], sapi_enabled);\r
- STDOUT.WriteBlankLines(2);\r
-\r
+ if (!MODE_PHPIZE) {\r
+ STDOUT.WriteLine("Enabled SAPI:");\r
+ output_as_table(["Sapi Name"], sapi_enabled);\r
+ STDOUT.WriteBlankLines(2);\r
+ }\r
ar[0] = ['Build type', PHP_DEBUG == "yes" ? "Debug" : "Release"];\r
ar[1] = ['Thread Safety', PHP_ZTS == "yes" ? "Yes" : "No"];\r
ar[2] = ['Compiler', VC_VERSIONS[VCVERS]];\r
\r
STDOUT.WriteLine("Generating files...");\r
generate_makefile();\r
- generate_internal_functions();\r
- generate_config_h();\r
-\r
+ if (!MODE_PHPIZE) {\r
+ generate_internal_functions();\r
+ generate_config_h();\r
+ generate_phpize();\r
+ }\r
STDOUT.WriteLine("Done.");\r
STDOUT.WriteBlankLines(1);\r
write_summary();\r
outfile.Close();\r
}\r
\r
+function generate_phpize()\r
+{\r
+ STDOUT.WriteLine("Generating phpize");\r
+ dest = get_define("BUILD_DIR") + '/devel';\r
+\r
+ if (!FSO.FolderExists(dest)) {\r
+ FSO.CreateFolder(dest);\r
+ }\r
+\r
+ var MF = FSO.CreateTextFile(dest + "/phpize.js", true);\r
+ prefix = get_define("PHP_PREFIX");\r
+ prefix = prefix.replace(new RegExp("/", "g"), "\\");\r
+ prefix = prefix.replace(new RegExp("\\\\", "g"), "\\\\");\r
+ MF.WriteLine("var PHP_PREFIX=" + '"' + prefix + '"');\r
+ MF.WriteLine("var PHP_ZTS=" + '"' + (PHP_ZTS.toLowerCase() == "yes" ? "Yes" : "No") + '"');\r
+ MF.WriteLine("var VC_VERSION=" + VCVERS);\r
+ MF.WriteLine("var PHP_VERSION=" + PHP_VERSION);\r
+ MF.WriteLine("var PHP_MINOR_VERSION=" + PHP_MINOR_VERSION);\r
+ MF.WriteLine("var PHP_RELEASE_VERSION=" + PHP_RELEASE_VERSION);\r
+ MF.WriteBlankLines(2);\r
+ MF.WriteLine("/* Genereted win32/build/phpize.js.in */");\r
+ MF.WriteBlankLines(1);\r
+ MF.Write(file_get_contents("win32/build/phpize.js.in"));\r
+ MF.Close();\r
+\r
+ /* Generate flags file */\r
+ /* spit out variable definitions */\r
+ CJ = FSO.CreateTextFile(dest + "/config.phpize.js");\r
+/*\r
+ function escape(in) {\r
+ val = t.replace(new RegExp('("\\\\)', "g"), '\\$1');\r
+ }\r
+*/\r
+ //if (typeof t == "string") {\r
+ \r
+ CJ.WriteLine("var PHP_ZTS =" + '"' + PHP_ZTS + '"');\r
+ CJ.WriteLine("var PHP_LIB =" + '"' + get_define('PHPLIB') + '"');\r
+\r
+ CJ.WriteBlankLines(1);\r
+ CJ.Close();\r
+}\r
+\r
function generate_makefile()\r
{\r
STDOUT.WriteLine("Generating Makefile");\r
var MF = FSO.CreateTextFile("Makefile", true);\r
\r
MF.WriteLine("# Generated by configure.js");\r
-\r
/* spit out variable definitions */\r
var keys = (new VBArray(configure_subst.Keys())).toArray();\r
var i;\r
}\r
\r
MF.WriteBlankLines(1);\r
+ if (MODE_PHPIZE) {\r
+ var TF = FSO.OpenTextFile(PHP_DIR + "/script/Makefile.phpize", 1);\r
+ } else {\r
+ var TF = FSO.OpenTextFile("win32/build/Makefile", 1);\r
+ }\r
\r
- var TF = FSO.OpenTextFile("win32/build/Makefile", 1);\r
MF.Write(TF.ReadAll());\r
+\r
+ MF.WriteLine("install-headers:");\r
+ MF.WriteLine(" @if not exist $(PHP_PREFIX)\\include mkdir $(PHP_PREFIX)\\include >nul");\r
+ MF.WriteLine(" @for %D in ($(INSTALL_HEADERS_DIR)) do @if not exist $(PHP_PREFIX)\\include\\%D mkdir $(PHP_PREFIX)\\include\\%D >nul");\r
+ for (i in headers_install) {\r
+ if (headers_install[i][2] != "") {\r
+ MF.WriteLine(" @if not exist $(PHP_PREFIX)\\include\\" + headers_install[i][2] + " mkdir $(PHP_PREFIX)\\include\\" + \r
+ headers_install[i][2] + ">nul");\r
+ MF.WriteLine(" @copy " + headers_install[i][0] + " " + "$(PHP_PREFIX)\\include\\" + headers_install[i][2] + " /y >nul");\r
+ }\r
+ }\r
+ MF.WriteLine(" @for %D in ($(INSTALL_HEADERS_DIR)) do @copy %D*.h $(PHP_PREFIX)\\include\\%D /y >nul");\r
TF.Close();\r
\r
MF.WriteBlankLines(2);\r
return items;\r
}\r
\r
+function PHP_INSTALL_HEADERS(dir, headers_list)\r
+{\r
+ headers_list = headers_list.split(new RegExp("\\s+"));\r
+ headers_list.sort();\r
+ if (dir.length > 0 && dir.substr(dir.length - 1) != '/') {\r
+ dir += '/';\r
+ }\r
+ dir = dir.replace(new RegExp("/", "g"), "\\");\r
+\r
+ for (i in headers_list) {\r
+ src = headers_list[i];\r
+ src = src.replace(new RegExp("/", "g"), "\\");\r
+ isdir = FSO.FolderExists(dir + src);\r
+ isfile = FSO.FileExists(dir + src);\r
+ if (isdir) {\r
+ if (src.length > 0 && src.substr(src.length - 1) != '/') {\r
+ src += '\\';\r
+ }\r
+ headers_install[headers_install.length] = [dir + src, 'dir',''];\r
+ ADD_FLAG("INSTALL_HEADERS_DIR", dir + src);\r
+ } else if (isfile) {\r
+ dirname = FSO.GetParentFolderName(dir + src);\r
+ headers_install[headers_install.length] = [dir + src, 'file', dirname];\r
+ ADD_FLAG("INSTALL_HEADERS", dir + src);\r
+ } else {\r
+ STDOUT.WriteLine(headers_list);\r
+ ERROR("Cannot find header " + dir + src);\r
+ }\r
+ }\r
+}\r
\r
// for snapshot builders, this option will attempt to enable everything\r
// and you can then build everything, ignoring fatal errors within a module\r
// by running "nmake snap"\r
PHP_SNAPSHOT_BUILD = "no";\r
-ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and ignores build errors', 'no');\r
-\r
-// one-shot build optimizes build by asking compiler to build\r
-// several objects at once, reducing overhead of starting new\r
-// compiler processes.\r
-ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot builders, not so hot for edit-and-rebuild hacking', 'no');\r
+if (!MODE_PHPIZE) {\r
+ ARG_ENABLE('snapshot-build', 'Build a snapshot; turns on everything it can and ignores build errors', 'no');\r
\r
+ // one-shot build optimizes build by asking compiler to build\r
+ // several objects at once, reducing overhead of starting new\r
+ // compiler processes.\r
+ ARG_ENABLE('one-shot', 'Optimize for fast build - best for release and snapshot builders, not so hot for edit-and-rebuild hacking', 'no');\r
+}\r
\r
--- /dev/null
+@echo off
+SET PHP_BUILDCONF_PATH=%~dp0
+cscript /nologo %PHP_BUILDCONF_PATH%\script\phpize.js %*
+copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul
+IF NOT EXIST %PHP_BUILDCONF_PATH% (echo Error generating configure script, configure script was not copied) ELSE (echo Now run 'configure --help')
+SET PHP_BUILDCONF_PATH=
--- /dev/null
+/*\r
+ +----------------------------------------------------------------------+\r
+ | PHP Version 5 |\r
+ +----------------------------------------------------------------------+\r
+ | Copyright (c) 1997-2008 The PHP Group |\r
+ +----------------------------------------------------------------------+\r
+ | This source file is subject to version 3.01 of the PHP license, |\r
+ | that is bundled with this package in the file LICENSE, and is |\r
+ | available through the world-wide-web at the following url: |\r
+ | http://www.php.net/license/3_01.txt |\r
+ | If you did not receive a copy of the PHP license and are unable to |\r
+ | obtain it through the world-wide-web, please send a note to |\r
+ | license@php.net so we can mail you a copy immediately. |\r
+ +----------------------------------------------------------------------+\r
+ | Author: Pierre Joye <pierre1@php.net> |\r
+ +----------------------------------------------------------------------+\r
+*/\r
+\r
+/* $Id$ */\r
+// This generates a configure script for win32 build\r
+\r
+var STDOUT = WScript.StdOut;\r
+\r
+var FSO = WScript.CreateObject("Scripting.FileSystemObject");\r
+var C = FSO.CreateTextFile("configure.js", true);\r
+var B = FSO.CreateTextFile("configure.bat", true);\r
+var DSP = false;\r
+re = /\\script/i;\r
+var PHP_DIR=FSO.GetParentFolderName(WScript.ScriptFullName).replace(re,"");\r
+\r
+var modules = "";\r
+var MODULES = WScript.CreateObject("Scripting.Dictionary");\r
+var module_dirs = new Array();\r
+\r
+function ERROR(msg)\r
+{\r
+ STDERR.WriteLine("ERROR: " + msg);\r
+ WScript.Quit(3);\r
+}\r
+\r
+function file_get_contents(filename)\r
+{\r
+ var F = FSO.OpenTextFile(filename, 1);\r
+ var t = F.ReadAll();\r
+ F.Close();\r
+ return t;\r
+}\r
+\r
+function Module_Item(module_name, config_path, dir_line, deps, content)\r
+{\r
+ this.module_name = module_name;\r
+ this.config_path = config_path;\r
+ this.dir_line = dir_line;\r
+ this.deps = deps;\r
+ this.content = content;\r
+}\r
+\r
+function get_module_dep(contents)\r
+{\r
+ var re_dep_line = new RegExp("ADD_EXTENSION_DEP\\([^,]*\\s*,\\s*['\"]([^'\"]+)['\"].*\\)", "gm");\r
+ var calls = contents.match(re_dep_line);\r
+ if (calls != null) {\r
+ for (i = 0; i < calls.length; i++) {\r
+ // now we need the extension name out of this thing\r
+ if (calls[i].match(re_dep_line)) {\r
+ deps[deps.length] = RegExp.$1;\r
+\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+function find_config_w32(dirname)\r
+{\r
+ if (!FSO.FolderExists(dirname)) {\r
+ return;\r
+ }\r
+\r
+ var f = FSO.GetFolder(dirname);\r
+ var fc = new Enumerator(f.SubFolders);\r
+ var c, i, ok, n;\r
+ var item = null;\r
+\r
+ c = dirname + "\\config.w32";\r
+ if (FSO.FileExists(c)) {\r
+ var dir_line = "configure_module_dirname = condense_path(FSO.GetParentFolderName('"\r
+ + c.replace(new RegExp('(["\\\\])', "g"), '\\$1') + "'));\r\n";\r
+ var contents = file_get_contents(c);\r
+ var deps = new Array();\r
+\r
+ get_module_dep(contents);\r
+\r
+ item = new Module_Item(n, c, dir_line, deps, contents);\r
+ MODULES.Add(n, item);\r
+ }\r
+\r
+ for (; !fc.atEnd(); fc.moveNext()) {\r
+ /* check if we already picked up a module with the same dirname;\r
+ * if we have, don't include it here */\r
+ n = FSO.GetFileName(fc.item());\r
+ if (n == '.svn' || n == 'tests' || n == '.git') {\r
+ continue;\r
+ }\r
+\r
+ c = FSO.BuildPath(fc.item(), "config.w32");\r
+ if (FSO.FileExists(c)) {\r
+ var dir_line = "configure_module_dirname = condense_path(FSO.GetParentFolderName('"\r
+ + c.replace(new RegExp('(["\\\\])', "g"), '\\$1') + "'));\r\n";\r
+ var contents = file_get_contents(c);\r
+ var deps = new Array();\r
+\r
+ get_module_dep(contents);\r
+\r
+ item = new Module_Item(n, c, dir_line, deps, contents);\r
+ MODULES.Add(n, item);\r
+ }\r
+ }\r
+}\r
+\r
+function emit_module(item)\r
+{\r
+ return item.dir_line + item.content;\r
+}\r
+\r
+function emit_dep_modules(module_names)\r
+{\r
+ var i, mod_name, j;\r
+ var output = "";\r
+ var item = null;\r
+\r
+ for (i in module_names) {\r
+ mod_name = module_names[i];\r
+\r
+ if (MODULES.Exists(mod_name)) {\r
+ item = MODULES.Item(mod_name);\r
+ MODULES.Remove(mod_name);\r
+ if (item.deps.length) {\r
+ output += emit_dep_modules(item.deps);\r
+ }\r
+ output += emit_module(item);\r
+ }\r
+ }\r
+\r
+ return output;\r
+}\r
+\r
+function gen_modules()\r
+{\r
+ var module_names = (new VBArray(MODULES.Keys())).toArray();\r
+ var i, mod_name, j;\r
+ var item;\r
+ var output = "";\r
+\r
+ // first, look for modules with empty deps; emit those first\r
+ for (i in module_names) {\r
+ STDOUT.WriteLine("module ... " + module_names);\r
+ mod_name = module_names[i];\r
+ item = MODULES.Item(mod_name);\r
+ if (item.deps.length == 0) {\r
+ MODULES.Remove(mod_name);\r
+ output += emit_module(item);\r
+ }\r
+ }\r
+\r
+ // now we are left with modules that have dependencies on other modules\r
+ module_names = (new VBArray(MODULES.Keys())).toArray();\r
+ output += emit_dep_modules(module_names);\r
+\r
+ return output;\r
+}\r
+\r
+// Process buildconf arguments\r
+function buildconf_process_args()\r
+{\r
+ args = WScript.Arguments;\r
+\r
+ for (i = 0; i < args.length; i++) {\r
+ arg = args(i);\r
+ // If it is --foo=bar, split on the equals sign\r
+ arg = arg.split("=", 2);\r
+ argname = arg[0];\r
+ if (arg.length > 1) {\r
+ argval = arg[1];\r
+ } else {\r
+ argval = null;\r
+ }\r
+\r
+ if (argname == '--clean' && argval != null) {\r
+ STDOUT.WriteLine("Cleaning...");\r
+ return 0;\r
+ }\r
+\r
+ if (argname == '--help') {\r
+ STDOUT.WriteLine("Usage: phpize [--clean|--help|--version|-v]");\r
+ return 0;\r
+ }\r
+ return 1;\r
+ }\r
+}\r
+\r
+if (buildconf_process_args() == 0) {\r
+ WScript.Quit(3);\r
+}\r
+STDOUT.WriteLine("Rebuilding configure.js");\r
+STDOUT.WriteLine(PHP_DIR);\r
+\r
+// Write the head of the configure script\r
+C.WriteLine("/* This file automatically generated from script/confutils.js */");\r
+C.WriteLine("var MODE_PHPIZE = true;");\r
+C.WriteLine("var PHP_DIR = " + '"' + PHP_DIR.replace(new RegExp('(["\\\\])', "g"), '\\$1') + '"');\r
+\r
+C.Write(file_get_contents(PHP_DIR + "/script/confutils.js"));\r
+C.Write(file_get_contents(PHP_DIR + "/script/config.phpize.js"));\r
+\r
+// If project files were requested, pull in the code to generate them\r
+if (DSP == true) {\r
+ C.WriteLine('PHP_DSP="yes"');\r
+ C.WriteBlankLines(1);\r
+ C.Write(file_get_contents(PHP_DIR + "win32/build/projectgen.js"));\r
+} else {\r
+ C.WriteLine('PHP_DSP="no"');\r
+ C.WriteBlankLines(1);\r
+}\r
+\r
+// Pull in code from sapi and extensions\r
+modules = file_get_contents(PHP_DIR + "/script/config.w32.phpize.in");\r
+\r
+C.WriteLine("ARG_ENABLE('debug', 'Compile with debugging symbols', \"no\");");\r
+find_config_w32(".");\r
+\r
+// Now generate contents of module based on MODULES, chasing dependencies\r
+// to ensure that dependent modules are emitted first\r
+modules += gen_modules();\r
+\r
+// Look for ARG_ENABLE or ARG_WITH calls\r
+re = new RegExp("(ARG_(ENABLE|WITH)\([^;]+\);)", "gm");\r
+calls = modules.match(re);\r
+for (i = 0; i < calls.length; i++) {\r
+ item = calls[i];\r
+ C.WriteLine("try {");\r
+ C.WriteLine(item);\r
+ C.WriteLine("} catch (e) {");\r
+ C.WriteLine('\tSTDOUT.WriteLine("problem: " + e);');\r
+ C.WriteLine("}");\r
+}\r
+\r
+C.WriteBlankLines(1);\r
+C.WriteLine("conf_process_args();");\r
+C.WriteBlankLines(1);\r
+\r
+C.Write(file_get_contents(PHP_DIR + "/script/config.w32.phpize.in"));\r
+\r
+// Comment out the calls from their original positions\r
+modules = modules.replace(re, "/* $1 */");\r
+C.Write(modules);\r
+\r
+\r
+C.WriteBlankLines(1);\r
+C.Write(file_get_contents(PHP_DIR + "\\script\\configure.tail"));\r
+\r
+B.WriteLine("@echo off");\r
+B.WriteLine("cscript /nologo configure.js %*");\r
REGEDIT4\r
\r
-[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.1.0-dev]\r
+[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\PHP-5.3.5-dev]\r
"TypesSupported"=dword:00000007\r
-"EventMessageFile"="C:\\php5\\php5ts.dll"\r
+"EventMessageFile"="g:\\test\\php53install\\php5ts.dll"\r