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