From patchwork Wed Sep 2 03:54:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Bobroff X-Patchwork-Id: 513285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 774B114012C for ; Wed, 2 Sep 2015 13:56:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9B8FA31B5F; Wed, 2 Sep 2015 03:56:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jwDTL1nt8CBY; Wed, 2 Sep 2015 03:56:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 34E8C31C32; Wed, 2 Sep 2015 03:55:58 +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 727871C2DBF for ; Wed, 2 Sep 2015 03:55:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6E3D08D75C for ; Wed, 2 Sep 2015 03:55:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ulAcpgktZs7X for ; Wed, 2 Sep 2015 03:55:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) by whitealder.osuosl.org (Postfix) with ESMTPS id 61FE38D75E for ; Wed, 2 Sep 2015 03:55:54 +0000 (UTC) Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 Sep 2015 13:55:50 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 2 Sep 2015 13:55:49 +1000 X-Helo: d23dlp01.au.ibm.com X-MailFrom: sam.bobroff@au1.ibm.com X-RcptTo: buildroot@busybox.net Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 3E6D62CE8055 for ; Wed, 2 Sep 2015 13:55:49 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t823tfeg59375654 for ; Wed, 2 Sep 2015 13:55:49 +1000 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t823tHIS003605 for ; Wed, 2 Sep 2015 13:55:17 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t823tGFN002942 for ; Wed, 2 Sep 2015 13:55:16 +1000 Received: from tungsten.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id BB289A0255 for ; Wed, 2 Sep 2015 13:54:52 +1000 (AEST) From: Sam Bobroff To: buildroot@busybox.net Date: Wed, 2 Sep 2015 13:54:35 +1000 Message-Id: <7e0cdb0562f5255b6abbb74d592a0222ff4424ae.1441166076.git.sam.bobroff@au1.ibm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15090203-0033-0000-0000-0000020D7535 Subject: [Buildroot] [PATCH v2 1/4] Handle kconfig generated defconfigs 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" As of Linux kernel commit ea4d1a8 "powerpc/configs: Replace pseries_le_defconfig with a Makefile target using merge_config" some kconfig defconfigs (one so far: "pseries_le_defconfig") can be generated using "make " and they do not exist on disk as a single kconfig file. This causes buildroot's build to fail for those configs with: 'arch/powerpc/configs/pseries_le_defconfig' for 'linux' does not exist To handle this case and keep the makefile steps as simple as possible, introduce a new package variable, *_KCONFIG_DEFCONFIG, that can be used to indicate that a defconfig is being used, rather than a file. This allows the rule that generates the .config file to use either the provided file (by copying) or a generated defconfig (by running "make ") as it's starting point. merge_config.sh can then be run the same way in either case, using .config as both input and output. Note that merge_config.sh is now modifying .config in-place but this is safe because it uses a temporary copy while making changes. This patch introduces the new variable but does not make use of it. Use of the new variable will be introduced in separate patches. Signed-off-by: Sam Bobroff --- package/pkg-kconfig.mk | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk index 44c74a7..47bb550 100644 --- a/package/pkg-kconfig.mk +++ b/package/pkg-kconfig.mk @@ -63,8 +63,14 @@ $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES): | $(1)-patch # full .config first. We use 'make oldconfig' because this can be safely # done even when the package does not support defconfigs. $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES) + if [ ! -z "$$($(2)_KCONFIG_DEFCONFIG)" ] ; then \ + $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ + $$($(2)_KCONFIG_OPTS) $$($(2)_KCONFIG_DEFCONFIG)_defconfig ; \ + else \ + cp $$($(2)_KCONFIG_FILE) $$(@) ; \ + fi support/kconfig/merge_config.sh -m -O $$(@D) \ - $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES) + $$(@) $$($(2)_KCONFIG_FRAGMENT_FILES) $$(Q)yes "" | $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ $$($(2)_KCONFIG_OPTS) oldconfig @@ -89,10 +95,10 @@ $$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done # already called above, so we can effectively use this variable. ifeq ($$($$($(2)_KCONFIG_VAR)),y) -# FOO_KCONFIG_FILE is required ifeq ($$(BR_BUILDING),y) -ifeq ($$($(2)_KCONFIG_FILE),) -$$(error Internal error: no value specified for $(2)_KCONFIG_FILE) +# Either FOO_KCONFIG_FILE or FOO_KCONFIG_DEFCONFIG is required +ifeq ($$($(2)_KCONFIG_FILE)$$($(2)_KCONFIG_DEFCONFIG),) +$$(error Internal error: no value specified for $(2)_KCONFIG_FILE or $(2)_KCONFIG_DEFCONFIG) endif endif @@ -159,7 +165,9 @@ $(1)-savedefconfig: $(1)-check-configuration-done # cp and 'touch --reference' is used for symmetry with $(1)-update-defconfig. $(1)-update-config: $(1)-check-configuration-done @$$(if $$($(2)_KCONFIG_FRAGMENT_FILES), \ - echo "Unable to perform $(1)-update-config when fragment files are set"; exit 1) + $$(error Unable to perform $(1)-update-config when fragment files are set)) + @$$(if $$($(2)_KCONFIG_DEFCONFIG), \ + $$(error Unable to perform $(1)-update-config when using an in-tree defconfig)) cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE) touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE) @@ -169,7 +177,9 @@ $(1)-update-config: $(1)-check-configuration-done # we copy. $(1)-update-defconfig: $(1)-savedefconfig @$$(if $$($(2)_KCONFIG_FRAGMENT_FILES), \ - echo "Unable to perform $(1)-update-defconfig when fragment files are set"; exit 1) + $$(error Unable to perform $(1)-update-defconfig when fragment files are set)) + @$$(if $$($(2)_KCONFIG_DEFCONFIG), \ + $$(error Unable to perform $(1)-update-defconfig when using an in-tree defconfig")) cp -f $$($(2)_DIR)/defconfig $$($(2)_KCONFIG_FILE) touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)