]> granicus.if.org Git - php/commitdiff
Use $(CC) for linking instead of $(LD). This allows usage of advansed optimization...
authorDmitry Stogov <dmitry@php.net>
Fri, 10 Nov 2006 10:30:56 +0000 (10:30 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 10 Nov 2006 10:30:56 +0000 (10:30 +0000)
win32/build/Makefile
win32/build/confutils.js

index 6fbd6126c22deb037f3861736b5f5c73499bfbd0..c4214665a148075804151edfaabfd4113fbc73d1 100644 (file)
@@ -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)
        
index c598fc829e97bd16ac94c3797f17509897744556..e5d1334b7675711e5e7bf60af72d4c33d9624310 100644 (file)
@@ -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);
                }