From patchwork Sun Nov 17 16:12:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Florent VIARD (Mojix)" X-Patchwork-Id: 1196387 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mojix.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mojix.com header.i=@mojix.com header.b="fm4As6b7"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47GHDY22M4z9s7T for ; Mon, 18 Nov 2019 03:12:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9BE0687C9F; Sun, 17 Nov 2019 16:12:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E673Wnu+j3aC; Sun, 17 Nov 2019 16:12:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A995387CB1; Sun, 17 Nov 2019 16:12:42 +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 597991BF2BB for ; Sun, 17 Nov 2019 16:12:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 563CF85582 for ; Sun, 17 Nov 2019 16:12:41 +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 xEt6Da1Wm0zi for ; Sun, 17 Nov 2019 16:12:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3E95685455 for ; Sun, 17 Nov 2019 16:12:40 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id q15so3780734wrw.7 for ; Sun, 17 Nov 2019 08:12:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojix.com; s=google; h=from:subject:to:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=SGUUejKkdegQJUAEWseeTPEAejBkkmM3L8ZQvKmlm/U=; b=fm4As6b7ph9q/QBdRdpndxzLrsqU99o+Qx/wlXywI9wWzB5EWnHFaj8H2PzA5l5uBB Jejz0aB1c7oJz1DOe4FH5lTZu6GgHTexVayVeONsHuxJIz8198u0J4Vm49uL9zuE1qa3 s42+iCQtcvuVROs5W1qg/Br/U2++J21/R2eHc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=SGUUejKkdegQJUAEWseeTPEAejBkkmM3L8ZQvKmlm/U=; b=EfOnfEPU4lwF9mhbGBHE6R2njX3MZFN/ifCQ4L2R7qNfN5YsiCF8XK0XQFKVUtBtG+ qNZdd02cn5t6ZxZ8dFXB8BEwHv5Em5Nq5EE/6YlDPzl09gwcUHlAYGXd4DP+1oOyWA4b fvAHqfpNMl9gSdKMwQN6bwFTzQhAJefUT2c++bqmzWEPZ6A5DsM2W+/3CuQkxZWFhbRW wbdBSKQuWWnKsFvX8oCOVLGqvyYxxj1wKiGXunj8haxS2xCfQoctRpovRgAFsimTXEpt CC/NdyUnCse8IIVulrzDMNfVsUSvimP1uTYizKCymK06BDkhaDGBYUkpcFWNsgorL24m M1VA== X-Gm-Message-State: APjAAAUKh16gQiO1UdOV4BlMg62h3oSunuox0VQJXsfiexRyHgU/0ttM /q3snlmBa41H6mJEmUrZ3OLvLLgCcf3JZf5WLX/19SFzS1tkCzLJJIO6VpixVb1ANUInQKgrx4Z pO8RM5jEdxO3ID7M1AEByVynyM+4WM0EGo1glmTD9csjHei0gFz0+3FQu5VGP5jFpYTA/Nw== X-Google-Smtp-Source: APXvYqy63lOHT+Ls51CXThOM4fidboe15VAyQoYstR9UnmnPxTxOt5q7uiJoo01Mf94GYUtRF9FW2A== X-Received: by 2002:a05:6000:104:: with SMTP id o4mr24430992wrx.309.1574007158346; Sun, 17 Nov 2019 08:12:38 -0800 (PST) Received: from [192.168.1.181] ([78.193.194.117]) by smtp.gmail.com with ESMTPSA id w11sm22472037wra.83.2019.11.17.08.12.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Nov 2019 08:12:37 -0800 (PST) From: "Florent VIARD (Mojix)" To: buildroot@busybox.net Message-ID: <06c9840e-2577-dc81-c0ab-f9301b5bcce7@mojix.com> Date: Sun, 17 Nov 2019 17:12:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Content-Language: en-US Subject: [Buildroot] [PATCH 1/1] core: load a global.mk file if it exists to override global vars X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" For example, this can be useful to permanently set a BR2_EXTERNAL without having to use the "env var" at least once. The global.mk file has to be located inside TOPDIR. Example: -- global.mk -- BR2_EXTERNAL = ext-myproject It can also probably be used for BR2_VERSION customization or to add global variables to be used in custom config files. To give a little bit of context of the genesis of this change: - I have a project using buildroot for a custom product. - I have an "ext-myproject" folder at the root of TOPDIR that is an external folder. - All the configs, scripts or vendor specific packages are located inside this external folder. Like that, the project is kind of "out-of-tree", with everything located in a specific dir, and the buildroot original file/folders stay clean. So, it is more easy to merge updated versions. The issue solved by this change is that, currently, path to external folder(s) has to be manually set through the env var at least once by everyone in the team after a checkout and eventually again after a make distclean. Because, the BR2_EXTERNAL path settings are saved within the "output" folder. Using the global.mk file, i can setup the BR2_EXTERNAL and save/commit it with the project, so that anyone can start building with a single "make" without non obvious manipulation. As a side effect of this change, using this can help overcome a regression in buildroot that I have noticed: External paths are supposed to be absolute or relative, but a change pushed a few years ago, automatically change external relative path to absolute before generating the temporary files. Signed-off-by: Florent Viard --- Makefile | 3 +++ 1 file changed, 3 insertions(+) # diff --git a/Makefile b/Makefile index c78c2cbcf6..f2c43ef40f 100644 --- a/Makefile +++ b/Makefile @@ -170,6 +170,9 @@ export CDPATH := BASE_DIR := $(CANONICAL_O) $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist)) +# Include the global override file if one is provided +# This is useful, for example, to allow the user to permanently set BR2_EXTERNAL +-include $(TOPDIR)/global.mk # Handling of BR2_EXTERNAL.