From d1945eef491cf38ed5bcaf6780287c8629d6edd4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Dec 2017 16:56:52 +0200 Subject: Add --verbose option to build scripts --- build-mingw.bat | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'build-mingw.bat') diff --git a/build-mingw.bat b/build-mingw.bat index ddb8a5d..a5da24c 100644 --- a/build-mingw.bat +++ b/build-mingw.bat @@ -16,6 +16,7 @@ echo --repo ^ Alternative package repository location. echo --trust ^ Repository certificate fingerprint to trust. echo --timeout ^ Network operations timeout in seconds. echo --make ^ Bootstrap using GNU make instead of batch file. +echo --verbose ^ Diagnostics verbosity level between 0 and 6. echo. echo By default the batch file will install into C:\build2. It also expects echo to find the base utilities in the bin\ subdirectory of the installation @@ -57,6 +58,7 @@ set "idir=C:\build2" set "trust=" set "timeout=" set "make=" +set "verbose=" :options if "_%~1_" == "_/?_" goto usage @@ -118,6 +120,17 @@ if "_%~1_" == "_--make_" ( goto options ) +if "_%~1_" == "_--verbose_" ( + if "_%~2_" == "__" ( + echo error: diagnostics level between 0 and 6 expected after --verbose + goto error + ) + set "verbose=%~2" + shift + shift + goto options +) + if "_%~1_" == "_--_" shift rem Validate options and arguments. @@ -161,6 +174,12 @@ if not "_%timeout%_" == "__" ( set "timeout=--fetch-timeout %timeout%" ) +rem Diagnostics verbosity. +rem +if not "_%verbose%_" == "__" ( + set "verbose=--verbose %verbose%" +) + if not exist %idir%\bin\ ( echo error: %idir%\bin\ does not exist goto error @@ -172,7 +191,7 @@ if exist build\config.build ( ) if exist ..\%cdir%\ ( - echo error: ..\%cdir%\ bpkg configuration directory already exists + echo error: ..\%cdir%\ bpkg configuration directory already exists, remove it goto error ) @@ -213,7 +232,7 @@ cmd /C bootstrap-mingw.bat %cxx% -static build2\b-boot --version @if errorlevel 1 goto error -build2\b-boot config.cxx=%cxx% config.bin.lib=static +build2\b-boot %verbose% config.cxx=%cxx% config.bin.lib=static @if errorlevel 1 goto error move /y build2\b.exe build2\b-boot.exe @@ -226,14 +245,14 @@ build2\b-boot --version @rem cd .. -build2\build2\b-boot configure^ +build2\build2\b-boot %verbose% configure^ config.cxx=%cxx%^ config.bin.suffix=-stage^ config.install.root=%idir%^ config.install.data_root=root\stage @if errorlevel 1 goto error -build2\build2\b-boot install +build2\build2\b-boot %verbose% install @if errorlevel 1 goto error @rem The where command is not available on XP without the resource kit. @@ -263,23 +282,23 @@ cd %cdir% @rem @set "cdir=%CD%" -bpkg-stage create^ +bpkg-stage %verbose% create^ cc^ config.cxx=%cxx%^ config.cc.coptions=-O3^ config.install.root=%idir% @if errorlevel 1 goto error -bpkg-stage add %BUILD2_REPO% +bpkg-stage %verbose% add %BUILD2_REPO% @if errorlevel 1 goto error -bpkg-stage fetch %timeout% %trust% +bpkg-stage %verbose% fetch %timeout% %trust% @if errorlevel 1 goto error -bpkg-stage build %timeout% --yes build2 bpkg +bpkg-stage %verbose% build %timeout% --yes build2 bpkg @if errorlevel 1 goto error -bpkg-stage install build2 bpkg +bpkg-stage %verbose% install build2 bpkg @if errorlevel 1 goto error where b @@ -297,7 +316,7 @@ bpkg --version @rem Clean up stage. @rem cd %owd% -b uninstall +b %verbose% uninstall @if errorlevel 1 goto error @echo off -- cgit v1.1