new: added script to cross compile for arm6 on a preconfigured machine

This commit is contained in:
evilsocket 2018-02-10 08:16:29 +01:00
commit 9c1c937106
2 changed files with 22 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
*.sw*
*.tar.gz
pcaps
bettercap-ng*.*
bettercap-ng*

21
build_arm.sh Executable file
View file

@ -0,0 +1,21 @@
# nothing to see here, just what i use to cross compile for ARM
DIR=/Users/evilsocket/gocode/src/github.com/evilsocket/bettercap-ng
EXE=bettercap-ng_arm7
echo "@ Updating repo ..."
rm -rf $EXE && git pull
echo "@ Configuring libpcap ..."
rm -rf libpcap-*.*
rm -rf libpcap*
wget http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz
tar xvf libpcap-1.8.1.tar.gz
cd libpcap-1.8.1
export CC=arm-linux-gnueabi-gcc
./configure --host=arm-linux --with-pcap=linux
make
echo "@ Building $EXE ..."
cd ..
env CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CGO_LDFLAGS="-Llibpcap-1.8.1" go build -o $EXE .
rm -rf libpcap-1.8.1