config.w32.phpize.in 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // vim:ft=javascript
  2. // "Master" config file; think of it as a configure.ac
  3. // equivalent.
  4. ARG_WITH("verbosity", "Output verbosity, 0-2.", "1");
  5. setup_verbosity();
  6. ARG_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");
  9. toolset_option_handle()
  10. var PHP_CYGWIN="notset";
  11. toolset_setup_compiler();
  12. // do we use x64 or 80x86 version of compiler?
  13. X64 = toolset_is_64();
  14. toolset_setup_arch();
  15. toolset_setup_linker();
  16. toolset_setup_project_tools();
  17. // stick objects somewhere outside of the source tree
  18. ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', '');
  19. object_out_dir_option_handle();
  20. ARG_ENABLE('debug', 'Compile with debugging symbols', PHP_DEBUG);
  21. ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no');
  22. if (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") {
  23. ERROR("Use of both --enable-debug and --enable-debug-pack not allowed.");
  24. }
  25. if (PHP_PREFIX == '') {
  26. PHP_PREFIX = "C:\\php";
  27. if (PHP_DEBUG == "yes")
  28. PHP_PREFIX += "\\debug";
  29. }
  30. DEFINE('PHP_PREFIX', PHP_PREFIX);
  31. 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 ");
  32. toolset_setup_common_cflags();
  33. ARG_WITH('prefix', 'PHP installation prefix', PHP_PREFIX);
  34. ARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for compilation', 'auto');
  35. var PHP_MP_DISABLED = true;
  36. if (VS_TOOLSET && PHP_MP != 'disable') {
  37. // no from disable-all
  38. if(PHP_MP == 'auto' || PHP_MP == 'no') {
  39. ADD_FLAG('CFLAGS', ' /MP ');
  40. PHP_MP_DISABLED = false;
  41. } else {
  42. if(parseInt(PHP_MP) != 0) {
  43. ADD_FLAG('CFLAGS', ' /MP'+ PHP_MP +' ');
  44. PHP_MP_DISABLED = false;
  45. } else {
  46. STDOUT.WriteLine('WARNING: Invalid argument for MP: ' + PHP_MP);
  47. }
  48. }
  49. }
  50. /* For snapshot builders, where can we find the additional
  51. * files that make up the snapshot template? */
  52. ARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no");
  53. // General link flags
  54. toolset_setup_common_ldlags();
  55. // General libs
  56. toolset_setup_common_libs();
  57. // Set some debug/release specific options
  58. toolset_setup_build_mode();
  59. setup_zts_stuff();
  60. if (MODE_PHPIZE) {
  61. DEFINE("PHPDLL", PHP_DLL);
  62. DEFINE("PHPLIB", PHP_DLL_LIB);
  63. }
  64. // Find the php_build dir - it contains headers and libraries
  65. // that we need
  66. 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');
  67. php_build_option_handle();
  68. ARG_WITH('extra-includes', 'Extra include path to use when building everything', '');
  69. ARG_WITH('extra-libs', 'Extra library path to use when linking everything', '');
  70. var php_usual_include_suspects = PHP_PHP_BUILD+"\\include";
  71. var php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib";
  72. ADD_FLAG("CFLAGS", '/I "' + php_usual_include_suspects + '" ');
  73. ADD_FLAG("LDFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" ');
  74. ADD_FLAG("ARFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" ');
  75. probe_basic_headers();
  76. add_extra_dirs();
  77. //DEFINE("PHP_BUILD", PHP_PHP_BUILD);
  78. STDOUT.WriteBlankLines(1);
  79. STDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR'));
  80. STDOUT.WriteLine("PHP Core: " + get_define('PHPDLL') + " and " + get_define('PHPLIB'));
  81. /* XXX inspect this for other toolsets */
  82. //AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);
  83. AC_DEFINE('HAVE_STRNLEN', 1);
  84. STDOUT.WriteBlankLines(1);
  85. if (PHP_SNAPSHOT_TEMPLATE == "no") {
  86. /* default is as a sibling of the php_build dir */
  87. if (FSO.FolderExists(PHP_PHP_BUILD + "\\template")) {
  88. PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\template");
  89. } else if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) {
  90. PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template");
  91. }
  92. }
  93. DEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE);
  94. AC_DEFINE("PHP_DIR", PHP_DIR);
  95. DEFINE("PHP_DIR", PHP_DIR);
  96. ARG_WITH("codegen-arch", "Architecture for code generation", "no");
  97. toolset_setup_codegen_arch();
  98. ARG_ENABLE("native-intrinsics", "Comma separated list of intrinsic optimizations to enable. \
  99. Available optimization names are sse, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2. \
  100. SSE and SSE2 are enabled by default. The best optimization specified will \
  101. automatically enable all the older optimizations. Note, that the produced binary \
  102. might not work properly, if the optimizations are not available on the target \
  103. processor.", "no");
  104. toolset_setup_intrinsic_cflags();