diff --git a/docs/manual/adding-packages-kconfig.txt b/docs/manual/adding-packages-kconfig.txt index d4d8630a79..982c1229ea 100644 --- a/docs/manual/adding-packages-kconfig.txt +++ b/docs/manual/adding-packages-kconfig.txt @@ -81,3 +81,7 @@ be set to suit the needs of the package under consideration: be well suited for all packages that use the standard kconfig infrastructure as inherited from the Linux kernel; some packages use a derivative of kconfig that use a different location. + +* +FOO_KCONFIG_DEPENDENCIES+: the list of packages (most probably, host + packages) that need to be built before this package's kconfig is + interpreted. Seldom used. By default, empty. diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk index 81bba5220c..d6c95b897e 100644 --- a/package/pkg-kconfig.mk +++ b/package/pkg-kconfig.mk @@ -41,6 +41,10 @@ endef define inner-kconfig-package +# Register the kconfig dependencies as regular dependencies, so that +# they are also accounted for in the generated graphs. +$(2)_DEPENDENCIES += $$($(2)_KCONFIG_DEPENDENCIES) + # Call the generic package infrastructure to generate the necessary # make targets. # Note: this must be done _before_ attempting to use $$($(2)_DIR) in a @@ -121,6 +125,11 @@ $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_F # it explicitly. It doesn't hurt to always have it though. $$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): | $(1)-patch +# Some packages may need additional tools to be present by the time their +# kconfig structure is parsed (e.g. the linux kernel may need to call to +# the compiler to test its features). +$$($(2)_DIR)/$$($(2)_KCONFIG_DOTCONFIG): | $$($(2)_KCONFIG_DEPENDENCIES) + # In order to get a usable, consistent configuration, some fixup may be needed. # The exact rules are specified by the package .mk file. define $(2)_FIXUP_DOT_CONFIG