1// vim:ft=javascript 2// $Id: config.w32 306241 2010-12-11 22:18:10Z pajoye $ 3// "Master" config file; think of it as a configure.in 4// equivalent. 5 6ARG_WITH("toolset", "Toolset to use for the compilation, give: vs, clang, icc. " + 7 "The only recommended and supported toolset for production use " + 8 "is Visual Studio. Use others at your own risk.", "vs"); 9toolset_option_handle() 10 11var PHP_CYGWIN="notset"; 12 13toolset_setup_compiler(); 14 15// do we use x64 or 80x86 version of compiler? 16X64 = toolset_is_64(); 17toolset_setup_arch(); 18 19toolset_setup_linker(); 20toolset_setup_project_tools(); 21 22// stick objects somewhere outside of the source tree 23ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', ''); 24object_out_dir_option_handle(); 25 26ARG_ENABLE('debug', 'Compile with debugging symbols', PHP_DEBUG); 27ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no'); 28if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") { 29 ERROR("Use of both --enable-debug and --enable-debug-pack not allowed."); 30} 31 32if (PHP_PREFIX == '') { 33 PHP_PREFIX = "C:\\php"; 34 if (PHP_DEBUG == "yes") 35 PHP_PREFIX += "\\debug"; 36} 37DEFINE('PHP_PREFIX', PHP_PREFIX); 38 39DEFINE("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 "); 40 41toolset_setup_common_cflags(); 42 43ARG_WITH('prefix', 'PHP installation prefix', PHP_PREFIX); 44ARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for compilation', 'auto'); 45var PHP_MP_DISABLED = true; 46if (VS_TOOLSET && PHP_MP != 'disable') { 47 // no from disable-all 48 if(PHP_MP == 'auto' || PHP_MP == 'no') { 49 ADD_FLAG('CFLAGS', ' /MP '); 50 PHP_MP_DISABLED = false; 51 } else { 52 if(parseInt(PHP_MP) != 0) { 53 ADD_FLAG('CFLAGS', ' /MP'+ PHP_MP +' '); 54 PHP_MP_DISABLED = false; 55 } else { 56 STDOUT.WriteLine('WARNING: Invalid argument for MP: ' + PHP_MP); 57 } 58 } 59} 60 61/* For snapshot builders, where can we find the additional 62 * files that make up the snapshot template? */ 63ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no"); 64 65// General link flags 66toolset_setup_common_ldlags(); 67 68// General libs 69toolset_setup_common_libs(); 70 71// Set some debug/release specific options 72toolset_setup_build_mode(); 73 74setup_zts_stuff(); 75 76if (MODE_PHPIZE) { 77 DEFINE("PHPDLL", PHP_DLL); 78 DEFINE("PHPLIB", PHP_DLL_LIB); 79} 80 81// Find the php_build dir - it contains headers and libraries 82// that we need 83ARG_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'); 84php_build_option_handle(); 85 86ARG_WITH('extra-includes', 'Extra include path to use when building everything', ''); 87ARG_WITH('extra-libs', 'Extra library path to use when linking everything', ''); 88 89var php_usual_include_suspects = PHP_PHP_BUILD+"\\include"; 90var php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib"; 91 92ADD_FLAG("CFLAGS", '/I "' + php_usual_include_suspects + '" '); 93ADD_FLAG("LDFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" '); 94ADD_FLAG("ARFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" '); 95 96probe_basic_headers(); 97add_extra_dirs(); 98 99//DEFINE("PHP_BUILD", PHP_PHP_BUILD); 100 101STDOUT.WriteBlankLines(1); 102STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR')); 103STDOUT.WriteLine("PHP Core: " + get_define('PHPDLL') + " and " + get_define('PHPLIB')); 104 105/* XXX inspect this for other toolsets */ 106//AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1); 107 108AC_DEFINE('HAVE_STRNLEN', 1); 109 110STDOUT.WriteBlankLines(1); 111 112if (PHP_SNAPSHOT_TEMPLATE == "no") { 113 /* default is as a sibling of the php_build dir */ 114 if (FSO.FolderExists(PHP_PHP_BUILD + "\\template")) { 115 PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\template"); 116 } else if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) { 117 PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template"); 118 } 119} 120 121DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE); 122 123AC_DEFINE("PHP_DIR", PHP_DIR); 124DEFINE("PHP_DIR", PHP_DIR); 125 126ARG_WITH("codegen-arch", "Architecture for code generation", "no"); 127toolset_setup_codegen_arch(); 128 129