iperf 2.05版本升级到2.0.9
将openwrt trunk 分支上iperf 2.0.9移植到 bb版本上时,编译遇到如下问题:
make[6]: Entering directory '/home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9/man'
make[6]: Nothing to be done for 'all'.
make[6]: Leaving directory '/home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9/man'
make[6]: Entering directory '/home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9'
make[6]: Leaving directory '/home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9'
make[5]: Leaving directory '/home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9'
make[4]: Leaving directory '/home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9'
touch /home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9/.built
mkdir -p /home/hbg/bb/bin/ar71xx/packages /home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9/ipkg-ar71xx/iperf/CONTROL /home/hbg/bb/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo
install -d -m0755 /home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9/ipkg-ar71xx/iperf/usr/bin
install -m0755 /home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9/src/iperf /home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9/ipkg-ar71xx/iperf/usr/bin/iperf
find /home/hbg/bb/build_dir/target-mips_34kc_uClibc-0.9.33.2/iperf-2.0.9/ipkg-ar71xx/iperf -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf
Package iperf is missing dependencies for the following libraries:
librt.so.0
Makefile:56: recipe for target '/home/hbg/bb/bin/ar71xx/packages/base/iperf_2.0.9-1_ar71xx.ipk' failed
make[3]: *** [/home/hbg/bb/bin/ar71xx/packages/base/iperf_2.0.9-1_ar71xx.ipk] Error 1
make[3]: Leaving directory '/home/hbg/bb/package/network/utils/iperf'
package/Makefile:177: recipe for target 'package/network/utils/iperf/compile' failed
make[2]: *** [package/network/utils/iperf/compile] Error 2
缺少了依赖库文件 librt.so
将其添加到makefile中的依赖文件中,修改内容如下:
define Package/iperf
SECTION:=net
CATEGORY:=Network
DEPENDS:= $(CXX_DEPENDS) +libpthread +librt
TITLE:=Internet Protocol bandwidth measuring tool
URL:=http://sourceforge.net/projects/iperf2/
endef
即可编译成功,完成iperf 2.0.5到iperf 2.0.9的替换,完美解决iperf 2.0.5异常退出等bug。
备注:
在此替换过程中,出现过一个小的失误,就是添加librt时,写成如下:
define Package/iperf
SECTION:=net
CATEGORY:=Network
DEPENDS:= $(CXX_DEPENDS) +libpthread + librt // 此处‘+’ 和 ‘librt’ 之间多了一个空格
TITLE:=Internet Protocol bandwidth measuring tool
URL:=http://sourceforge.net/projects/iperf2/
endef
导致make menuconfig 时无法显示 iperf 选项。