Fix pkg-kconfig infra (branch yem/kconfig)
v2 cover Fix pkg-kconfig infra (branch yem/kconfig)
Hello All!
This series fixes a nasty regression introduced with the pkg-kconfig infrastructure recently applied, whereby kconfig packages are always rebuilt on each 'make'.
The proposed fix consists in a post-configure hook, and I believe this is enough to get us rolling for the next release.
A better fix would be to move the call to 'oldocnifg' out of the packages, and into the kconfig infra itself, but this is a bit more involved. This could be done in -next (or maybe in master shortly after -rc1 if possible).
Changes v1 -> v2:
- fix typoes (Thomas DS)
Regards,
Yann E. MORIN.
The following changes since commit 98a18ea01d7ea3f69bf5c44d48358dd110764c9c:
m2tools: fix MIA comment dependencies (2014-08-04 18:29:40 +0200)
are available in the git repository at:
git://gitorious.org/buildroot/buildroot.git
for you to fetch changes up to d7f91e1c2160c032ef1c24c724629ce23ff23e6c:
infra/pkg-kconfig: do not rebuild kconfig packages again and again (2014-08-04 19:37:06 +0200)
----------------------------------------------------------------
Yann E. MORIN (2):
infra/pkg-kconfig: join comments to the related code-block infra/pkg-kconfig: do not rebuild kconfig packages again and again
package/pkg-kconfig.mk | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/2 infra/pkg-kconfig: join comments to the related code-block
The current layout of comments wrt. to the related code-blocks is a bit hard to handle visually.
Remove empty lines between the comments and their respective related code-blocks.
--- package/pkg-kconfig.mk | 7 ------- 1 file changed, 7 deletions(-)
package/pkg-kconfig.mk +0 -7
@@ -32,36 +32,30 @@ define inner-kconfig-package $(call inner-generic-package,$(1),$(2),$(3),$(4)) # Default values - $(2)_KCONFIG_EDITORS ?= menuconfig $(2)_KCONFIG_OPT ?= $(2)_KCONFIG_FIXUP_CMDS ?= # FOO_KCONFIG_FILE is required - ifndef $(2)_KCONFIG_FILE $$(error Internal error: no value specified for $(2)_KCONFIG_FILE) endif # The .config file is obtained by copying it from the specified source # configuration file, after the package has been patched. - $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) | $(1)-patch $$(INSTALL) -m 0644 $$($(2)_KCONFIG_FILE) $$($(2)_DIR)/.config # In order to get a usable, consistent configuration, some fixup may be needed. # The exact rules are specified by the package .mk file. - $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config $$($(2)_KCONFIG_FIXUP_CMDS) $$(Q)touch $$@ # Before running configure, the configuration file should be present and fixed - $$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done # Configuration editors (menuconfig, ...) - $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_done $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ $$($(2)_KCONFIG_OPT) $$(subst $(1)-,,$$@)
@@ -69,7 +63,6 @@ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_ rm -f $$($(2)_DIR)/.stamp_{target,staging}_installed # Target to copy back the configuration to the source configuration file - $(1)-update-config: $$($(2)_DIR)/.stamp_kconfig_fixup_done cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
Signature · 1 line
1.9.1
PATCH v2 2/2 infra/pkg-kconfig: do not rebuild kconfig packages again and again
In reply to Yann E. MORINWhen a kconfig-based package executes its configure step, it may overwrite its .config file. Thus, the .config file is more recent than our stamp file .stamp_kconfig_fixup_done. On a subsequent build, our dependency rules would kick in, and run the config fixup again, thus kicking in the package's configure, build and install steps yet once more, that, ad infinitum.
Fix that by introducing a post-configure hook that re-touches our stamp file, so it is always more recent than the .config.
--- package/pkg-kconfig.mk | 10 ++++++++++ 1 file changed, 10 insertions(+)
package/pkg-kconfig.mk +10 -0
@@ -55,6 +55,16 @@ $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config # Before running configure, the configuration file should be present and fixed $$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done +# During their configure steps, some kconfig packages may regenerate their +# .config file, thus making it more recent than our .stamp_kconfig_fixup_done +# stamp file; thus, on a subsequent build, the package will be reconfigured +# and rebuilt, re-installed, again and again... +# Work around this by re-touching our stamp file after the configure step. +define KCONFIG_RETOUCH_FIXUP_STAMP_HOOK + $$(Q)touch $$(@D)/.stamp_kconfig_fixup_done +endef +$(2)_POST_CONFIGURE_HOOKS += KCONFIG_RETOUCH_FIXUP_STAMP_HOOK + # Configuration editors (menuconfig, ...) $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_done $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
Signature · 1 line
1.9.1