Skip to content

Commit

Permalink
Travis: Cross-compile a Win64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Sep 17, 2014
1 parent 1b7cb8a commit 077992b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
13 changes: 12 additions & 1 deletion .travis.deps
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ echo -e 'deb http://ftp.us.debian.org/debian/ wheezy main\ndeb http://security.d
sudo rm -r /etc/apt/sources.list.d
curl https://ftp-master.debian.org/keys/archive-key-7.0.asc | sudo apt-key add -
sudo apt-get update -qq
sudo apt-get install -y build-essential autoconf automake libtool libcurl4-gnutls-dev libjansson-dev uthash-dev $EXTRA_DEPS
if [ -z "$CROSS_BINPKGS" ]; then
DEV_DEPS='libcurl4-gnutls-dev libjansson-dev uthash-dev'
fi
sudo apt-get install -y build-essential autoconf automake libtool $DEV_DEPS $EXTRA_DEPS

if [ -n "$UBUNTU_DEPS" ]; then
cat <<\EOF | sudo tee '/etc/apt/sources.list'
Expand All @@ -22,3 +25,11 @@ EOF
sudo apt-get update -qq
sudo apt-get install -y $UBUNTU_DEPS
fi

if [ -n "$CROSS_BINPKGS" ]; then
wget "https://github.com/luke-jr/cross-binpkgs/archive/${CROSS_BINPKGS}.zip"
unzip "${CROSS_BINPKGS}.zip"
for f in "cross-binpkgs-${CROSS_BINPKGS}"/*/*; do
sudo tar -C "/usr/${CROSS_BINPKGS}/" -xjvpf "$f"
done
fi
16 changes: 13 additions & 3 deletions .travis.script
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
test "x$1" = "xI-am-okay-with-destroying-my-system" || exit 1
set -ex

export CC=$(which "$myCC")
if [ -n "$CROSS_BINPKGS" ]; then
myCC="${CROSS_BINPKGS}-gcc"
CC_ARGS="-I/usr/${CROSS_BINPKGS}/usr/include"
export LDFLAGS="-L/usr/${CROSS_BINPKGS}/usr/lib -L/usr/${CROSS_BINPKGS}/usr/bin"
export PKG_CONFIG_PATH="/usr/${CROSS_BINPKGS}/usr/lib/pkgconfig/"
export PKG_CONFIG_SYSROOT_DIR="/usr/${CROSS_BINPKGS}"
fi

export CC="$(which "$myCC") $CC_ARGS"
$CC --version

./autogen.sh
./configure $GLOBAL_CONFIGURE_ARGS $CONFIGURE_ARGS
make CFLAGS="$GLOBAL_CFLAGS $BUILD_CFLAGS" $MAKEOPTS
make check
sudo make install
if [ -z "$CROSS_BINPKGS" ]; then
make check
sudo make install
fi
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ matrix:
env: myCC='clang' UBUNTU_DEPS='libhidapi-dev linux-libc-dev' EXTRA_DEPS='pkg-config libncursesw5-dev libudev-dev libusb-1.0-0-dev libevent-dev libmicrohttpd-dev libi2c-dev yasm libsensors4-dev' BUILD_CFLAGS='-Werror' CONFIGURE_ARGS='--enable-other-drivers --enable-scrypt --without-system-libbase58 --enable-tool'
- compiler: ": pkgconf"
env: myCC='clang' UBUNTU_DEPS='libhidapi-dev linux-libc-dev pkgconf' EXTRA_DEPS='libncursesw5-dev libudev-dev libusb-1.0-0-dev libevent-dev libmicrohttpd-dev libi2c-dev yasm libsensors4-dev' BUILD_CFLAGS='-Werror' CONFIGURE_ARGS='--enable-other-drivers --enable-scrypt --without-system-libbase58 --enable-tool'
- compiler: ": MinGW64"
env: UBUNTU_DEPS='gcc-mingw-w64-x86-64' EXTRA_DEPS='pkg-config yasm' CROSS_BINPKGS='x86_64-w64-mingw32' BUILD_CFLAGS='-Werror' CONFIGURE_ARGS='--enable-other-drivers --enable-scrypt --without-system-libbase58 --host=x86_64-w64-mingw32 --disable-knc --disable-bfsb --disable-jingtian --disable-metabank --disable-minergate'
- compiler: ": Std SHA2"
env: myCC='clang' UBUNTU_DEPS='libhidapi-dev linux-libc-dev' EXTRA_DEPS='pkg-config libncursesw5-dev libudev-dev libusb-1.0-0-dev libevent-dev libmicrohttpd-dev libi2c-dev yasm libsensors4-dev' CONFIGURE_ARGS=''
- compiler: ": Std scrypt"
Expand Down

0 comments on commit 077992b

Please sign in to comment.