From patchwork Fri Oct 14 14:39:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 682295 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]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3swVct4kw8z9s2Q for ; Sat, 15 Oct 2016 01:40:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=t8wfGWWx; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EB8B933BF7; Fri, 14 Oct 2016 14:40:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XRWIIHLgBy0L; Fri, 14 Oct 2016 14:40:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id D630333C12; Fri, 14 Oct 2016 14:39:36 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 527971CE770 for ; Fri, 14 Oct 2016 14:39:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2427F33C06 for ; Fri, 14 Oct 2016 14:39:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oBZ4e8KHtW6w for ; Fri, 14 Oct 2016 14:39:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by silver.osuosl.org (Postfix) with ESMTPS id DEB7C33BF1 for ; Fri, 14 Oct 2016 14:39:27 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id 191so114483wmr.0 for ; Fri, 14 Oct 2016 07:39:27 -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=99ayrCbUPlD4kvZsd5SGCbg0ZNhrimjyoaZPlkviDzo=; b=t8wfGWWxRkzICw+u3j1owdsnXlBNyP211npTRHAi7m0yWC0y0sFFrntiWAwSPr4F7e +tVsfBe//h2DcjleIWTGilmmxNbQFrJtAzj30dWQjEojTzDElAHvEM1Q/bun/Edi8svm jOwb5mT1rKT5jlwchybPRja+gJhfjmGGugtQSLFMRtz2TfkoqlDfsoVxCBME9cdg/gDN q02Tg3tAD56YeO7POampGoyAjaVY9mi4yqVGHt5pX7Ot9uXojQndxtKJxtLYDmIPtKE7 tc6LbFDl4NajVtQoGfnxSJZq2XIYLa5kW2ZJg+CewjWQpEwfC4WwQSLbWyeISG/TxUzA aEHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=99ayrCbUPlD4kvZsd5SGCbg0ZNhrimjyoaZPlkviDzo=; b=QyuJE7xt6AKnZm0pjWWXw22cbyQs8h5esmSxnBtV9XYIqGHXHaeVaGGyAnUZvyERcd nrEnK2IoaFx3cwchdnDJw0R/LgTkWh4AGIABiz8wpS20ZRVgeeME3wYHOgD1RS4bDZw8 T0Di756gchTYksnXsGQoQNnjYmTX8Df6S5ceVwQTXGrS1JGUEp1f6oYSAlxSPUnH6KBm ihpSJysxwMzXlenV09nuw79//807Bk4kI7Z4+/BUq87hYoQpzmdWDmKPmkJ/QPGhMAxJ b+XNrJomtG73sd3kus+kGiVYLSkAuRVhg4db3tmqCXuXX89NE1Eave9CJJ58JmuV/ZYc OMSw== X-Gm-Message-State: AA6/9RlxLHkq2l01/ieHygjuNKOuHlcqXfZB7fa0HE99Pf/zvziTE+hlZmffAAZDznQuPw== X-Received: by 10.28.10.146 with SMTP id 140mr5931265wmk.129.1476455966303; Fri, 14 Oct 2016 07:39:26 -0700 (PDT) Received: from gourin.in-berlin.de ([2001:bf0:c001:30:d89:1745:6e40:c77e]) by smtp.gmail.com with ESMTPSA id h3sm32328537wjp.45.2016.10.14.07.39.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Oct 2016 07:39:25 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Fri, 14 Oct 2016 16:39:14 +0200 Message-Id: <1745e486ac71d0f82cd9f782ef3b25ad3520ac7f.1476455955.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Cc: Thomas Petazzoni , "Yann E. MORIN" , Romain Naour Subject: [Buildroot] [PATCH 02/12] core: get rid of our dummy br2-external tree 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" Now that we generate a kconfig snippet, we can conditionally include the BR2_EXTERNAL's Config.in only when BR2_EXTERNAL is supplied by the user, which means our empty/dummy Config.in is no longer useful to us. As for external.mk, we can also include it only when BR2_EXTERNAL is supplied by the user, which means our empty/dummy external.mk is no longer of any use to us. Ditch both of those files, and: - only generate actual content in the Kconfig snippet when we actually do have a BR2_EXTERNAL provided by the user (i.e. BR2_EXTERNAL is not empty); - add a variable that contains the path to the external.mk provided by the user, or empty if none, and include the path set in that variable (make can 'include' nothing without any problem! ;-) ) Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni Cc: Arnout Vandecappelle Cc: Romain Naour Cc: Julien CORJON --- Makefile | 11 ++++------- support/dummy-external/Config.in | 0 support/dummy-external/external.mk | 0 support/scripts/br2-external | 18 +++++++++++++++--- 4 files changed, 19 insertions(+), 10 deletions(-) delete mode 100644 support/dummy-external/Config.in delete mode 100644 support/dummy-external/external.mk diff --git a/Makefile b/Makefile index f44e509..10afcda 100644 --- a/Makefile +++ b/Makefile @@ -147,16 +147,11 @@ $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist)) # on the command line, therefore the file is re-created every time make is run. # # When BR2_EXTERNAL is set to an empty value (e.g. explicitly in command -# line), the .br-external file is removed and we point to -# support/dummy-external. This makes sure we can unconditionally include the -# Config.in and external.mk from the BR2_EXTERNAL directory. In this case, -# override is necessary so the user can clear BR2_EXTERNAL from the command -# line, but the dummy path is still used internally. +# line), the .br-external file is removed. BR2_EXTERNAL_FILE = $(BASE_DIR)/.br-external -include $(BR2_EXTERNAL_FILE) ifeq ($(BR2_EXTERNAL),) - override BR2_EXTERNAL = support/dummy-external $(shell rm -f $(BR2_EXTERNAL_FILE)) else _BR2_EXTERNAL = $(shell cd $(BR2_EXTERNAL) >/dev/null 2>&1 && pwd) @@ -165,6 +160,7 @@ else endif override BR2_EXTERNAL := $(_BR2_EXTERNAL) $(shell echo BR2_EXTERNAL ?= $(BR2_EXTERNAL) > $(BR2_EXTERNAL_FILE)) + BR2_EXTERNAL_MK = $(BR2_EXTERNAL)/external.mk endif # To make sure that the environment variable overrides the .config option, @@ -461,7 +457,8 @@ include boot/common.mk include linux/linux.mk include fs/common.mk -include $(BR2_EXTERNAL)/external.mk +# Nothing to include if no BR2_EXTERNAL tree in use +include $(BR2_EXTERNAL_MK) # Now we are sure we have all the packages scanned and defined. We now # check for each package in the list of enabled packages, that all its diff --git a/support/dummy-external/Config.in b/support/dummy-external/Config.in deleted file mode 100644 index e69de29..0000000 diff --git a/support/dummy-external/external.mk b/support/dummy-external/external.mk deleted file mode 100644 index e69de29..0000000 diff --git a/support/scripts/br2-external b/support/scripts/br2-external index 6c2b85b..1c42ffa 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -19,9 +19,11 @@ main() { # Forget options; keep only positional args shift $((OPTIND-1)) - if [ ${#} -ne 1 ]; then - error "need exactly one br2-external tree to be specified\n" + # Accept 0 or 1 br2-external tree. + if [ ${#} -gt 1 ]; then + error "only zero or one br2-external tree allowed.\n" fi + br2_ext="${1}" if [ -z "${ofile}" ]; then @@ -38,6 +40,11 @@ main() { do_validate() { local br2_ext="${1}" + # No br2-external tree is valid + if [ -z "${br2_ext}" ]; then + return + fi + if [ ! -d "${br2_ext}" ]; then error "'%s': no such file or directory\n" "${br2_ext}" fi @@ -52,12 +59,17 @@ do_validate() { do_kconfig() { printf '#\n# Automatically generated file; DO NOT EDIT.\n#\n' printf '\n' + + if [ -z "${BR2_EXT}" ]; then + printf '# No br2-external tree defined.\n' + return + fi + printf 'config BR2_EXTERNAL\n' printf '\tstring\n' printf '\tdefault "%s"\n' "${BR2_EXT}" printf '\n' printf 'menu "User-provided options"\n' - printf '\tdepends on BR2_EXTERNAL != "support/dummy-external"\n' printf '\n' printf 'source "%s/Config.in"\n' "${BR2_EXT}" printf '\n'