From 4031fe9d6d78f8045a93022f1b9dea0ea6ff7eca Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 9 Jul 2022 12:08:35 +0200 Subject: [PATCH] - auto-assign HOST_ variables --- package/pkg-utils.mk | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index 3ec3d94b..3a5e2755 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -6,9 +6,12 @@ ################################################################################ pkgname = $(basename $(@F)) + pkg = $(call LOWERCASE,$(pkgname)) PKG = $(call UPPERCASE,$(pkgname)) +PKG_PARENT = $(subst HOST_,,$(PKG)) + PKG_BUILD_DIR = $(BUILD_DIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR) PKG_FILES_DIR = $(PACKAGE_DIR)/$(subst host-,,$(pkgname))/files PKG_PATCHES_DIR = $(PACKAGE_DIR)/$(subst host-,,$(pkgname))/patches @@ -21,6 +24,22 @@ PKG_TARGET_PACKAGE = $(if $(filter $(PKG_HOST_PACKAGE),NO),YES,NO) # check for necessary $(PKG) variables define PKG_CHECK_VARIABLES +# auto-assign HOST_ variables +ifeq ($(PKG_HOST_PACKAGE),YES) + ifndef $(PKG)_VERSION + $(PKG)_VERSION = $$($(PKG_PARENT)_VERSION) + endif + ifndef $(PKG)_DIR + $(PKG)_DIR = $$($(PKG_PARENT)_DIR) + endif + ifndef $(PKG)_SOURCE + $(PKG)_SOURCE = $$($(PKG_PARENT)_SOURCE) + endif + ifndef $(PKG)_SITE + $(PKG)_SITE = $$($(PKG_PARENT)_SITE) + endif +endif + # patch ifndef $(PKG)_PATCH $(PKG)_PATCH = $$(PKG_PATCHES_DIR)