diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-06-14 12:16:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-06-15 13:46:11 +0200 |
commit | 91364b58fa5cc224e80209e28e62613ca36dc4a9 (patch) | |
tree | 8b11e1ffca0b25682dfa20da5431c967b3f97175 /etc/bootstrap/bbot-bootstrap.sh | |
parent | 2068fd01f5acebeea9f0b92fbc43426772b10538 (diff) |
Command line interface redesign for bootstrap scripts
Diffstat (limited to 'etc/bootstrap/bbot-bootstrap.sh')
-rwxr-xr-x | etc/bootstrap/bbot-bootstrap.sh | 39 |
1 files changed, 29 insertions, 10 deletions
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" |