Add sysstat (#2124)
[openwrt/svn-archive/archive.git] / net / iperf / Makefile
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=iperf
12 PKG_VERSION:=2.0.2
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://dast.nlanr.net/Projects/Iperf2.0
17 PKG_MD5SUM:=bb658aba58a5af0356f5b1342dfe8f53
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/iperf/Default
22 SUBMENU:=Monitoring
23 SECTION:=net
24 CATEGORY:=Network
25 DEPENDS:= +uclibcxx
26 TITLE:=Internet Protocol bandwidth measuring tool
27 URL:=http://dast.nlanr.net/Projects/Iperf/
28 endef
29
30 define Package/iperf/Default/description
31 Iperf is a modern alternative for measuring TCP and UDP bandwidth
32 performance, allowing the tuning of various parameters and
33 characteristics.
34 endef
35
36
37 define Package/iperf
38 $(call Package/iperf/Default)
39 TITLE+= (with single thread support)
40 endef
41
42 define Package/iperf/description
43 $(call Package/iperf/Default/description)
44 This package is built with single thread support.
45 endef
46
47
48 define Package/iperf-mt
49 $(call Package/iperf/Default)
50 DEPENDS+= +libpthread
51 TITLE+= (with multithread support)
52 endef
53
54 define Package/iperf-mt/description
55 $(call Package/iperf/Default/description)
56 This package is built with multithread support.
57 endef
58
59
60 define Build/Template
61
62 $(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
63 -$(MAKE) -C $(PKG_BUILD_DIR) clean
64 $(call Build/Configure/Default,$(3))
65 $(MAKE) -C $(PKG_BUILD_DIR)
66 ( cd $(PKG_BUILD_DIR)/src; mv -f iperf iperf-$(2) )
67 touch $$@
68
69 $(STAMP_BUILT): $(STAMP_BUILT)-$(2)
70
71 define Package/$(1)/install
72 $(INSTALL_DIR) $$(1)/usr/bin
73 $(INSTALL_BIN) $$(PKG_BUILD_DIR)/src/iperf-$(2) $$(1)/usr/bin/iperf
74 endef
75
76 endef
77
78 CONFIGURE_ARGS += \
79 --disable-multicast \
80
81 CONFIGURE_VARS += \
82 CXX="g++-uc" \
83 CXXFLAGS="$$$$CXX_CFLAGS -fno-rtti" \
84
85
86 ifneq ($(SDK)$(CONFIG_PACKAGE_iperf),)
87 define Build/singlethread
88 $(call Build/Template,iperf,singlethread, \
89 --disable-threads \
90 )
91 endef
92 endif
93 $(eval $(Build/singlethread))
94
95 ifneq ($(SDK)$(CONFIG_PACKAGE_iperf-mt),)
96 define Build/multithread
97 $(call Build/Template,iperf-mt,multithread, \
98 --enable-threads=posix \
99 LDFLAGS="$(TARGET_LDFLAGS) -lpthread" \
100 ac_cv_func_pthread_cancel=no \
101 )
102 endef
103 endif
104 $(eval $(Build/multithread))
105
106 $(eval $(call BuildPackage,iperf))
107 $(eval $(call BuildPackage,iperf-mt))