Building bindings requires rust-bindgen checked out and built in ../../rust-bindgen
(it expects to find the binary in ../../rust-bindgen/target/debug/bindgen).

=== Windows ===

rust-bindgen must be built using a rust for the pc-windows-gnu target, not msvc, even
when generating msvc bindings.  Within a MINGW64 env, install mingw-w64-x86_64-clang
then build rust-bindgen with 'LIBCLANG_PATH=c:/msys64/mingw64/bin cargo build' (replace
c:/msys64 with the root of your msys2-64 install directory).

==== MSVC bindings ====

Now, build rust-mozjs using a pc-windows-msvc rust.  Note that you'll need to be in an
environment that has the Visual C++ env vars already set up for your compiler -- the msys
package http://people.mozilla.org/~vladimir/misc/moz-vs-0.1.2-any.pkg.tar.xz can help
with this (install with pacman -U moz-vs-0.1.2-any.pkg.tar.xz).  After installation, running
"moz_vs" will set up env vars for the current shell for the given target (2015 or 2013).
This command is additive to the env -- it doesn't "switch", a new shell is required to use
a different compiler.

To generate VC14 (VS2015) bindings, in rust-mozjs:

moz_vs 2015
cargo build
[wait for everything to build; if bindings are out of date, it'll error out at the end -- that's okay]
./etc/bindings.sh msvc14
cp out.rs src/jsapi_windows_msvc14_64.rs
cargo build # make sure the build finishes

The debug bindings:

cargo clean
cargo build --features debugmozjs
[wait for everything to build]
./etc/bindings.sh msvc14
cp out.rs src/jsapi_windows_msvc14_64_debug.rs
cargo build --features debugmozjs

If you get errors about "static_assert expression is not an integral constant expression",
additional static_assert(offsetof(...)) sites need to be #if 0'd out (this ends up being
a non-constant-expression according to clang when built with the MSVC headers).

For generating the bindings with MSVC, only MSVC 2013 and 2015 are
supported (VC12 and 14).  Run 'bindings.sh msvc12' and/or 'bindings.sh msvc14'.
