build-arm-linux-gnueabihf.sh 536 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. if ! command -v arm-linux-gnueabihf-gcc &> /dev/null; then
  3. echo "Please install a toolchain for cross-compiling."
  4. echo "You can refer to: "
  5. echo " https://k2-fsa.github.io/sherpa/ncnn/install/arm-embedded-linux.html"
  6. echo "for help."
  7. exit 1
  8. fi
  9. set -ex
  10. dir=build-arm-linux-gnueabihf
  11. mkdir -p $dir
  12. cd $dir
  13. cmake \
  14. -DCMAKE_INSTALL_PREFIX=./install \
  15. -DCMAKE_BUILD_TYPE=Release \
  16. -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabihf.toolchain.cmake \
  17. ..
  18. make VERBOSE=1 -j4
  19. make install/strip