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");
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");
toolset_setup_common_ldlags();\r
\r
// General libs\r
-// urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib\r
-DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib");\r
+toolset_setup_common_libs();\r
\r
// Set some debug/release specific options\r
-if (PHP_DEBUG == "yes") {\r
- ADD_FLAG("CFLAGS", "/LDd /MDd /W3 /Gm /Od /D _DEBUG /D ZEND_DEBUG=1 " +\r
- (X64?"/Zi":"/ZI"));\r
- ADD_FLAG("LDFLAGS", "/debug");\r
- // Avoid problems when linking to release libraries that use the release\r
- // version of the libc\r
- ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:msvcrt");\r
-} else {\r
- // Generate external debug files when --enable-debug-pack is specified\r
- if (PHP_DEBUG_PACK == "yes") {\r
- ADD_FLAG("CFLAGS", "/Zi");\r
- ADD_FLAG("LDFLAGS", "/incremental:no /debug /opt:ref,icf");\r
- }\r
- // Equivalent to Release_TSInline build -> best optimization\r
- ADD_FLAG("CFLAGS", "/LD /MD /W3 /Ox /D NDebug /D NDEBUG /D ZEND_WIN32_FORCE_INLINE /GF /D ZEND_DEBUG=0");\r
-\r
- // if you have VS.Net /GS hardens the binary against buffer overruns\r
- // ADD_FLAG("CFLAGS", "/GS");\r
-}\r
+toolset_setup_build_mode();\r
\r
if (PHP_ZTS == "yes") {\r
ADD_FLAG("CFLAGS", "/D ZTS=1");\r
\r
DEFINE("PHP_ZTS_ARCHIVE_POSTFIX", PHP_ZTS == "yes" ? '' : "-nts");\r
\r
-\r
-// we want msvcrt in the PHP DLL\r
-ADD_FLAG("PHP_LDFLAGS", "/nodefaultlib:libcmt");\r
-\r
// set up the build dir and DLL name\r
if (PHP_DEBUG == "yes" && PHP_ZTS == "yes") {\r
DEFINE("BUILD_DIR", PHP_OBJECT_OUT_DIR + "Debug_TS");\r
} 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");
+ }
}