From 91364b58fa5cc224e80209e28e62613ca36dc4a9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Jun 2018 12:16:25 +0200 Subject: Command line interface redesign for bootstrap scripts --- etc/bootstrap/bbot-bootstrap.sh | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'etc/bootstrap/bbot-bootstrap.sh') diff --git a/etc/bootstrap/bbot-bootstrap.sh b/etc/bootstrap/bbot-bootstrap.sh index d2153e8..4914ae4 100755 --- a/etc/bootstrap/bbot-bootstrap.sh +++ b/etc/bootstrap/bbot-bootstrap.sh @@ -33,22 +33,15 @@ run () # Defaults that can be changed via command line. # -cxx=g++ build=/tmp environments="$HOME/environments" +make= +jobs= # Parse options. # while test $# -ne 0; do case $1 in - --cxx) - shift - if test $# -eq 0; then - error "missing C++ compiler after --cxx" - fi - cxx="$1" - shift - ;; --build) shift if test $# -eq 0; then @@ -65,6 +58,22 @@ while test $# -ne 0; do environments="$1" shift ;; + --make) + shift + if test $# -eq 0; then + error "missing make program after --make" + fi + make="$1" + shift + ;; + --jobs) + shift + if test $# -eq 0; then + error "missing jobs number after --jobs" + fi + jobs="$1" + shift + ;; *) break ;; @@ -85,6 +94,16 @@ timeout=600 #tftp="127.0.0.1:55123" #build_options="--install-dir $install" +# If make was specified, add it to build_options. +# +if test -n "$make"; then + build_options="$build_options --make $make" + + if test -n "$jobs"; then + build_options="$build_options --make -j$jobs" + fi +fi + PATH="$install/bin:$PATH" export PATH @@ -121,7 +140,7 @@ run rm trust # bstrap="$(echo build2-toolchain-*)" run cd "$bstrap" -run ./build.sh --timeout "$timeout" --trust "$trust" $build_options "$@" "$cxx" +run ./build.sh --timeout "$timeout" --trust "$trust" $build_options "$@" run cd .. run rm -r "$bstrap" -- cgit v1.1