From: Anatol Belski Date: Mon, 10 Nov 2014 23:38:37 +0000 (+0100) Subject: further fixes to win build X-Git-Tag: PRE_NATIVE_TLS_MERGE~130^2~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d509e79d70bfe43c782437b0dbd7dee1501acb6a;p=php further fixes to win build - fixed pdb generation with vs - made object-out-dir to use an absolute path, that fixes path issues with x86/x64 and nmake snap --- diff --git a/win32/build/Makefile b/win32/build/Makefile index 90f02d2494..d6a22c162c 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -158,19 +158,14 @@ build-dist: $(BUILD_DIR)\deplister.exe $(BUILD_DIR)\php.exe -d date.timezone=UTC -n -dphar.readonly=0 win32/build/mkdist.php "$(BUILD_DIR)" "$(PHP_BUILD)" "$(PHPDLL)" "$(SAPI_TARGETS)" "$(EXT_TARGETS) $(PHP_EXTRA_DIST_FILES)" "$(PECL_TARGETS) $(PECL_EXTRA_DIST_FILES)" "$(SNAPSHOT_TEMPLATE)" cd $(BUILD_DIR)\php-$(PHP_VERSION_STRING) -$(ZIP) -9 -q -r ..\php-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip . - cd ..\.. cd $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING) -$(ZIP) -9 -q -r ..\pecl-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip . - cd ..\.. cd $(BUILD_DIR)\php-test-pack-$(PHP_VERSION_STRING) -$(ZIP) -9 -q -r ..\php-test-pack-$(PHP_VERSION_STRING).zip . - cd ..\.. cd $(BUILD_DIR) -$(ZIP) -9 -q php-debug-pack-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip *.pdb - cd - cd -$(ZIP) -9 -q -r php-devel-pack-$(PHP_VERSION_STRING)$(PHP_ZTS_ARCHIVE_POSTFIX)-Win32-$(PHP_COMPILER_SHORT)-$(PHP_ARCHITECTURE).zip $(BUILD_DIR_DEV_NAME) - cd ..\.. + cd $(BUILD_DIR) dist: all build-dist snap: build-snap build-devel build-dist diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 43ff038062..85a96f1694 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -27,18 +27,7 @@ toolset_setup_project_tools(); // stick objects somewhere outside of the source tree ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', ''); -if (PHP_OBJECT_OUT_DIR.length) { - PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(PHP_OBJECT_OUT_DIR); - if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) { - ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist'); - } - PHP_OBJECT_OUT_DIR += '\\'; -} else if (X64) { - if (!FSO.FolderExists("x64")) { - FSO.CreateFolder("x64"); - } - PHP_OBJECT_OUT_DIR = 'x64\\'; -} +object_out_dir_option_handle(); ARG_ENABLE('debug', 'Compile with debugging symbols', "no"); ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no'); diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in index e2860e3a96..52947c1ace 100644 --- a/win32/build/config.w32.phpize.in +++ b/win32/build/config.w32.phpize.in @@ -27,18 +27,7 @@ toolset_setup_project_tools(); // stick objects somewhere outside of the source tree ARG_ENABLE('object-out-dir', 'Alternate location for binary objects during build', ''); -if (PHP_OBJECT_OUT_DIR.length) { - PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(PHP_OBJECT_OUT_DIR); - if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) { - ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist'); - } - PHP_OBJECT_OUT_DIR += '\\'; -} else if (X64) { - if (!FSO.FolderExists("x64")) { - FSO.CreateFolder("x64"); - } - PHP_OBJECT_OUT_DIR = 'x64\\'; -} +object_out_dir_option_handle(); ARG_ENABLE('debug', 'Compile with debugging symbols', "no"); ARG_ENABLE('debug-pack', 'Release binaries with external debug symbols (--enable-debug must not be specified)', 'no'); diff --git a/win32/build/confutils.js b/win32/build/confutils.js index bad5f1322e..c73ae6b2fd 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -1439,7 +1439,10 @@ function ADD_SOURCES(dir, file_list, target, obj_dir) sub_build += d; - DEFINE(bd_flags_name, " /Fp" + sub_build + " /FR" + sub_build + " "); + DEFINE(bd_flags_name, "/Fp" + sub_build + " /FR" + sub_build + " "); + if (VS_TOOLSET) { + ADD_FLAG(bd_flags_name, "/Fd" + sub_build); + } for (i in file_list) { src = file_list[i]; @@ -2617,3 +2620,23 @@ function toolset_setup_build_mode() } } +function object_out_dir_option_handle() +{ + if (PHP_OBJECT_OUT_DIR.length) { + PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName(PHP_OBJECT_OUT_DIR); + if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) { + ERROR('you chosen output directory ' + PHP_OBJECT_OUT_DIR + ' does not exist'); + } + PHP_OBJECT_OUT_DIR += '\\'; + } else { + PHP_OBJECT_OUT_DIR = FSO.GetAbsolutePathName("."); + + if (X64) { + PHP_OBJECT_OUT_DIR += '\\x64\\'; + if (!FSO.FolderExists(PHP_OBJECT_OUT_DIR)) { + FSO.CreateFolder(PHP_OBJECT_OUT_DIR); + } + } + } +} +