2 :: MinGW Build Script
for Appveyor
, leveraging the MSYS2 installation
3 :: Copyright
(C
) 2018 James E. King III
4 :: Distributed under the Boost Software License
, Version
1.0.
5 :: (See accompanying file LICENSE_1_0.txt or
copy at http
://boost.org
/LICENSE_1_0.txt
)
9 SETLOCAL EnableDelayedExpansion
12 echo using gcc
: %FLAVOR% : %ARCH%-w64
-mingw32
-g
++.exe
; > %USERPROFILE%\user
-config.jam
13 SET UPPERFLAVOR
=%FLAVOR%
14 CALL :TOUPPER UPPERFLAVOR
16 :: Install packages needed to build boost
17 :: Optional
: comment out ones this library does
not need
,
18 :: so people can
copy this script to another library.
20 FOR %%a IN
("gcc" "icu" "libiconv" "openssl" "xz" "zlib") DO (
21 c
:\msys64\usr
\bin\env MSYSTEM
=%UPPERFLAVOR% c
:\msys64\usr
\bin
\bash
-l
-c ^
22 "pacman --sync --needed --noconfirm %FLAVOR%/mingw-w64-%ARCH%-%%a" ||
EXIT /B
24 c
:\msys64\usr
\bin\env MSYSTEM
=%UPPERFLAVOR% c
:\msys64\usr
\bin
\bash
-l
-c ^
25 "pacman --sync --needed --noconfirm python3" ||
EXIT /B
28 :: Now build things...
31 c
:\msys64\usr
\bin\env MSYSTEM
=%UPPERFLAVOR% c
:\msys64\usr
\bin
\bash
-l
-c ^
32 "cd %CD:\=/% && ./bootstrap.sh --with-toolset=gcc" ||
EXIT /B
34 c
:\msys64\usr
\bin\env MSYSTEM
=%UPPERFLAVOR% c
:\msys64\usr
\bin
\bash
-l
-c ^
35 "cd %CD:\=/% && ./b2 libs/%SELF% toolset=gcc-%FLAVOR% cxxstd=%CXXSTD% %CXXFLAGS% %DEFINES% %B2_ADDRESS_MODEL% %B2_LINK% %B2_THREADING% %B2_VARIANT% -j3" ||
EXIT /B
40 :: Function to uppercase a variable
41 :: from
: https
://stackoverflow.com
/questions
/34713621/batch
-converting
-variable
-to
-uppercase
46 FOR %%a IN
("a=A" "b=B" "c=C" "d=D" "e=E" "f=F" "g=G" "h=H" "i=I"
47 "j=J" "k=K" "l=L" "m=M" "n=N" "o=O" "p=P" "q=Q" "r=R"
48 "s=S" "t=T" "u=U" "v=V" "w=W" "x=X" "y=Y" "z=Z" ) DO ( CALL SET %~
1=%%%~
1:%%~a
%% )