xref: /PHP-7.4/win32/build/config.w32.phpize.in (revision 1ad08256)
1ef04bc4aSAnatol Belski// vim:ft=javascript
224e1ae0eSPeter Kokot// "Master" config file; think of it as a configure.ac
3ef04bc4aSAnatol Belski// equivalent.
4ef04bc4aSAnatol Belski
5978cef04SAnatol BelskiARG_WITH("verbosity", "Output verbosity, 0-2.", "1");
6978cef04SAnatol Belskisetup_verbosity();
7978cef04SAnatol Belski
8ef04bc4aSAnatol BelskiARG_WITH("toolset", "Toolset to use for the compilation, give: vs, clang, icc. " +
9ef04bc4aSAnatol Belski		"The only recommended and supported toolset for production use " +
10ef04bc4aSAnatol Belski		"is Visual Studio. Use others at your own risk.", "vs");
11ef04bc4aSAnatol Belskitoolset_option_handle()
12ef04bc4aSAnatol Belski
13ef04bc4aSAnatol Belskivar PHP_CYGWIN="notset";
14ef04bc4aSAnatol Belski
15ef04bc4aSAnatol Belskitoolset_setup_compiler();
16ef04bc4aSAnatol Belski
17ef04bc4aSAnatol Belski// do we use x64 or 80x86 version of compiler?
18ef04bc4aSAnatol BelskiX64 = toolset_is_64();
19ef04bc4aSAnatol Belskitoolset_setup_arch();
20ef04bc4aSAnatol Belski
21ef04bc4aSAnatol Belskitoolset_setup_linker();
22ef04bc4aSAnatol Belskitoolset_setup_project_tools();
23ef04bc4aSAnatol Belski
24ef04bc4aSAnatol Belski// stick objects somewhere outside of the source tree
25ef04bc4aSAnatol BelskiARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', '');
26ef04bc4aSAnatol Belskiobject_out_dir_option_handle();
27ef04bc4aSAnatol Belski
28ef04bc4aSAnatol BelskiARG_ENABLE('debug', 'Compile with debugging symbols', PHP_DEBUG);
29ef04bc4aSAnatol BelskiARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no');
30ef04bc4aSAnatol Belskiif (PHP_DEBUG == "yes" && PHP_DEBUG_PACK == "yes") {
31ef04bc4aSAnatol Belski	ERROR("Use of both --enable-debug and --enable-debug-pack not allowed.");
32ef04bc4aSAnatol Belski}
33ef04bc4aSAnatol Belski
34ef04bc4aSAnatol Belskiif (PHP_PREFIX == '') {
35ef04bc4aSAnatol Belski	PHP_PREFIX = "C:\\php";
36ef04bc4aSAnatol Belski	if (PHP_DEBUG == "yes")
37ef04bc4aSAnatol Belski		PHP_PREFIX += "\\debug";
38ef04bc4aSAnatol Belski}
39ef04bc4aSAnatol BelskiDEFINE('PHP_PREFIX', PHP_PREFIX);
40ef04bc4aSAnatol Belski
41ef04bc4aSAnatol BelskiDEFINE("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 ");
42ef04bc4aSAnatol Belski
43ef04bc4aSAnatol Belskitoolset_setup_common_cflags();
44ef04bc4aSAnatol Belski
456ed71363Sy-utiARG_WITH('prefix', 'PHP installation prefix', PHP_PREFIX);
46ef04bc4aSAnatol BelskiARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for compilation', 'auto');
47ef04bc4aSAnatol Belskivar PHP_MP_DISABLED = true;
48ef04bc4aSAnatol Belskiif (VS_TOOLSET && PHP_MP != 'disable') {
49*37c329d7SPeter Kokot		// no from disable-all
50ef04bc4aSAnatol Belski		if(PHP_MP == 'auto' || PHP_MP == 'no') {
51ef04bc4aSAnatol Belski			 ADD_FLAG('CFLAGS', ' /MP ');
52ef04bc4aSAnatol Belski			PHP_MP_DISABLED = false;
53ef04bc4aSAnatol Belski		} else {
54ef04bc4aSAnatol Belski			if(parseInt(PHP_MP) != 0) {
55ef04bc4aSAnatol Belski				ADD_FLAG('CFLAGS', ' /MP'+ PHP_MP +' ');
56ef04bc4aSAnatol Belski				PHP_MP_DISABLED = false;
57ef04bc4aSAnatol Belski			} else {
58ef04bc4aSAnatol Belski				STDOUT.WriteLine('WARNING: Invalid argument for MP: ' + PHP_MP);
59ef04bc4aSAnatol Belski			}
60ef04bc4aSAnatol Belski		}
61ef04bc4aSAnatol Belski}
62ef04bc4aSAnatol Belski
63ef04bc4aSAnatol Belski/* For snapshot builders, where can we find the additional
64ef04bc4aSAnatol Belski * files that make up the snapshot template? */
65ef04bc4aSAnatol BelskiARG_WITH("snapshot-template", "Path to snapshot builder template dir", "no");
66ef04bc4aSAnatol Belski
67ef04bc4aSAnatol Belski// General link flags
68ef04bc4aSAnatol Belskitoolset_setup_common_ldlags();
69ef04bc4aSAnatol Belski
70ef04bc4aSAnatol Belski// General libs
71ef04bc4aSAnatol Belskitoolset_setup_common_libs();
72ef04bc4aSAnatol Belski
73ef04bc4aSAnatol Belski// Set some debug/release specific options
74ef04bc4aSAnatol Belskitoolset_setup_build_mode();
75ef04bc4aSAnatol Belski
76ef04bc4aSAnatol Belskisetup_zts_stuff();
77ef04bc4aSAnatol Belski
78ef04bc4aSAnatol Belskiif (MODE_PHPIZE) {
79ef04bc4aSAnatol Belski	DEFINE("PHPDLL", PHP_DLL);
80ef04bc4aSAnatol Belski	DEFINE("PHPLIB", PHP_DLL_LIB);
81ef04bc4aSAnatol Belski}
82ef04bc4aSAnatol Belski
83ef04bc4aSAnatol Belski// Find the php_build dir - it contains headers and libraries
84ef04bc4aSAnatol Belski// that we need
85ef04bc4aSAnatol BelskiARG_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');
86ef04bc4aSAnatol Belskiphp_build_option_handle();
87ef04bc4aSAnatol Belski
88ef04bc4aSAnatol BelskiARG_WITH('extra-includes', 'Extra include path to use when building everything', '');
89ef04bc4aSAnatol BelskiARG_WITH('extra-libs', 'Extra library path to use when linking everything', '');
90ef04bc4aSAnatol Belski
91ef04bc4aSAnatol Belskivar php_usual_include_suspects = PHP_PHP_BUILD+"\\include";
92ef04bc4aSAnatol Belskivar php_usual_lib_suspects = PHP_PHP_BUILD+"\\lib";
93ef04bc4aSAnatol Belski
94ef04bc4aSAnatol BelskiADD_FLAG("CFLAGS", '/I "' + php_usual_include_suspects + '" ');
95ef04bc4aSAnatol BelskiADD_FLAG("LDFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" ');
96ef04bc4aSAnatol BelskiADD_FLAG("ARFLAGS", '/libpath:"\\"' + php_usual_lib_suspects + '\\"" ');
97ef04bc4aSAnatol Belski
98ef04bc4aSAnatol Belskiprobe_basic_headers();
99ef04bc4aSAnatol Belskiadd_extra_dirs();
100ef04bc4aSAnatol Belski
101ef04bc4aSAnatol Belski//DEFINE("PHP_BUILD", PHP_PHP_BUILD);
102ef04bc4aSAnatol Belski
103ef04bc4aSAnatol BelskiSTDOUT.WriteBlankLines(1);
104ef04bc4aSAnatol BelskiSTDOUT.WriteLine("Build dir: " + get_define('BUILD_DIR'));
105ef04bc4aSAnatol BelskiSTDOUT.WriteLine("PHP Core:  " + get_define('PHPDLL') + " and " + get_define('PHPLIB'));
106ef04bc4aSAnatol Belski
107ef04bc4aSAnatol Belski/* XXX inspect this for other toolsets */
108ef04bc4aSAnatol Belski//AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);
109ef04bc4aSAnatol Belski
110ef04bc4aSAnatol BelskiAC_DEFINE('HAVE_STRNLEN', 1);
111ef04bc4aSAnatol Belski
112ef04bc4aSAnatol BelskiSTDOUT.WriteBlankLines(1);
113ef04bc4aSAnatol Belski
114ef04bc4aSAnatol Belskiif (PHP_SNAPSHOT_TEMPLATE == "no") {
115ef04bc4aSAnatol Belski	/* default is as a sibling of the php_build dir */
116ef04bc4aSAnatol Belski	if (FSO.FolderExists(PHP_PHP_BUILD + "\\template")) {
117ef04bc4aSAnatol Belski		PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\template");
118ef04bc4aSAnatol Belski	} else if (FSO.FolderExists(PHP_PHP_BUILD + "\\..\\template")) {
119ef04bc4aSAnatol Belski		PHP_SNAPSHOT_TEMPLATE = FSO.GetAbsolutePathName(PHP_PHP_BUILD + "\\..\\template");
120ef04bc4aSAnatol Belski	}
121ef04bc4aSAnatol Belski}
122ef04bc4aSAnatol Belski
123ef04bc4aSAnatol BelskiDEFINE('SNAPSHOT_TEMPLATE', PHP_SNAPSHOT_TEMPLATE);
124ef04bc4aSAnatol Belski
125ef04bc4aSAnatol BelskiAC_DEFINE("PHP_DIR", PHP_DIR);
126ef04bc4aSAnatol BelskiDEFINE("PHP_DIR", PHP_DIR);
127ef04bc4aSAnatol Belski
128ef04bc4aSAnatol BelskiARG_WITH("codegen-arch", "Architecture for code generation", "no");
129ef04bc4aSAnatol Belskitoolset_setup_codegen_arch();
130ef04bc4aSAnatol Belski
131dfcbc2c3SAnatol BelskiARG_ENABLE("native-intrinsics", "Comma separated list of intrinsic optimizations to enable. \
132dfcbc2c3SAnatol Belski	Available optimization names are sse, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2. \
133dfcbc2c3SAnatol Belski	SSE and SSE2 are enabled by default. The best optimization specified will \
134dfcbc2c3SAnatol Belski	automatically enable all the older optimizations. Note, that the produced binary \
135dfcbc2c3SAnatol Belski	might not work properly, if the optimizations are not available on the target \
136dfcbc2c3SAnatol Belski	processor.", "no");
137dfcbc2c3SAnatol Belskitoolset_setup_intrinsic_cflags();
138