com php-src: further refactoring of toolset+phpize stuff: win32/build/config.w32 win32/build/config.w32.phpize.in win32/build/confutils.js
| From: | Anatol Belski | Date: | Fri, 07 Nov 2014 12:48:29 +0000 |
| Subject: | com php-src: further refactoring of toolset+phpize stuff: win32/build/config.w32 win32/build/config.w32.phpize.in win32/build/confutils.js | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82980@lists.php.net to get a copy of this message | ||
Commit: b155ba21bd509dff28dd8084d71c8a476027a0cd
Author: Anatol Belski <ab@php.net> Fri, 7 Nov 2014 13:48:29 +0100
Parents: 4d8c28af60c9876749cf6aa83b56f4903df1d063
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b155ba21bd509dff28dd8084d71c8a476027a0cd
Log:
further refactoring of toolset+phpize stuff
Changed paths:
M win32/build/config.w32
M win32/build/config.w32.phpize.in
M win32/build/confutils.js
Diff:
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 85cec0c..0a801af 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -75,45 +75,7 @@ DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP7DLLTS_EXPORTS /D
PHP_EXPORTS \
DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');
// General CFLAGS for building objects
-DEFINE("CFLAGS", "/nologo $(BASE_INCLUDES) /D _WINDOWS \
-/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 ");
-if (VS_TOOLSET) {
- ADD_FLAG("CFLAGS", " /FD ");
-}
-
-if (CLANG_TOOLSET) {
- if (X64) {
- ADD_FLAG('CFLAGS', ' -m64 ');
- } else {
- ADD_FLAG('CFLAGS', ' -m32 ');
- }
-}
-
-if (VS_TOOLSET && VCVERS < 1400) {
- // Enable automatic precompiled headers
- ADD_FLAG('CFLAGS', ' /YX ');
-
- if (PHP_DEBUG == "yes") {
- // Set some debug/release specific options
- ADD_FLAG('CFLAGS', ' /GZ ');
- }
-}
-
-if (VS_TOOLSET && VCVERS >= 1400) {
- // fun stuff: MS deprecated ANSI stdio and similar functions
- // disable annoying warnings. In addition, time_t defaults
- // to 64-bit. Ask for 32-bit.
- if (X64) {
- ADD_FLAG('CFLAGS', ' /wd4996 ');
- } else {
- ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 ');
- }
-
- if (PHP_DEBUG == "yes") {
- // Set some debug/release specific options
- ADD_FLAG('CFLAGS', ' /RTC1 ');
- }
-}
+toolset_setup_common_cflags();
ARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for
compilation', 'auto');
var PHP_MP_DISABLED = true;
@@ -133,15 +95,7 @@ if (VS_TOOLSET && VCVERS >= 1500 && PHP_MP !=
'disable') {
}
// General link flags
-
-if (VS_TOOLSET || CLANG_TOOLSET) {
- if (VCVERS >= 1700 || CLANG_TOOLSET) {
- DEFINE("LDFLAGS", "/nologo ");
- } else {
- DEFINE("LDFLAGS", "/nologo /version:" +
- PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION);
- }
-}
+toolset_setup_common_ldlags();
// General DLL link flags
DEFINE("DLL_LDFLAGS", "/dll ");
diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in
index 91ebc24..0b7443e 100644
--- a/win32/build/config.w32.phpize.in
+++ b/win32/build/config.w32.phpize.in
@@ -60,37 +60,7 @@ DEFINE("CFLAGS_PHP", "/D _USRDLL /D PHP7DLLTS_EXPORTS /D
PHP_EXPORTS \
DEFINE('CFLAGS_PHP_OBJ', '$(CFLAGS_PHP) $(STATIC_EXT_CFLAGS)');
// General CFLAGS for building objects
-DEFINE("CFLAGS", "/nologo $(BASE_INCLUDES) /D _WINDOWS \
-/D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 ");
-if (VS_TOOLSET) {
- ADD_FLAG("CFLAGS", " /FD ");
-}
-
-if (VS_TOOLSET && VCVERS < 1400) {
- // Enable automatic precompiled headers
- ADD_FLAG('CFLAGS', ' /YX ');
-
- if (PHP_DEBUG == "yes") {
- // Set some debug/release specific options
- ADD_FLAG('CFLAGS', ' /GZ ');
- }
-}
-
-if (VS_TOOLSET && VCVERS >= 1400) {
- // fun stuff: MS deprecated ANSI stdio and similar functions
- // disable annoying warnings. In addition, time_t defaults
- // to 64-bit. Ask for 32-bit.
- if (X64) {
- ADD_FLAG('CFLAGS', ' /wd4996 ');
- } else {
- ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 ');
- }
-
- if (PHP_DEBUG == "yes") {
- // Set some debug/release specific options
- ADD_FLAG('CFLAGS', ' /RTC1 ');
- }
-}
+toolset_setup_common_cflags();
ARG_WITH('prefix', 'PHP installation prefix', '');
ARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for
compilation', 'auto');
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index cafb267..9da415c 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -2507,3 +2507,60 @@ function toolset_setup_linker()
ERROR("Unsupported toolset");
}
+function toolset_setup_common_cflags()
+{
+ DEFINE("CFLAGS", "/nologo $(BASE_INCLUDES) /D _WINDOWS \
+ /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /W3 ");
+
+ if (VS_TOOLSET) {
+ ADD_FLAG("CFLAGS", " /FD ");
+
+ if (VCVERS < 1400) {
+ // Enable automatic precompiled headers
+ ADD_FLAG('CFLAGS', ' /YX ');
+
+ if (PHP_DEBUG == "yes") {
+ // Set some debug/release specific options
+ ADD_FLAG('CFLAGS', ' /GZ ');
+ }
+ }
+
+ if (VCVERS >= 1400) {
+ // fun stuff: MS deprecated ANSI stdio and similar functions
+ // disable annoying warnings. In addition, time_t defaults
+ // to 64-bit. Ask for 32-bit.
+ if (X64) {
+ ADD_FLAG('CFLAGS', ' /wd4996 ');
+ } else {
+ ADD_FLAG('CFLAGS', ' /wd4996 /D_USE_32BIT_TIME_T=1 ');
+ }
+
+ if (PHP_DEBUG == "yes") {
+ // Set some debug/release specific options
+ ADD_FLAG('CFLAGS', ' /RTC1 ');
+ }
+ }
+
+ } else if (CLANG_TOOLSET) {
+ if (X64) {
+ ADD_FLAG('CFLAGS', ' -m64 ');
+ } else {
+ ADD_FLAG('CFLAGS', ' -m32 ');
+ }
+ }
+}
+
+function toolset_setup_common_ldlags()
+{
+ if (VS_TOOLSET) {
+ if (VCVERS >= 1700) {
+ DEFINE("LDFLAGS", "/nologo ");
+ } else {
+ DEFINE("LDFLAGS", "/nologo /version:" +
+ PHP_VERSION + "." + PHP_MINOR_VERSION + "." + PHP_RELEASE_VERSION);
+ }
+ } else {
+ DEFINE("LDFLAGS", "/nologo ");
+ }
+}
+