Index: trunk/kBuild/retry-10-delay-500ms.sh
===================================================================
--- trunk/kBuild/retry-10-delay-500ms.sh	(revision 3597)
+++ trunk/kBuild/retry-10-delay-500ms.sh	(revision 3597)
@@ -0,0 +1,49 @@
+#!/usr/bin/env kmk_ash
+# $Id$
+## @file
+# kBuild Helper Script - Retry execution of command 10 times with 0.5 seconds delay.
+#
+
+#
+# Copyright (c) 2023 knut st. osmundsen <bird-kBuild-spam-xxiii@anduin.net>
+#
+# This file is part of kBuild.
+#
+# kBuild is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# kBuild is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with kBuild; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+# As a special exception you are granted permission to include this file, via
+# the kmk include directive, as you wish without this in itself causing the
+# resulting makefile, program or whatever to be covered by the GPL license.
+# This exception does not however invalidate any other reasons why the makefile,
+# program, whatever should not be covered the GPL.
+#
+#
+
+# First try...
+"$@" && exit 0
+MY_EXITCODE=$?
+
+# Retry up to five times with a little delay between each.
+for MY_RETRY in 1 2 3 4 5 6 7 8 9;
+do
+    echo "retry-10-delay-500ms.sh: Retry #${MY_RETRY} failed: ${MY_EXITCODE} (cmd: $*)"
+    kmk_sleep 500ms
+    "$@" && exit 0
+    MY_EXITCODE=$?
+done
+echo "retry-10-delay-500ms.sh: Giving up after 10 tries: ${MY_EXITCODE} (cmd: $*)" >&2
+exit ${MY_EXITCODE}
+
Index: trunk/kBuild/tools/VCC140.kmk
===================================================================
--- trunk/kBuild/tools/VCC140.kmk	(revision 3596)
+++ trunk/kBuild/tools/VCC140.kmk	(revision 3597)
@@ -129,6 +129,7 @@
 TOOL_VCC140_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140_BIN_QSH)/editbin.exe
 
-TOOL_VCC140_RC  ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC140_RC_CACHED)
-TOOL_VCC140_MT  ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC140_MT_CACHED)
+TOOL_VCC140_RC      ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC140_RC_CACHED)
+TOOL_VCC140_MT      ?= $(TOOL_VCC140_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC140_MT_CACHED)
+TOOL_VCC140_MT_RETRY ?= $(WINCMN_MT_RETRY)
 
 undefine TOOL_VCC140_USE_KSUBMIT # for now
Index: trunk/kBuild/tools/VCC140AMD64.kmk
===================================================================
--- trunk/kBuild/tools/VCC140AMD64.kmk	(revision 3596)
+++ trunk/kBuild/tools/VCC140AMD64.kmk	(revision 3597)
@@ -86,6 +86,7 @@
 TOOL_VCC140AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140AMD64_BIN_QSH)/editbin.exe
 
-TOOL_VCC140AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC140_RC_CACHED)
-TOOL_VCC140AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC140_MT_CACHED)
+TOOL_VCC140AMD64_RC      ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC140_RC_CACHED)
+TOOL_VCC140AMD64_MT      ?= $(TOOL_VCC140AMD64_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC140_MT_CACHED)
+TOOL_VCC140AMD64_MT_RETRY ?= $(TOOL_VCC140_MT_RETRY)
 
 undefine TOOL_VCC140AMD64_USE_KSUBMIT # for now
Index: trunk/kBuild/tools/VCC140X86.kmk
===================================================================
--- trunk/kBuild/tools/VCC140X86.kmk	(revision 3596)
+++ trunk/kBuild/tools/VCC140X86.kmk	(revision 3597)
@@ -86,6 +86,7 @@
 TOOL_VCC140X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/editbin.exe
 
-TOOL_VCC140X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC140_RC_CACHED)
-TOOL_VCC140X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC140_MT_CACHED)
+TOOL_VCC140X86_RC      ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC140_RC_CACHED)
+TOOL_VCC140X86_MT      ?= $(TOOL_VCC140X86_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC140_MT_CACHED)
+TOOL_VCC140X86_MT_RETRY ?= $(TOOL_VCC140_MT_RETRY)
 
 undefine TOOL_VCC140X86_USE_KSUBMIT # for now
Index: trunk/kBuild/tools/VCC141.kmk
===================================================================
--- trunk/kBuild/tools/VCC141.kmk	(revision 3596)
+++ trunk/kBuild/tools/VCC141.kmk	(revision 3597)
@@ -119,6 +119,7 @@
 TOOL_VCC141_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/editbin.exe
 
