@@ -180,6 +180,17 @@ $(foreach dir,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)),\
$(if $(wildcard $(dir)),,\
$(error BR2_GLOBAL_PATCH_DIR contains nonexistent directory $(dir))))
+define EXPAND_DEPENDENCY_CULPRITS
+ $(foreach c,$(1),\
+ $(c) \
+ $(call EXPAND_DEPENDENCY_CULPRITS,$($(call UPPERCASE,$(c))_DEPENDENT_OF)))
+endef
+
+define DEPENDENCY_CULPRITS
+ $(foreach c,$(call EXPAND_DEPENDENCY_CULPRITS,$(1)),\
+ $(if $($($(call UPPERCASE,$(c))_KCONFIG_VAR)),$(c)))
+endef
+
# Configure
$(BUILD_DIR)/%/.stamp_configured:
# Only trigger the check for default builds. If the user forces
@@ -193,6 +204,8 @@ ifeq ($(MAKECMDGOALS),)
echo "ERROR: $($(PKG)_NAME) is in the dependency chain of a package that has" ; \
echo "added it to its _DEPENDENCIES variable (directly or indirectly)" ; \
echo "without selecting it from Config.in." ; \
+ echo "Potential culprits:" ; \
+ printf ' - %s\n' $(call DEPENDENCY_CULPRITS,$($(PKG)_DEPENDENT_OF)); \
exit 1 ; \
fi
endif
@@ -828,6 +841,12 @@ endif # other packages
endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
$$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))
+# Store reverse build-dependency information: we add the name of the
+# current package to the <pkg>_DEPENDENT_OF variable of all packages
+# the current package depends on.
+$$(eval $$(foreach d,$$($(2)_FINAL_ALL_DEPENDENCIES),\
+ $$(call UPPERCASE,$$(d))_DEPENDENT_OF += $(1)$$(sep)))
+
# add package to the general list of targets if requested by the buildroot
# configuration
ifeq ($$($$($(2)_KCONFIG_VAR)),y)