procd: depend on libubox directly to rebuild on ABI changes
[openwrt/openwrt.git] / include / package.mk
index 02893b8f66e293931f056fb9ea500707a76c1ff5..d14c525506b0e13230812a8c1a0185299b8ded57 100644 (file)
@@ -27,7 +27,7 @@ else
 PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL)$(CONFIG_PKG_DEFAULT_PARALLEL),\
        $(if $(CONFIG_PKG_BUILD_PARALLEL),$(MAKE_J),-j1),-j1)
 endif
-ifdef CONFIG_HAS_MIPS16
+ifdef CONFIG_USE_MIPS16
   ifeq ($(strip $(PKG_USE_MIPS16)),1)
     TARGET_ASFLAGS_DEFAULT = $(filter-out -mips16 -minterlink-mips16,$(TARGET_CFLAGS))
     TARGET_CFLAGS += -mips16 -minterlink-mips16
@@ -39,6 +39,15 @@ include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/unpack.mk
 include $(INCLUDE_DIR)/depends.mk
 
+find_library_dependencies = $(wildcard $(patsubst %,$(STAGING_DIR)/pkginfo/%.version, \
+       $(filter-out $(BUILD_PACKAGES),$(foreach dep, \
+               $(filter-out @%, $(patsubst +%,%,$(1))), \
+               $(if $(findstring :,$(dep)), \
+                       $(word 2,$(subst :,$(space),$(dep))), \
+                       $(dep) \
+               ) \
+       ))))
+
 STAMP_NO_AUTOREBUILD=$(wildcard $(PKG_BUILD_DIR)/.no_autorebuild)
 PREV_STAMP_PREPARED:=$(if $(STAMP_NO_AUTOREBUILD),$(wildcard $(PKG_BUILD_DIR)/.prepared*))
 ifneq ($(PREV_STAMP_PREPARED),)
@@ -227,6 +236,9 @@ define Package/$(1)/description
 endef
 endif
 
+  BUILD_PACKAGES += $(1)
+  $(STAMP_PREPARED): $$(if $(QUILT)$(DUMP),,$(call find_library_dependencies,$(DEPENDS)))
+
   $(foreach FIELD, TITLE CATEGORY SECTION VERSION,
     ifeq ($($(FIELD)),)
       $$(error Package/$(1) is missing the $(FIELD) field)