aboutsummaryrefslogtreecommitdiff
path: root/bootstrap-mingw.bat
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-20 09:34:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-20 09:34:27 +0200
commitbdabddcc90a5cc203a2821c8229e7238c32f5ba6 (patch)
tree1510fe27d7a6fe876c8df8e8e279f0d4c63bc7ae /bootstrap-mingw.bat
parent4776ab7859e71bb6cec004a1aea05324ad33fd1d (diff)
Improve bootstrap scripts
Diffstat (limited to 'bootstrap-mingw.bat')
-rw-r--r--bootstrap-mingw.bat37
1 files changed, 20 insertions, 17 deletions
diff --git a/bootstrap-mingw.bat b/bootstrap-mingw.bat
index 63a2918..a7049bb 100644
--- a/bootstrap-mingw.bat
+++ b/bootstrap-mingw.bat
@@ -9,16 +9,15 @@ goto start
:usage
echo.
-echo Usage: %0 [/?] [cxx [cxx-option...]]
+echo Usage: %0 [/?] ^<cxx^> [^<cxx-option^>...]
echo.
echo The batch file expects to find the libbutl\ or libbutl-*\ directory
-echo either in the current directory (build2 root) or one level up.
+echo either in the current directory (build2 root) or one level up. The
+echo result is saved as build2\b-boot.exe.
echo.
-echo Note that if any cxx-option arguments are specified, then they must
-echo be preceded by the compiler executable (use g++ as the default). For
-echo example:
+echo Example usage:
echo.
-echo %0 g++ -O3
+echo %0 C:\mingw\bin\g++ -static
echo.
echo See the INSTALL file for details.
echo.
@@ -28,6 +27,15 @@ goto end
if "_%1_" == "_/?_" goto usage
+rem Compiler executable.
+rem
+if "_%1_" == "__" (
+ echo error: compiler executable expected, run %0 /? for details
+ goto error
+) else (
+ set "cxx=%1"
+)
+
rem See if there is libbutl or libbutl-* in the current directory and one
rem directory up. Note that globbing returns paths in alphabetic order.
rem
@@ -64,17 +72,9 @@ set "src=%src% build2\test\*.cxx"
set "src=%src% build2\install\*.cxx"
set "src=%src% %libbutl%\butl\*.cxx"
-rem Get the compiler executable.
-rem
-if "_%1_" == "__" (
- set "cxx=g++"
-) else (
- set "cxx=%1"
-)
-
rem Get the compile options.
rem
-set "ops=-std=c++1y -static"
+set "ops=-std=c++1y"
:ops_next
shift
if "_%1_" == "__" (
@@ -87,8 +87,11 @@ if "_%1_" == "__" (
rem Compile.
rem
-echo %cxx% -I%libbutl% -I. -DBUILD2_HOST_TRIPLET=\"i686-w64-mingw32\" %ops% -o build2\b-boot.exe %src%
- %cxx% -I%libbutl% -I. -DBUILD2_HOST_TRIPLET=\"i686-w64-mingw32\" %ops% -o build2\b-boot.exe %src%
+rem Note that echo does not override errorlevel.
+rem
+echo on
+%cxx% -I%libbutl% -I. -DBUILD2_HOST_TRIPLET=\"i686-w64-mingw32\" %ops% -o build2\b-boot.exe %src%
+@echo off
if errorlevel 1 goto error
goto end