diff --git a/Makefile b/Makefile index ed7911a..7bb3eb6 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ cmake_build_args += -DCMAKE_BUILD_TYPE=Release 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 @@ -98,6 +98,13 @@ ifneq ($(shell uname), Darwin) 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): 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) endif -build: rust ucore biscuit $(busybox) nginx redis +build: rust ucore biscuit $(busybox) nginx redis iperf3 sfsimg: $(out_qcow2) diff --git a/iperf3/.gitignore b/iperf3/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/iperf3/.gitignore @@ -0,0 +1 @@ +build diff --git a/iperf3/Makefile b/iperf3/Makefile new file mode 100644 index 0000000..2833459 --- /dev/null +++ b/iperf3/Makefile @@ -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) diff --git a/iperf3/src/.gitignore b/iperf3/src/.gitignore new file mode 100644 index 0000000..335ec95 --- /dev/null +++ b/iperf3/src/.gitignore @@ -0,0 +1 @@ +*.tar.gz