• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1::
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)
6::
7
8@ECHO ON
9SETLOCAL EnableDelayedExpansion
10
11:: Set up the toolset
12echo using gcc : %FLAVOR% : %ARCH%-w64-mingw32-g++.exe ; > %USERPROFILE%\user-config.jam
13SET UPPERFLAVOR=%FLAVOR%
14CALL :TOUPPER UPPERFLAVOR
15
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.
19
20FOR %%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
23)
24c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^
25  "pacman --sync --needed --noconfirm python3" || EXIT /B
26
27::
28:: Now build things...
29::
30
31c:\msys64\usr\bin\env MSYSTEM=%UPPERFLAVOR% c:\msys64\usr\bin\bash -l -c ^
32  "cd %CD:\=/% && ./bootstrap.sh --with-toolset=gcc" || EXIT /B
33
34c:\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
36
37EXIT /B 0
38
39::
40:: Function to uppercase a variable
41:: from: https://stackoverflow.com/questions/34713621/batch-converting-variable-to-uppercase
42::
43
44:TOUPPER <variable>
45@ECHO OFF
46FOR %%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%% )
49@ECHO ON
50GOTO :EOF