--- embedaddon/php/win32/build/config.w32 2012/02/21 23:48:06 1.1.1.1 +++ embedaddon/php/win32/build/config.w32 2012/05/29 12:34:34 1.1.1.2 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32,v 1.1.1.1 2012/02/21 23:48:06 misho Exp $ +// $Id: config.w32,v 1.1.1.2 2012/05/29 12:34:34 misho Exp $ // "Master" config file; think of it as a configure.in // equivalent. @@ -19,6 +19,11 @@ if (!PHP_CL) { // Which version of the compiler do we have? VCVERS = probe_binary(PHP_CL).substr(0, 5).replace('.', ''); STDOUT.WriteLine(" Detected compiler " + VC_VERSIONS[VCVERS]); + +if (VCVERS < 1500) { + ERROR("Unsupported MS C++ Compiler, VC9 (2008) minimum is required"); +} + AC_DEFINE('COMPILER', VC_VERSIONS[VCVERS], "Detected compiler version"); DEFINE("PHP_COMPILER_SHORT", VC_VERSIONS_SHORT[VCVERS]); AC_DEFINE('PHP_COMPILER_ID', VC_VERSIONS_SHORT[VCVERS], "Compiler compatibility ID"); @@ -100,6 +105,19 @@ ARG_ENABLE('debug-pack', 'Release binaries with extern if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") { ERROR("Use of both --enable-debug and --enable-debug-pack not allowed."); } + +ARG_ENABLE('pgi', 'Generate PGO instrumented binaries', 'no'); +ARG_WITH('pgo', 'Compile optimized binaries using training data from folder', 'no'); +if (PHP_PGI == "yes" || PHP_PGO != "no") { + PGOMGR = PATH_PROG('pgomgr', WshShell.Environment("Process").Item("PATH")); + if (!PGOMGR) { + ERROR("--enable-pgi and --with-pgo options can only be used if PGO capable compiler is present."); + } + if (PHP_PGI == "yes" && PHP_PGO != "no") { + ERROR("Use of both --enable-pgi and --with-pgo not allowed."); + } +} + ARG_ENABLE('zts', 'Thread safety', 'yes'); // Configures the hard-coded installation dir ARG_WITH('prefix', 'where PHP will be installed', ''); @@ -229,6 +247,19 @@ if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") { DEFINE("PHPLIB", "php" + PHP_VERSION + ".lib"); } +// CFLAGS, LDFLAGS and BUILD_DIR are defined +// Add compiler and link flags if PGO options are selected +if (PHP_DEBUG != "yes" && PHP_PGI == "yes") { + ADD_FLAG('CFLAGS', "/GL /O2"); + ADD_FLAG('LDFLAGS', "/LTCG:PGINSTRUMENT"); + DEFINE("PGOPGD_DIR", "$(BUILD_DIR)"); +} +else if (PHP_DEBUG != "yes" && PHP_PGO != "no") { + ADD_FLAG('CFLAGS', "/GL /O2"); + ADD_FLAG('LDFLAGS', "/LTCG:PGUPDATE"); + DEFINE("PGOPGD_DIR", ((PHP_PGO.length == 0 || PHP_PGO == "yes") ? "$(BUILD_DIR)" : PHP_PGO)); +} + // Find the php_build dir - it contains headers and libraries // that we need 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'); @@ -328,13 +359,13 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_langu zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \ zend_object_handlers.c zend_objects_API.c \ zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c \ - zend_float.c zend_canary.c zend_alloc_canary.c"); + zend_float.c zend_string.c"); if (VCVERS == 1200) { AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1); } -ADD_SOURCES("main", "main.c snprintf.c spprintf.c safe_mode.c getopt.c fopen_wrappers.c \ +ADD_SOURCES("main", "main.c snprintf.c spprintf.c getopt.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 php_sprintf.c"); @@ -358,6 +389,7 @@ PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/stream STDOUT.WriteBlankLines(1); + /* Can we build with IPv6 support? */ ARG_ENABLE("ipv6", "Disable IPv6 support (default is turn it on if available)", "yes"); @@ -377,15 +409,8 @@ AC_DEFINE('HAVE_IPV6', main_network_has_ipv6); ARG_ENABLE('fd-setsize', "Set maximum number of sockets for select(2)", "256"); ADD_FLAG("CFLAGS", "/D FD_SETSIZE=" + parseInt(PHP_FD_SETSIZE)); -ARG_ENABLE("zend-multibyte", "Enable Zend multibyte encoding support", "no"); -if (PHP_ZEND_MULTIBYTE == "yes") { - STDOUT.WriteLine("Enabling Zend multibyte encoding support"); - AC_DEFINE('ZEND_MULTIBYTE', 1); -} - AC_DEFINE('HAVE_USLEEP', 1); AC_DEFINE('HAVE_STRCOLL', 1); -AC_DEFINE('SUHOSIN_PATCH', 1); /* For snapshot builders, where can we find the additional * files that make up the snapshot template? */ @@ -409,7 +434,7 @@ if (PHP_DSP != "no") { FSO.CreateFolder("tmp"); } -ARG_ENABLE("security-flags", "Enable the compiler security flags", "no"); +ARG_ENABLE("security-flags", "Disable the compiler security flags", "yes"); if (PHP_SECURITY_FLAGS == "yes") { ADD_FLAG("LDFLAGS", "/NXCOMPAT /DYNAMICBASE "); }