From patchwork Sat Jun 6 11:54:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 481645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 0D881140280 for ; Sat, 6 Jun 2015 21:54:45 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=HD9vx4K5; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2D68B91E90; Sat, 6 Jun 2015 11:54:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sYowAjNzUyiq; Sat, 6 Jun 2015 11:54:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 8F10F91E28; Sat, 6 Jun 2015 11:54:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 448D41C0C5F for ; Sat, 6 Jun 2015 11:54:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3EB1091EE7 for ; Sat, 6 Jun 2015 11:54:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7TzdYvbvdEdy for ; Sat, 6 Jun 2015 11:54:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by whitealder.osuosl.org (Postfix) with ESMTPS id 48BD891E3A for ; Sat, 6 Jun 2015 11:54:33 +0000 (UTC) Received: by wgv5 with SMTP id 5so73161891wgv.1 for ; Sat, 06 Jun 2015 04:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=b/VHG0QTiF1HZ2Cx6pcyWqrT2osomM9ZHsLut5QFzDg=; b=HD9vx4K5fqpiWDx8dXKpQno3dEFVFA5rRJ2GgmJRfLQ0AAdEc/ET6wh3alaGAG8xWV jIJ8DsHmz/l5fuQ+ft6A0NWa3/5SNzCbcLS+WpGR7fSdV+TNYfah94oJY/LSUFZA7D3F pQHD6zJqK1mifPnWmTcvXeMn8cVvEL3B0mNz0RWrTMX0FMu0gwPze40upCxLjmB4GgdL Kczj0YY7WiihD3H4y+ZhxZL8rrstjhsD+BnUN/0b7yv2VGgCmyK6D3XWvj8Xz6kmcmgi +F3GtXZvMGzaEzpTh0Ist0ycVEsaWQ823ntOuJwgr4KGnFHaQxm4kL/8FJaBnYTt3p8X U/fA== X-Received: by 10.180.206.14 with SMTP id lk14mr5118289wic.94.1433591671980; Sat, 06 Jun 2015 04:54:31 -0700 (PDT) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by mx.google.com with ESMTPSA id gz3sm2197743wib.0.2015.06.06.04.54.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 06 Jun 2015 04:54:31 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Sat, 6 Jun 2015 13:54:25 +0200 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH 3/4] core/pkg-kconfig: run the kconfig fixups after exiting configurators X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" After we exit the configurators, we need to re-run the kconfig fixups to ensure the user is not able to override them in the configurators. Currently, we schedule that "for later", by removing the corresponding stamp file, so make will run the fixups "later". This means the user has access to the un-fixed .config file, which he might decide to copy and use as a reference (not too bad, since we'd run the fixups anyway; but not clean either). Furthermore, we'll need to have the .config file properly fixed-up without requiring the full dependency chain up to the original user-supplied (def)config, so we won't be able to rely on the stamp file in the dependency list, so we'll need to run the fixups when exiting the configurators anyway. Note that we still remove the stamp file before running the fixups, in case any one of those fixups breaks, so we don't want to believe the fixups have been applied; the fixup macro will touch that file anyway. Signed-off-by: "Yann E. MORIN" Cc: Thomas De Schampheleire Cc: Thomas Petazzoni --- package/pkg-kconfig.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk index d6986c3..6bb2559 100644 --- a/package/pkg-kconfig.mk +++ b/package/pkg-kconfig.mk @@ -89,11 +89,24 @@ $$(error Internal error: no value specified for $(2)_KCONFIG_FILE) endif # Configuration editors (menuconfig, ...) +# +# Apply the kconfig fixups right after exiting the configurators, so +# that the user always sees a .config file that is clean wrt. our +# requirements. +# +# Because commands in $(1)_FIXUP_KCONFIG are probably using $(@D), we +# fake it for the configurators (otherwise it is set to just '.', i.e. +# the current directory where make is run, which happens to be in +# $(TOPDIR), because the target of the rule is not an actual file, so +# does not have any path component). +# +$$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): @D=$$($(2)_DIR) $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_done $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ $$($(2)_KCONFIG_OPTS) $$(subst $(1)-,,$$@) rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built} rm -f $$($(2)_DIR)/.stamp_{target,staging,images}_installed + $$(call $(1)_FIXUP_KCONFIG) $(1)-savedefconfig: $$($(2)_DIR)/.stamp_kconfig_fixup_done $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \