diff options
Diffstat (limited to 'build-clang.bat.in')
-rw-r--r-- | build-clang.bat.in | 76 |
1 files changed, 58 insertions, 18 deletions
diff --git a/build-clang.bat.in b/build-clang.bat.in index bee0759..34e2726 100644 --- a/build-clang.bat.in +++ b/build-clang.bat.in @@ -16,6 +16,7 @@ echo --no-bdep Don't install bdep. echo --no-modules Don't install standard build system modules. echo --modules "<list>" Install only specified standard build system modules. echo --install-dir ^<dir^> Alternative installation directory. +echo --jobs^|-j ^<num^> Number of jobs to perform in parallel. echo --repo ^<loc^> Alternative package repository location. echo --trust ^<fp^> Repository certificate fingerprint to trust. echo --timeout ^<sec^> Network operations timeout in seconds. @@ -27,6 +28,10 @@ echo install into C:\build2. It also expects to find the base utilities in the echo bin\ subdirectory of the installation directory ^(C:\build2\bin\ by echo default^). echo. +echo If --jobs^|-j is unspecified, then the bootstrap step is performed +echo serially with the rest of the process using the number of available +echo hardware threads. +echo. echo The --trust option recognizes two special values: 'yes' ^(trust everything^) echo and 'no' (trust nothing). echo. @@ -36,6 +41,9 @@ echo additional make options, for example: echo. echo %0 --make mingw32-make --make -j8 echo. +echo If --jobs^|-j is specified, then its value is passed to make before +echo any additional options. +echo. echo The script by default installs the following standard build system echo modules: echo. @@ -84,9 +92,11 @@ set "bpkg=true" set "bdep=true" set "modules=%standard_modules%" set "idir=C:\build2" +set "jobs=" set "trust=" set "timeout=" set "make=" +set "make_options=" set "verbose=" :options @@ -136,6 +146,21 @@ if "_%~1_" == "_--install-dir_" ( goto options ) +set "jo=" +if "_%~1_" == "_-j_" set "jo=true" +if "_%~1_" == "_--jobs_" set "jo=true" + +if "_%jo%_" == "_true_" ( + if "_%~2_" == "__" ( + echo error: number of jobs expected after --jobs^|-j + goto error + ) + set "jobs=-j %~2" + shift + shift + goto options +) + if "_%~1_" == "_--trust_" ( if "_%~2_" == "__" ( echo error: certificate fingerprint expected after --trust @@ -174,7 +199,12 @@ if "_%~1_" == "_--make_" ( echo error: argument expected after --make goto error ) - set "make=%make% %~2" + + if "_%make%_" == "__" ( + set "make=%~2" + ) else ( + set "make_options=%make_options% %~2" + ) shift shift goto options @@ -204,6 +234,16 @@ if "_%1_" == "__" ( set "cxx=%1" ) +rem Merge jobs and make_options into make. +rem +if not "_%make%_" == "__" ( + if not "_%jobs%_" == "__" set "make=%make% %jobs%" + + rem Already has leading space. + rem + if not "_%make_options%_" == "__" set "make=!make!%make_options%" +) + rem If --no-bpkg is specified, then we require --local to also be specified rem since it won't be possible to build things from packages without bpkg. rem Also imply --no-bdep in this case, since bdep is pretty much useless @@ -317,7 +357,7 @@ cmd /C bootstrap-clang.bat %cxx% build2\b-boot --version @if errorlevel 1 goto error -build2\b-boot %verbose% config.cxx=%cxx% config.cc.coptions=-m64 config.bin.lib=static build2\exe{b} +build2\b-boot %verbose% %jobs% config.cxx=%cxx% config.cc.coptions=-m64 config.bin.lib=static build2\exe{b} @if errorlevel 1 goto error move /y build2\b.exe build2\b-boot.exe @@ -351,7 +391,7 @@ build2\build2\b-boot %verbose% configure^ set "projects=%projects% bdep\" ) -build2\build2\b-boot %verbose% install: %projects% +build2\build2\b-boot %verbose% %jobs% install: %projects% @if errorlevel 1 goto error where b @@ -392,10 +432,10 @@ bdep --version @if "_%projects%_" == "__" goto mods_ile -b install: %projects:~1% +b %verbose% %jobs% install: %projects:~1% @if errorlevel 1 goto error -b noop: %tests:~1% +b %verbose% noop: %tests:~1% @if errorlevel 1 goto error :mods_ile @@ -422,7 +462,7 @@ build2\build2\b-boot %verbose% configure^ config.install.data_root=root\stage @if errorlevel 1 goto error -build2\build2\b-boot %verbose% install: build2\ bpkg\ +build2\build2\b-boot %verbose% %jobs% install: build2\ bpkg\ @if errorlevel 1 goto error where b-stage @@ -458,22 +498,22 @@ bpkg-stage %verbose% create^ config.install.root=%idir% @if errorlevel 1 goto error -bpkg-stage %verbose% add %BUILD2_REPO% -@if errorlevel 1 goto error - -bpkg-stage %verbose% %timeout% %trust% fetch -@if errorlevel 1 goto error - @set "packages=build2/%build2_ver% bpkg/%bpkg_ver%" @if "_%bdep%_" == "_true_" ( set "packages=%packages% bdep/%bdep_ver%" ) -bpkg-stage %verbose% %timeout% build --for install --yes --plan= %packages% +bpkg-stage %verbose% add %BUILD2_REPO% +@if errorlevel 1 goto error + +bpkg-stage %verbose% %timeout% %trust% fetch +@if errorlevel 1 goto error + +bpkg-stage %verbose% %jobs% %timeout% build --for install --yes --plan= %packages% @if errorlevel 1 goto error -bpkg-stage %verbose% install --all +bpkg-stage %verbose% %jobs% install --all @if errorlevel 1 goto error where b @@ -510,10 +550,10 @@ bdep --version @if "_%packages%_" == "__" goto mods_ipe -bpkg build --for install %packages:~1% +bpkg %verbose% %jobs% %timeout% build --for install %packages:~1% @if errorlevel 1 goto error -bpkg install --all-pattern=libbuild2-* +bpkg %verbose% %jobs% install --all-pattern=libbuild2-* @if errorlevel 1 goto error :mods_ipe @@ -522,14 +562,14 @@ cd %owd% @if "_%tests%_" == "__" goto mods_lpe -b noop: %tests:~1% +b %verbose% noop: %tests:~1% @if errorlevel 1 goto error :mods_lpe @rem Clean up stage. @rem -b %verbose% uninstall: build2\ bpkg\ +b %verbose% %jobs% uninstall: build2\ bpkg\ @if errorlevel 1 goto error @echo off |