aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux/travis-build.sh
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-03-08 20:33:21 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-03-08 20:33:21 +0100
commit214d09891909ce5505d7bdbc5c848a9c4be23c0d (patch)
tree143098c6b3529debd326d6cee04d1bd18556a456 /build-aux/travis-build.sh
parentd8f0fc6cb36a9d7c153a974b5095a4efb8c8add0 (diff)
downloadblogc-214d09891909ce5505d7bdbc5c848a9c4be23c0d.tar.gz
blogc-214d09891909ce5505d7bdbc5c848a9c4be23c0d.tar.bz2
blogc-214d09891909ce5505d7bdbc5c848a9c4be23c0d.zip
travis: added script to upload distfiles
Diffstat (limited to 'build-aux/travis-build.sh')
-rwxr-xr-xbuild-aux/travis-build.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/build-aux/travis-build.sh b/build-aux/travis-build.sh
new file mode 100755
index 0000000..d03cafd
--- /dev/null
+++ b/build-aux/travis-build.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+set -ex
+
+rm -rf build
+mkdir -p build
+
+MAKE_TARGET="${TARGET}"
+
+if [[ "x${TARGET}" = xw* ]]; then
+ unset CC
+ export CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
+ export CHOST="x86_64-w64-mingw32"
+ [[ "x${TARGET}" = "xw32" ]] && export CHOST="i686-w64-mingw32"
+ MAKE_TARGET="all"
+else
+ export CFLAGS="-Wall -g"
+ export CONFIGURE_ARGS="--enable-tests --enable-valgrind"
+fi
+
+pushd build > /dev/null
+
+../configure \
+ ${CHOST:+--host=${CHOST} --target=${CHOST}} \
+ --enable-ronn \
+ --with-squareball=internal \
+ --disable-silent-rules \
+ ${CONFIGURE_ARGS}
+
+popd > /dev/null
+
+make -C build "${MAKE_TARGET}"
+
+if [[ "x${TARGET}" = xw* ]]; then
+ TARNAME="$(grep PACKAGE_TARNAME build/config.h | cut -d\" -f2)"
+ VERSION="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)"
+ DEST_DIR="${TARNAME}-${VERSION}-${TARGET}"
+
+ rm -rf "${DEST_DIR}"
+ mkdir -p "${DEST_DIR}"
+
+ cp build/.libs/blogc.exe "${DEST_DIR}/"
+ cp LICENSE "${DEST_DIR}/"
+ cp README.md "${DEST_DIR}/"
+
+ zip "build/${DEST_DIR}.zip" "${DEST_DIR}"/*
+fi