From patchwork Sat Apr 25 12:48:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1276813 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=jwoFulo3; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 498W7N6Svdz9sSW for ; Sat, 25 Apr 2020 22:48:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 914608684A; Sat, 25 Apr 2020 12:48:46 +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 2iopdPr8picb; Sat, 25 Apr 2020 12:48:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A811A864C5; Sat, 25 Apr 2020 12:48:44 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 68D801BF3FD for ; Sat, 25 Apr 2020 12:48:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6525785D37 for ; Sat, 25 Apr 2020 12:48:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3Z9drVXEjY-D for ; Sat, 25 Apr 2020 12:48:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 44E3C85D11 for ; Sat, 25 Apr 2020 12:48:42 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id u16so14784921wmc.5 for ; Sat, 25 Apr 2020 05:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=sHN3H2TmfSP6tXdUYTZQNYL97opJwGDs3+yMAThPVU8=; b=jwoFulo3k8lt8VDeEgykbYWOqI0aAQZOr+Al5Kqxw6/WZMjQTfBYHdJsSWgr5iqNHg PEyZjMFVdm+1PhDAsMDjs7WkOEsB7z9gyzdGxBc34UDk/4Aqm/nYMC1E+h6X/YZ9BZs/ vdOE8AC78jskcajBe+XoovH0sZLe+tTMJIHgDLELWilccL2mnZ33u9A6nWc3afeOhxm2 s+2OHal3MUV7VRXTgVAilWIexQr/H94ODhIy2lSNpyFP8mn4KlOQ0TcKN34d4jHHKAgp xRxSHSCkHRJSygKDtbCuvy9IaQNVO438PcgnYEbTx1NqNsGbFTMlu6Ga6bKcJ/SrFxu6 n52w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sHN3H2TmfSP6tXdUYTZQNYL97opJwGDs3+yMAThPVU8=; b=sjB1gMJoxedN5VCMeJKFqacYghNPtc+m7ur5mbUzI9CXMvDCXmFbwtWY/mZXiaSsjH MK3BpQ5xXVvzCbHqXF7dckZdtDuqJfNH0SAimFXRt4+Najeo8dSGu/vdEmxN/uM8bWR7 PmHbS4HISsRxYw7AJRwwKJ56gccOZ97wtsZdI17nqY98cCMVzzXhcrvTfupQPxSBOX1H a46BDG1ZZ9rs65UHQJkqeMdagtmZswDyPYB23fhZAWPf5MvrhIfT1gUMbWNN1YPMLLQs umjaYxmlhoNrmpJ9khOtTVYved5sff94lX6P8WDL/IBToOfVrCi+9+N00BcLVXNp8Gym mhqg== X-Gm-Message-State: AGi0PuaGsarv6wBK1Q9VWnzOTA/XkbhG/lgvrWtWgkSG95aT1Vl8lz4X lddGp14/D11z34w5KMaWNfLflfurIeU= X-Google-Smtp-Source: APiQypJgTj4iSTTxMgOLouIBkd2jDCjutMiu/rsjr/yCrDFWaRMxMEcwbfLwY82wjbtq5AvGppt76A== X-Received: by 2002:a1c:4946:: with SMTP id w67mr16448864wma.38.1587818920236; Sat, 25 Apr 2020 05:48:40 -0700 (PDT) Received: from localhost.localdomain (host185036129193.static.fidoka.tech. [185.36.129.193]) by smtp.gmail.com with ESMTPSA id a187sm7115550wmh.40.2020.04.25.05.48.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Apr 2020 05:48:39 -0700 (PDT) From: Angelo Compagnucci X-Google-Original-From: Angelo Compagnucci To: buildroot@buildroot.org Date: Sat, 25 Apr 2020 14:48:34 +0200 Message-Id: <20200425124836.122729-1-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 Subject: [Buildroot] [PATCH v4 1/3] package/environment-setup: new package 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: , Cc: Angelo Compagnucci , Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Angelo Compagnucci Install an helper script to setup a build environment based on buildroot. It's useful when a developer wants to use a buildroot generated sdk to build an external project. Due to the nature of the intrusiveness of this script, a new PS1 is installed to let the user understand that the current running shell is not a normal shell. Signed-off-by: Angelo Compagnucci --- Changelog: v1->v2: * Moved from echo to printf (Yann) * removed sh extension (Yann) * Adding missing script v2->v3: * Split the patch v3->v4: * Better handling of SDK_PATH dir (Mircea Gliga) Some of the reason I kept several things the way I originally planned: * I kept it being a package because it doesn't fit in any other tool: indeed this script changes your curent PATH and exports some variables that can be used for anything. Think of qmake or cmake or a package that doesn't have any build system at all. It has some features geared also towards autotools software but I keep planning others. * I kept the script being installed in host root: other build system does that and I want this script to mimic other build systems. * I kept looping in TARGET_CONFIGURE_OPTS, indeed it produces a more clean environment script at the end. For the problem arised by Yann: variables in TARGET_CONFIGURE_OPTS _are_ properly escaped, indeed if not they were a big source of problems on each ./configure invocation due to the fact they are injected on the ./configure commandline invocation. * I kept the PS1: this script heavily mess with the path, it is expected by the user running it, but it can be very confusing being on a shell that doesn't behaves like your normal shell. So having a different PS1 helps remembering you are running into the buildroot shell and not into an ordinary one (other build systems does the same). * I kept the manual entry: I think that the most documentation the better. docs/manual/using-buildroot-toolchain.txt | 7 +++++ package/Config.in | 1 + package/environment-setup/Config.in | 6 ++++ package/environment-setup/environment-setup | 16 ++++++++++ .../environment-setup/environment-setup.mk | 29 +++++++++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 package/environment-setup/Config.in create mode 100644 package/environment-setup/environment-setup create mode 100644 package/environment-setup/environment-setup.mk diff --git a/docs/manual/using-buildroot-toolchain.txt b/docs/manual/using-buildroot-toolchain.txt index 0c0c35fced..7b2de4bdfa 100644 --- a/docs/manual/using-buildroot-toolchain.txt +++ b/docs/manual/using-buildroot-toolchain.txt @@ -27,6 +27,13 @@ Upon extracting the SDK tarball, the user must run the script +relocate-sdk.sh+ (located at the top directory of the SDK), to make sure all paths are updated with the new location. +For your convenience, by selecting the package BR2_PACKAGE_ENVIRONMENT_SETUP, +you can have a +setup-environment+ script installed in +output/host/+. +This script can be sourced with +. your/sdk/path/environment-setup+ to launch +the buildroot shell. Inside this shell, you will find an environment already +set up with the correct PATH and the complete list of +target configure +options+. + Alternatively, if you just want to prepare the SDK without generating the tarball (e.g. because you will just be moving the +host+ directory, or will be generating the tarball on your own), Buildroot also allows diff --git a/package/Config.in b/package/Config.in index 9a6461277e..81f45bfaaf 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1953,6 +1953,7 @@ menu "Miscellaneous" source "package/collectl/Config.in" source "package/domoticz/Config.in" source "package/empty/Config.in" + source "package/environment-setup/Config.in" source "package/gnuradio/Config.in" source "package/googlefontdirectory/Config.in" source "package/gqrx/Config.in" diff --git a/package/environment-setup/Config.in b/package/environment-setup/Config.in new file mode 100644 index 0000000000..f0fcc7d0f8 --- /dev/null +++ b/package/environment-setup/Config.in @@ -0,0 +1,6 @@ +config BR2_PACKAGE_ENVIRONMENT_SETUP + bool "Environment setup" + help + Install an helper script to setup a build environment + based on buildroot. It's useful when you export an sdk + and want to use buildroot to build an external project diff --git a/package/environment-setup/environment-setup b/package/environment-setup/environment-setup new file mode 100644 index 0000000000..b48f1979d6 --- /dev/null +++ b/package/environment-setup/environment-setup @@ -0,0 +1,16 @@ +cat <<'EOF' + _ _ _ _ _ +| |__ _ _(_) | __| |_ __ ___ ___ | |_ +| '_ \| | | | | |/ _` | '__/ _ \ / _ \| __| +| |_) | |_| | | | (_| | | | (_) | (_) | |_ +|_.__/ \__,_|_|_|\__,_|_| \___/ \___/ \__| shell + + Making embedded Linux easy! + +Some tips: +* PATH is now pointing to the HOST_DIR path +* Target configure options are already exported +* To configure do "./configure $CONFIGURE_FLAGS" + +EOF +SDK_PATH=$(dirname $(realpath "${BASH_SOURCE[0]}")) diff --git a/package/environment-setup/environment-setup.mk b/package/environment-setup/environment-setup.mk new file mode 100644 index 0000000000..fc74594459 --- /dev/null +++ b/package/environment-setup/environment-setup.mk @@ -0,0 +1,29 @@ +################################################################################ +# +# environment-setup +# +################################################################################ + +ENVIRONMENT_SETUP_FILE = $(HOST_DIR)/environment-setup +ENVIRONMENT_SETUP_HOST_DIR_SED_EXP = 's+$(HOST_DIR)+\$$SDK_PATH+g' + +define ENVIRONMENT_SETUP_INSTALL_TARGET_CMDS + cp package/environment-setup/environment-setup $(ENVIRONMENT_SETUP_FILE) + for var in $(TARGET_CONFIGURE_OPTS); do \ + printf "export \"$$var\"\n" >> $(ENVIRONMENT_SETUP_FILE); \ + done + printf "export \"CROSS_COMPILE=$(TARGET_CROSS)\"\n" >> $(ENVIRONMENT_SETUP_FILE) + printf "export \"CONFIGURE_FLAGS=--target=$(GNU_TARGET_NAME) \ + --host=$(GNU_TARGET_NAME) \ + --build=$(GNU_HOST_NAME) \ + --prefix=/usr \ + --exec-prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --program-prefix=\"\n" >> $(ENVIRONMENT_SETUP_FILE) + $(SED) $(ENVIRONMENT_SETUP_HOST_DIR_SED_EXP) $(ENVIRONMENT_SETUP_FILE) + printf "PS1=\"\[\e[32m\]buildroot-$(BR2_VERSION)\[\e[m\]:\[\e[34m\]\w\[\e[m\]\$$ \"\n" \ + >> $(ENVIRONMENT_SETUP_FILE) +endef + +$(eval $(generic-package)) From patchwork Sat Apr 25 12:48:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1276814 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ZEHynmAj; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 498W7W32jXz9sSW for ; Sat, 25 Apr 2020 22:48:55 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D8A2F864C5; Sat, 25 Apr 2020 12:48:49 +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 4N5jbHflK4mO; Sat, 25 Apr 2020 12:48:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A6651868E5; Sat, 25 Apr 2020 12:48:48 +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 745E51BF3FD for ; Sat, 25 Apr 2020 12:48:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6D060204CF for ; Sat, 25 Apr 2020 12:48:44 +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 lm8H4CkZAxII for ; Sat, 25 Apr 2020 12:48:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by silver.osuosl.org (Postfix) with ESMTPS id 61024203B9 for ; Sat, 25 Apr 2020 12:48:43 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id x4so14165715wmj.1 for ; Sat, 25 Apr 2020 05:48:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4UUD/ck+Wf2ajGGR9hYvV8Cgd0Xit40vwhPqgkSYWSU=; b=ZEHynmAjPiN9mRh9WDSanzFWATs9UKB1FsunVESVpMNpAdokK7Y/pCD2P7rR8cq2b9 j0NPziQb3hLP8kj+wtsC8vx/vtsZnbjaGAOamst/YHARp4j1UelS4+nu0on2uvr0eWdr 7+cb9m5gRjaGw6bJKkEkbelt29bxv0z9bc8ugIFwaRvXNSmX/u7gsVabab3zpFm4+1ke coSLmo8zyCF2nULow3+6QQU4xGTKUjW+pcYiaPy78HOcu9dXfwIVdrTMNosTFuUqVPEp zxXIU35ujIdP5jlGQapGoqsLFMFT/0lOfFm5BSK9KuvvKpDcoj+u7wThvSgMaIRKDD5k 3VqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4UUD/ck+Wf2ajGGR9hYvV8Cgd0Xit40vwhPqgkSYWSU=; b=FBK1Wa6x9RBTm0yksAq6q1Pbu2VliFcRRgF+fEWi8N9+ppl+yGoucxSj0oEhuQPbsg +KpHdY8Au9OsZTCcxPTjaOCYbYxb6L6BjKKY5bQWntLlUkAv82yHbsIYJOeyJweRkSdi /jCFc/TkiKMI4t1sqag2OU8YfcjCtCmu/oaGMjWgIm3m9aIrjSw8O2M1r/CaDCCAGXzC lEb/mOLKPZ36qQWZ6zLyl62gwKAjJRfNclC43k9NqC2n4brMkz6AMqyiVfH/fb3q+eeG 8eJajg02fDqptOuozs5twiFeBBlNt/SvRjG83M7gAW3RycFORwKntfnfEJ1uQwUeOV3X VKuA== X-Gm-Message-State: AGi0PuZIDheQPWzLiFcTER8PPHoQor6gjNDVz0azJXXYCt61iovAmUSD f9Au2uPLZl8Fa/U7WG94ncnKPTRHLA0= X-Google-Smtp-Source: APiQypLSD4kvg+WRGKEtttRbu6VQ1Cw+xJ4FD/LJJ/zscd7Xfm7QcmShtSAA0VQsMa5hUaUf7ybqJQ== X-Received: by 2002:a7b:c642:: with SMTP id q2mr16502521wmk.41.1587818921463; Sat, 25 Apr 2020 05:48:41 -0700 (PDT) Received: from localhost.localdomain (host185036129193.static.fidoka.tech. [185.36.129.193]) by smtp.gmail.com with ESMTPSA id a187sm7115550wmh.40.2020.04.25.05.48.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Apr 2020 05:48:40 -0700 (PDT) From: Angelo Compagnucci X-Google-Original-From: Angelo Compagnucci To: buildroot@buildroot.org Date: Sat, 25 Apr 2020 14:48:35 +0200 Message-Id: <20200425124836.122729-2-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200425124836.122729-1-angelo@amarulasolutions.com> References: <20200425124836.122729-1-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v4 2/3] package/environment-setup: add configure alias 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: , Cc: Angelo Compagnucci , Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Angelo Compagnucci In order to simplify the usage of a buildroot toolchain within the buildroot shell, a "configure" alias is provided to call ./configure with the correct flags. Signed-off-by: Angelo Compagnucci --- docs/manual/using-buildroot-toolchain.txt | 4 ++-- package/environment-setup/environment-setup | 1 + package/environment-setup/environment-setup.mk | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/manual/using-buildroot-toolchain.txt b/docs/manual/using-buildroot-toolchain.txt index 7b2de4bdfa..187ffd472b 100644 --- a/docs/manual/using-buildroot-toolchain.txt +++ b/docs/manual/using-buildroot-toolchain.txt @@ -31,8 +31,8 @@ For your convenience, by selecting the package BR2_PACKAGE_ENVIRONMENT_SETUP, you can have a +setup-environment+ script installed in +output/host/+. This script can be sourced with +. your/sdk/path/environment-setup+ to launch the buildroot shell. Inside this shell, you will find an environment already -set up with the correct PATH and the complete list of +target configure -options+. +set up with the correct PATH, the complete list of +target configure +options+ and some useful commands. Alternatively, if you just want to prepare the SDK without generating the tarball (e.g. because you will just be moving the +host+ directory, diff --git a/package/environment-setup/environment-setup b/package/environment-setup/environment-setup index b48f1979d6..db652fe090 100644 --- a/package/environment-setup/environment-setup +++ b/package/environment-setup/environment-setup @@ -11,6 +11,7 @@ Some tips: * PATH is now pointing to the HOST_DIR path * Target configure options are already exported * To configure do "./configure $CONFIGURE_FLAGS" +* Alternatively use the alias "configure" EOF SDK_PATH=$(dirname $(realpath "${BASH_SOURCE[0]}")) diff --git a/package/environment-setup/environment-setup.mk b/package/environment-setup/environment-setup.mk index fc74594459..bd74dcb2f4 100644 --- a/package/environment-setup/environment-setup.mk +++ b/package/environment-setup/environment-setup.mk @@ -21,6 +21,8 @@ define ENVIRONMENT_SETUP_INSTALL_TARGET_CMDS --sysconfdir=/etc \ --localstatedir=/var \ --program-prefix=\"\n" >> $(ENVIRONMENT_SETUP_FILE) + printf "alias configure=\"./configure \$${CONFIGURE_FLAGS}\"\n" \ + >> $(ENVIRONMENT_SETUP_FILE) $(SED) $(ENVIRONMENT_SETUP_HOST_DIR_SED_EXP) $(ENVIRONMENT_SETUP_FILE) printf "PS1=\"\[\e[32m\]buildroot-$(BR2_VERSION)\[\e[m\]:\[\e[34m\]\w\[\e[m\]\$$ \"\n" \ >> $(ENVIRONMENT_SETUP_FILE) From patchwork Sat Apr 25 12:48:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1276815 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.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=cNhqcEAO; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 498W7c1bVQz9sSW for ; Sat, 25 Apr 2020 22:49:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4F22886B43; Sat, 25 Apr 2020 12:48:57 +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 6AndX25M6pZb; Sat, 25 Apr 2020 12:48:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6D1C286938; Sat, 25 Apr 2020 12:48:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B8F0A1BF3FD for ; Sat, 25 Apr 2020 12:48:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B606385D37 for ; Sat, 25 Apr 2020 12:48:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o7nspfjr_4Dn for ; Sat, 25 Apr 2020 12:48:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 4747285D11 for ; Sat, 25 Apr 2020 12:48:44 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id h4so909651wmb.4 for ; Sat, 25 Apr 2020 05:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IkfrDUrb+7ny/38iCZjelimEe6+l2FE5FvptGLqXZuk=; b=cNhqcEAOJP4JQO8n8PbSW/QosXUB7Fd6FTjsF9XTZBuc+0O0UQFDIp/IPLZYzYXI3/ GE6OkmmnS/iTkFz2KrMMRBV9JffgnUG4shdKnQ031G5AIzMtjWQpvu7EtqB4OkNVVx5l lupkxQUjRJjyTizneecjkkxSwVka/jErruGNt25N4qw+rr5a1lHkIHOgIcB7vfpV16x8 inRwmV3v9MvZQvgE7nnBuWykm3NbmVy+tV3pR8GMAxPrRgtnoHdT1cbFSWsRN2F1LreD ZVphjkvTsBEjzzfx34DiClIqF9DXpZNgVNMZMZZrGWrPhXLvfMHIuQsYiqzDSaCdrEnE EI3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IkfrDUrb+7ny/38iCZjelimEe6+l2FE5FvptGLqXZuk=; b=K/S/jjmIrY+n881MEjJQaqBqEzg5s5kYy7+bis4VNjVod5oqLXJk9AOQlnibPOdMZb TL/RdmNLR11Sr/a0lDLifciGOZF8W4GI6UMrdDZsqAlq41PfTFN4/HhCTwQxi/e4RSkb ZnK58dDK+uLRkXNQSyDwmqX97rRUSRWIBB/aZJ3AoqdmjzlOxyG0BDhgpxsKjHaapZWc kBPZYhW0W5gUGDl+mmYjI1hH10qeHESt4X4Krj6fisZl3Sgn0qFB7I9wZSc1iw8qmvuN GJ5juhBC+qf+0XqSoSkfuSEI+QZMAuVe0N46v2wztNK3imGi0Km/nC6RrsO3E6kCcjpV 1DnA== X-Gm-Message-State: AGi0Pubrlny0JI9In2O9zYQCPpGIceBqf9ivejED/RWdId92DIgYKwMD lJuWdaYp+XblBtTi1LxJNBq6Kd+M4/o= X-Google-Smtp-Source: APiQypIRFVgHQDQk/pJ9FtCdz9y2HtUJTXr/s18yZGJ8RwD80a/z3RfHY3hA8jmenNzoQPlaFsj+ng== X-Received: by 2002:a1c:f609:: with SMTP id w9mr15534858wmc.123.1587818922455; Sat, 25 Apr 2020 05:48:42 -0700 (PDT) Received: from localhost.localdomain (host185036129193.static.fidoka.tech. [185.36.129.193]) by smtp.gmail.com with ESMTPSA id a187sm7115550wmh.40.2020.04.25.05.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Apr 2020 05:48:41 -0700 (PDT) From: Angelo Compagnucci X-Google-Original-From: Angelo Compagnucci To: buildroot@buildroot.org Date: Sat, 25 Apr 2020 14:48:36 +0200 Message-Id: <20200425124836.122729-3-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200425124836.122729-1-angelo@amarulasolutions.com> References: <20200425124836.122729-1-angelo@amarulasolutions.com> Subject: [Buildroot] [PATCH v4 3/3] package/environment-setup: add cmake alias 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: , Cc: Angelo Compagnucci , Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Angelo Compagnucci In order to simplify the usage of a buildroot toolchain within the buildroot shell, a "cmake" alias is provided to call cmake with the correct toolchain file and options. Signed-off-by: Angelo Compagnucci --- package/environment-setup/environment-setup | 1 + package/environment-setup/environment-setup.mk | 3 +++ 2 files changed, 4 insertions(+) diff --git a/package/environment-setup/environment-setup b/package/environment-setup/environment-setup index db652fe090..7c3ddda18b 100644 --- a/package/environment-setup/environment-setup +++ b/package/environment-setup/environment-setup @@ -12,6 +12,7 @@ Some tips: * Target configure options are already exported * To configure do "./configure $CONFIGURE_FLAGS" * Alternatively use the alias "configure" +* A "cmake" alias is available EOF SDK_PATH=$(dirname $(realpath "${BASH_SOURCE[0]}")) diff --git a/package/environment-setup/environment-setup.mk b/package/environment-setup/environment-setup.mk index bd74dcb2f4..0f3c954b65 100644 --- a/package/environment-setup/environment-setup.mk +++ b/package/environment-setup/environment-setup.mk @@ -23,6 +23,9 @@ define ENVIRONMENT_SETUP_INSTALL_TARGET_CMDS --program-prefix=\"\n" >> $(ENVIRONMENT_SETUP_FILE) printf "alias configure=\"./configure \$${CONFIGURE_FLAGS}\"\n" \ >> $(ENVIRONMENT_SETUP_FILE) + printf "alias cmake=\"cmake \ + -DCMAKE_TOOLCHAIN_FILE=$(HOST_DIR)/share/buildroot/toolchainfile.cmake \ + -DCMAKE_INSTALL_PREFIX=/usr\"\n" >> $(ENVIRONMENT_SETUP_FILE) $(SED) $(ENVIRONMENT_SETUP_HOST_DIR_SED_EXP) $(ENVIRONMENT_SETUP_FILE) printf "PS1=\"\[\e[32m\]buildroot-$(BR2_VERSION)\[\e[m\]:\[\e[34m\]\w\[\e[m\]\$$ \"\n" \ >> $(ENVIRONMENT_SETUP_FILE)