#!/usr/bin/env bash # Download build dependencies for the build, notably: # # - required git submodules # - host packages # # Only needs to be run once before each type of build per-system. set -eux all=false apt_get=true baremetal=false baremetal_given=false buildroot=true buildroot_given=false linux=true linux_given=false interactive_pkgs=libsdl2-dev parsec_benchmark_given=false gem5=false gem5_given=false qemu=true qemu_given=false submodules_dir=submodules submodules= y= while [ $# -gt 0 ]; do case "$1" in --all) all=true shift ;; --baremetal) baremetal_given=true shift ;; --buildroot) buildroot_given=true shift ;; --gem5) gem5_given=true shift ;; --parsec-benchmark) parsec_benchmark_given=true shift ;; --qemu) qemu_given=true shift ;; --no-apt-get) apt_get=false shift ;; --travis) interactive_pkgs= y=-y shift ;; *) echo 'unknown option' 1>&2 exit 2 ;; esac done if ! "$all" && "$gem5_given" && ! "$qemu_given"; then qemu=false fi if "$all" || "$gem5_given"; then gem5=true fi if "$all" || "$baremetal_given"; then baremetal=true fi if ! "$all" && "$baremetal_given" && ! "$buildroot_given"; then buildroot=false fi if "$all" || "$parsec_benchmark_given"; then submodules="${submodules} parsec-benchmark" fi if "$apt_get"; then pkgs="\ automake \ bc \ bison \ build-essential \ coreutils \ cpio \ expect \ flex \ gcc-aarch64-linux-gnu \ gcc-arm-linux-gnueabi \ git \ libguestfs-tools \ moreutils \ rsync \ tmux \ unzip \ vinagre \ wget \ " if "$gem5"; then pkgs="${pkgs} \ ccache \ diod \ libgoogle-perftools-dev \ protobuf-compiler \ python-dev \ python-pip \ scons \ " fi if "$baremetal"; then pkgs="${pkgs} \ docbook2x \ libtool-bin \ " fi command -v apt-get >/dev/null 2>&1 || { cat <