From: Dmitry Stogov Date: Fri, 10 Nov 2006 10:30:56 +0000 (+0000) Subject: Use $(CC) for linking instead of $(LD). This allows usage of advansed optimization... X-Git-Tag: RELEASE_1_0_0RC1~1081 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f1c5a77015e2a03aaa09f3c3b04fbe28e4c3d64;p=php Use $(CC) for linking instead of $(LD). This allows usage of advansed optimization techniques (like Intel's inner-procedure optimization) --- diff --git a/win32/build/Makefile b/win32/build/Makefile index 6fbd6126c2..c4214665a1 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -61,7 +61,7 @@ $(PHPDLL_RES): win32\build\template.rc win32\build\template.rc $(BUILD_DIR)\$(PHPDLL): generated_files $(PHPDEF) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(PHPDLL_RES) $(MCFILE) - @$(LD) /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) + @$(CC) $(PHP_GLOBAL_OBJS) $(STATIC_EXT_OBJS) $(STATIC_EXT_LIBS) $(LIBS) $(PHPDLL_RES) /link /out:$(BUILD_DIR)\$(PHPDLL) $(PHP_LDFLAGS) $(LDFLAGS) $(STATIC_EXT_LDFLAGS) $(BUILD_DIR)\$(PHPLIB): $(BUILD_DIR)\$(PHPDLL) diff --git a/win32/build/confutils.js b/win32/build/confutils.js index c598fc829e..e5d1334b76 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -// $Id: confutils.js,v 1.62 2006-05-07 00:07:53 edink Exp $ +// $Id: confutils.js,v 1.63 2006-11-10 10:30:56 dmitry Exp $ var STDOUT = WScript.StdOut; var STDERR = WScript.StdErr; @@ -578,7 +578,7 @@ function CHECK_LIB(libnames, target, path_to_check, common_name) path_to_check += ";" + php_usual_lib_suspects; // It is common practice to put libs under one of these dir names - var subdirs = new Array(PHP_DEBUG == "yes" ? "Debug" : "Release", "lib", "libs", "libexec"); + var subdirs = new Array(PHP_DEBUG == "yes" ? "Debug" : (PHP_DEBUG_PACK == "yes"?"Release_Dbg":"Release"), "lib", "libs", "libexec"); // libnames can be ; separated list of accepted library names libnames = libnames.split(';'); @@ -665,7 +665,7 @@ function OLD_CHECK_LIB(libnames, target, path_to_check) var i; var libname; - var subdir = PHP_DEBUG == "yes" ? "Debug" : "Release"; + var subdir = PHP_DEBUG == "yes" ? "Debug" : (PHP_DEBUG_PACK == "yes"?"Release_Dbg":"Release"); libnames = libnames.split(';'); for (i = 0; i < libnames.length; i++) { @@ -876,7 +876,7 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) var SAPI = sapiname.toUpperCase(); var ldflags; var resname; - var ld = "@$(LD)"; + var ld; if (typeof(obj_dir) == "undefined") { sapiname_for_printing = configure_module_dirname; @@ -915,7 +915,16 @@ function SAPI(sapiname, file_list, makefiletarget, cflags, obj_dir) ldflags = "$(LDFLAGS)"; } - MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname); + if(PHP_VCI = "yes" || PHP_VCO == "yes") { + ldflags += " /PGD:$(BUILD_DIR)\\"+makefiletarget+".pgd"; + } + + if (ld) { + MFO.WriteLine("\t" + ld + " /nologo /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LDFLAGS_" + SAPI + ") $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname); + } else { + ld = "@$(CC)"; + MFO.WriteLine("\t" + ld + " /nologo " + " $(" + SAPI + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + SAPI + ") $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + makefiletarget + " " + ldflags + " $(LDFLAGS_" + SAPI + ")"); + } DEFINE('CFLAGS_' + SAPI + '_OBJ', '$(CFLAGS_' + SAPI + ')'); @@ -1031,10 +1040,10 @@ function EXTENSION(extname, file_list, shared, cflags, dllname, obj_dir) var libname = dllname.substring(0, dllname.length-4) + ".lib"; var resname = generate_version_info_resource(dllname, configure_module_dirname); - var ld = "@$(LD)"; + var ld = "@$(CC)"; MFO.WriteLine("$(BUILD_DIR)\\" + dllname + " $(BUILD_DIR)\\" + libname + ": $(DEPS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(BUILD_DIR)\\" + resname); - MFO.WriteLine("\t" + ld + " /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ") $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname); + MFO.WriteLine("\t" + ld + " $(" + EXT + "_GLOBAL_OBJS) $(BUILD_DIR)\\$(PHPLIB) $(LIBS_" + EXT + ") $(LIBS) $(BUILD_DIR)\\" + resname + " /link /out:$(BUILD_DIR)\\" + dllname + " $(DLL_LDFLAGS) $(LDFLAGS) $(LDFLAGS_" + EXT + ")"); MFO.WriteBlankLines(1); if (configure_module_dirname.match("pecl")) { @@ -1211,7 +1220,7 @@ function generate_files() continue; } last = bd; - ADD_FLAG("BUILD_DIRS_SUB", bd); + ADD_FLAG("BUILD_DIRS_SUB", bd.replace(new RegExp('^'+dir+'\\\\'), '$(BUILD_DIR)\\')); if (!FSO.FolderExists(bd)) { FSO.CreateFolder(bd); }