2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
15 PKG_SOURCE_URL
:=http
://devresources.linux-foundation.org
/dev
/iproute2
/download
/
16 PKG_MD5SUM
:=b0f281b3124bf04669e18f5fe16d4934
19 PKG_BUILD_DIR
:=$(BUILD_DIR
)/iproute2-
$(PKG_VERSION
)
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/iproute2
/Default
26 URL
:=http
://linux-net.osdl.org
/index.php
/Iproute2
30 $(call Package
/iproute2
/Default
)
31 TITLE
:=Routing control utility
35 $(call Package
/iproute2
/Default
)
36 TITLE
:=Traffic control utility
41 $(call Package
/iproute2
/Default
)
42 TITLE
:=General netlink utility frontend
45 define Build
/Configure
46 $(SED
) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR
)/Makefile
47 $(SED
) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \
48 $(PKG_BUILD_DIR
)/Makefile
49 $(SED
) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \
50 $(PKG_BUILD_DIR
)/Makefile
51 # For now disable compiling of the misc directory because it seems to fail
52 rm -rf
$(PKG_BUILD_DIR
)/misc
53 $(SED
) "s, misc,," $(PKG_BUILD_DIR
)/Makefile
54 echo
"static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \
55 > $(PKG_BUILD_DIR
)/include/SNAPSHOT.h
59 EXTRA_CCOPTS
="$(TARGET_CFLAGS)" \
60 KERNEL_INCLUDE
="$(LINUX_DIR)/include" \
64 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/netem \
65 HOSTCC
="$(HOSTCC)" EXTRA_CCOPTS
="$(TARGET_CFLAGS)" \
66 CFLAGS
="-D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall \
67 -I../include -DRESOLVE_HOSTNAMES"
68 $(MAKE_VARS
) $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) $(MAKE_FLAGS
) all
69 $(MAKE_VARS
) $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/tc
$(MAKE_FLAGS
) tc
70 $(MAKE_VARS
) $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/ip
$(MAKE_FLAGS
) ip
73 define Build
/InstallDev
74 $(INSTALL_DIR
) $(1)/usr
/include
75 $(CP
) $(PKG_BUILD_DIR
)/include/libnetlink.h
$(1)/usr
/include/
76 $(INSTALL_DIR
) $(1)/usr
/lib
77 $(CP
) $(PKG_BUILD_DIR
)/lib
/libnetlink.a
$(1)/usr
/lib
/
80 define Package
/ip
/install
81 $(INSTALL_DIR
) $(1)/usr
/sbin
82 $(INSTALL_DIR
) $(1)/etc
/iproute2
83 $(INSTALL_DATA
) $(PKG_BUILD_DIR
)/etc
/iproute2
/rt_tables
$(1)/etc
/iproute2
84 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/ip
/ip
$(1)/usr
/sbin
/
87 define Package
/tc
/install
88 $(INSTALL_DIR
) $(1)/usr
/sbin
89 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/tc
/tc
$(1)/usr
/sbin
/
92 define Package
/genl
/install
93 $(INSTALL_DIR
) $(1)/usr
/sbin
94 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/genl
/genl
$(1)/usr
/sbin
/
97 $(eval
$(call BuildPackage
,ip
))
98 $(eval
$(call BuildPackage
,tc
))
99 $(eval
$(call BuildPackage
,genl
))