iproute2: cake AQM prepare tc for COBALT algorithm
[openwrt/staging/lynxis/omap.git] / package / network / utils / iproute2 / Makefile
1 #
2 # Copyright (C) 2006-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=iproute2
11 PKG_VERSION:=4.4.0
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
16 PKG_MD5SUM:=d762653ec3e1ab0d4a9689e169ca184f
17 PKG_BUILD_PARALLEL:=1
18 PKG_LICENSE:=GPL-2.0
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/iproute2/Default
25 TITLE:=Routing control utility ($(2))
26 SECTION:=net
27 CATEGORY:=Network
28 URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
29 SUBMENU:=Routing and Redirection
30 MAINTAINER:=Russell Senior <russell@personaltelco.net>
31 DEPENDS:= +libnl-tiny
32 VARIANT:=$(1)
33 endef
34
35 define Package/ip
36 $(call Package/iproute2/Default,tiny,Minimal)
37 CONFLICTS:=ip-full
38 endef
39
40 Package/ip-full=$(call Package/iproute2/Default,full,Full)
41
42 define Package/tc
43 $(call Package/iproute2/Default)
44 TITLE:=Traffic control utility
45 DEPENDS:=+kmod-sched-core
46 endef
47
48 define Package/genl
49 $(call Package/iproute2/Default)
50 TITLE:=General netlink utility frontend
51 endef
52
53 define Package/ip-bridge
54 $(call Package/iproute2/Default)
55 TITLE:=Bridge configuration utility from iproute2
56 endef
57
58 define Package/ss
59 $(call Package/iproute2/Default)
60 TITLE:=Socket statistics utility
61 endef
62
63 define Package/nstat
64 $(call Package/iproute2/Default)
65 TITLE:=Network statistics utility
66 endef
67
68 ifeq ($(BUILD_VARIANT),tiny)
69 IP_CONFIG_TINY:=y
70 endif
71
72 define Build/Configure
73 $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
74 $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
75 $(PKG_BUILD_DIR)/Makefile
76 $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
77 $(PKG_BUILD_DIR)/Makefile
78 echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-lede\";" \
79 > $(PKG_BUILD_DIR)/include/SNAPSHOT.h
80 endef
81
82 TARGET_CFLAGS += -DHAVE_SETNS
83 TARGET_CFLAGS += -ffunction-sections -fdata-sections
84
85 MAKE_FLAGS += \
86 EXTRA_CCOPTS="$(TARGET_CFLAGS) -I../include -I$(STAGING_DIR)/usr/include/libnl-tiny" \
87 KERNEL_INCLUDE="$(LINUX_DIR)/include" \
88 SHARED_LIBS="" \
89 LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \
90 IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
91 FPIC="$(FPIC)"
92
93 define Build/Compile
94 +$(MAKE_VARS) $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
95 endef
96
97 define Build/InstallDev
98 $(INSTALL_DIR) $(1)/usr/include
99 $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
100 $(INSTALL_DIR) $(1)/usr/lib
101 $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
102 endef
103
104 define Package/ip/install
105 $(INSTALL_DIR) $(1)/usr/bin
106 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/bin/
107 endef
108
109 define Package/ip-full/install
110 $(INSTALL_DIR) $(1)/usr/sbin
111 $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
112 endef
113
114 define Package/tc/install
115 $(INSTALL_DIR) $(1)/usr/sbin
116 $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
117 $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
118 $(INSTALL_BIN) ./files/15-teql $(1)/etc/hotplug.d/iface/
119 endef
120
121 define Package/genl/install
122 $(INSTALL_DIR) $(1)/usr/sbin
123 $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
124 endef
125
126 define Package/ip-bridge/install
127 $(INSTALL_DIR) $(1)/usr/sbin
128 $(INSTALL_BIN) $(PKG_BUILD_DIR)/bridge/bridge $(1)/usr/sbin/
129 endef
130
131 define Package/ss/install
132 $(INSTALL_DIR) $(1)/usr/sbin
133 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/ss $(1)/usr/sbin/
134 endef
135
136 define Package/nstat/install
137 $(INSTALL_DIR) $(1)/usr/sbin
138 $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/nstat $(1)/usr/sbin/
139 endef
140
141 $(eval $(call BuildPackage,ip))
142 $(eval $(call BuildPackage,ip-full))
143 $(eval $(call BuildPackage,tc))
144 $(eval $(call BuildPackage,genl))
145 $(eval $(call BuildPackage,ip-bridge))
146 $(eval $(call BuildPackage,ss))
147 $(eval $(call BuildPackage,nstat))