From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 2/9] pkg-cmake: install CMake files as part of a package
Date: Sat, 24 Mar 2018 15:20:01 +0100 [thread overview]
Message-ID: <20180324142008.10375-3-thomas.petazzoni@bootlin.com> (raw)
In-Reply-To: <20180324142008.10375-1-thomas.petazzoni@bootlin.com>
Currently, the toolchainfile.cmake and Buildroot.cmake files are
installed outside of any package, just triggered by the toolchain
target.
As part of the per-package SDK effort, we are trying to avoid anything
that installs to the global $(HOST_DIR), and this is one of the
remaining files installed in $(HOST_DIR) outside of any package. We
fix this by installing such files as part of the toolchain package
post-install staging hooks.
Yes, a post-install staging hook to install things to $(HOST_DIR) is a
bit weird, but the toolchain infrastructure is made of target packages
only, and they all install a lot of stuff to $(HOST_DIR) already.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
Changes since v3:
- Added Reviewed-by from Yann
Changes since v2:
- None
Changes since v1:
- New patch
---
package/pkg-cmake.mk | 12 +++++++-----
toolchain/toolchain/toolchain.mk | 3 ---
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 9b07798a1e..34b49bdbe5 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -253,8 +253,8 @@ endif
# based on the toolchainfile.cmake file's location: $(HOST_DIR)/share/buildroot
# In all the other variables, HOST_DIR will be replaced by RELOCATED_HOST_DIR,
# so we have to strip "$(HOST_DIR)/" from the paths that contain it.
-$(HOST_DIR)/share/buildroot/toolchainfile.cmake:
- @mkdir -p $(@D)
+define TOOLCHAIN_CMAKE_INSTALL_FILES
+ @mkdir -p $(HOST_DIR)/share/buildroot
sed \
-e 's#@@STAGING_SUBDIR@@#$(call qstrip,$(STAGING_SUBDIR))#' \
-e 's#@@TARGET_CFLAGS@@#$(call qstrip,$(TARGET_CFLAGS))#' \
@@ -268,7 +268,9 @@ $(HOST_DIR)/share/buildroot/toolchainfile.cmake:
-e 's#@@TOOLCHAIN_HAS_FORTRAN@@#$(if $(BR2_TOOLCHAIN_HAS_FORTRAN),1,0)#' \
-e 's#@@CMAKE_BUILD_TYPE@@#$(if $(BR2_ENABLE_DEBUG),Debug,Release)#' \
$(TOPDIR)/support/misc/toolchainfile.cmake.in \
- > $@
+ > $(HOST_DIR)/share/buildroot/toolchainfile.cmake
+ $(Q)$(INSTALL) -D -m 0644 support/misc/Buildroot.cmake \
+ $(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake
+endef
-$(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake:
- $(Q)$(INSTALL) -D -m 0644 support/misc/Buildroot.cmake $(@)
+TOOLCHAIN_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_CMAKE_INSTALL_FILES
diff --git a/toolchain/toolchain/toolchain.mk b/toolchain/toolchain/toolchain.mk
index 179c09edf1..91c9ca2eff 100644
--- a/toolchain/toolchain/toolchain.mk
+++ b/toolchain/toolchain/toolchain.mk
@@ -38,6 +38,3 @@ TOOLCHAIN_INSTALL_STAGING = YES
endif
$(eval $(virtual-package))
-
-toolchain: $(HOST_DIR)/share/buildroot/toolchainfile.cmake
-toolchain: $(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake
--
2.14.3
next prev parent reply other threads:[~2018-03-24 14:20 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-24 14:19 [Buildroot] [PATCH v4 0/9] Preparation for per-package host/target directories Thomas Petazzoni
2018-03-24 14:20 ` [Buildroot] [PATCH v4 1/9] Makefile, skeleton: move the host skeleton logic to host-skeleton package Thomas Petazzoni
2018-03-24 15:28 ` Yann E. MORIN
2018-03-24 15:37 ` Thomas Petazzoni
2018-03-24 15:43 ` Yann E. MORIN
2018-03-25 13:00 ` Peter Korsgaard
2018-03-25 13:21 ` Yann E. MORIN
2018-03-25 15:34 ` Peter Korsgaard
2018-03-25 14:59 ` Thomas Petazzoni
2018-03-25 15:33 ` Peter Korsgaard
2018-03-25 15:36 ` Peter Korsgaard
2018-03-24 14:20 ` Thomas Petazzoni [this message]
2018-03-25 15:37 ` [Buildroot] [PATCH v4 2/9] pkg-cmake: install CMake files as part of a package Peter Korsgaard
2018-03-24 14:20 ` [Buildroot] [PATCH v4 3/9] package/pkg-generic: add the concept of extract dependency Thomas Petazzoni
2018-03-25 3:23 ` Matthew Weber
2018-03-25 15:40 ` Peter Korsgaard
2018-03-24 14:20 ` [Buildroot] [PATCH v4 4/9] package/pkg-generic: handle host-tar as an " Thomas Petazzoni
2018-03-25 3:23 ` Matthew Weber
2018-03-25 15:42 ` Peter Korsgaard
2018-03-24 14:20 ` [Buildroot] [PATCH v4 5/9] package/pkg-generic: handle host-xz " Thomas Petazzoni
2018-03-25 15:45 ` Peter Korsgaard
2018-03-24 14:20 ` [Buildroot] [PATCH v4 6/9] package/pkg-generic: handle host-lzip " Thomas Petazzoni
2018-03-25 15:48 ` Peter Korsgaard
2018-03-24 14:20 ` [Buildroot] [PATCH v4 7/9] package/pkg-generic: handle host-ccache as a regular dependency Thomas Petazzoni
2018-03-24 15:38 ` Yann E. MORIN
2018-03-25 3:23 ` Matthew Weber
2018-03-25 15:50 ` Peter Korsgaard
2018-03-24 14:20 ` [Buildroot] [PATCH v4 8/9] package/pkg-generic: handle host-fakedate " Thomas Petazzoni
2018-03-25 15:51 ` Peter Korsgaard
2018-03-24 14:20 ` [Buildroot] [PATCH v4 9/9] core: kill DEPENDENCIES_HOST_PREREQ Thomas Petazzoni
2018-03-25 15:53 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180324142008.10375-3-thomas.petazzoni@bootlin.com \
--to=thomas.petazzoni@bootlin.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox