Path: blob/master/build-linux-arm.sh
548 views
#!/bin/bash12# Linux build, optimised for ARM devices34if [ ! -e configure ]; then5echo "Creating configure..."6rm -rf autom4te.cache7rm -f Makefile.in aclocal.m4 autom4te.cache compat/Makefile.in8rm -f compile config.guess config.sub config.status configure9rm -f cpuminer-config.h.in depcomp install-sh missing10if ./autogen.sh; then11echo " => done."12else13exit 114fi15fi1617if [ -e Makefile ]; then18echo "Cleaning previous build..."19make distclean20echo " => done."21fi2223echo "Configuring..."2425# --disable-assembly: some ASM code doesn't build on ARM26# Note: we don't enable -flto, it doesn't bring anything here but slows down27# the build a lot. If needed, just add -flto to the CFLAGS string.28# normal build.29./configure --with-crypto --with-curl --disable-assembly CC=gcc CXX=g++ CFLAGS="-Ofast -fuse-linker-plugin -ftree-loop-if-convert-stores -march=native" LDFLAGS="-march=native"3031# debug build32#./configure --with-crypto --with-curl --disable-assembly CC=gcc CXX=g++ CFLAGS="-O0 -g3 -fuse-linker-plugin -ftree-loop-if-convert-stores -march=native" LDFLAGS="-g3 -march=native"3334[ $? = 0 ] || exit $?35echo " => done."3637if [ -z "$NPROC" ]; then38NPROC=$(nproc 2>/dev/null)39NPROC=${NPROC:-1}40fi4142echo "Compiling on $NPROC processes..."4344make -j $NPROC4546if [ $? != 0 ]; then47echo "Compilation failed (make=$?)".48echo "Common causes: missing libjansson-dev libcurl4-openssl-dev libssl-dev"49echo "If you pulled updates into this directory, remove configure and try again."50exit 151fi52echo " => done."5354echo '$ ls -l cpuminer'55ls -l cpuminer5657echo "Stripping..."5859strip -s cpuminer6061[ $? = 0 ] || exit $?62echo " => done."636465