From edee850e181abba55d7cb03788d75fc3bac2a54a Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@openwrt.org>
Date: Sun, 10 Jun 2012 20:27:37 +0000
Subject: [PATCH] build: add a dependency on libc to all non-kernel packages

SVN-Revision: 32171
---
 include/package-defaults.mk | 6 ++++++
 include/package-dumpinfo.mk | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/package-defaults.mk b/include/package-defaults.mk
index 75442925f1f3..c3496767cf7f 100644
--- a/include/package-defaults.mk
+++ b/include/package-defaults.mk
@@ -5,6 +5,12 @@
 # See /LICENSE for more information.
 #
 
+ifneq ($(PKG_NAME),toolchain)
+  PKG_FIXUP_DEPENDS = $(if $(filter kmod-%,$(1)),$(2),+libc $(filter-out +libc,$(2)))
+else
+  PKG_FIXUP_DEPENDS = $(2)
+endif
+
 define Package/Default
   CONFIGFILE:=
   SECTION:=opt
diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk
index a297f2336ea7..2bf78c3f184b 100644
--- a/include/package-dumpinfo.mk
+++ b/include/package-dumpinfo.mk
@@ -30,7 +30,7 @@ $(if $(MENU),Menu: $(MENU)
 )$(if $(DEFAULT),Default: $(DEFAULT)
 )$(if $(findstring $(PREREQ_CHECK),1),Prereq-Check: 1
 )Version: $(VERSION)
-Depends: $(DEPENDS)
+Depends: $(call PKG_FIXUP_DEPENDS,$(1),$(DEPENDS))
 Menu-Depends: $(MDEPENDS)
 Provides: $(PROVIDES)
 $(if $(VARIANT),Build-Variant: $(VARIANT)
-- 
2.30.2