summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rw-r--r--package/pkg-cmake.mk11
1 files changed, 7 insertions, 4 deletions
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index ca56b48995..a84aa0b302 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -158,14 +158,17 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
# Generation of the CMake toolchain file
################################################################################
+# In order to allow the toolchain to be relocated, we calculate the HOST_DIR
+# based on the toolchainfile.cmake file's location: $(HOST_DIR)/usr/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)/usr/share/buildroot/toolchainfile.cmake:
@mkdir -p $(@D)
sed \
- -e 's:@@HOST_DIR@@:$(call qstrip,$(HOST_DIR)):' \
- -e 's:@@STAGING_DIR@@:$(call qstrip,$(STAGING_DIR)):' \
+ -e 's:@@STAGING_SUBDIR@@:$(call qstrip,$(STAGING_SUBDIR)):' \
-e 's:@@TARGET_CFLAGS@@:$(call qstrip,$(TARGET_CFLAGS)):' \
-e 's:@@TARGET_CXXFLAGS@@:$(call qstrip,$(TARGET_CXXFLAGS)):' \
- -e 's:@@TARGET_CC_NOCCACHE@@:$(call qstrip,$(TARGET_CC_NOCCACHE)):' \
- -e 's:@@TARGET_CXX_NOCCACHE@@:$(call qstrip,$(TARGET_CXX_NOCCACHE)):' \
+ -e 's:@@TARGET_CC_NOCCACHE@@:$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CC_NOCCACHE))):' \
+ -e 's:@@TARGET_CXX_NOCCACHE@@:$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CXX_NOCCACHE))):' \
$(TOPDIR)/support/misc/toolchainfile.cmake.in \
> $@
OpenPOWER on IntegriCloud