$ ./configure --with-windows-version=502
loading site script /etc/config.site
loading cache ./config.cache
checking host system type... x86_64-pc-mingw32
checking target system type... x86_64-pc-mingw32
checking build system type... x86_64-pc-mingw32
checking for mawk... no
checking for gawk... gawk
checking for perl5... no
checking for perl... /usr/bin/perl
checking for gcc... /mingw64/bin/gcc
checking whether the C compiler (/mingw64/bin/gcc ) works... yes
checking whether the C compiler (/mingw64/bin/gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether /mingw64/bin/gcc accepts -g... yes
checking for c++... /mingw64/bin/g++
checking whether the C++ compiler (/mingw64/bin/g++ ) works... yes
checking whether the C++ compiler (/mingw64/bin/g++ ) is a cross-compiler... no
checking whether we are using GNU C++... yes
checking whether /mingw64/bin/g++ accepts -g... yes
checking for ranlib... ranlib
checking for ml64... no
checking for as... /mingw64/bin/as
checking for ar... ar
checking for ld... link
checking for strip... strip
checking for windres... windres
checking for w32api version >= 3.8... yes
checking for windres version >= 2.14.90... (GNU
./configure: line 3402: test: (GNU: integer expression expected
checking for Windows SDK being recent enough... yes
checking whether /mingw64/bin/gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... cl -E -nologo
checking how to run the C++ preprocessor... cl -TP -E -nologo
checking for sb-conf... no
checking for ve... no
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln -s works... no
checking for minimum required perl version >= 5.006... 5.038004
checking for full perl installation... yes
checking for python2.7... no
checking for python2.6... no
checking for python2.5... no
checking for python... /mingw64/bin/python
checking for doxygen... :
checking for autoconf... /usr/bin/autoconf
checking for unzip... :
checking for zip... /usr/bin/zip
checking for makedepend... no
checking for xargs... /usr/bin/xargs
checking for make... /usr/bin/make
checking for X... no
checking whether the compiler supports -Wno-invalid-offsetof... yes
checking whether the compiler supports -Wno-variadic-macros... yes
checking whether the compiler supports -Werror=return-type... yes
checking whether ld has archive extraction flags... yes
checking that static assertion macros used in autoconf tests work... yes
checking for 64-bit OS... yes
checking for Python version >= 2.5 but not 3.x... configure: error: Python 2.5 or higher (but not Python 3.x) is required.
Python 2.7 installed fine. There seems to be a need for an env var "MOZ_TOOLS". I'm not sure what it is supposed to point to. If I set it to something, configure fails with "checking for a 1-byte type... configure: error: Couldn't find a 1-byte type"
echo $ac_n "checking for a 1-byte type""... $ac_c" 1>&6
echo "configure:8634: checking for a 1-byte type" >&5
if eval "test \"`echo '$''{'moz_cv_n_byte_type_JS_INT8_TYPE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
moz_cv_n_byte_type_JS_INT8_TYPE=
for type in char; do
cat > conftest.$ac_ext <<EOF
Anyone got any idea what are MOZ_TOOLS and/or what this error is about?
"Netscape has modified a handful of the GNU command-line tools to solve some problems mostly for makefile compatibility with the GNU-styled UNIX builds.
checking for nspr-config... /mingw64/bin/nspr-config
checking for NSPR - version >= 4.7.0... yes
checking for valid optimization flags... no
configure: error: These compiler flags are invalid: -O
Last edited by mcarans on Mon Sep 01, 2025 9:05 pm, edited 1 time in total.
/mingw64/bin/gcc -o nsinstall.exe -I/mingw64/include -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_AMD64_ -O2 -DUNICODE -D_UNICODE -lpthread -L/mingw64/lib host_nsinstall_win.o
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/lib/libmingw32.a(lib64_libmingw32_a-crtexewin.o): in function `main':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/crtexewin.c:66:(.text.startup+0xb5): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
It looks like it is building nsinstall.exe but I am wondering: is it necessary since I already have nsinstall from an MSYS2 package? Why is it trying to build it as a GUI application instead of a console one for nsinstall.exe?
Just to double-check, you are building with JIT (just-in-time compiler) enabled, as well as the flags needed by Oolite, right? When I was building it I had to set these flags:
Out of all those, the ones I remember as being terribly important for Oolite are the ones at the top plus JS_C_STRINGS_ARE_UTF8 and of course the EXPORT_JS_API one. Many or all of those are probably set anyway by your build configuration, but it doesn't hurt to check, it might help avoid unnecessary pain if you build it successfully only to find out that a critical flag was missing.
Just to double-check, you are building with JIT (just-in-time compiler) enabled, as well as the flags needed by Oolite, right? When I was building it I had to set these flags:
Out of all those, the ones I remember as being terribly important for Oolite are the ones at the top plus JS_C_STRINGS_ARE_UTF8 and of course the EXPORT_JS_API one. Many or all of those are probably set anyway by your build configuration, but it doesn't hurt to check, it might help avoid unnecessary pain if you build it successfully only to find out that a critical flag was missing.
Thanks, I added the missing ones. Now when building Oolite with the new JS library, I get errors like:
No and I think that PR_* is from the nspr library, required for building with JS_THREADSAFE.
Note that the Windows version of JS is built without JS_THREADSAFE (the Linux version is built with it enabled), but we do not use any JS multi thread functionality in Oolite so it should not be a problem if JS_THREADSAFE is removed in order to simplify things.
No and I think that PR_* is from the nspr library, required for building with JS_THREADSAFE.
Note that the Windows version of JS is built without JS_THREADSAFE (the Linux version is built with it enabled), but we do not use any JS multi thread functionality in Oolite so it should not be a problem if JS_THREADSAFE is removed in order to simplify things.
I had to remove the line below from libjs.make to get it to build a .dll.a file:
Using that file libmozjs.dll.a instead of libjs_static.a, it linked ok. Copying the corresponding mozjs.dll into oolite.app, Oolite started and then shut down. The logging messages I had previously added showed that it got further.
Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ff88c3f86a0 in JS_GetClass () from C:\oolite\oolite.app\mozjs.dll
(gdb)
I then tried building mozjs without threadsafe. This time Oolite started up and showed the opening screen with music playing and rotating ship. I could start a new game - so much further than before. However, it was then that it crashed. Trying again in gdb, when I started a new game, I got:
Not enough data. We need a backtrace from the crash. When it crashes just execute bt from the gdb prompt and if you have debug symbols in the js library we may be able to identify the exact crash location in MethodJIT.cpp.
I have successfully built a JS_THREADSAFE Spidermonkey for Oolite using my flavor of the Dev Environment for Windows. You can test it by dropping the files from this zip into oolite.app. The game should load up and play without issues - at least it does so for me.
In case it helps, I can upload my work files for this once I get the opportunity (need to write some build instructions first). In the meantime, there is a new version of the LE Dev Environment available here that contains pre-built nspr4.dll, js32 binary and import libraries etc.
If testing shows all clear this can go into master soon.
BTW, Oolite needs to have JS_THREADSAFE defined as well to run without problems. The switch for that is in the Windows deps\x86_64\JS32ECMAv5\include\js-config.h file. The #undef JS_THREADSAFE needs to become #define JS_THREADSAFE 1.
I have successfully built a JS_THREADSAFE Spidermonkey for Oolite using my flavor of the Dev Environment for Windows. You can test it by dropping the files from this zip into oolite.app. The game should load up and play without issues - at least it does so for me.
In case it helps, I can upload my work files for this once I get the opportunity (need to write some build instructions first). In the meantime, there is a new version of the LE Dev Environment available here that contains pre-built nspr4.dll, js32 binary and import libraries etc.
If testing shows all clear this can go into master soon.
BTW, Oolite needs to have JS_THREADSAFE defined as well to run without problems. The switch for that is in the Windows deps\x86_64\JS32ECMAv5\include\js-config.h file. The #undef JS_THREADSAFE needs to become #define JS_THREADSAFE 1.
That's good. In my MSYS2 environment, your threadsafe version worked like the non-threadsafe one with the #define JS_THREADSAFE 1 ie. it ran fine in gdb but stopped on startup without gdb (presumably in the same place as described here viewtopic.php?p=302473#p302473 but I didn't add back all the log messages to check).
The threadsafe dll I generated is meant to be used in combination with the standard binaries distributed with the game. I would expect all sorts of issues if you tried to use it with binaries built on a different environment, as you have already experienced.