Build iperf3 statically

master
Jiajie Chen 6 years ago
parent 7589a0acf4
commit 1349a4c4c2

@ -101,6 +101,8 @@ endif
iperf3: iperf3:
ifeq ($(arch), x86_64) ifeq ($(arch), x86_64)
@echo Building iperf3 @echo Building iperf3
@mkdir -p $(out_dir)/dev
@dd if=/dev/urandom of=$(out_dir)/dev/urandom count=512
@cd iperf3 && make arch=$(arch) all @cd iperf3 && make arch=$(arch) all
@cp iperf3/build/$(arch)/iperf3 $(out_dir) @cp iperf3/build/$(arch)/iperf3 $(out_dir)
endif endif
@ -110,7 +112,7 @@ $(alpine):
alpine: $(alpine) alpine: $(alpine)
ifeq ($(arch), $(filter $(arch), x86_64 aarch64)) ifeq ($(arch), $(filter $(arch), x86_64 aarch64))
@mkdir -p $(out_dir) @mkdir -p $(out_dir)/etc
@echo "nameserver 101.6.6.6" > $(out_dir)/etc/resolv.conf @echo "nameserver 101.6.6.6" > $(out_dir)/etc/resolv.conf
@cd $(out_dir) && tar xvf ../../$(alpine) @cd $(out_dir) && tar xvf ../../$(alpine)
endif endif

@ -20,7 +20,7 @@ $(iperf3_dir)/src/iperf3: $(iperf3_dir)
sed -i 's/-pg//' $(iperf3_dir)/src/Makefile.am sed -i 's/-pg//' $(iperf3_dir)/src/Makefile.am
cd $(iperf3_dir) && autoreconf cd $(iperf3_dir) && autoreconf
cd $(iperf3_dir) && ./configure CC=$(cc) --disable-shared --enable-static --without-openssl --host $(arch)-linux-musl cd $(iperf3_dir) && ./configure CC=$(cc) --disable-shared --enable-static --without-openssl --host $(arch)-linux-musl
cd $(iperf3_dir) && make cd $(iperf3_dir) && make iperf3_CFLAGS="--static"
$(bin_unstripped): $(iperf3_dir)/src/iperf3 $(bin_unstripped): $(iperf3_dir)/src/iperf3
cp $(iperf3_dir)/src/iperf3 $(bin_unstripped) cp $(iperf3_dir)/src/iperf3 $(bin_unstripped)

Loading…
Cancel
Save