Method to build Duktape on Windows, and prebuilt binary releases.
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
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
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
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
gcc -c -fPIC -Os -pedantic -std=c99 -Wall -Wextra -fstrict-aliasing -fomit-frame-pointer ./libduktape/duktape.c
ar rcs libduktape.a duktape.o
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