Root/package/iproute2/Makefile

1#
2# Copyright (C) 2006-2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=iproute2
11PKG_VERSION:=2.6.29-1
12PKG_RELEASE:=2
13
14PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15PKG_SOURCE_URL:=http://devresources.linux-foundation.org/dev/iproute2/download/
16PKG_MD5SUM:=c1bc258a6c345905e79935ac7a3cc582
17
18PKG_BUILD_DIR:=$(BUILD_DIR)/iproute2-$(PKG_VERSION)
19
20include $(INCLUDE_DIR)/package.mk
21
22define Package/iproute2/Default
23  SECTION:=net
24  CATEGORY:=Network
25  URL:=http://linux-net.osdl.org/index.php/Iproute2
26endef
27
28define Package/ip
29$(call Package/iproute2/Default)
30  TITLE:=Routing control utility
31endef
32
33define Package/tc
34$(call Package/iproute2/Default)
35  TITLE:=Traffic control utility
36  DEPENDS:=+kmod-sched
37endef
38
39define Package/genl
40$(call Package/iproute2/Default)
41  TITLE:=General netlink utility frontend
42endef
43
44define Build/Configure
45    $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
46    $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
47        $(PKG_BUILD_DIR)/Makefile
48    $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
49        $(PKG_BUILD_DIR)/Makefile
50    # For now disable compiling of the misc directory because it seems to fail
51    rm -rf $(PKG_BUILD_DIR)/misc
52    $(SED) "s, misc,," $(PKG_BUILD_DIR)/Makefile
53endef
54
55MAKE_FLAGS += \
56    EXTRA_CCOPTS="$(TARGET_CFLAGS)" \
57    KERNEL_INCLUDE="$(LINUX_DIR)/include" \
58    FPIC="$(FPIC)" \
59    all tc/tc ip/ip
60
61define Build/Compile
62    $(_SINGLE)$(MAKE) -C $(PKG_BUILD_DIR)/netem HOSTCC="$(HOSTCC)" EXTRA_CCOPTS="$(TARGET_CFLAGS)" CFLAGS="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall -I ../include -DRESOLVE_HOSTNAMES"
63    $(_SINGLE)$(Build/Compile/Default)
64endef
65
66define Build/InstallDev
67    $(INSTALL_DIR) $(1)/usr/include
68    $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
69    $(INSTALL_DIR) $(1)/usr/lib
70    $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
71endef
72
73define Package/ip/install
74    $(INSTALL_DIR) $(1)/usr/sbin
75    $(INSTALL_DIR) $(1)/etc/iproute2
76    $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
77    $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
78endef
79
80define Package/tc/install
81    $(INSTALL_DIR) $(1)/usr/sbin
82    $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
83endef
84
85define Package/genl/install
86    $(INSTALL_DIR) $(1)/usr/sbin
87    $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
88endef
89
90$(eval $(call BuildPackage,ip))
91$(eval $(call BuildPackage,tc))
92$(eval $(call BuildPackage,genl))
93

Archive Download this file



interactive