Index: trunk/kBuild/tools/GCC4MACHO.kmk
===================================================================
--- trunk/kBuild/tools/GCC4MACHO.kmk	(revision 1012)
+++ trunk/kBuild/tools/GCC4MACHO.kmk	(revision 1013)
@@ -91,7 +91,23 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param    $(objsuff)  Object suffix.
-TOOL_GCC4MACHO_COMPILE_C_OUTPUT =
 TOOL_GCC4MACHO_COMPILE_C_DEPEND =
 TOOL_GCC4MACHO_COMPILE_C_DEPORD =
+ifdef USE_KOBJCACHE
+TOOL_GCC4MACHO_COMPILE_C_USES_KOBJCACHE = 1
+TOOL_GCC4MACHO_COMPILE_C_OUTPUT = $(outbase).i
+define TOOL_GCC4MACHO_COMPILE_C_CMDS
+	$(QUIET)$(KOBJCACHE) -f $(outbase).koc -r --kObjCache-cpp $(outbase).i \
+		$(TOOL_GCC4MACHO_CC) -E -o -\
+		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
+		-Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
+		$(abspath $(source)) \
+		--kObjCache-cc $(obj) \
+		$(TOOL_GCC4MACHO_CC) -c\
+		$(flags)\
+		-o $(obj)\
+		$(outbase).i
+endef
+else  # !USE_KOBJCACHE
+TOOL_GCC4MACHO_COMPILE_C_OUTPUT =
 define TOOL_GCC4MACHO_COMPILE_C_CMDS
 	$(QUIET)$(TOOL_GCC4MACHO_CC) -c\
@@ -101,4 +117,5 @@
 		$(abspath $(source))
 endef
+endif # !KUSE_OBJCACHE
 
 
@@ -115,7 +132,23 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param    $(objsuff)  Object suffix.
-TOOL_GCC4MACHO_COMPILE_CXX_OUTPUT =
 TOOL_GCC4MACHO_COMPILE_CXX_DEPEND =
 TOOL_GCC4MACHO_COMPILE_CXX_DEPORD =
+ifdef USE_KOBJCACHE
+TOOL_GCC4MACHO_COMPILE_CXX_USES_KOBJCACHE = 1
+TOOL_GCC4MACHO_COMPILE_CXX_OUTPUT = $(outbase).ii
+define TOOL_GCC4MACHO_COMPILE_CXX_CMDS
+	$(QUIET)$(KOBJCACHE) -f $(outbase).koc -r --kObjCache-cpp $(outbase).ii \
+		$(TOOL_GCC4MACHO_CXX) -E -o -\
+		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
+		-Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
+		$(abspath $(source)) \
+		--kObjCache-cc $(obj) \
+		$(TOOL_GCC4MACHO_CXX) -c\
+		$(flags)\
+		-o $(obj)\
+		$(outbase).ii
+endef
+else  # !USE_KOBJCACHE
+TOOL_GCC4MACHO_COMPILE_CXX_OUTPUT =
 define TOOL_GCC4MACHO_COMPILE_CXX_CMDS
 	$(QUIET)$(TOOL_GCC4MACHO_CXX) -c\
@@ -125,4 +158,5 @@
 		$(abspath $(source))
 endef
+endif # !USE_KOBJCACHE
 
 
Index: trunk/kBuild/tools/GXX4MACHO.kmk
===================================================================
--- trunk/kBuild/tools/GXX4MACHO.kmk	(revision 1012)
+++ trunk/kBuild/tools/GXX4MACHO.kmk	(revision 1013)
@@ -91,7 +91,23 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param    $(objsuff)  Object suffix.
-TOOL_GXX4MACHO_COMPILE_C_OUTPUT =
 TOOL_GXX4MACHO_COMPILE_C_DEPEND =
 TOOL_GXX4MACHO_COMPILE_C_DEPORD =
+ifdef USE_KOBJCACHE
+TOOL_GXX4MACHO_COMPILE_C_USES_KOBJCACHE = 1
+TOOL_GXX4MACHO_COMPILE_C_OUTPUT = $(outbase).i
+define TOOL_GXX4MACHO_COMPILE_C_CMDS
+	$(QUIET)$(KOBJCACHE) -f $(outbase).koc -r --kObjCache-cpp $(outbase).i \
+		$(TOOL_GXX4MACHO_CC) -E -o -\
+		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
+		-Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
+		$(abspath $(source)) \
+		--kObjCache-cc $(obj) \
+		$(TOOL_GXX4MACHO_CC) -c\
+		$(flags)\
+		-o $(obj)\
+		$(outbase).i
+endef
+else  # !USE_KOBJCACHE
+TOOL_GXX4MACHO_COMPILE_C_OUTPUT =
 define TOOL_GXX4MACHO_COMPILE_C_CMDS
 	$(QUIET)$(TOOL_GXX4MACHO_CC) -c\
@@ -101,4 +117,5 @@
 		$(abspath $(source))
 endef
+endif # !KUSE_OBJCACHE
 
 
@@ -115,7 +132,23 @@
 # @param    $(outbase)  Output basename (full). Use this for list files and such.
 # @param    $(objsuff)  Object suffix.
-TOOL_GXX4MACHO_COMPILE_CXX_OUTPUT =
 TOOL_GXX4MACHO_COMPILE_CXX_DEPEND =
 TOOL_GXX4MACHO_COMPILE_CXX_DEPORD =
+ifdef USE_KOBJCACHE
+TOOL_GXX4MACHO_COMPILE_CXX_USES_KOBJCACHE = 1
+TOOL_GXX4MACHO_COMPILE_CXX_OUTPUT = $(outbase).ii
+define TOOL_GXX4MACHO_COMPILE_CXX_CMDS
+	$(QUIET)$(KOBJCACHE) -f $(outbase).koc -r --kObjCache-cpp $(outbase).ii \
+		$(TOOL_GXX4MACHO_CXX) -E -o -\
+		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
+		-Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
+		$(abspath $(source)) \
+		--kObjCache-cc $(obj) \
+		$(TOOL_GXX4MACHO_CXX) -c\
+		$(flags)\
+		-o $(obj)\
+		$(outbase).ii
+endef
+else  # !USE_KOBJCACHE
+TOOL_GXX4MACHO_COMPILE_CXX_OUTPUT =
 define TOOL_GXX4MACHO_COMPILE_CXX_CMDS
 	$(QUIET)$(TOOL_GXX4MACHO_CXX) -c\
@@ -125,4 +158,5 @@
 		$(abspath $(source))
 endef
+endif # !KUSE_OBJCACHE
 
 
