diff --git a/.travis.yml b/.travis.yml index 618ea37f..a2d7a516 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,12 @@ before_install: - ./admin/travis-install-deps.sh env: - - DO=apidocs - - DO=style - - DO=distcheck AS_ROOT=no - - DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=no - - DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=yes + - ARCH=amd64 DO=apidocs + - ARCH=amd64 DO=style + - ARCH=amd64 DO=distcheck AS_ROOT=no + - ARCH=amd64 DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=no + - ARCH=amd64 DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=yes + - ARCH=i386 DO=distcheck AS_ROOT=no matrix: exclude: @@ -20,13 +21,17 @@ matrix: # env above to see if we can actually build, but do not really worry # about the run-time aspects of the tests. - compiler: gcc - env: DO=apidocs + env: ARCH=amd64 DO=apidocs - compiler: gcc - env: DO=style + env: ARCH=amd64 DO=style - compiler: gcc - env: DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=no + env: ARCH=amd64 DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=no - compiler: gcc - env: DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=yes + env: ARCH=amd64 DO=distcheck AS_ROOT=yes UNPRIVILEGED_USER=yes + # For the i386 test, use gcc as that's the only prebuilt version of + # the tools we've got. + - compiler: clang + env: ARCH=i386 DO=distcheck AS_ROOT=no script: - ./admin/travis-build.sh diff --git a/admin/travis-build.sh b/admin/travis-build.sh index 10c745e5..f583800d 100755 --- a/admin/travis-build.sh +++ b/admin/travis-build.sh @@ -49,8 +49,13 @@ do_distcheck() { sudo sysctl -w "kernel.core_pattern=core.%p" + local archflags= + [ "${ARCH?}" != i386 ] || archflags=-m32 + local f= + f="${f} CFLAGS='${archflags}'" f="${f} CPPFLAGS='-I/usr/local/include'" + f="${f} CXXFLAGS='${archflags}'" f="${f} LDFLAGS='-L/usr/local/lib -Wl,-R/usr/local/lib'" f="${f} PKG_CONFIG_PATH='/usr/local/lib/pkgconfig'" if [ "${AS_ROOT:-no}" = yes ]; then diff --git a/admin/travis-install-deps.sh b/admin/travis-install-deps.sh index 87182097..a029890c 100755 --- a/admin/travis-install-deps.sh +++ b/admin/travis-install-deps.sh @@ -29,9 +29,25 @@ set -e -x -sudo apt-get update -qq -sudo apt-get install -y gdb liblua5.2-0 liblua5.2-dev \ - libsqlite3-0 libsqlite3-dev pkg-config sqlite3 +install_deps() { + sudo apt-get update -qq + + local pkgsuffix= + local packages= + if [ "${ARCH?}" = i386 ]; then + pkgsuffix=:i386 + packages="${packages} gcc-multilib" + packages="${packages} g++-multilib" + fi + packages="${packages} gdb" + packages="${packages} liblua5.2-0${pkgsuffix}" + packages="${packages} liblua5.2-dev${pkgsuffix}" + packages="${packages} libsqlite3-0${pkgsuffix}" + packages="${packages} libsqlite3-dev${pkgsuffix}" + packages="${packages} pkg-config${pkgsuffix}" + packages="${packages} sqlite3" + sudo apt-get install -y ${packages} +} install_from_github() { local name="${1}"; shift @@ -44,12 +60,17 @@ install_from_github() { "${baseurl}/releases/download/${distname}/${distname}.tar.gz" tar -xzvf "${distname}.tar.gz" + local archflags= + [ "${ARCH?}" != i386 ] || archflags=-m32 + cd "${distname}" ./configure \ --disable-developer \ --without-atf \ --without-doxygen \ + CFLAGS="${archflags}" \ CPPFLAGS="-I/usr/local/include" \ + CXXFLAGS="${archflags}" \ LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib" \ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" make @@ -60,7 +81,18 @@ install_from_github() { } install_from_bintray() { - local name="20160204-usr-local-kyua-ubuntu-12-04-amd64-${CC:-gcc}.tar.gz" + case "${ARCH?}" in + amd64) + name="20160204-usr-local-kyua-ubuntu-12-04-amd64-${CC?}.tar.gz" + ;; + i386) + name="20160714-usr-local-kyua-ubuntu-12-04-i386-${CC?}.tar.gz" + ;; + *) + echo "ERROR: Unknown ARCH value ${ARCH}" 1>&2 + exit 1 + ;; + esac wget "http://dl.bintray.com/jmmv/kyua/${name}" || return 1 sudo tar -xzvp -C / -f "${name}" rm -f "${name}" @@ -92,6 +124,7 @@ main() { echo "DO must be defined" 1>&2 exit 1 fi + install_deps for step in ${DO}; do "do_${DO}" || exit 1 done