From 5d5c6b954c4a91e388de71ff55ab28a900752010 Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Thu, 8 Mar 2018 08:41:00 +0000 Subject: [PATCH] configure: make qemu and gem5 steps optional --- README.adoc | 6 ++++-- configure | 57 ++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/README.adoc b/README.adoc index 054ae9a..49fb1d2 100644 --- a/README.adoc +++ b/README.adoc @@ -1501,12 +1501,14 @@ To get started, have a look at the "Hardware device drivers" secion under link:k == gem5 +=== gem5 getting started + gem5 is a system simulator, much <>: http://gem5.org/ For the most part, just add the `-g` option to the QEMU commands and everything should magically work: .... -./configure && ./build -a arm -g +./configure -gq && ./build -a arm -g ./run -a arm -g .... @@ -1839,7 +1841,7 @@ We have ported the PARSEC benchmark http://parsec.cs.princeton.edu for cross com This repo makes it trivial to get started with it: .... -configure -p && ./build -a arm -g -i buildroot_config_fragment_parsec +configure -gpq && ./build -a arm -g -i buildroot_config_fragment_parsec ./run -a arm -g .... diff --git a/configure b/configure index edf8e99..65c5816 100755 --- a/configure +++ b/configure @@ -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 <