aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-04-18 14:58:01 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-04-18 14:58:01 +0000
commit79f1326d735382db527254b91c0d07a66a435fa8 (patch)
tree7f744a928ce2fca9db9c9f1b12d46639bca282c6
parent7bfcbab875a03251abd95af2a1e18e94c7170281 (diff)
downloadupstream-79f1326d735382db527254b91c0d07a66a435fa8.tar.gz
upstream-79f1326d735382db527254b91c0d07a66a435fa8.tar.bz2
upstream-79f1326d735382db527254b91c0d07a66a435fa8.zip
build: reimplement package build directory override
Remove leftover pieces from package-version-override.mk support Add a new variable USE_SOURCE_DIR to use a custom build directory. Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 40527
-rw-r--r--include/package.mk30
1 files changed, 15 insertions, 15 deletions
diff --git a/include/package.mk b/include/package.mk
index 696e752973..f7da9e3499 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -66,6 +66,12 @@ ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
USE_GIT_TREE:=1
QUILT:=1
endif
+ifdef USE_SOURCE_DIR
+ QUILT:=1
+endif
+ifneq ($(wildcard $(PKG_BUILD_DIR)/.source_dir),)
+ QUILT:=1
+endif
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
@@ -95,20 +101,6 @@ ifeq ($(DUMP)$(filter prereq clean refresh update,$(MAKECMDGOALS)),)
endif
endif
-ifeq ($(CONFIG_$(PKG_NAME)_USE_CUSTOM_SOURCE_DIR),y)
-# disable load stage
-PKG_SOURCE_URL:=
-# add hook to install a link to customer source path of dedicated package
-Hooks/Prepare/Pre += prepare_custom_source_directory
-ifeq ($(filter autoreconf,$(Hooks/Configure/Pre)),)
- Hooks/Configure/Pre += autoreconf_target
-endif
-# define empty default action
-define Build/Prepare/Default
- @:
-endef
-endif
-
define Download/default
FILE:=$(PKG_SOURCE)
URL:=$(PKG_SOURCE_URL)
@@ -127,6 +119,14 @@ ifdef USE_GIT_TREE
( cd $(PKG_BUILD_DIR); git checkout .)
endef
endif
+ifdef USE_SOURCE_DIR
+ define Build/Prepare/Default
+ rm -rf $(PKG_BUILD_DIR)
+ $(if $(wildcard $(USE_SOURCE_DIR)/*),,@echo "Error: USE_SOURCE_DIR=$(USE_SOURCE_DIR) path not found"; false)
+ ln -snf $(USE_SOURCE_DIR) $(PKG_BUILD_DIR)
+ touch $(PKG_BUILD_DIR)/.source_dir
+ endef
+endif
define Build/Exports/Default
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
@@ -141,7 +141,7 @@ Build/Exports=$(Build/Exports/Default)
define Build/DefaultTargets
$(if $(QUILT),$(Build/Quilt))
- $(if $(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
+ $(if $(USE_SOURCE_DIR)$(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(call Build/Autoclean)
download: