summaryrefslogtreecommitdiff
path: root/clbootstrap.sh
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2024-12-07 17:14:45 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2024-12-21 16:21:49 +0100
commitd2e7188e33a58cab05ef6292795303ad4b92a5f7 (patch)
treea6789fb724833d4d800626bf9b4707fa4ae1e9d8 /clbootstrap.sh
parente166206702c8dbd3162452cf26f368e856ac0138 (diff)
WIPmsvc
Diffstat (limited to 'clbootstrap.sh')
-rwxr-xr-xclbootstrap.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/clbootstrap.sh b/clbootstrap.sh
new file mode 100755
index 0000000..47664d1
--- /dev/null
+++ b/clbootstrap.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+set -e
+set -x
+export WINEDEBUG=-all
+
+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
+mkdir build
+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 /Fo:build/ ctor.cc src/bootstrap.cc /link /out:ctor.exe
+#sleep 1
+wine ctor.exe
+#sleep 1
+wine cl /nologo /std:c++20 /D_X86_ /EHsc /Isrc /Fo:build/ ctor.cc build/libctor.lib /link /subsystem:console /out:ctor.exe
+#sleep 1
+wine ctor.exe configure --ctor-includedir=src --ctor-libdir=build
+#sleep 1
+
+#exit 0
+
+wine ctor.exe -a test/ctor.cc
+#sleep 1
+wine ctor.exe -v check
+#sleep 1