Skip to content

Commit fc734cf

Browse files
committed
further catch up with phpize and improved clang arch setup
1 parent cfd2b39 commit fc734cf

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

win32/build/config.w32

-7
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ DEFINE('PHP_PREFIX', PHP_PREFIX);
6868

6969
DEFINE("BASE_INCLUDES", "/I . /I main /I Zend /I TSRM /I ext ");
7070

71-
// CFLAGS for building the PHP dll
72-
DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP7DLLTS_EXPORTS /D PHP_EXPORTS \
73-
/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=" + WINVER);
74-
75-
DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');
76-
77-
// General CFLAGS for building objects
7871
toolset_setup_common_cflags();
7972

8073
ARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for compilation', 'auto');

win32/build/config.w32.phpize.in

-7
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ DEFINE('PHP_PREFIX', PHP_PREFIX);
5353

5454
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 ");
5555

56-
// CFLAGS for building the PHP dll
57-
DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP7DLLTS_EXPORTS /D PHP_EXPORTS \
58-
/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=" + WINVER);
59-
60-
DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');
61-
62-
// General CFLAGS for building objects
6356
toolset_setup_common_cflags();
6457

6558
ARG_WITH('prefix', 'PHP installation prefix', '');

win32/build/confutils.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -2480,10 +2480,15 @@ function toolset_is_64()
24802480
if (VS_TOOLSET) {
24812481
return probe_binary(PHP_CL, 64);
24822482
} else if (CLANG_TOOLSET) {
2483-
var command = 'cmd /c ""' + PHP_CL + '" -v"';
2483+
/*var command = 'cmd /c ""' + PHP_CL + '" -v"';
24842484
var full = execute(command + '" 2>&1"');
24852485
2486-
return null != full.match(/x86_64/);
2486+
return null != full.match(/x86_64/);*/
2487+
2488+
/* Even executed within an environment setup with vcvars32.bat,
2489+
clang-cl doesn't recognize the arch toolset. But as it needs
2490+
the VS environment, checking the arch of cl.exe is correct. */
2491+
return probe_binary(PATH_PROG('cl', null), 64);
24872492
} else if (INTEL_TOOLSET) {
24882493
var command = 'cmd /c ""' + PHP_CL + '" -v"';
24892494
var full = execute(command + '" 2>&1"');
@@ -2511,6 +2516,13 @@ function toolset_setup_linker()
25112516

25122517
function toolset_setup_common_cflags()
25132518
{
2519+
// CFLAGS for building the PHP dll
2520+
DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP7DLLTS_EXPORTS /D PHP_EXPORTS \
2521+
/D LIBZEND_EXPORTS /D TSRM_EXPORTS /D SAPI_EXPORTS /D WINVER=" + WINVER);
2522+
2523+
DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');
2524+
2525+
// General CFLAGS for building objects
25142526
DEFINE("CFLAGS", "/nologo $(BASE_INCLUDES) /D _WINDOWS \
25152527
/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 ");
25162528

@@ -2545,9 +2557,9 @@ function toolset_setup_common_cflags()
25452557

25462558
} else if (CLANG_TOOLSET) {
25472559
if (X64) {
2548-
ADD_FLAG('CFLAGS', ' -m64 ');
2560+
ADD_FLAG('CFLAGS', '-m64');
25492561
} else {
2550-
ADD_FLAG('CFLAGS', ' -m32 ');
2562+
ADD_FLAG('CFLAGS', '-m32');
25512563
}
25522564
ADD_FLAG("CFLAGS", " /fallback ");
25532565
}

0 commit comments

Comments
 (0)