Without this patch, cross compilation on MSVC seems to directly embed backslashes from the prefix argument as various string constants in a C file via defines, like ENGINESDIR. This causes a build failure, as these backslashes get picked up as escape sequences.
Windows GNU targets are not affected by this issue, as they already do something similar to this patch within sanitize_sh.
I think this issue is caused by OpenSSL using the unix makefile template for cross-building to Linux, which I believe is not capable of escaping backslashes in the prefix argument. I believe that this is why a normal MSVC build works and why cross builds fail.
I have tested that this on Windows 11; this patch allows me to cross compile from x86_64-pc-windows-msvc to x86_64-unknown-linux-gnu and aarch64-unknown-linux-gnu.
Closes #118
Without this patch, cross compilation on MSVC seems to directly embed backslashes from the prefix argument as various string constants in a C file via defines, like
ENGINESDIR
. This causes a build failure, as these backslashes get picked up as escape sequences.Windows GNU targets are not affected by this issue, as they already do something similar to this patch within
sanitize_sh
.I think this issue is caused by OpenSSL using the unix makefile template for cross-building to Linux, which I believe is not capable of escaping backslashes in the prefix argument. I believe that this is why a normal MSVC build works and why cross builds fail.
I have tested that this on Windows 11; this patch allows me to cross compile from
x86_64-pc-windows-msvc
tox86_64-unknown-linux-gnu
andaarch64-unknown-linux-gnu
.