@@ -42,6 +42,18 @@ $(eval $(call caseconvert-helper,LOWERCASE,$(join $(addsuffix :,$([TO])),$([FROM
# slashes, colons (OK in filenames but not in rules), and spaces.
sanitize = $(subst $(space),_,$(subst :,_,$(subst /,_,$(strip $(1)))))
+# Return a relative filepath to path from a start directory.
+# This is a path computation: the filesystem is not accessed to confirm
+# the existence or nature of path or start.
+# $1: path
+# $2: start
+relative-path = $(strip \
+ $(subst //,/,\
+ $(eval __r :=) \
+ $(foreach p,$(subst /, ,$(1)),$(eval __r := $(__r)../)) \
+ $(__r)$(subst /%,%,$(2))))
+
+
#
# Manipulation of .config files based on the Kconfig
# infrastructure. Used by the BusyBox package, the Linux kernel
This new helper computes relative path between 2 paths. This helper will be useful later when fixing the RPATH valuel. Signed-off-by: Samuel Martin <s.martin49@gmail.com> --- package/pkg-utils.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+)