Skip to content

Instantly share code, notes, and snippets.

@tappleby
Created March 14, 2014 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tappleby/9550058 to your computer and use it in GitHub Desktop.
Save tappleby/9550058 to your computer and use it in GitHub Desktop.
Cross compile JQ for windows
#!/bin/sh
# Modified version of: https://github.com/svnpenn/a/blob/e06ea1e/scripts/install-jq.sh
# up to date Windows native jq
# autoconf need for autoreconf
# automake need for autoreconf > aclocal
# libtool need for autoreconf > libtool
# bison need for make
# flex need for make
pacman -S autoconf automake bison flex libtool
rm -rf jq
git clone --depth 1 git://github.com/stedolan/jq
cd jq
export CC=i586-mingw32msvc-gcc
export CXX=i586-mingw32msvc-c++
export LD=i586-mingw32msvc-ld
export AR=i586-mingw32msvc-ar
export AS=i586-mingw32msvc-as
export NM=i586-mingw32msvc-nm
export STRIP=i586-mingw32msvc-strip
export RANLIB=i586-mingw32msvc-ranlib
export DLLTOOL=i586-mingw32msvc-dlltool
export OBJDUMP=i586-mingw32msvc-objdump
export RESCOMP=i586-mingw32msvc-windres
export WINDRES=i586-mingw32msvc-windres
MINGWFLAGS="-std=c99 "
CFLAGS="$MINGWFLAGS"
CXXFLAGS="$MINGWFLAGS"
autoreconf -i
./configure --target=i586-mingw32msvc --host=i586
make -j4 LDFLAGS=-all-static CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment