summaryrefslogtreecommitdiff
path: root/package/pkg-download.mk
diff options
context:
space:
mode:
Diffstat (limited to 'package/pkg-download.mk')
-rw-r--r--package/pkg-download.mk11
1 files changed, 10 insertions, 1 deletions
diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index 9e9858100..fa9a3e883 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -22,11 +22,20 @@ LOCALFILES:=$(call qstrip,$(BR2_LOCALFILES))
# external-deps target.
DL_MODE=DOWNLOAD
-DL_DIR=$(call qstrip,$(BR2_DL_DIR))
+# Override BR2_DL_DIR if shell variable defined
+ifneq ($(BUILDROOT_DL_DIR),)
+DL_DIR:=$(BUILDROOT_DL_DIR)
+else
+DL_DIR:=$(call qstrip,$(BR2_DL_DIR))
+endif
+
ifeq ($(DL_DIR),)
DL_DIR:=$(TOPDIR)/dl
endif
+# ensure it exists and a absolute path
+DL_DIR:=$(shell mkdir -p $(DL_DIR) && cd $(DL_DIR) >/dev/null && pwd)
+
#
# URI scheme helper functions
# Example URIs: