Index: /trunk/kBuild/header.kmk
===================================================================
--- /trunk/kBuild/header.kmk	(revision 661)
+++ /trunk/kBuild/header.kmk	(revision 662)
@@ -548,4 +548,28 @@
 	LIBS LIBPATH
 
+## PROPS_ALL
+# List of all the properties.
+PROPS_ALL = $(PROPS_SINGLE) $(PROPS_DEFERRED) $(PROPS_ACCUMULATE_L) $(PROPS_ACCUMULATE_R)
+
+
+#
+# Here is a special 'hack' to prevent innocent environment variables being 
+# picked up and treated as properties. (The most annoying example of why 
+# this is necessary is the Visual C++ commandline with it's LIBPATH.)
+#
+# Define KBUILD_DONT_KILL_ENV_PROPS in the env. or on the commandline to 
+# disable this 'hack'.
+#
+ifndef KBUILD_DONT_KILL_ENV_PROPS
+
+define def_nuke_environment_prop
+ifeq ($(origin $(prop)),environment)
+$(prop) =
+endif
+endef
+$(foreach prop,$(PROPS_ALL),$(eval $(value def_nuke_environment_prop)))
+
+endif
+
 
 #
