Index: trunk/kBuild/tools/VCC80AMD64.kmk
===================================================================
--- trunk/kBuild/tools/VCC80AMD64.kmk	(revision 436)
+++ trunk/kBuild/tools/VCC80AMD64.kmk	(revision 437)
@@ -29,11 +29,11 @@
 PATH_TOOL_VCC80AMD64               ?= $(PATH_DEV)/x86.win32/vcc80
 PATH_TOOL_VCC80AMD64_LIB           ?= $(PATH_DEV)/x86.win32/vcc80/lib
-ifeq ($(BUILD_PLATFORM),win64
-PATH_TOOL_VCC80AMD64_BIN           ?= $(PATH_DEV)/x86.win32/vcc80/amd64/bin
+ifeq ($(BUILD_PLATFORM),win64)
+PATH_TOOL_VCC80AMD64_BIN           ?= $(PATH_DEV)/x86.win32/vcc80/bin/amd64
 else
-PATH_TOOL_VCC80AMD64_BIN           ?= $(PATH_DEV)/x86.win32/vcc80/x86_amd64/bin
-endif
-
-TOOL_VCC80AMD64_CC                 := $(EXEC_AMD64_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/cl.exe
+PATH_TOOL_VCC80AMD64_BIN           ?= $(PATH_DEV)/x86.win32/vcc80/bin/x86_amd64
+endif
+
+TOOL_VCC80AMD64_CC                 := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/cl.exe
 TOOL_VCC80AMD64_COBJSUFF           := .obj
 TOOL_VCC80AMD64_CFLAGS             := -TC -c -nologo
@@ -44,5 +44,5 @@
 TOOL_VCC80AMD64_CDEFS              :=
 
-TOOL_VCC80AMD64_CXX                := $(EXEC_AMD64_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/cl.exe
+TOOL_VCC80AMD64_CXX                := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/cl.exe
 TOOL_VCC80AMD64_CXXOBJSUFF         := .obj
 TOOL_VCC80AMD64_CXXFLAGS           := -TP -c -nologo
@@ -53,15 +53,18 @@
 TOOL_VCC80AMD64_CXXDEFS            :=
 
-TOOL_VCC80AMD64_AS                 := $(EXEC_AMD64_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/ml.exe
+TOOL_VCC80AMD64_AS                 := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/ml.exe
 TOOL_VCC80AMD64_ASOBJSUFF          := .obj
 
-TOOL_VCC80AMD64_AR                 := $(EXEC_AMD64_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/lib.exe
+TOOL_VCC80AMD64_AR                 := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/lib.exe
 TOOL_VCC80AMD64_ARFLAGS            := -nologo
 TOOL_VCC80AMD64_ARLIBSUFF          := .lib
 
-TOOL_VCC80AMD64_LD                 := $(EXEC_AMD64_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/link.exe
-TOOL_VCC80AMD64_LDFLAGS            := -nologo
+TOOL_VCC80AMD64_LD                 := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/link.exe
+TOOL_VCC80AMD64_LDFLAGS            := -nologo -machine:amd64
 TOOL_VCC80AMD64_LDFLAGS.debug      := -debug
 TOOL_VCC80AMD64_LDFLAGS.release    :=
+
+TOOL_VCC80AMD64_MT                 := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/mt.exe
+
 
 ## Constructs the correct .pdb name (the name is lowercased).
@@ -195,5 +198,5 @@
 # @param    $(outbase)      Output basename (full). Use this for list files and such.
 #
-TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80AMD64_PDB, $(outbase),pdb) $(outbase).ilk
+TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80AMD64_PDB, $(outbase),pdb) $(outbase).ilk $(out).manifest
 TOOL_VCC80AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 TOOL_VCC80AMD64_LINK_PROGRAM_DEPORD =
@@ -201,5 +204,5 @@
 	$(TOOL_VCC80AMD64_LD) $(flags) \
 		/OUT:$(out) \
-		/MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
+		/MAPINFO:EXPORTS /INCREMENTAL:NO \
 		/MAP:$(outbase).map \
 		$(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
@@ -208,4 +211,7 @@
 		$(subst /,\\,$(objs)) \
 		$(subst /,\\,$(libs))
+	if test -f $(out).manifest; then \
+		$(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)); \
+	fi
 endef
 
@@ -225,5 +231,5 @@
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
-TOOL_VCC80AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80AMD64_PDB, $(outbase),pdb) $(outbase).ilk
+TOOL_VCC80AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80AMD64_PDB, $(outbase),pdb) $(outbase).ilk $(out).manifest
 TOOL_VCC80AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 TOOL_VCC80AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
@@ -232,5 +238,5 @@
 		/OUT:$(out) \
 		/IMPLIB:$(outbase).lib \
-		/MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
+		/MAPINFO:EXPORTS /INCREMENTAL:NO \
 		/MAP:$(outbase).map \
 		/DLL \
@@ -240,4 +246,7 @@
 		$(subst /,\\,$(objs)) \
 		$(subst /,\\,$(libs))
+	if test -f $(out).manifest; then \
+		$(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
+	fi
 ifeq ($(filter %.exp .def,$(othersrc)),)
 	if test -f $(outbase).exp; then $(CP_EXT) $(outbase).exp $(PATH_LIB)/; fi
@@ -262,5 +271,5 @@
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
-TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80AMD64_PDB, $(outbase),pdb) $(outbase).ilk
+TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80AMD64_PDB, $(outbase),pdb) $(outbase).ilk $(out).manifest
 TOOL_VCC80AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 TOOL_VCC80AMD64_LINK_SYSMOD_DEPORD =
@@ -268,5 +277,5 @@
 	$(TOOL_VCC80AMD64_LD) $(flags) \
 		/OUT:$(out) \
-		/MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
+		/MAPINFO:EXPORTS /INCREMENTAL:NO \
 		/MAP:$(outbase).map \
 		$(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
@@ -275,4 +284,7 @@
 		$(subst /,\\,$(objs)) \
 		$(subst /,\\,$(libs))
-endef
-
+	if test -f $(out).manifest; then \
+		$(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
+	fi
+endef
+
Index: trunk/kBuild/tools/VCC80X86.kmk
===================================================================
--- trunk/kBuild/tools/VCC80X86.kmk	(revision 436)
+++ trunk/kBuild/tools/VCC80X86.kmk	(revision 437)
@@ -34,5 +34,5 @@
 TOOL_VCC80X86_COBJSUFF           := .obj
 TOOL_VCC80X86_CFLAGS             := -TC -c -nologo
-TOOL_VCC80X86_CFLAGS.debug       := -Od -Zi
+TOOL_VCC80X86_CFLAGS.debug       := -Zi
 TOOL_VCC80X86_CFLAGS.release     := -O2
 TOOL_VCC80X86_CFLAGS.profile     := -O2
@@ -43,5 +43,5 @@
 TOOL_VCC80X86_CXXOBJSUFF         := .obj
 TOOL_VCC80X86_CXXFLAGS           := -TP -c -nologo
-TOOL_VCC80X86_CXXFLAGS.debug     := -Od -Zi
+TOOL_VCC80X86_CXXFLAGS.debug     := -Zi
 TOOL_VCC80X86_CXXFLAGS.release   := -O2
 TOOL_VCC80X86_CXXFLAGS.profile   := -O2
@@ -57,7 +57,9 @@
 
 TOOL_VCC80X86_LD                 := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80X86_BIN)/link.exe
-TOOL_VCC80X86_LDFLAGS            := -nologo
+TOOL_VCC80X86_LDFLAGS            := -nologo -machine:x86
 TOOL_VCC80X86_LDFLAGS.debug      := -debug
 TOOL_VCC80X86_LDFLAGS.release    :=
+
+TOOL_VCC80X86_MT                 := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80X86_BIN)/mt.exe
 
 ## Constructs the correct .pdb name (the name is lowercased).
@@ -69,4 +71,5 @@
 TOOL_VCC80X86_PDB                = $(1).$(2)
 endif
+
 
 #ifeq ($(BUILD_PLATFORM),win32)
@@ -191,5 +194,5 @@
 # @param    $(outbase)      Output basename (full). Use this for list files and such.
 #
-TOOL_VCC80X86_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80X86_PDB, $(outbase),pdb) $(outbase).ilk
+TOOL_VCC80X86_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80X86_PDB, $(outbase),pdb) $(outbase).ilk $(out).manifest
 TOOL_VCC80X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 TOOL_VCC80X86_LINK_PROGRAM_DEPORD =
