Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=iperf
  9. PKG_VERSION:=2.0.5
  10. PKG_RELEASE:=1
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=@SF/$(PKG_NAME)
  14. PKG_MD5SUM:=44b5536b67719f4250faed632a3cd016
  15. PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
  16. PKG_LICENSE:=BSD-3-Clause
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_CHECK_FORMAT_SECURITY:=0
  19. include $(INCLUDE_DIR)/uclibc++.mk
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/iperf/Default
  22. SECTION:=net
  23. CATEGORY:=Network
  24. DEPENDS:= $(CXX_DEPENDS)
  25. TITLE:=Internet Protocol bandwidth measuring tool
  26. URL:=http://sourceforge.net/projects/iperf/
  27. endef
  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. define Package/iperf
  34. $(call Package/iperf/Default)
  35. TITLE+= (with single thread support)
  36. VARIANT:=single
  37. endef
  38. define Package/iperf/description
  39. $(call Package/iperf/Default/description)
  40. This package is built with single thread support.
  41. endef
  42. define Package/iperf-mt
  43. $(call Package/iperf/Default)
  44. DEPENDS+= +libpthread
  45. TITLE+= (with multithread support)
  46. VARIANT:=mt
  47. endef
  48. define Package/iperf-mt/description
  49. $(call Package/iperf/Default/description)
  50. This package is built with multithread support.
  51. endef
  52. CONFIGURE_ARGS += --disable-multicast
  53. CONFIGURE_VARS += ac_cv_func_malloc_0_nonnull=yes
  54. ifeq ($(BUILD_VARIANT),single)
  55. CONFIGURE_ARGS += --disable-threads
  56. else
  57. CONFIGURE_ARGS += --enable-threads=posix
  58. CONFIGURE_VARS += ac_cv_func_pthread_cancel=no
  59. endif
  60. CONFIGURE_VARS += CXXFLAGS="$$$$CXXFLAGS -fno-rtti"
  61. ifeq ($(BUILD_VARIANT),mt)
  62. CONFIGURE_VARS += LIBS="-lpthread"
  63. endif
  64. define Package/iperf/install
  65. $(INSTALL_DIR) $(1)/usr/bin
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iperf $(1)/usr/bin/iperf
  67. endef
  68. Package/iperf-mt/install = $(Package/iperf/install)
  69. $(eval $(call BuildPackage,iperf))
  70. $(eval $(call BuildPackage,iperf-mt))