Add iperf3 program

master
Jiajie Chen 6 years ago
parent 69febc9fcc
commit 7589a0acf4

@ -26,7 +26,7 @@ cmake_build_args += -DCMAKE_BUILD_TYPE=Release
endif endif
.PHONY: all clean build rust ucore biscuit bin busybox nginx redis alpine .PHONY: all clean build rust ucore biscuit bin busybox nginx redis alpine iperf3
all: build all: build
@ -98,6 +98,13 @@ ifneq ($(shell uname), Darwin)
endif endif
endif endif
iperf3:
ifeq ($(arch), x86_64)
@echo Building iperf3
@cd iperf3 && make arch=$(arch) all
@cp iperf3/build/$(arch)/iperf3 $(out_dir)
endif
$(alpine): $(alpine):
wget "http://dl-cdn.alpinelinux.org/alpine/v3.9/releases/$(arch)/$(alpine_file)" -O $(alpine) wget "http://dl-cdn.alpinelinux.org/alpine/v3.9/releases/$(arch)/$(alpine_file)" -O $(alpine)
@ -108,7 +115,7 @@ ifeq ($(arch), $(filter $(arch), x86_64 aarch64))
@cd $(out_dir) && tar xvf ../../$(alpine) @cd $(out_dir) && tar xvf ../../$(alpine)
endif endif
build: rust ucore biscuit $(busybox) nginx redis build: rust ucore biscuit $(busybox) nginx redis iperf3
sfsimg: $(out_qcow2) sfsimg: $(out_qcow2)

1
iperf3/.gitignore vendored

@ -0,0 +1 @@
build

@ -0,0 +1,37 @@
iperf3_version := 3.6
iperf3_tarball := iperf3-$(iperf3_version).tar.gz
iperf3_tarball_path := src/$(iperf3_tarball)
build_dir := build/$(arch)
iperf3_dir := $(build_dir)/iperf-$(iperf3_version)
cc := $(arch)-linux-musl-gcc
strip := $(arch)-linux-musl-strip
bin_unstripped := build/$(arch)/iperf3_unstripped
bin := build/$(arch)/iperf3
$(iperf3_tarball_path):
wget https://github.com/esnet/iperf/archive/$(iperf3_version).tar.gz -O $(iperf3_tarball_path)
$(iperf3_dir): $(iperf3_tarball_path)
mkdir -p $(build_dir)
cd $(build_dir) && tar xvf ../../$(iperf3_tarball_path)
$(iperf3_dir)/src/iperf3: $(iperf3_dir)
sed -i 's/AM_INIT_AUTOMAKE$$/AM_INIT_AUTOMAKE\([foreign]\)/' $(iperf3_dir)/configure.ac
sed -i 's/-pg//' $(iperf3_dir)/src/Makefile.am
cd $(iperf3_dir) && autoreconf
cd $(iperf3_dir) && ./configure CC=$(cc) --disable-shared --enable-static --without-openssl --host $(arch)-linux-musl
cd $(iperf3_dir) && make
$(bin_unstripped): $(iperf3_dir)/src/iperf3
cp $(iperf3_dir)/src/iperf3 $(bin_unstripped)
$(bin): $(bin_unstripped)
cp $(bin_unstripped) $(bin)
$(strip) $(bin)
.PHONY: all clean
all: $(bin)
clean:
rm -rf build/$(arch)

@ -0,0 +1 @@
*.tar.gz
Loading…
Cancel
Save