From 7436d83ef371d4fee4a66bec235e102ed80275db Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 19 Aug 2022 18:09:25 +0200 Subject: Add support for msvc tool-chain (cl.exe/link.exe and lib.exe) on windows. --- clbootstrap.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 clbootstrap.sh (limited to 'clbootstrap.sh') diff --git a/clbootstrap.sh b/clbootstrap.sh new file mode 100755 index 0000000..e3a420f --- /dev/null +++ b/clbootstrap.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -e +set -x +export WINEDEBUG=-all + +rm -f ~/.wine/drive_c/number + +export BASE='C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133' +export ONECORELIB="$BASE\lib\onecore\x86" +export WINEPATH="$BASE\bin\Hostx86\x86" +export INCLUDE="$BASE\include" +export UCRT="C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt" +export UCRTLIB="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x86" +export UM="C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um" +export UMLIB="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x86" +export SHARED="C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared" +echo Bootstrapping... + +export CL="/I\"$BASE\include\" /I\"$UCRT\" /I\"$UM\" /I\"$SHARED\" /link /LIBPATH:\"$UMLIB\" /LIBPATH:\"$ONECORELIB\" /LIBPATH:\"$UCRTLIB\"" +export LINK="/LIBPATH:\"$UMLIB\" /LIBPATH:\"$ONECORELIB\" /LIBPATH:\"$UCRTLIB\"" +export LIB="/LIBPATH:\"$UMLIB\" /LIBPATH:\"$ONECORELIB\" /LIBPATH:\"$UCRTLIB\"" + +# https://docs.microsoft.com/en-us/cpp/build/reference/cl-environment-variables?view=msvc-170 + +# set INCLUDE="$BASE\include";$UCRT;$UM;$SHARED +# set LIB= +# set LIBPATH=$UMLIB;$ONECORELIB;$UCRTLIB + +rm -Rf ctor.exe build/ configuration.cc + +export CXX="cl.exe" +export CC="cl.exe" +export AR="lib.exe" +export LD="link.exe" +wine cl /nologo /std:c++20 /D_X86_ /EHsc /Isrc src/bootstrap.cc /link /SUBSYSTEM:CONSOLE /out:ctor.exe + +#echo -e "\n\n\nHit ENTER to continue...\n\n\n"; read + +wine ctor.exe + +#echo -e "\n\n\nHit ENTER to continue...\n\n\n"; read + +wine cl /nologo /std:c++20 /D_X86_ /EHsc /Isrc ctor.cc build/libctor.lib /link /SUBSYSTEM:CONSOLE /out:ctor.exe + +#echo -e "\n\n\nHit ENTER to continue...\n\n\n"; read + +wine ctor.exe configure --ctor-includedir=src --ctor-libdir=build --cxx=cl.exe --cc=cl.exe --ar=lib.exe --ld=link.exe + +#echo -e "\n\n\nHit ENTER to continue...\n\n\n"; read + -- cgit v1.2.3