com php-src: moved libs and debug/release mode setup into functions: win32/build/config.w32 win32/build/config.w32.phpize.in win32/build/confutils.js
| From: | Anatol Belski | Date: | Mon, 10 Nov 2014 22:30:16 +0000 |
| Subject: | com php-src: moved libs and debug/release mode setup into functions: 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-83010@lists.php.net to get a copy of this message | ||
Commit: 64c081f347b177d11b1083a6f13efa744884ff98
Author: Anatol Belski <ab@php.net> Mon, 10 Nov 2014 23:28:03 +0100
Parents: 96805364fa89f98e5dff24e2eab9bb780c87e5de
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=64c081f347b177d11b1083a6f13efa744884ff98
Log:
moved libs and debug/release mode setup into functions
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 e89b805...43ff038 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -93,29 +93,10 @@ if (VS_TOOLSET && VCVERS >= 1500 && PHP_MP !=
'disable') {
toolset_setup_common_ldlags();
// General libs
-// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib
-DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib
ws2_32.lib Dnsapi.lib");
+toolset_setup_common_libs();
// Set some debug/release specific options
-if (PHP_DEBUG == "yes") {
- ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +
- (X64?"/Zi":"/ZI"));
- ADD_FLAG("LDFLAGS", "/debug");
- // Avoid problems when linking to release libraries that use the release
- // version of the libc
- ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");
-} else {
- // Generate external debug files when --enable-debug-pack is specified
- if (PHP_DEBUG_PACK == "yes") {
- ADD_FLAG("CFLAGS", "/Zi");
- ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
- }
- // Equivalent to Release_TSInline build -> best optimization
- ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE
/GF /D ZEND_DEBUG=0");
-
- // if you have VS.Net /GS hardens the binary against buffer overruns
- // ADD_FLAG("CFLAGS", "/GS");
-}
+toolset_setup_build_mode();
if (PHP_ZTS == "yes") {
ADD_FLAG("CFLAGS", "/D ZTS=1");
@@ -126,10 +107,6 @@ if (PHP_ZTS == "yes") {
DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' :
"-nts");
-
-// we want msvcrt in the PHP DLL
-ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");
-
// set up the build dir and DLL name
if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");
diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in
index da6f6eb..e2860e3 100644
--- a/win32/build/config.w32.phpize..in
+++ b/win32/build/config.w32.phpize.in
@@ -83,29 +83,10 @@ ARG_WITH("snapshot-template", "Path to snapshot builder template
dir", "no");
toolset_setup_common_ldlags();
// General libs
-// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib
-DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib
ws2_32.lib Dnsapi.lib");
+toolset_setup_common_libs();
// Set some debug/release specific options
-if (PHP_DEBUG == "yes") {
- ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +
- (X64?"/Zi":"/ZI"));
- ADD_FLAG("LDFLAGS", "/debug");
- // Avoid problems when linking to release libraries that use the release
- // version of the libc
- ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");
-} else {
- // Generate external debug files when --enable-debug-pack is specified
- if (PHP_DEBUG_PACK == "yes") {
- ADD_FLAG("CFLAGS", "/Zi");
- ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
- }
- // Equivalent to Release_TSInline build -> best optimization
- ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE
/GF /D ZEND_DEBUG=0");
-
- // if you have VS.Net /GS hardens the binary against buffer overruns
- // ADD_FLAG("CFLAGS", "/GS");
-}
+toolset_setup_build_mode();
if (PHP_ZTS == "yes") {
ADD_FLAG("CFLAGS", "/D ZTS=1");
@@ -113,10 +94,6 @@ if (PHP_ZTS == "yes") {
DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' :
"-nts");
-
-// we want msvcrt in the PHP DLL
-ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");
-
// set up the build dir and DLL name
if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {
DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index 0f07e18..bad5f13 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -2583,5 +2583,37 @@ function toolset_setup_common_ldlags()
} else {
DEFINE("LDFLAGS", "/nologo ");
}
+
+ // we want msvcrt in the PHP DLL
+ ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");
+}
+
+function toolset_setup_common_libs()
+{
+ // urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32..lib
+ DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib
ws2_32.lib Dnsapi.lib");
+}
+
+function toolset_setup_build_mode()
+{
+ if (PHP_DEBUG == "yes") {
+ ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +
+ (X64?"/Zi":"/ZI"));
+ ADD_FLAG("LDFLAGS", "/debug");
+ // Avoid problems when linking to release libraries that use the release
+ // version of the libc
+ ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");
+ } else {
+ // Generate external debug files when --enable-debug-pack is specified
+ if (PHP_DEBUG_PACK == "yes") {
+ ADD_FLAG("CFLAGS", "/Zi");
+ ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");
+ }
+ // Equivalent to Release_TSInline build -> best optimization
+ ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE
/GF /D ZEND_DEBUG=0");
+
+ // if you have VS.Net /GS hardens the binary against buffer overruns
+ // ADD_FLAG("CFLAGS", "/GS");
+ }
}