0849e8193e
Thanks to the pkgparentdir and pkgname functions, we can rewrite the GENTARGETS macro in a way that avoids the need for each package to repeat its name and the directory in which it is present. [Peter: pkgdir->pkgparentdir] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
58 lines
1.8 KiB
Makefile
58 lines
1.8 KiB
Makefile
#############################################################
|
|
#
|
|
# iproute2
|
|
#
|
|
#############################################################
|
|
|
|
IPROUTE2_VERSION = 2.6.39
|
|
IPROUTE2_SITE = http://devresources.linuxfoundation.org/dev/iproute2/download
|
|
IPROUTE2_TARGET_SBINS = ctstat genl ifstat ip lnstat nstat routef routel rtacct rtmon rtpr rtstat ss tc
|
|
|
|
# If both iproute2 and busybox are selected, make certain we win
|
|
# the fight over who gets to have their utils actually installed.
|
|
ifeq ($(BR2_PACKAGE_BUSYBOX),y)
|
|
IPROUTE2_DEPENDENCIES += busybox
|
|
endif
|
|
|
|
# If we've got iptables enable xtables support for tc
|
|
ifeq ($(BR2_PACKAGE_IPTABLES),y)
|
|
IPROUTE2_DEPENDENCIES += iptables
|
|
define IPROUTE2_WITH_IPTABLES
|
|
# Makefile is busted so it never passes IPT_LIB_DIR properly
|
|
$(SED) "s/-DIPT/-DXT/" $(IPROUTE2_DIR)/tc/Makefile
|
|
echo "TC_CONFIG_XT:=y" >>$(IPROUTE2_DIR)/Config
|
|
endef
|
|
endif
|
|
|
|
define IPROUTE2_CONFIGURE_CMDS
|
|
# Use kernel headers
|
|
rm -r $(IPROUTE2_DIR)/include/netinet
|
|
# arpd needs berkeleydb
|
|
$(SED) "/^TARGETS=/s: arpd : :" $(IPROUTE2_DIR)/misc/Makefile
|
|
echo "IPT_LIB_DIR:=/usr/lib/xtables" >>$(IPROUTE2_DIR)/Config
|
|
$(IPROUTE2_WITH_IPTABLES)
|
|
endef
|
|
|
|
define IPROUTE2_BUILD_CMDS
|
|
$(SED) 's/$$(CCOPTS)//' $(@D)/netem/Makefile
|
|
$(MAKE) CC="$(TARGET_CC)" CCOPTS="$(TARGET_CFLAGS) -D_GNU_SOURCE" -C $(@D)
|
|
endef
|
|
|
|
define IPROUTE2_INSTALL_TARGET_CMDS
|
|
$(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" SBINDIR=/sbin \
|
|
DOCDIR=/usr/share/doc/iproute2-$(IPROUTE2_VERSION) \
|
|
MANDIR=/usr/share/man install
|
|
# Wants bash
|
|
rm -f $(TARGET_DIR)/sbin/ifcfg
|
|
endef
|
|
|
|
define IPROUTE2_UNINSTALL_TARGET_CMDS
|
|
rm -rf $(TARGET_DIR)/lib/tc
|
|
rm -rf $(TARGET_DIR)/usr/lib/tc
|
|
rm -rf $(TARGET_DIR)/etc/iproute2
|
|
rm -rf $(TARGET_DIR)/var/lib/arpd
|
|
rm -f $(addprefix $(TARGET_DIR)/sbin/, $(IPROUTE2_TARGET_SBINS))
|
|
endef
|
|
|
|
$(eval $(call GENTARGETS))
|