mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-08 08:30:47 -09:00
Makefile: fix SDK relocation for per-package-dirs
The relocate-sdk.sh script does not work correctly when BR2_PER_PACKAGE_DIRECTORIES is enabled. relocate-sdk.sh expects everything to point at $HOST_DIR, but each package will be pointing at its $(O)/per-package/*/host. Use the same command for scrubing host paths during the build, to scrub to the final host directory location. Signed-off-by: Brandon Maier <Brandon.Maier@collins.com> Acked-by: Charles Hardin <ckhardin@gmail.com> Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
This commit is contained in:
committed by
Arnout Vandecappelle
parent
708eb34bf4
commit
25e60fbe1c
1
Makefile
1
Makefile
@@ -600,6 +600,7 @@ prepare-sdk: world
|
|||||||
PARALLEL_JOBS=$(PARALLEL_JOBS) \
|
PARALLEL_JOBS=$(PARALLEL_JOBS) \
|
||||||
PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) \
|
PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) \
|
||||||
$(TOPDIR)/support/scripts/fix-rpath staging
|
$(TOPDIR)/support/scripts/fix-rpath staging
|
||||||
|
$(call ppd-fixup-paths,$(BASE_DIR))
|
||||||
$(INSTALL) -m 755 $(TOPDIR)/support/misc/relocate-sdk.sh $(HOST_DIR)/relocate-sdk.sh
|
$(INSTALL) -m 755 $(TOPDIR)/support/misc/relocate-sdk.sh $(HOST_DIR)/relocate-sdk.sh
|
||||||
mkdir -p $(HOST_DIR)/share/buildroot
|
mkdir -p $(HOST_DIR)/share/buildroot
|
||||||
echo $(HOST_DIR) > $(HOST_DIR)/share/buildroot/sdk-location
|
echo $(HOST_DIR) > $(HOST_DIR)/share/buildroot/sdk-location
|
||||||
|
|||||||
@@ -92,18 +92,8 @@ endif
|
|||||||
|
|
||||||
ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
|
ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
|
||||||
|
|
||||||
# Ensure files like .la, .pc, .pri, .cmake, and so on, point to the
|
|
||||||
# proper staging and host directories for the current package: find
|
|
||||||
# all text files that contain the PPD root, and replace it with the
|
|
||||||
# current package's PPD.
|
|
||||||
define PPD_FIXUP_PATHS
|
define PPD_FIXUP_PATHS
|
||||||
$(Q)grep --binary-files=without-match -lrZ '$(PER_PACKAGE_DIR)/[^/]\+/' $(HOST_DIR) \
|
$(call ppd-fixup-paths,$(PER_PACKAGE_DIR)/$($(PKG)_NAME))
|
||||||
|while read -d '' f; do \
|
|
||||||
file -b --mime-type "$${f}" | grep -q '^text/' || continue; \
|
|
||||||
printf '%s\0' "$${f}"; \
|
|
||||||
done \
|
|
||||||
|xargs -0 --no-run-if-empty \
|
|
||||||
$(SED) 's:$(PER_PACKAGE_DIR)/[^/]\+/:$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/:g'
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Remove python's pre-compiled "sysconfigdata", as it may contain paths to
|
# Remove python's pre-compiled "sysconfigdata", as it may contain paths to
|
||||||
|
|||||||
@@ -233,6 +233,21 @@ define prepare-per-package-directory
|
|||||||
$(call per-package-rsync,$(1),host,$(HOST_DIR))
|
$(call per-package-rsync,$(1),host,$(HOST_DIR))
|
||||||
$(call per-package-rsync,$(1),target,$(TARGET_DIR))
|
$(call per-package-rsync,$(1),target,$(TARGET_DIR))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
# Ensure files like .la, .pc, .pri, .cmake, and so on, point to the
|
||||||
|
# proper staging and host directories for the current package: find
|
||||||
|
# all text files that contain the PPD root, and replace it with the
|
||||||
|
# current package's PPD.
|
||||||
|
# $1: destination root directory containing host and staging
|
||||||
|
define ppd-fixup-paths
|
||||||
|
$(Q)grep --binary-files=without-match -lrZ '$(PER_PACKAGE_DIR)/[^/]\+/' $(HOST_DIR) \
|
||||||
|
|while read -d '' f; do \
|
||||||
|
file -b --mime-type "$${f}" | grep -q '^text/' || continue; \
|
||||||
|
printf '%s\0' "$${f}"; \
|
||||||
|
done \
|
||||||
|
|xargs -0 --no-run-if-empty \
|
||||||
|
$(SED) 's:$(PER_PACKAGE_DIR)/[^/]\+/:$(1)/:g'
|
||||||
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user