Git Product home page Git Product logo

quickjs-windows-build's Introduction

QuickJS Windows Build

GitHub release (latest by date)

GitHub issues GitHub stars GitHub All Releases GitHub license

Build QuickJS on Windows, and prebuilt binary releases.

Build Prerequisites

Install MSYS2

If build 64-bit QuickJS with MINGW64, install x86_64-toolchain

pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
echo "#! /bin/sh" > /mingw64/bin/make
echo "\"mingw32-make\" \"\$@\"" >> /mingw64/bin/make

If build 32-bit QuickJS with MINGW32, install i686-toolchain

pacman -S mingw-w64-i686-gcc mingw-w64-i686-make
echo "#! /bin/sh" > /mingw32/bin/make
echo "\"mingw32-make\" \"\$@\"" >> /mingw32/bin/make

Obtain source code

git clone https://github.com/mengmo/QuickJS-Windows-Build.git

Compilation

cd QuickJS-Windows-Build
make LDEXPORT="-static -s" LDEXTRAS="-static -s"

Packaging

zip -9 -r quickjs-$(cat version)-win$(echo ${MSYSTEM:0-2}).zip qjs.exe run-test262.exe
mkdir ./bin
mv qjs.exe qjsc.exe run-test262.exe ./bin
mkdir -p ./lib/quickjs
strip -g libquickjs.a
mv libquickjs.a libquickjs.lto.a ./lib/quickjs
mkdir -p ./include/quickjs
cp -p quickjs.h quickjs-libc.h ./include/quickjs
zip -9 -r quickjs-$(cat version)-win$(echo ${MSYSTEM:0-2})-all.zip ./bin ./doc ./examples ./include ./lib Changelog readme.txt TODO VERSION

Related Projects

quickjs: Thin Python wrapper of https://bellard.org/quickjs/

jsvu: install recent versions of various JavaScript engines without having to compile them from source.


      A method to generate libquickjs.dll, use at your own risk.

  • Generating libquickjs.dll with libquickjs.a
  gcc -shared -o libquickjs.dll -static -s -Wl,--whole-archive libquickjs.a -lm -Wl,--no-whole-archive
  • Generating libquickjs.dll with libquickjs.lto.a
  gcc -shared -o libquickjs.dll -static -s -Wl,--whole-archive libquickjs.lto.a -lm -Wl,--no-whole-archive
  • Loading libquickjs.dll with ctypes from Python
  python
  from ctypes import *
  print(windll.libquickjs)
  exit()
  • A method to get a list of QuickJS Javascript Engine API
  objdump -p libquickjs.dll > libquickjs_api_list.txt

      QuickJS Javascript Engine API list located in [Ordinal/Name Pointer] Table

      Check quickjs.h to see what these APIs were defined for

      Tips: (I think there is no need to do this any more)

      When trying to load libquickjs.dll outside MSYS2/MINGW64/MINGW32

      if encountered OSError: [Error 126] The specified module could not be found.

      try to find dlls that libquickjs.dll depends on with

  objdump -p libquickjs.dll | grep -E .dll
  objdump -p libquickjs.dll | findstr /c:.dll

quickjs-windows-build's People

Contributors

mengmo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.