<div dir="ltr">Hi Jaka,<div><br></div><div>I am trying to follow your steps in order to compile it on Windows 10 (using cygwin instead of msys2, but on msys2 I seem to get the same). For now, getting errors :(.</div><div><br></div><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">$ ./otp_build configure<br>Copying static configure cache /cygdrive/c/Users/oltar/Downloads/otp_src_22.0/erts/autoconf/win32.config.cache.static to /cygdrive/c/Users/oltar/Downloads/otp_src_22.0/erts/autoconf/win32.config.cache<br>/cygdrive/c/Users/oltar/Downloads/otp_src_22.0/configure --build=x86_64-unknown-cygwin build_alias=win32 --host=win32 --target=win32 --disable-dynamic-ssl-lib --cache-file=/cygdrive/c/Users/oltar/Downloads/otp_src_22.0/erts/autoconf/win32.config.cache CC=cc\.sh CXX=cc\.sh RANLIB=true AR=ar\.sh<br>WARNING: Only using config cache file '/cygdrive/c/Users/oltar/Downloads/otp_src_22.0/erts/autoconf/win32.config.cache' as static cache<br>=== Running configure in /cygdrive/c/Users/oltar/Downloads/otp_src_22.0/erts ===<br>./configure '--build=x86_64-unknown-cygwin' 'build_alias=win32' '--host=win32' '--target=win32' '--disable-dynamic-ssl-lib' 'CC=cc.sh' 'CXX=cc.sh' 'RANLIB=true' 'AR=ar.sh' --disable-option-checking --cache-file=./local.static.config.cache --srcdir="/cygdrive/c/Users/oltar/Downloads/otp_src_22.0/erts"<br>configure: loading cache ./local.static.config.cache<br>checking for win32-gcc... (cached) cc.sh<br>checking whether the C compiler works... no<br>configure: error: in `/cygdrive/c/Users/oltar/Downloads/otp_src_22.0/erts':<br>configure: error: C compiler cannot create executables<br>See `config.log' for more details<br>ERROR: /cygdrive/c/Users/oltar/Downloads/otp_src_22.0/erts/configure failed!<br>./configure: line 343: kill: (-2670) - No such process</blockquote></div><div><br></div><div>I want to ask if you can share the contents of "cc.sh". Also maybe you could advise what might be missing.</div><div>Oleg</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 16, 2019 at 1:43 PM Jaka Bac <<a href="mailto:jakabac@gmail.com">jakabac@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>The windows build process&setup is not "magic" at all....</div><div><br></div>In fact it is actually possible to build Erlang/OTP with MSVC 2019<br>My build process (instructions not exact) looked like this:<br>1. Install MSVC 2019<br>2. Install MSYS2 and configure it so the msys shell inherits the Windows environment (PATH) when started. Also install all the "Linux" prereqs (GCC,...)<br>3. Download and build OpenSSL (follow OpenSSL build instructions, I used 1.1.1b version to get all possible ciphers, hashes,...)<br>4. Download and build wxWidgets (put wxWidgets in /opt/local/pgm and build the static libs there (instructions taken from OTP build guide for WIN, wxWidgets 3.0.4 is also fine):<br><br>C:\...\> cd <path\to\pgm>\wxMSW-3.0.3\build\msw<br>C:\...\> nmake TARGET_CPU=amd64 BUILD=release SHARED=0 DIR_SUFFIX_CPU= -f <a href="http://makefile.vc" target="_blank">makefile.vc</a><br><br><br>5. Apply this patch: <br>diff --git a/erts/etc/win32/msys_tools/vc/cc.sh b/erts/etc/win32/msys_tools/vc/cc.sh<br>index 2b0482e876..99db719c38 100644<br>--- a/erts/etc/win32/msys_tools/vc/cc.sh<br>+++ b/erts/etc/win32/msys_tools/vc/cc.sh<br>@@ -242,7 +242,10 @@ for x in $SOURCES; do<br> if [ $PREPROCESSING = true ]; then<br> output_flag="-E"<br> else<br>+<br> output_flag="-FS -c -Fo`cmd //C echo ${output_filename}`"<br>+ output_flag=`echo $output_flag | sed -e 's/\\//\\\\\\\\/g'`<br>+ #echo "PATCHED OUTPUT: " $output_flag<br> fi<br> params="$COMMON_CFLAGS $MD $DEBUG_FLAGS $OPTIMIZE_FLAGS \<br> $CMD ${output_flag} $MPATH"<br><br>The cc.sh makes cl.exe look like gcc to the OTP build environment. It does fiddling with the paths to translate them from MSYS style to native paths. But it seems that MSVC 2019 does not like absolute paths with / insted of \ (Relative paths work fine with /)<br><br>5. Follow the WIN build instructions for OTP (tell configure where your OpenSSL lives):<br><br>$ eval `./otp_build env_win32 x64`<br>$ ./otp_build autoconf<br>$ ./otp_build configure --with-ssl=/x/path/to/openssl #you might want to tell it where to find javac also if you want jinterface<div><br></div><div>Even if configure does not complainabout OpenSSL it seems that everythig is still not as the build environment expects. I had to copy libcrypto_static.lib and libssl_static.lib to c_src folder lib\crypto\c_src while renaming them to crypto.lib and ssl.lib.</div><div>Also It seems that I built OpenSSL with newtorking support since the OTP build died while building crypto app with unresolved winsock symbols. To fix it I added </div><div>LDFLAGS += -dll Ws2_32.Lib</div><div>to otp\lib\crypto\c_src\win32\Makefile (please keep in mind that this file is probably generated during the build process so this is a dirty hack, I did not feel like digging deeper into the build scripts, makefiles etc...)</div><div><br>$ ./otp_build boot -a<br>$ ./otp_build release -a<br><br>Building the installer expects a pretty ancient NSIS installation. I just removed the version checks in the installer makefile to go through that, but you really don't need the installer...</div><div><br></div><div>After ./otp_build release -a completes you will find everything you need in otp\release\win32. This is more or less what the installer will pack.</div><div><br></div><div>You can just copy that folder to wherever you want your build to live and run install.exe in that folder as the last step (this is also done by the windows installer)</div><div>It will create bin folder and put all the "public" exes there, set up an erl.ini and also copy the boot scripts into bin.</div><div><br></div><div>After that you are good to go! </div><div>I did not bother building the docs, but feel free to try that...</div><div><br></div><div>I confirmed that wx application is working by running observer and also did limited testing of the crypto app. </div><div><br></div><div>If you get stuck feel free to contact me</div><div>Cheers,</div><div>Jaka</div><div><div><br></div><div>On Tue, 30 Apr 2019 at 17:50, Andre Nathan <<a href="mailto:andre@digirati.com.br" target="_blank">andre@digirati.com.br</a>> wrote:<div>><br>> On 4/30/19 12:36 PM, Dmytro Lytovchenko wrote:<br>> > From what I know the building instructions are pure magic involving<br>> > MinGW and Visual Studio, and it is dangerous to go alone.<br>> > Take this <a href="https://visualstudio.microsoft.com/vs/older-downloads/" target="_blank">https://visualstudio.microsoft.com/vs/older-downloads/</a><br>><br>> Yeah, I've found that, but the VS 2013 link leads to a page that says no<br>> downloads are available.<br>><br>> Thanks,<br>> Andre<br>> _______________________________________________<br>> erlang-questions mailing list<br>> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a></div></div></div></div>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>