Skip to content

mengmo/Duktape-Windows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Duktape Windows

GitHub release (latest by date)

GitHub issues GitHub stars GitHub All Releases GitHub license

Method to build Duktape on Windows, and prebuilt binary releases.

Build Prerequisites

Install MSYS2

If build 64-bit Duktape 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 Duktape 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

Get Duktape latest release from GitHub release (latest by date)

Compilation

tar -xvJf duktape-2.5.0.tar.xz
cd ./duktape-2.5.0
make -f Makefile.cmdline DEFINES="-static -s"

Here is enough if you'd like to test only

Build Windows DLL

Prerequisites

If build 64-bit dll with MINGW64, install mingw-w64-x86_64-python2-yaml in MSYS2 without MINGW64 running.

pacman -S mingw-w64-x86_64-python2-yaml

If build 32-bit dll with MINGW32, install mingw-w64-i686-python2-yaml in MSYS2 without MINGW32 running.

pacman -S mingw-w64-i686-python2-yaml

Compilation

python2 tools/configure.py --output-directory ./libduktape --dll
gcc -shared -o libduktape.dll -static -s -fPIC -Os -pedantic -std=c99 -Wall -Wextra -fstrict-aliasing -fomit-frame-pointer -I./libduktape ./libduktape/duktape.c -lm

Build static library

gcc -c -fPIC -Os -pedantic -std=c99 -Wall -Wextra -fstrict-aliasing -fomit-frame-pointer ./libduktape/duktape.c
ar rcs libduktape.a duktape.o

Packaging

mkdir ./bin
mv duk.exe ./bin
mkdir ./lib
mv libduktape.dll libduktape.a ./lib
mkdir ./include
cp -p ./libduktape/duk_config.h ./libduktape/duktape.h ./include
zip -9 -r $(basename `pwd`)-win$(echo ${MSYSTEM:0-2}).zip ./bin ./include ./lib LICENSE.txt README.rst