cddb35756231932107319c422b2b90ff123560f1
[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 PKG_BUILD_PARALLEL:=1
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/iperf/Default
23 SECTION:=net
24 CATEGORY:=Network
25 DEPENDS:= +uclibcxx
26 TITLE:=Internet Protocol bandwidth measuring tool
27 URL:=http://sourceforge.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 define Package/iperf
37 $(call Package/iperf/Default)
38 TITLE+= (with single thread support)
39 endef
40
41 define Package/iperf/description
42 $(call Package/iperf/Default/description)
43 This package is built with single thread support.
44 endef
45
46 define Package/iperf-mt
47 $(call Package/iperf/Default)
48 DEPENDS+= +libpthread
49 TITLE+= (with multithread support)
50 endef
51
52 define Package/iperf-mt/description
53 $(call Package/iperf/Default/description)
54 This package is built with multithread support.
55 endef
56
57 define Build/Template
58
59 $(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
60 -$(MAKE) -C $(PKG_BUILD_DIR) clean
61 $(call Build/Configure/Default,$(3))
62 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
63 ( cd $(PKG_BUILD_DIR)/src; mv -f iperf iperf-$(2) )
64 touch $$@
65
66 $(STAMP_BUILT): $(STAMP_BUILT)-$(2)
67
68 define Package/$(1)/install
69 $(INSTALL_DIR) $$(1)/usr/bin
70 $(INSTALL_BIN) $$(PKG_BUILD_DIR)/src/iperf-$(2) $$(1)/usr/bin/iperf
71 endef
72
73 endef
74
75 CONFIGURE_ARGS += \
76 --disable-multicast \
77
78 CONFIGURE_VARS += \
79 CXX="g++-uc" \
80 CXXFLAGS="$$$$CXX_CFLAGS -fno-rtti" \
81
82 ifneq ($(SDK)$(CONFIG_PACKAGE_iperf),)
83 define Build/singlethread
84 $(call Build/Template,iperf,singlethread, \
85 --disable-threads \
86 )
87 endef
88 endif
89 $(eval $(Build/singlethread))
90
91 ifneq ($(SDK)$(CONFIG_PACKAGE_iperf-mt),)
92 define Build/multithread
93 $(call Build/Template,iperf-mt,multithread, \
94 --enable-threads=posix \
95 LDFLAGS="$(TARGET_LDFLAGS) -lpthread" \
96 ac_cv_func_pthread_cancel=no \
97 )
98 endef
99 endif
100 $(eval $(Build/multithread))
101
102 $(eval $(call BuildPackage,iperf))
103 $(eval $(call BuildPackage,iperf-mt))