Changeset 25019


Ignore:
Timestamp:
2011-01-16T02:25:59+01:00 (6 years ago)
Author:
nbd
Message:

iperf: use build variants, fix uclibc compile issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/net/iperf/Makefile

    r23583 r25019  
    1212PKG_RELEASE:=1 
    1313 
     14PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) 
    1415PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 
    1516PKG_SOURCE_URL:=@SF/$(PKG_NAME) 
     
    3738$(call Package/iperf/Default) 
    3839  TITLE+= (with single thread support) 
     40  VARIANT:=single 
    3941endef 
    4042 
     
    4850  DEPENDS+= +libpthread 
    4951  TITLE+= (with multithread support) 
     52  VARIANT:=mt 
    5053endef 
    5154 
     
    5558endef 
    5659 
    57 define Build/Template 
     60CONFIGURE_ARGS += --disable-multicast 
     61CONFIGURE_VARS += ac_cv_func_malloc_0_nonnull=yes 
    5862 
    59 $(STAMP_BUILT)-$(2): $(STAMP_PREPARED) 
    60         -$(MAKE) -C $(PKG_BUILD_DIR) clean 
    61         $(call Build/Configure/Default,$(3)) 
    62         $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) 
    63         ( cd $(PKG_BUILD_DIR)/src; mv -f iperf iperf-$(2) ) 
    64         touch $$@ 
    65  
    66 $(STAMP_BUILT): $(STAMP_BUILT)-$(2) 
    67  
    68 define Package/$(1)/install 
    69         $(INSTALL_DIR) $$(1)/usr/bin 
    70         $(INSTALL_BIN) $$(PKG_BUILD_DIR)/src/iperf-$(2) $$(1)/usr/bin/iperf 
    71 endef 
    72  
    73 endef 
    74  
    75 CONFIGURE_ARGS += \ 
    76         --disable-multicast \ 
     63ifeq ($(BUILD_VARIANT),st) 
     64  CONFIGURE_ARGS += --disable-threads 
     65else 
     66  CONFIGURE_ARGS += --enable-threads=posix 
     67  CONFIGURE_VARS += ac_cv_func_pthread_cancel=no 
     68endif 
    7769 
    7870CONFIGURE_VARS += \ 
     
    8072        CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ 
    8173 
    82 ifneq ($(SDK)$(CONFIG_PACKAGE_iperf),) 
    83   define Build/singlethread 
    84     $(call Build/Template,iperf,singlethread, \ 
    85         --disable-threads \ 
    86     ) 
    87   endef 
    88 endif 
    89 $(eval $(Build/singlethread)) 
    90  
    91 ifneq ($(SDK)$(CONFIG_PACKAGE_iperf-mt),) 
    92   define Build/multithread 
    93     $(call Build/Template,iperf-mt,multithread, \ 
    94         --enable-threads=posix \ 
    95         LDFLAGS="$(TARGET_LDFLAGS) -lpthread" \ 
    96         ac_cv_func_pthread_cancel=no \ 
    97     ) 
    98   endef 
    99 endif 
    100 $(eval $(Build/multithread)) 
     74define Package/iperf/install 
     75        $(INSTALL_DIR) $(1)/usr/bin 
     76        $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iperf $(1)/usr/bin/iperf 
     77endef 
     78Package/iperf-mt/install = $(Package/iperf/install) 
    10179 
    10280$(eval $(call BuildPackage,iperf)) 
Note: See TracChangeset for help on using the changeset viewer.