[gjs/master.windows] win32/README.txt: Update SpiderMonkey build instructions



commit 9554ae65f01e9d82962a17765a32500ce34ab9a6
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Mar 4 17:02:31 2019 +0800

    win32/README.txt: Update SpiderMonkey build instructions
    
    As there are some gotcha's/pitfalls for building SpiderMonkey for use
    with GJS on Windows, note in the README file in win32 telling people
    how:
    
    -They could obtain the SpiderMonkey sources (which is not easy,
     nowadays)
    -They know the flags and envvar's that must be passed into
     SpiderMonkey's configure line for GJS to build and run correctly.
    -That they should not try to link to mozglue.lib at any point during the
     GJS build.
    
    Fixes issue #228

 win32/README.txt | 47 +++++++++++++++++++++++++++++++++++++----------
 1 file changed, 37 insertions(+), 10 deletions(-)
---
diff --git a/win32/README.txt b/win32/README.txt
index 450f3db6..ae0aa767 100644
--- a/win32/README.txt
+++ b/win32/README.txt
@@ -7,7 +7,7 @@ earlier is not supported, nor is Visual Studio 2017 15.5.x or earlier,
 as the compiler flag /Zc:externConstexpr is needed.
 
 You will need the following items to build GJS using Visual Studio:
--SpiderMonkey 60 (mozjs-60)
+-SpiderMonkey 60 (mozjs-60).  Please see the below section carefully on this...
 -GObject-Introspection (G-I) 1.41.4 or later
 -GLib 2.54.x or later, (which includes GIO, GObject, and the associated tools)
 -Cairo including Cairo-GObject support, unless NO_CAIRO=1 is specified.
@@ -18,15 +18,41 @@ Note that SpiderMonkey must be built with Visual Studio, and the rest
 should preferably be built with Visual Studio as well.  The Visual Studio
 version used should preferably be the one that is used here to build GJS.
 
-If you built SpiderMonkey 38 using the normal build instructions as described
-on Mozilla's website, you may notice that the output library, DLLs and include
-directory might not be what one may expect, which is likely due to bugs in its build
-scripts.  If this is the case, rename mozjs-.lib to mozjs-38.lib, and the
-include directory from mozjs- to mozjs-38 (but please do *not* rename mozjs-.dll
-and mozjs-.pdb, as they will be searched for when gjs-console.exe/gjs.exe runs,
-along with any program that uses the GJS DLL).  Otherwise, do (or redo) the
-SpiderMonkey build process (including running configure) after applying the patch
-from https://git.gnome.org/browse/jhbuild/tree/patches/mozjs38-release-number.patch
+Be aware that it is nowadays often hard to find a suitable source release for
+SpiderMonkey, so if may be helpful to look in
+
+ftp://ftp.gnome.org/pub/gnome/teams/releng/tarballs-needing-help/mozjs/
+
+for the suitable release series of SpiderMonkey that corresponds to the GJS
+version that is being built, as GJS depends on ESR (Extended Service Release,
+a.k.a Long-term support) releases of SpiderMonkey.
+
+Please do note that the build must be done carefully, in addition to the
+official instructions that are posted on the Mozilla website:
+
+https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Build_Documentation
+
+For the configuration, you will need to run the following:
+
+(64-bit/x64 builds)
+JS_STANDALONE=1 ../mozjs-60.1.0/js/src/configure --enable-nspr-build --host=x86_64-pc-mingw32 
--target=x86_64-pc-mingw32 --prefix=--prefix=<some_prefix> --disable-jemalloc
+
+(32-bit builds)
+JS_STANDALONE=1 ../mozjs-60.1.0/js/src/configure --enable-nspr-build --prefix=<some_prefix> 
--disable-jemalloc
+
+Notice that "JS_STANDALONE=1" and "--disable-jemalloc" are absolutely required,
+otherwise GJS will not build/run correctly.  Please do not try to update the
+NMake Makefiles to link to mozglue.lib!  Note in particular that a mozglue.dll
+should *not* be in $(builddir)/dist/bin, although there will be a mozglue.lib
+somewhere in the build tree (which, you can safely delete after building
+SpiderMonkey).  The --host=... and --target=... are absolutely required for x64
+builds, as per the Mozilla's SpiderMonkey build instructions.
+
+You may want to pass in --disable-js-shell to not build the JS shell that comes
+with SpiderMonkey to save time, and perhaps use --with-system-nspr (instead of
+the --enable-nspr-build as above), --with-system-zlib and --with-system-icu if
+you know what you are doing and that their pkg-config files (or headers/LIB's)
+can be found directly or using configuration options, to further save time.
 
 The following are instructions for performing such a build, as there is a
 number of build configurations supported for the build.  Note that the default
@@ -68,6 +94,7 @@ INTROSPECTION: Enable build of introspection files, for making
                required.
 
 PYTHON: Full path to the Python interpreter to be used, if it is not in %PATH%.
+        This is necessary for building the introspection files (INTROSPECTION=1).
 
 LIBTOOL_DLL_NAME: Enable libtool-style DLL names.  Note this does not make this
                   GJS build usable by other compilers, due to C++ usage.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]