-TOOL_VCC141_RC  ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
-TOOL_VCC141_MT  ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
+TOOL_VCC141_RC      ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
+TOOL_VCC141_MT      ?= $(TOOL_VCC141_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
+TOOL_VCC141_MT_RETRY ?= $(WINCMN_MT_RETRY)
 
 undefine TOOL_VCC141_USE_KSUBMIT # for now
Index: trunk/kBuild/tools/VCC141AMD64.kmk
===================================================================
--- trunk/kBuild/tools/VCC141AMD64.kmk	(revision 3596)
+++ trunk/kBuild/tools/VCC141AMD64.kmk	(revision 3597)
@@ -89,6 +89,7 @@
 TOOL_VCC141AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/editbin.exe
 
-TOOL_VCC141AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
-TOOL_VCC141AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
+TOOL_VCC141AMD64_RC      ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
+TOOL_VCC141AMD64_MT      ?= $(TOOL_VCC141AMD64_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
+TOOL_VCC141AMD64_MT_RETRY ?= $(TOOL_VCC141_MT_RETRY)
 
 undefine TOOL_VCC141AMD64_USE_KSUBMIT # for now
Index: trunk/kBuild/tools/VCC141X86.kmk
===================================================================
--- trunk/kBuild/tools/VCC141X86.kmk	(revision 3596)
+++ trunk/kBuild/tools/VCC141X86.kmk	(revision 3597)
@@ -89,6 +89,7 @@
 TOOL_VCC141X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141X86_BIN_QSH)/editbin.exe
 
-TOOL_VCC141X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
-TOOL_VCC141X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
+TOOL_VCC141X86_RC      ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
+TOOL_VCC141X86_MT      ?= $(TOOL_VCC141X86_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
+TOOL_VCC141X86_MT_RETRY ?= $(TOOL_VCC141_MT_RETRY)
 
 undefine TOOL_VCC141X86_USE_KSUBMIT # for now
Index: trunk/kBuild/tools/VCC142.kmk
===================================================================
--- trunk/kBuild/tools/VCC142.kmk	(revision 3596)
+++ trunk/kBuild/tools/VCC142.kmk	(revision 3597)
@@ -119,6 +119,7 @@
 TOOL_VCC142_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142_BIN_QSH)/editbin.exe
 
-TOOL_VCC142_RC  ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC142_RC_CACHED)
-TOOL_VCC142_MT  ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC142_MT_CACHED)
+TOOL_VCC142_RC      ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC142_RC_CACHED)
+TOOL_VCC142_MT      ?= $(TOOL_VCC142_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC142_MT_CACHED)
+TOOL_VCC142_MT_RETRY ?= $(WINCMN_MT_RETRY)
 
 ifdef TOOL_VCC142_USE_KSUBMIT
Index: trunk/kBuild/tools/VCC142AMD64.kmk
===================================================================
--- trunk/kBuild/tools/VCC142AMD64.kmk	(revision 3596)
+++ trunk/kBuild/tools/VCC142AMD64.kmk	(revision 3597)
@@ -89,6 +89,7 @@
 TOOL_VCC142AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142AMD64_BIN_QSH)/editbin.exe
 
-TOOL_VCC142AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC142_RC_CACHED)
-TOOL_VCC142AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC142_MT_CACHED)
+TOOL_VCC142AMD64_RC      ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC142_RC_CACHED)
+TOOL_VCC142AMD64_MT      ?= $(TOOL_VCC142AMD64_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC142_MT_CACHED)
+TOOL_VCC142AMD64_MT_RETRY ?= $(TOOL_VCC142_MT_RETRY)
 
 ifdef TOOL_VCC142AMD64_USE_KSUBMIT
Index: trunk/kBuild/tools/VCC142X86.kmk
===================================================================
--- trunk/kBuild/tools/VCC142X86.kmk	(revision 3596)
+++ trunk/kBuild/tools/VCC142X86.kmk	(revision 3597)
@@ -89,6 +89,7 @@
 TOOL_VCC142X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142X86_BIN_QSH)/editbin.exe
 
-TOOL_VCC142X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC142_RC_CACHED)
-TOOL_VCC142X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC142_MT_CACHED)
+TOOL_VCC142X86_RC      ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC142_RC_CACHED)
+TOOL_VCC142X86_MT      ?= $(TOOL_VCC142X86_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC142_MT_CACHED)
+TOOL_VCC142X86_MT_RETRY ?= $(TOOL_VCC142_MT_RETRY)
 
 ifdef TOOL_VCC142X86_USE_KSUBMIT
Index: trunk/kBuild/win-common.kmk
===================================================================
--- trunk/kBuild/win-common.kmk	(revision 3596)
+++ trunk/kBuild/win-common.kmk	(revision 3597)
@@ -60,2 +60,6 @@
 WINCMN_MAP_ARCH.x86   := x86
 ## @}
+
+## @def WINCMN_MT_RETRY
+## Invocation of script for retrying MT.EXE when it clashes with AV software.
+WINCMN_MT_RETRY = $(ASH) $(KBUILD_PATH)/retry-10-delay-500ms.sh
