diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 75fda02c3e..5111f31d92 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -502,26 +502,35 @@ $(2)_MANIFEST_TARBALL ?= not saved $(1)-legal-info: # Packages without a source are assumed to be part of Buildroot, skip them. ifneq ($(call qstrip,$$($(2)_SOURCE)),) + ifeq ($$($(2)_SITE_METHOD),local) # Packages without a tarball: don't save and warn @$(call legal-warning-pkg-savednothing,$$($(2)_RAWNAME),local) + else ifneq ($$($(2)_OVERRIDE_SRCDIR),) @$(call legal-warning-pkg-savednothing,$$($(2)_RAWNAME),override) + else # Other packages + # Save license files if defined ifeq ($(call qstrip,$$($(2)_LICENSE_FILES)),) @$(call legal-license-nofiles,$$($(2)_RAWNAME)) @$(call legal-warning-pkg,$$($(2)_RAWNAME),cannot save license ($(2)_LICENSE_FILES not defined)) else - @$(foreach F,$($(2)_LICENSE_FILES),$(call legal-license-file,$$($(2)_RAWNAME),$(F),$$($(2)_DIR)/$(F))$$(sep)) -endif +# Double dollar signs are really needed here, to catch host packages +# without explicit HOST_FOO_LICENSE_FILES assignment, also in case they +# have multiple license files. + @$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAWNAME),$$(F),$$($(2)_DIR)/$$(F))$$(sep)) +endif # license files + ifeq ($$($(2)_REDISTRIBUTE),YES) # Copy the source tarball (just hardlink if possible) @cp -l $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR) 2>/dev/null || \ cp $(DL_DIR)/$$($(2)_SOURCE) $(REDIST_SOURCES_DIR) -endif -endif +endif # redistribute + +endif # other packages @$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL)) endif # ifneq ($(call qstrip,$$($(2)_SOURCE)),) $(foreach hook,$($(2)_POST_LEGAL_INFO_HOOKS),$(call $(hook))$(sep))