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