+VERSION_MANUFACTURER:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER))
+VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt)
+
+VERSION_PRODUCT:=$(call qstrip_escape,$(CONFIG_VERSION_PRODUCT))
+VERSION_PRODUCT:=$(if $(VERSION_PRODUCT),$(VERSION_PRODUCT),Generic)
+
+VERSION_HWREV:=$(call qstrip_escape,$(CONFIG_VERSION_HWREV))
+VERSION_HWREV:=$(if $(VERSION_HWREV),$(VERSION_HWREV),v0)
+
+define taint2sym
+$(CONFIG_$(firstword $(subst :, ,$(subst +,,$(subst -,,$(1))))))
+endef
+
+define taint2name
+$(lastword $(subst :, ,$(1)))
+endef
+
+VERSION_TAINT_SPECS := \
+ -ALL:no-all \
+ -IPV6:no-ipv6 \
+ +USE_GLIBC:glibc \
+ +USE_MKLIBS:mklibs \
+ +BUSYBOX_CUSTOM:busybox \
+ +OVERRIDE_PKGS:override \
+
+VERSION_TAINTS := $(strip $(foreach taint,$(VERSION_TAINT_SPECS), \
+ $(if $(findstring +,$(taint)), \
+ $(if $(call taint2sym,$(taint)),$(call taint2name,$(taint))), \
+ $(if $(call taint2sym,$(taint)),,$(call taint2name,$(taint))) \
+ )))
+
+PKG_CONFIG_DEPENDS += $(foreach taint,$(VERSION_TAINT_SPECS),$(call taint2sym,$(taint)))
+