|
@@ -90,21 +90,24 @@ endif
|
|
|
#######################################
|
|
|
# Helper functions
|
|
|
|
|
|
-# Make sure .la files only reference the current per-package
|
|
|
-# directory.
|
|
|
-
|
|
|
-# $1: package name (lower case)
|
|
|
-# $2: staging directory of the package
|
|
|
ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
|
|
|
-define fixup-libtool-files
|
|
|
- $(Q)find $(2) \( -path '$(2)/lib*' -o -path '$(2)/usr/lib*' \) \
|
|
|
- -name "*.la" -print0 | xargs -0 --no-run-if-empty \
|
|
|
- $(SED) "s:$(PER_PACKAGE_DIR)/[^/]\+/:$(PER_PACKAGE_DIR)/$(1)/:g"
|
|
|
+
|
|
|
+# 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
|
|
|
+ $(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)/[^/]\+/:$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/:g'
|
|
|
endef
|
|
|
-endif
|
|
|
|
|
|
-# Make sure python _sysconfigdata*.py files only reference the current
|
|
|
-# per-package directory.
|
|
|
+# Remove python's pre-compiled "sysconfigdata", as it may contain paths to
|
|
|
+# the original staging or host dirs.
|
|
|
#
|
|
|
# Can't use $(foreach d, $(HOST_DIR)/lib/python* $(STAGING_DIR)/usr/lib/python*, ...)
|
|
|
# because those directories may be created in the same recipe this macro will
|
|
@@ -113,19 +116,15 @@ endif
|
|
|
# fail.
|
|
|
# So we just use HOST_DIR as a starting point, and filter on the two directories
|
|
|
# of interest.
|
|
|
-ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
|
|
|
-define FIXUP_PYTHON_SYSCONFIGDATA
|
|
|
+define PPD_PYTHON_REMOVE_SYSCONFIGDATA_PYC
|
|
|
$(Q)find $(HOST_DIR) \
|
|
|
\( -path '$(HOST_DIR)/lib/python*' \
|
|
|
-o -path '$(STAGING_DIR)/usr/lib/python*' \
|
|
|
\) \
|
|
|
- \( \( -name "_sysconfigdata*.pyc" -delete \) \
|
|
|
- -o \( -name "_sysconfigdata*.py" -print0 \) \
|
|
|
- \) \
|
|
|
- | xargs -0 --no-run-if-empty \
|
|
|
- $(SED) 's:$(PER_PACKAGE_DIR)/[^/]\+/:$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/:g'
|
|
|
+ \( -name "_sysconfigdata*.pyc" -delete \)
|
|
|
endef
|
|
|
-endif
|
|
|
+
|
|
|
+endif # PPD
|
|
|
|
|
|
# Functions to collect statistics about installed files
|
|
|
|
|
@@ -278,8 +277,6 @@ $(BUILD_DIR)/%/.stamp_configured:
|
|
|
@$(call pkg_size_before,$(STAGING_DIR),-staging)
|
|
|
@$(call pkg_size_before,$(BINARIES_DIR),-images)
|
|
|
@$(call pkg_size_before,$(HOST_DIR),-host)
|
|
|
- $(call fixup-libtool-files,$(NAME),$(HOST_DIR))
|
|
|
- $(call fixup-libtool-files,$(NAME),$(STAGING_DIR))
|
|
|
$(foreach hook,$($(PKG)_POST_PREPARE_HOOKS),$(call $(hook))$(sep))
|
|
|
$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
|
|
|
$($(PKG)_CONFIGURE_CMDS)
|
|
@@ -836,7 +833,9 @@ $(2)_EXTRACT_CMDS ?= \
|
|
|
$$(TAR_OPTIONS) -)
|
|
|
|
|
|
# pre/post-steps hooks
|
|
|
-$(2)_POST_PREPARE_HOOKS += FIXUP_PYTHON_SYSCONFIGDATA
|
|
|
+$(2)_POST_PREPARE_HOOKS += \
|
|
|
+ PPD_FIXUP_PATHS \
|
|
|
+ PPD_PYTHON_REMOVE_SYSCONFIGDATA_PYC
|
|
|
|
|
|
ifeq ($$($(2)_TYPE),target)
|
|
|
ifneq ($$(HOST_$(2)_KCONFIG_VAR),)
|