--- /dev/null
+# Travis build integration.
+# https://docs.travis-ci.com/
+
+language: c
+compiler:
+# TODO: Enable clang support.
+# - clang
+ - gcc
+
+sudo: false
+
+os:
+ - linux
+# TODO: Enable OS X support.
+# - osx
+
+script: ./travis/main.sh
--- /dev/null
+#!/bin/bash
+# List of all supported arches.
+# Written by Mike Frysinger <vapier@gentoo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+# The e1/nios targets are dead and no longer configure.
+ARCHES=(
+ arm
+ bfin
+# e1
+ h8300
+ m68k
+ microblaze
+# nios
+ nios2
+ sh
+ sparc
+ v850
+)
+
+# Expanded list of targets that we can use with configure.
+TARGETS=${ARCHES[@]/%/-elf}
--- /dev/null
+#!/bin/bash
+# Common funcs for working w/Travis.
+# Written by Mike Frysinger <vapier@gentoo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+travis_fold() {
+ if [[ -n ${TRAVIS_OS_NAME} ]] ; then
+ printf 'travis_fold:%s:%s\r\n' "$@" | sed 's: :_:g'
+ fi
+}
+
+if [[ -n ${TRAVIS_OS_NAME} ]] ; then
+ whitebg=$(tput setab 7)
+ blackfg=$(tput setaf 0)
+ normal=$(tput sgr0)
+else
+ whitebg=
+ blackbg=
+ normal=
+fi
+v() {
+ local fold=""
+ case $1 in
+ --fold=*) fold=${1:7}; shift;;
+ esac
+ if [[ -n ${fold} ]] ; then
+ travis_fold start "${fold}"
+ echo "\$ $*"
+ "$@"
+ travis_fold end "${fold}"
+ else
+ echo "${whitebg}${blackfg}\$ $*${normal}"
+ "$@"
+ fi
+}
+
+ncpus=$(getconf _NPROCESSORS_ONLN)
+m() {
+ v make -j${ncpus} "$@"
+}
--- /dev/null
+#!/bin/bash -e
+# Main Travis test script.
+# Written by Mike Frysinger <vapier@gentoo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+. "${0%/*}"/lib.sh
+. "${0%/*}"/arches.sh
+
+BINUTILS_VER="2.25.1"
+
+build_one() {
+ local arch=$1
+ local S=${PWD}
+
+ travis_fold start ${arch}
+ v mkdir -p build/${arch}
+ pushd build/${arch} >/dev/null
+ v "${S}"/configure \
+ --enable-werror \
+ --with-binutils-build-dir="${S}"/../prebuilts-binutils-libs/output/${BINUTILS_VER} \
+ --target=${arch}-elf
+ m
+ m check
+ popd >/dev/null
+ travis_fold end ${arch}
+}
+
+main() {
+ v --fold="git_clone_binutils" \
+ git clone --depth=1 https://github.com/uclinux-dev/prebuilts-binutils-libs ../prebuilts-binutils-libs
+
+ local a
+ for a in "${ARCHES[@]}" ; do
+ build_one "${a}"
+ done
+}
+main "$@"