Skip to content
Nico Williams edited this page May 16, 2015 · 18 revisions

This assumes /home/build is where MinGW32 is found, as well as jq and Oniguruma workspaces. Assume the shell's $PS1 is set to : ; , which makes it easy to cut-n-paste (because : is the same as true).

For Windows (64-bit):

: ; # Install mingw bits into /home/build/mingw/mingw-w64-x86_64
: ; # Fetch Oniguruma 5.9.5, untar into /home/build/ws/onig-5.9.5
: ; # Make a directory for installing cross-built code into
: ; mkdir -p /home/build/proto/win64
: ; PATH=/home/build/mingw/mingw-w64-x86_64/bin:$PATH
: ; cd /home/build/ws/onig-5.9.5
: ; ./configure --target=win64-x86_64 --host=x86_64-w64-mingw32
: ; make -j16 LDFLAGS=-all-static clean all install DESTDIR=/home/build/proto/win64
: ; cd /home/build/ws/jq
: ; scripts/crosscompile win64 --target=win64-x86_64 --host=x86_64-w64-mingw32 --with-oniguruma=/home/build/proto/win64/usr/local LDFLAGS=-all-static

(The -all-static bit may need to be hand-edited into the resulting Makefile by hand. That's a bug. We should make sure that ./configure --disable-shared sets LDFLAGS = -all-static.)

Similarly for Windows 32-bit:

: ; # Install mingw bits into /home/build/mingw/mingw-w32-x86_64
: ; # Fetch Oniguruma 5.9.5, untar into /home/build/ws/onig-5.9.5
: ; # Make a directory for installing cross-built code into
: ; mkdir -p /home/build/proto/win32
: ; PATH=/home/build/mingw/mingw-w32-x86_64/bin:$PATH
: ; cd /home/build/ws/onig-5.9.5
: ; ./configure --target=win32-i686 --host=i686-w64-mingw32
: ; make -j16 LDFLAGS=-all-static clean all install DESTDIR=/home/build/proto/win32
: ; cd /home/build/ws/jq
: ; scripts/crosscompile win32 --target=win32-i686 --host=i686-w64-mingw32 --with-oniguruma=/home/build/proto/win32/usr/local LDFLAGS=-all-static

(See the above note about LDFLAGS=-all-static.)

Clone this wiki locally