SET bitness=64& SET platform=x86_64 SET MD=c:\test\msys64 cd /D c:\ mkdir %MD% mkdir %MD%\var\src @REM Prepare 7-zip for expanding msys powershell -Command "((new-object net.webclient).DownloadFile('https://www.7-zip.org/a/7za920.zip', '%TEMP%\7z.zip'))" powershell -Command "$shell = New-Object -ComObject Shell.Application; $zip_src = $shell.NameSpace('%TEMP%\7z.zip'); $zip_dest = $shell.NameSpace('%TEMP%'); $zip_dest.CopyHere($zip_src.Items(), 1044)" @REM Download and extract msys powershell -Command "((new-object net.webclient).DownloadFile('http://repo.msys2.org/distrib/msys2-%platform%-latest.tar.xz', '%TEMP%\msys.tar.xz'))" %TEMP%\7za.exe x %TEMP%\msys.tar.xz -so | %TEMP%\7za.exe x -oc:\test\ -aoa -si -ttar >%TEMP%/7z-msys.log @REM Output bash script contained in this CMD @for /f "delims=:" %%a in ('findstr -n "^___" %0') do @set "DELIMLINE=%%a" @for /f "skip=%DELIMLINE% tokens=* eol=_" %%a in ('type %0') do @echo %%a>> %MD%\var\src\make_check.sh @REM First run is performed to setup the environment %MD%\usr\bin\bash --login -i -c exit >%TEMP%\msys-setup.log 2>&1 %MD%\usr\bin\bash --login -i -c ^" ^ pacman --noconfirm -Sy ^" >>%TEMP%\msys-update.log 2>&1 %MD%\usr\bin\bash --login -i /var/src/make_check.sh SET LEVEL=%ERRORLEVEL% exit /b %LEVEL% ___BASH_SCRIPT___ set -e echo "`date -Iseconds`: Starting shell... "; pacman --noconfirm -S tar make diffutils patch perl git flex bison mingw-w64-x86_64-libxml2 mingw-w64-x86_64-openssl mingw-w64-x86_64-gcc export PATH="/mingw64/bin:/usr/bin/core_perl:$PATH" cd /var/src git clone https://git.postgresql.org/git/postgresql.git cd postgresql git checkout REL_11_STABLE gcc --version CFLAGS="-D WINVER=0x0600 -D _WIN32_WINNT=0x0600" LIBS="-ladvapi32" ./configure --host=x86_64-w64-mingw32 --without-zlib --with-openssl --with-libxml --prefix=/c/postgresql/pg11/ >configure.log make -j4 >make.log make install >install.log # make check /c/postgresql/pg11/bin/initdb.exe -D /c/postgresql/db