16 lines
583 B
Bash
16 lines
583 B
Bash
#!/bin/sh
|
|
test -f libpcap-1.10.1.tar.gz || wget https://www.tcpdump.org/release/libpcap-1.10.1.tar.gz
|
|
tar xf libpcap-1.10.1.tar.gz
|
|
cd libpcap-1.10.1
|
|
# export ZIG=~/.local/zig-linux-x86_64-0.10.0-dev.2836+2360f8c49/zig
|
|
export ZIG=zig # 0.9.1
|
|
export CC="$ZIG cc -target mips-linux-musl"
|
|
export CFLAGS='-Os'
|
|
# https://jensd.be/1126/linux/cross-compiling-for-arm-or-aarch64-on-debian-or-ubuntu
|
|
# https://old.reddit.com/r/Zig/comments/lzqgxf/trying_to_crosscompile_to_mips_with_zig_cc/
|
|
make clean
|
|
./configure \
|
|
--host=mips-unknown-linux-musl \
|
|
--with-pcap=linux LDFLAGS="-static"
|
|
make
|