diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-11-04 17:54:17 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-11-11 17:12:10 +0300 |
commit | aa54c708b2f667260d654658d380dd47d05d7001 (patch) | |
tree | 91fd0f7903761076fef0808e86e9ea5a17e355e5 /build-msvc.bat.in | |
parent | 82812af7df158ec633752c5d45541ce6046ccda6 (diff) |
Add libbuild2-kconfig to installation/upgrade documentation and build scripts
Diffstat (limited to 'build-msvc.bat.in')
-rw-r--r-- | build-msvc.bat.in | 118 |
1 files changed, 105 insertions, 13 deletions
diff --git a/build-msvc.bat.in b/build-msvc.bat.in index f94e2c2..46c5ddb 100644 --- a/build-msvc.bat.in +++ b/build-msvc.bat.in @@ -11,14 +11,16 @@ echo. rem echo Usage: %0 [/?] [^<options^>] [^<cl-compiler^>] echo Usage: %0 [/?] [^<options^>] echo Options: -echo --local Don't build from packages, only from local source. -echo --no-bpkg Don't install bpkg nor bdep (requires --local). -echo --no-bdep Don't install bdep. -echo --install-dir ^<dir^> Alternative installation directory. -echo --repo ^<loc^> Alternative package repository location. -echo --trust ^<fp^> Repository certificate fingerprint to trust. -echo --timeout ^<sec^> Network operations timeout in seconds. -echo --verbose ^<level^> Diagnostics verbosity level between 0 and 6. +echo --local Don't build from packages, only from local source. +echo --no-bpkg Don't install bpkg nor bdep (requires --local). +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 --repo ^<loc^> Alternative package repository location. +echo --trust ^<fp^> Repository certificate fingerprint to trust. +echo --timeout ^<sec^> Network operations timeout in seconds. +echo --verbose ^<level^> Diagnostics verbosity level between 0 and 6. echo. echo By default the batch file will use cl.exe as the C++ compiler and install echo into C:\build2. It also expects to find the base utilities in the bin\ @@ -27,6 +29,14 @@ echo. echo The --trust option recognizes two special values: 'yes' ^(trust everything^) echo and 'no' (trust nothing). echo. +echo The script by default installs the following standard build system +echo modules: +echo. +echo %standard_modules% +echo. +echo Use --no-modules to suppress installing build system modules or +echo --modules "<list>" to specify a comma-separated subset to install. +echo. echo See the BOOTSTRAP-WINDOWS-MSVC file for details. echo. goto end @@ -47,6 +57,14 @@ set "build2_ver=@BUILD2_VERSION@" set "bpkg_ver=@BPKG_VERSION@" set "bdep_ver=@BDEP_VERSION@" +rem Standard modules comma-separated list and versions. +rem +rem NOTE: we currently print the list as a single line and will need to +rem somehow change that when it becomes too long. +rem +set "standard_modules=kconfig" +set "kconfig_ver=@KCONFIG_VERSION@" + rem The bpkg configuration directory. rem set "cver=@CONFIG_VER@" @@ -57,6 +75,7 @@ rem set "local=" set "bpkg=true" set "bdep=true" +set "modules=%standard_modules%" set "idir=C:\build2" set "trust=" set "timeout=" @@ -85,6 +104,19 @@ if "_%~1_" == "_--no-bdep_" ( goto options ) +if "_%~1_" == "_--no-modules_" ( + set "modules=" + shift + goto options +) + +if "_%~1_" == "_--modules_" ( + set "modules=%~2" + shift + shift + goto options +) + if "_%~1_" == "_--install-dir_" ( if "_%~2_" == "__" ( echo error: installation directory expected after --install-dir @@ -176,6 +208,14 @@ if "_%bpkg%_" == "__" ( set "bdep=" ) +for %%m in (%modules%) do ( + if "_!%%m_ver!_" == "__" ( + echo error: unknown standard build system module '%%m' + echo info: available standard modules: %standard_modules% + goto error + ) +) + rem Convert a relative path to an absolute. rem for /F "delims=|" %%D in ("%idir%") do set "idir=%%~dpnxD" @@ -274,14 +314,16 @@ build2\build2\b-boot %verbose% configure^ config.install.root=%idir% @if errorlevel 1 goto error -@set "projects=build2/" +@rem Install toolchain. +@rem +@set "projects=build2\" @if "_%bpkg%_" == "_true_" ( - set "projects=%projects% bpkg/" + set "projects=%projects% bpkg\" ) @if "_%bdep%_" == "_true_" ( - set "projects=%projects% bdep/" + set "projects=%projects% bdep\" ) build2\build2\b-boot %verbose% install: %projects% @@ -313,6 +355,26 @@ bdep --version :bdep_vle +@rem Install modules. +@rem +@set "projects=" +@set "tests=" + +@for %%m in (%modules%) do @( + set "projects=!projects! libbuild2-%%m\" + set "tests=!tests! tests\libbuild2-%%m-tests\" +) + +@if "_%projects%_" == "__" goto mods_ile + +b install: %projects:~1% +@if errorlevel 1 goto error + +b noop: %tests:~1% +@if errorlevel 1 goto error + +:mods_ile + @echo off echo. @@ -410,10 +472,40 @@ bdep --version :bdep_vpe -@rem Clean up stage. +@rem Build, install, and verify the build system modules. @rem +@set "packages=" +@set "package_versions=" +@set "tests=" + +@for %%m in (%modules%) do @( + set "packages=!packages! libbuild2-%%m" + set "package_versions=!package_versions! libbuild2-%%m/!%%m_ver!" + set "tests=!tests! tests\libbuild2-%%m-tests\" +) + +@if "_%packages%_" == "__" goto mods_ipe + +bpkg build --for install %package_versions:~1% +@if errorlevel 1 goto error + +bpkg install %packages:~1% +@if errorlevel 1 goto error + +:mods_ipe + cd %owd% -b %verbose% uninstall: build2/ bpkg/ + +@if "_%tests%_" == "__" goto mods_lpe + +b noop: %tests:~1% +@if errorlevel 1 goto error + +:mods_lpe + +@rem Clean up stage. +@rem +b %verbose% uninstall: build2\ bpkg\ @if errorlevel 1 goto error @echo off |