Cross Compilation ( ARM example ) - rhaidiz/bettercap GitHub Wiki
As an example, let's cross compile bettercap for ARM (requires gcc-arm-linux-gnueabi
, yacc
and flex
packages).
Download and cross compile libpcap-1.8.1 for ARM (adjust PCAPV
to use a different libpcap version):
cd /tmp
export PCAPV=1.8.1
wget https://www.tcpdump.org/release/libpcap-$PCAPV.tar.gz
tar xvf libpcap-$PCAPV.tar.gz
cd libpcap-$PCAPV
export CC=arm-linux-gnueabi-gcc
./configure --host=arm-linux --with-pcap=linux
make
Cross compile bettercap itself:
cd $GOPATH/src/github.com/bettercap/bettercap
env CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm CGO_LDFLAGS="-L/tmp/libpcap-$PCAPV" make
For other cross compilation examples it is possible to look at the build.sh script.