endef
endif
+# Make sure python _sysconfigdata*.py files only reference the current
+# per-package directory.
+#
+# 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
+# be expanded in.
+# Additionally, either or both may be missing, which would make find whine and
+# 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
+ $(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'
+endef
+endif
+
# Functions to collect statistics about installed files
# $(1): base directory to search in
$(2)_POST_LEGAL_INFO_HOOKS ?=
$(2)_TARGET_FINALIZE_HOOKS ?=
$(2)_ROOTFS_PRE_CMD_HOOKS ?=
-$(2)_POST_PREPARE_HOOKS ?=
+
+$(2)_POST_PREPARE_HOOKS += FIXUP_PYTHON_SYSCONFIGDATA
ifeq ($$($(2)_TYPE),target)
ifneq ($$(HOST_$(2)_KCONFIG_VAR),)
--root=/ \
--single-version-externally-managed
-# Make sure python _sysconfigdata*.py files only reference the current
-# per-package directory.
-#
-# 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
-# be expanded in.
-# Additionally, either or both may be missing, which would make find whine and
-# 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 PKG_PYTHON_FIXUP_SYSCONFIGDATA
- $(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'
-endef
-endif
-
################################################################################
# inner-python-package -- defines how the configuration, compilation
# and installation of a Python package should be done, implements a
endif
endif
-$(2)_PRE_CONFIGURE_HOOKS += PKG_PYTHON_FIXUP_SYSCONFIGDATA
-
#
# Build step. Only define it if not already defined by the package .mk
# file.