[gjs/msvc.doc] README.MSVC.md: Update build documentation



commit 033acf53a85505bb9d518f274bf36f270376ae96
Author: Chun-wei Fan <fanc999 yahoo com tw>
Date:   Wed Dec 4 13:05:10 2019 +0800

    README.MSVC.md: Update build documentation
    
    Update the build instructions for Visual Studio since we only have Meson
    as our build system to build with Visual Studio.

 README.MSVC.md | 94 ++++++++++++++--------------------------------------------
 1 file changed, 23 insertions(+), 71 deletions(-)
---
diff --git a/README.MSVC.md b/README.MSVC.md
index dfa9fba9..a6749cbf 100644
--- a/README.MSVC.md
+++ b/README.MSVC.md
@@ -2,19 +2,16 @@ Instructions for building GJS on Visual Studio
 ==============================================
 Building the GJS on Windows is now supported using Visual Studio
 versions 2017 15.6.x or later in both 32-bit and 64-bit (x64) flavors,
-via NMake Makefiles and Meson.  Due to C++-14 usage, Visual Studio
-2017 15.6.x or later is required, as the compiler flag
-/Zc:externConstexpr is needed.
+via Meson.  Due to C++-14 usage, Visual Studio 2017 15.6.x or later is
+required, as the compiler flag /Zc:externConstexpr is needed.
 
 You will need the following items to build GJS using Visual Studio:
 -SpiderMonkey 60 (mozjs-60).  Please see the below section carefully 
  on this...
 -GObject-Introspection (G-I) 1.61.2 or later
 -GLib 2.58.x or later, (which includes GIO, GObject, and the associated tools)
--Cairo including Cairo-GObject support (Optional; specify NO_CAIRO=14
- to disable Cairo support in the NMake Makefiles)
--GTK+-3.20.x or later (Optional, specify NO_GTK=1 to disable GTK+
- support in the NMake Makefiles)
+-Cairo including Cairo-GObject support (Optional)
+-GTK+-3.20.x or later (Optional)
 -and anything that the above items depends on.
 
 Note that SpiderMonkey must be built with Visual Studio, and the rest
@@ -45,12 +42,16 @@ JS_STANDALONE=1 $(mozjs_srcroot)/js/src/configure --enable-nspr-build --host=x86
 JS_STANDALONE=1 $(mozjs_srcroot)/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.
+otherwise GJS will not build/run correctly.  If your GJS build crashes upon
+launch, use Depedency Walker to ensure that mozjs-60.dll does not depend on
+mozglue.dll!  If it does, or if GJS fails to link with missing arena_malloc() and
+friends symbols, you have built SpiderMoney incorrectly and will need to rebuild
+SpiderMonkey (with the build options as noted above) and retry the build.
+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
@@ -81,11 +82,11 @@ You may want to put the .lib's and DLLs/EXEs into $(PREFIX)\lib and
 $(PREFIX)\bin respectively, and put the headers into
 $(PREFIX)\include\mozjs-60 for convenience.
 
-For Meson builds, you will need to place the generated mozjs-60.pc
-pkg-config file into $(PREFIX)\lib\pkgconfig and ensure that
-pkg-config can find it by setting PKG_CONFIG_PATH.  Ensure
-that the 'includedir' and 'libdir' in there is correct, and remove
-the 'nspr' entry from the 'Requires.private:' line and change
+You will need to place the generated mozjs-60.pc pkg-config file into
+$(PREFIX)\lib\pkgconfig and ensure that pkg-config can find it by
+setting PKG_CONFIG_PATH.  Ensure that the 'includedir' and 'libdir'
+in there is correct, and remove the 'nspr' entry from the
+'Requires.private:' line and change
 '-include ${includedir}/mozjs-60/js/RequiredDefines.h' to
 '-FI${includedir}/mozjs-60/js/RequiredDefines.h', so that the
 mozjs-60.pc can be used correctly in Visual Studio builds.  You
@@ -93,59 +94,10 @@ will also need to ensure that the existing GObject-Introspection
 installation (if used) is on the same drive where the GJS sources
 are (and therefore where the GJS build is being carried out).
 
-To perform an NMake build:
-==========================
-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 build (where no options (see below) are specified, 
-the GJS library is built with Cairo and GTK+ support.  A 'clean' 
-target is provided-it is recommended that one cleans the build and 
-redo the build if any configuration option changed.  An 'install' 
-target is also provided to copy the built items in their appropriate
-locations under $(PREFIX), which is described below.
-
-Invoke the build by issuing the command:
-nmake /f Makefile.vc CFG=[release|debug] [PREFIX=...] <option1=1 option2=1 ...>
-where:
-
-CFG: Required.  Choose from a release or debug build.  Note that
-     all builds generate a .pdb file for each .dll and .exe built--this refers
-     to the C/C++ runtime that the build uses.
-
-PREFIX: Optional.  Base directory of where the third-party headers, libraries
-        and needed tools can be found, i.e. headers in $(PREFIX)\include,
-        libraries in $(PREFIX)\lib and tools in $(PREFIX)\bin.  If not
-        specified, $(PREFIX) is set as $(srcroot)\..\vs$(X)\$(platform), where
-        $(platform) is win32 for 32-bit builds or x64 for 64-bit builds, and
-        $(X) is the short version of the Visual Studio used, as follows:
-        2017: 15
-
-Explanation of options, set by <option>=1:
-------------------------------------------
-NO_CAIRO: Disables Cairo support in the GJS DLL.
-
-NO_GTK: Disables GTK+ support in the GJS DLL
-
-INTROSPECTION: Enable build of introspection files, for making
-               bindings for other programming languages available, such as
-               Python.  This requires the GObject-Introspection
-               libraries and tools, along with the Python interpreter that was
-               used during the build of GObject-Introspection.  This will
-               require the introspection files for GTK+, unless NO_GTK=1 is
-               specified, where the introspection files for GIO will be
-               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.
-
-==================================
-To carry out the build using Meson
-==================================
-In addition to the requirements listed in the NMake builds,
-you need to install Python 3.5.x or later, as well as the
+======================
+To carry out the build
+======================
+You need to install Python 3.5.x or later, as well as the
 pkg-config tool, Meson (via pip) and Ninja (unless using
 --backend=vs[2017|2019]).  Perform a build by doing the
 following, in an appropriate Visual Studio command prompt


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