configure: make qemu and gem5 steps optional

This commit is contained in:
Ciro Santilli
2018-03-08 08:41:00 +00:00
parent ef287e985e
commit 5d5c6b954c
2 changed files with 43 additions and 20 deletions

57
configure vendored
View File

@@ -1,10 +1,18 @@
#!/usr/bin/env bash
set -e
interactive_pkgs=libsdl2-dev
submodules='buildroot linux qemu gem5/gem5'
gem5=false
qemu=true
submodules='buildroot linux'
y=''
while getopts pt OPT; do
while getopts gqpt OPT; do
case "$OPT" in
g)
gem5=true
;;
q)
qemu=false
;;
p)
submodules="$submodules parsec-benchmark/parsec-benchmark"
;;
@@ -16,6 +24,14 @@ while getopts pt OPT; do
done
shift $(($OPTIND - 1))
## Submodules
if "$qemu"; then
submodules="$submodules qemu"
fi
if "$gem5"; then
submodules="$submodules gem5/gem5"
fi
(
set -e
# Shallow cloning saves a considerable amount of time, specially because of the linux kernel.
@@ -25,36 +41,39 @@ shift $(($OPTIND - 1))
# - `shallow = true` on the submodule has no effect for the non default educational branches of our submodules
# - QEMU's submodules point to commits that are neither under branches nor tags, and so `--shallow-submodules` fails
git submodule update --depth 1 --jobs 4 --init -- $submodules
cd qemu
git submodule update --init
if "$qemu"; then
cd qemu
git submodule update --init
fi
) &
wait $! || git submodule update --init -- $submodules
## apt-get
pkgs="\
automake \
build-essential \
coreutils \
"
# GEM5
pkgs="$pkgs \
g++-6 \
gcc-6 \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabi \
libgoogle-perftools-dev \
protobuf-compiler \
"
if "$gem5"; then
pkgs="$pkgs \
g++-6 \
gcc-6 \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabi \
libgoogle-perftools-dev \
protobuf-compiler \
"
fi
command -v apt-get >/dev/null 2>&1 || {
cat <<EOF
cat <<EOF
apt-get not found. You're on your own for installing dependencies.
On Ubuntu they are:
$pkgs
EOF
exit 0
exit 0
}
# Without this started failing in kernel 4.15 with:
@@ -71,4 +90,6 @@ sudo apt-get install $y \
$pkgs \
$interactive_pkgs \
;
sudo apt-get build-dep $y qemu
if "$qemu"; then
sudo apt-get build-dep $y qemu
fi