@@ -197,5 +200,5 @@
 	$(TOOL_VCC80X86_LD) $(flags) \
 		/OUT:$(out) \
-		/MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
+		/MAPINFO:EXPORTS /INCREMENTAL:NO \
 		/MAP:$(outbase).map \
 		$(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
@@ -204,4 +207,7 @@
 		$(subst /,\\,$(objs)) \
 		$(subst /,\\,$(libs))
+	if test -f $(out).manifest; then \
+		$(TOOL_VCC80X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)); \
+	fi
 endef
 
@@ -221,5 +227,5 @@
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
-TOOL_VCC80X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80X86_PDB, $(outbase),pdb) $(outbase).ilk
+TOOL_VCC80X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80X86_PDB, $(outbase),pdb) $(outbase).ilk $(out).manifest
 TOOL_VCC80X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 TOOL_VCC80X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
@@ -228,5 +234,5 @@
 		/OUT:$(out) \
 		/IMPLIB:$(outbase).lib \
-		/MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
+		/MAPINFO:EXPORTS /INCREMENTAL:NO \
 		/MAP:$(outbase).map \
 		/DLL \
@@ -236,4 +242,7 @@
 		$(subst /,\\,$(objs)) \
 		$(subst /,\\,$(libs))
+	if test -f $(out).manifest; then \
+		$(TOOL_VCC80X86_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
+	fi
 ifeq ($(filter %.exp .def,$(othersrc)),)
 	if test -f $(outbase).exp; then $(CP_EXT) $(outbase).exp $(PATH_LIB)/; fi
@@ -258,5 +267,5 @@
 #
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
-TOOL_VCC80X86_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80X86_PDB, $(outbase),pdb) $(outbase).ilk
+TOOL_VCC80X86_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(call TOOL_VCC80X86_PDB, $(outbase),pdb) $(outbase).ilk $(out).manifest
 TOOL_VCC80X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 TOOL_VCC80X86_LINK_SYSMOD_DEPORD =
@@ -264,5 +273,5 @@
 	$(TOOL_VCC80X86_LD) $(flags) \
 		/OUT:$(out) \
-		/MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES \
+		/MAPINFO:EXPORTS /INCREMENTAL:NO \
 		/MAP:$(outbase).map \
 		$(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
@@ -271,4 +280,7 @@
 		$(subst /,\\,$(objs)) \
 		$(subst /,\\,$(libs))
-endef
-
+	if test -f $(out).manifest; then \
+		$(TOOL_VCC80X86_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
+	fi
+endef
+
