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/ip/conffiles
34/etc/iproute2/rt_tables
35endef
36
37define Package/tc
38$(call Package/iproute2/Default)
39  TITLE:=Traffic control utility
40  DEPENDS:=+kmod-sched
41endef
42
43define Package/genl
44$(call Package/iproute2/Default)
45  TITLE:=General netlink utility frontend
46endef
47
48define Build/Configure
49    $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile
50    $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
51        $(PKG_BUILD_DIR)/Makefile
52    $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
53        $(PKG_BUILD_DIR)/Makefile
54    # For now disable compiling of the misc directory because it seems to fail
55    rm -rf $(PKG_BUILD_DIR)/misc
56    $(SED) "s, misc,," $(PKG_BUILD_DIR)/Makefile
57endef
58
59MAKE_FLAGS += \
60    EXTRA_CCOPTS="$(TARGET_CFLAGS)" \
61    KERNEL_INCLUDE="$(LINUX_DIR)/include" \
62    FPIC="$(FPIC)" \
63    all tc/tc ip/ip
64
65define Build/Compile
66    $(_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"
67    $(_SINGLE)$(Build/Compile/Default)
68endef
69
70define Build/InstallDev
71    $(INSTALL_DIR) $(1)/usr/include
72    $(CP) $(PKG_BUILD_DIR)/include/libnetlink.h $(1)/usr/include/
73    $(INSTALL_DIR) $(1)/usr/lib
74    $(CP) $(PKG_BUILD_DIR)/lib/libnetlink.a $(1)/usr/lib/
75endef
76
77define Package/ip/install
78    $(INSTALL_DIR) $(1)/usr/sbin
79    $(INSTALL_DIR) $(1)/etc/iproute2
80    $(INSTALL_DATA) $(PKG_BUILD_DIR)/etc/iproute2/rt_tables $(1)/etc/iproute2
81    $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/
82endef
83
84define Package/tc/install
85    $(INSTALL_DIR) $(1)/usr/sbin
86    $(INSTALL_BIN) $(PKG_BUILD_DIR)/tc/tc $(1)/usr/sbin/
87endef
88
89define Package/genl/install
90    $(INSTALL_DIR) $(1)/usr/sbin
91    $(INSTALL_BIN) $(PKG_BUILD_DIR)/genl/genl $(1)/usr/sbin/
92endef
93
94$(eval $(call BuildPackage,ip))
95$(eval $(call BuildPackage,tc))
96$(eval $(call BuildPackage,genl))
97

Archive Download this file



interactive