#
-# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2007-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
-# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=iperf
-PKG_VERSION:=2.0.2
+PKG_VERSION:=2.0.5
PKG_RELEASE:=1
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://dast.nlanr.net/Projects/Iperf2.0
-PKG_MD5SUM:=bb658aba58a5af0356f5b1342dfe8f53
-PKG_CAT:=zcat
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_MD5SUM:=44b5536b67719f4250faed632a3cd016
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
-define Package/iperf
+define Package/iperf/Default
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+uclibcxx
+ DEPENDS:= +uclibcxx
TITLE:=Internet Protocol bandwidth measuring tool
- DESCRIPTION:=\
- Iperf is a modern alternative for measuring TCP and UDP bandwidth \\\
- performance, allowing the tuning of various parameters and \\\
- characteristics.
- URL:=http://dast.nlanr.net/Projects/Iperf/
+ URL:=http://sourceforge.net/projects/iperf/
+endef
+
+define Package/iperf/Default/description
+ Iperf is a modern alternative for measuring TCP and UDP bandwidth
+ performance, allowing the tuning of various parameters and
+ characteristics.
endef
-define Build/Configure
- $(call Build/Configure/Default, \
- --disable-multicast \
- --disable-threads \
- , \
- CXXFLAGS="$$$$CXX_CFLAGS -fno-builtin -fno-rtti -nostdinc++" \
- LIBS="-nodefaultlibs -luClibc++ -lc -lm -lgcc_s" \
- )
+define Package/iperf
+$(call Package/iperf/Default)
+ TITLE+= (with single thread support)
+ VARIANT:=single
endef
-define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR) \
- DESTDIR="$(PKG_INSTALL_DIR)" \
- all install
+define Package/iperf/description
+$(call Package/iperf/Default/description)
+ This package is built with single thread support.
endef
-define Package/iperf/install
+define Package/iperf-mt
+$(call Package/iperf/Default)
+ DEPENDS+= +libpthread
+ TITLE+= (with multithread support)
+ VARIANT:=mt
+endef
+
+define Package/iperf-mt/description
+$(call Package/iperf/Default/description)
+ This package is built with multithread support.
+endef
+
+CONFIGURE_ARGS += --disable-multicast
+CONFIGURE_VARS += ac_cv_func_malloc_0_nonnull=yes
+
+ifeq ($(BUILD_VARIANT),single)
+ CONFIGURE_ARGS += --disable-threads
+else
+ CONFIGURE_ARGS += --enable-threads=posix
+ CONFIGURE_VARS += ac_cv_func_pthread_cancel=no
+endif
+
+TARGET_CXX=g++-uc
+
+CONFIGURE_VARS += CXXFLAGS="$$$$CXXFLAGS -fno-rtti"
+
+ifeq ($(BUILD_VARIANT),mt)
+ CONFIGURE_VARS += LIBS="-lpthread"
+endif
+
+define Package/iperf/install
$(INSTALL_DIR) $(1)/usr/bin
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/iperf $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iperf $(1)/usr/bin/iperf
endef
+Package/iperf-mt/install = $(Package/iperf/install)
$(eval $(call BuildPackage,iperf))
+$(eval $(call BuildPackage,iperf-mt))