aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-05-26 09:17:13 +0000
committerJo-Philipp Wich <jow@openwrt.org>2015-05-26 09:17:13 +0000
commit3fe418e4e0bad06e4b33aa475261a6c0b4863600 (patch)
tree99ae82da2b2986de14a98d01003187dc8856e04f
parent8182400cd32a4efc140de7559dd834c41410ff36 (diff)
downloadmaster-187ad058-3fe418e4e0bad06e4b33aa475261a6c0b4863600.tar.gz
master-187ad058-3fe418e4e0bad06e4b33aa475261a6c0b4863600.tar.bz2
master-187ad058-3fe418e4e0bad06e4b33aa475261a6c0b4863600.zip
include: clean package staging dir files before configure
This is required to allow packages to ship libraries with a different API. Previously the linker would favor the old shared libraries in STAGING_DIR instead of the just compiled ones in PKG_BUILD_DIR. Avoid that problem by clearing the package staging files right after prepare. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45759 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--include/package.mk24
1 files changed, 14 insertions, 10 deletions
diff --git a/include/package.mk b/include/package.mk
index fb73623004..c69d928197 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -104,6 +104,17 @@ STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.$(PKG_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),)_installed
STAGING_FILES_LIST:=$(PKG_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).list
+
+define CleanStaging
+ rm -f $(STAMP_INSTALLED)
+ @-(\
+ cd "$(STAGING_DIR)"; \
+ if [ -f packages/$(STAGING_FILES_LIST) ]; then \
+ cat packages/$(STAGING_FILES_LIST) | xargs -r rm -f 2>/dev/null; \
+ fi; \
+ )
+endef
+
ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
USE_GIT_TREE:=1
QUILT:=1
@@ -202,6 +213,7 @@ define Build/DefaultTargets
$(call Build/Exports,$(STAMP_CONFIGURED))
$(STAMP_CONFIGURED): $(STAMP_PREPARED)
+ $(CleanStaging)
$(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep))
$(Build/Configure)
$(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep))
@@ -219,7 +231,6 @@ define Build/DefaultTargets
$(STAMP_INSTALLED) : export PATH=$$(TARGET_PATH_PKG)
$(STAMP_INSTALLED): $(STAMP_BUILT)
- $(SUBMAKE) -j1 clean-staging
rm -rf $(TMP_DIR)/stage-$(PKG_NAME)
mkdir -p $(TMP_DIR)/stage-$(PKG_NAME)/host $(STAGING_DIR)/packages $(STAGING_DIR_HOST)/packages
$(foreach hook,$(Hooks/InstallDev/Pre),\
@@ -330,16 +341,9 @@ prepare:
configure:
compile: prepare-package-install
install: compile
-clean-staging: FORCE
- rm -f $(STAMP_INSTALLED)
- @-(\
- cd "$(STAGING_DIR)"; \
- if [ -f packages/$(STAGING_FILES_LIST) ]; then \
- cat packages/$(STAGING_FILES_LIST) | xargs -r rm -f 2>/dev/null; \
- fi; \
- )
-clean: clean-staging FORCE
+clean: FORCE
+ $(CleanStaging)
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
$(Build/Clean)
rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) $(STAGING_DIR_HOST)/packages/$(STAGING_FILES_LIST)