34a029fd48150398b9251d065342dcaa4e27bf7c
[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_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
17 PKG_MD5SUM:=44b5536b67719f4250faed632a3cd016
18
19 PKG_BUILD_PARALLEL:=1
20
21 include $(INCLUDE_DIR)/uclibc++.mk
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/iperf/Default
25 SECTION:=net
26 CATEGORY:=Network
27 DEPENDS:= $(CXX_DEPENDS)
28 TITLE:=Internet Protocol bandwidth measuring tool
29 URL:=http://sourceforge.net/projects/iperf/
30 endef
31
32 define Package/iperf/Default/description
33 Iperf is a modern alternative for measuring TCP and UDP bandwidth
34 performance, allowing the tuning of various parameters and
35 characteristics.
36 endef
37
38 define Package/iperf
39 $(call Package/iperf/Default)
40 TITLE+= (with single thread support)
41 VARIANT:=single
42 endef
43
44 define Package/iperf/description
45 $(call Package/iperf/Default/description)
46 This package is built with single thread support.
47 endef
48
49 define Package/iperf-mt
50 $(call Package/iperf/Default)
51 DEPENDS+= +libpthread
52 TITLE+= (with multithread support)
53 VARIANT:=mt
54 endef
55
56 define Package/iperf-mt/description
57 $(call Package/iperf/Default/description)
58 This package is built with multithread support.
59 endef
60
61 CONFIGURE_ARGS += --disable-multicast
62 CONFIGURE_VARS += ac_cv_func_malloc_0_nonnull=yes
63
64 ifeq ($(BUILD_VARIANT),single)
65 CONFIGURE_ARGS += --disable-threads
66 else
67 CONFIGURE_ARGS += --enable-threads=posix
68 CONFIGURE_VARS += ac_cv_func_pthread_cancel=no
69 endif
70
71 CONFIGURE_VARS += CXXFLAGS="$$$$CXXFLAGS -fno-rtti"
72
73 ifeq ($(BUILD_VARIANT),mt)
74 CONFIGURE_VARS += LIBS="-lpthread"
75 endif
76
77 define Package/iperf/install
78 $(INSTALL_DIR) $(1)/usr/bin
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iperf $(1)/usr/bin/iperf
80 endef
81 Package/iperf-mt/install = $(Package/iperf/install)
82
83 $(eval $(call BuildPackage,iperf))
84 $(eval $(call BuildPackage,iperf-mt))