[packages] openswan: update to v2.6.24 and remove obsolete patches - fixes Linux...
[packages.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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=iperf
11 PKG_VERSION:=2.0.4
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
16 PKG_MD5SUM:=8c5bc14cc2ea55f18f22afe3c23e3dcb
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
35 define Package/iperf
36 $(call Package/iperf/Default)
37   TITLE+= (with single thread support)
38 endef
39
40 define Package/iperf/description
41 $(call Package/iperf/Default/description)
42  This package is built with single thread support.
43 endef
44
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
58 define Build/Template
59
60 $(STAMP_BUILT)-$(2): $(STAMP_PREPARED)
61         -$(MAKE) -C $(PKG_BUILD_DIR) clean
62         $(call Build/Configure/Default,$(3))
63         $(MAKE) -C $(PKG_BUILD_DIR)
64         ( cd $(PKG_BUILD_DIR)/src; mv -f iperf iperf-$(2) )
65         touch $$@
66
67 $(STAMP_BUILT): $(STAMP_BUILT)-$(2)
68
69 define Package/$(1)/install
70         $(INSTALL_DIR) $$(1)/usr/bin
71         $(INSTALL_BIN) $$(PKG_BUILD_DIR)/src/iperf-$(2) $$(1)/usr/bin/iperf
72 endef
73
74 endef
75
76 CONFIGURE_ARGS += \
77         --disable-multicast \
78
79 CONFIGURE_VARS += \
80         CXX="g++-uc" \
81         CXXFLAGS="$$$$CXX_CFLAGS -fno-rtti" \
82
83
84 ifneq ($(SDK)$(CONFIG_PACKAGE_iperf),)
85   define Build/singlethread
86     $(call Build/Template,iperf,singlethread, \
87         --disable-threads \
88     )
89   endef
90 endif
91 $(eval $(Build/singlethread))
92
93 ifneq ($(SDK)$(CONFIG_PACKAGE_iperf-mt),)
94   define Build/multithread
95     $(call Build/Template,iperf-mt,multithread, \
96         --enable-threads=posix \
97         LDFLAGS="$(TARGET_LDFLAGS) -lpthread" \
98         ac_cv_func_pthread_cancel=no \
99     )
100   endef
101 endif
102 $(eval $(Build/multithread))
103
104 $(eval $(call BuildPackage,iperf))
105 $(eval $(call BuildPackage,iperf-mt))