# Support for Travis CI -- https://travis-ci.org/upx/upx/builds
# Copyright (C) Markus Franz Xaver Johannes Oberhumer

sudo: false
language: cpp

notifications: { email: { on_success: never, on_failure: change } }

.ubuntu_toolchain_sources: &S
  - ubuntu-toolchain-r-test
  - llvm-toolchain-precise-3.5
  - llvm-toolchain-precise-3.6
  - llvm-toolchain-precise-3.7
  - llvm-toolchain-precise-3.8
  - llvm-toolchain-precise-3.9

env:
  global:
    - CROSS= C= B= T= X=
    - secure: "YXHLXK+CM5d8yELIUSSs+P0/CoefClO7/AUX1oBj5W75g+YzR5uS2doVsB8UH8S8/GdNxk4P9Jgn4EiEVnjfGgn2eAD9MVpDPIxyJs5vI+5G77asq3QNdSl6QFv3O9I/6yBoVCewgPFPqsMd7Yvs/Ea3LcQkqalVhrC8ybYtmfs6VL2w33gn2J3b3TCn/s21L0ijklM0xvP1GNMDtuUpTSish5wvGOHE/91rwtdUDbJR8u31QY7fTASDiNnL/7ihgEIZ5XxpDYXviX1GC+nemhX1fWpmVmuT8m30Ruodi0yJVGASw9i2SaKv/VX/fJ/w2vlCfspL5LMZKkVLlfpIo3mQGqmMHFxv7mNy+hRu50ptoWNSkWArcqifwveh2liHUpl4jTvWaVll5Tw5VUGJhAUdzCTnqLIbWFnKIgCedL3iRFi4+EbyWNxel8lFESMOTDZFfJG5yEiDJbgbLsUaT2GmrsOphwAG7zDcZzvYTdjg/lF4Wh0MUnQJ+0MhDpii8Ahjp49lAPdw8uRQyyY7d7ksYKXVIkbgl6dRCC5vZSPucJiFjq2BClqIoEmzZPvHveDbovzFkNhJX9tFLrHLcXbPPcegww1FGoQ3wBM6JwJ+TvSD6N4OdCmou05aDuuQeznHi3GxOScjGwxdMIU28fdJDCTDg2rOihm22kHVajo="
    - secure: "JpSv3+QRmHcfN/bmT3mVkqET44NCPhM/qpcUssCVXnd2GW0qWURoyPHzVMn/gbeAkUjR6djtN3OzJ+M181QmlmTmE26pZC9Q6r1buNDWdkIH1FcpMCa67BBAjmq+yDwulDtvCMv0lbz60v57lzHBOLczF3yMxBVTjXxt1RsrzDLHzzVaDR5lEe+sQUNeRL7Vaq8crimPNTr4ZhMe59eweTO/3AWovuSPf250k1flfv7I8audZgrVZdbVKvj5C3Sziy1AGXcu8mDfET9/Ya2XBCQHWODjiKlnhSxqthhP3gQuacaLjpS2FjvQlamd+I9x6BBoLSeNbiXD9vgCydDUKvmUrU+zQs64U1hHk9WZWVC19kG7lTtTdanGDIUlIUtFZgqE4AQpJaIUWkUmHGyHi61JMvduzX21eL5c5j9DoJteX42FPb1n3xK/JSnUkLMpbFdQuy5inhzefhDfeNzaYxt8nPwHnJqrF73SW4PLDKeRyzvg/P+zqcou8nXrHfA1z9/FlnYzf7Qc9meai9Q/JARX3Q1ZKu5uyG+RuBLe2POq0192w6pflTr1ZlLJsKNSc1147PviKfmpla1lg3/6uVzMp5tgwbve/hx9SDXiRueGttKw/ymsY662+8G24NRKo4fxNklWFHaB4owM84edDzXDckPXbPgue8/HQT8BFio="

matrix:
  fast_finish: true
  include:
    - os: linux
      sudo: required
      dist: trusty
      compiler: gcc
      env: X=rebuild-stubs
      addons: { apt: { packages: [ "g++-multilib", "lib32z1" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.4-m32
      addons: { apt: { sources: *S, packages: [ "g++-4.4-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.4-m64
      addons: { apt: { sources: *S, packages: [ "g++-4.4" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.5-m32
      addons: { apt: { sources: *S, packages: [ "g++-4.5-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.5-m64
      addons: { apt: { sources: *S, packages: [ "g++-4.5" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.6-m32
      addons: { apt: { packages: [ "g++-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.6-m64
    - os: linux
      compiler: gcc
      env: C=gcc-4.7-m32
      addons: { apt: { sources: *S, packages: [ "g++-4.7-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.7-m64
      addons: { apt: { sources: *S, packages: [ "g++-4.7" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.8-m32
      addons: { apt: { sources: *S, packages: [ "g++-4.8-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.8-m64
      addons: { apt: { sources: *S, packages: [ "g++-4.8" ] } }
    - os: linux
      sudo: required
      dist: trusty
      compiler: gcc
      env: C=gcc-4.8-mx32
      addons: { apt: { packages: [ "g++-multilib", "libx32stdc++-4.8-dev" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.9-m32
      addons: { apt: { sources: *S, packages: [ "g++-4.9-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-4.9-m64
      addons: { apt: { sources: *S, packages: [ "g++-4.9" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-5-m32
      addons: { apt: { sources: *S, packages: [ "g++-5-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-5-m64
      addons: { apt: { sources: *S, packages: [ "g++-5" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-6-m32
      addons: { apt: { sources: *S, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-6-m64
      addons: { apt: { sources: *S, packages: [ "g++-6" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-6-m32 B=debug
      addons: { apt: { sources: *S, packages: [ "g++-6-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-6-m64 B=debug
      addons: { apt: { sources: *S, packages: [ "g++-6" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-6-m64 B=debug+sanitize
      addons: { apt: { sources: *S, packages: [ "g++-6" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-6-m64 B=sanitize
      addons: { apt: { sources: *S, packages: [ "g++-6" ] } }
    - os: linux
      compiler: gcc
      env: C=gcc-6-m64 B=valgrind T=valgrind
      addons: { apt: { sources: *S, packages: [ "g++-6", valgrind ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.4-m32
      addons: { apt: { packages: [ "g++-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.4-m64
    - os: linux
      compiler: clang
      env: C=clang-3.5-m32
      addons: { apt: { sources: *S, packages: [ "clang-3.5", "g++-6-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.5-m64
      addons: { apt: { sources: *S, packages: [ "clang-3.5" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.6-m32
      addons: { apt: { sources: *S, packages: [ "clang-3.6", "g++-6-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.6-m64
      addons: { apt: { sources: *S, packages: [ "clang-3.6" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.7-m32
      addons: { apt: { sources: *S, packages: [ "clang-3.7", "g++-6-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.7-m64
      addons: { apt: { sources: *S, packages: [ "clang-3.7" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.8-m32
      addons: { apt: { sources: *S, packages: [ "clang-3.8", "g++-6-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.8-m64
      addons: { apt: { sources: *S, packages: [ "clang-3.8" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.9-m32
      addons: { apt: { sources: *S, packages: [ "clang-3.9", "g++-6-multilib", "zlib1g-dev:i386" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.9-m64
      addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.9-m64 B=debug+sanitize
      addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.9-m64 B=sanitize
      addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.9-m64 B=debug+scan-build
      addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } }
    - os: linux
      compiler: clang
      env: C=clang-3.9-m64 B=scan-build
      addons: { apt: { sources: *S, packages: [ "clang-3.9" ] } }
    - os: linux
      compiler: gcc
      env: CROSS=arm-linux-gnueabi C=gcc-4.6 T=SKIP
      addons: { apt: { packages: [ "g++-arm-linux-gnueabi", "qemu-user" ] } }
    - os: linux
      compiler: gcc
      env: CROSS=arm-linux-gnueabihf C=gcc-4.6 T=SKIP
      addons: { apt: { packages: [ "g++-arm-linux-gnueabihf", "qemu-user" ] } }
    - os: linux
      compiler: gcc
      env: CROSS=i386-w64-mingw32 C=gcc-4.6 T=wine
      addons: { apt: { packages: [ "binutils-mingw-w64-i686", "g++-mingw-w64-i686", "wine" ] } }
    - os: linux
      compiler: gcc
      env: CROSS=x86_64-w64-mingw32 C=gcc-4.6 T=wine
      addons: { apt: { packages: [ "binutils-mingw-w64-x86-64", "g++-mingw-w64-x86-64", "wine" ] } }
    - os: osx
      osx_image: xcode6.4
      compiler: clang
      # must use debug build or else we get "ld: internal error: atom not found" when linking
      env: C=clang-602-m32 B=debug
    - os: osx
      osx_image: xcode6.4
      compiler: clang
      # must use debug build or else we get "ld: internal error: atom not found" when linking
      env: C=clang-602-m64 B=debug
    - os: osx
      osx_image: xcode7.3
      compiler: clang
      env: C=clang-703-m32
    - os: osx
      osx_image: xcode7.3
      compiler: clang
      env: C=clang-703-m64
    - os: osx
      osx_image: xcode8.3
      compiler: clang
      env: C=clang-802-m32
    - os: osx
      osx_image: xcode8.3
      compiler: clang
      env: C=clang-802-m64

install:
  - uname -a; pwd; id; umask
  - cat /etc/os-release || true
  - |
    cd /
    if [[ $TRAVIS_OS_NAME == linux ]]; then
      if [[ $B =~ (^|\+)coverage($|\+) ]]; then
        travis_retry pip install --user cpp-coveralls
      fi
    fi
    if [[ $TRAVIS_OS_NAME == osx ]]; then
      if ! gsha256sum </bin/sh >/dev/null 2>/dev/null; then travis_retry brew install coreutils; fi
      if [[ $B =~ (^|\+)coverage($|\+) ]]; then
        travis_retry brew install lcov
        travis_retry pip install --user cpp-coveralls
      fi
    fi
  - git --version && bash --version
  - umask 022; cd $TRAVIS_BUILD_DIR && mkdir -p ../deps ../build/travis
  - cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx/releases/download/v3.00/ucl-1.03.tar.xz | tar -xJ
  - cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx/releases/download/v3.00/zlib-1.2.8.tar.xz | tar -xJ
  - cd ../deps && travis_retry git clone https://github.com/upx/upx-testsuite
  - |
    if [[ $X =~ (^|\+)rebuild-stubs($|\+) ]]; then
      cd ../deps && travis_retry wget -q -O - https://github.com/upx/upx-stubtools/releases/download/v20160918/bin-upx-20160918.tar.xz | tar -xJ
    fi

script:
  - success=1
  - cd $TRAVIS_BUILD_DIR || success=0
  - test $success = 0 || bash ./.github/travis_build.sh || success=0
  - test $success = 0 || bash ./.github/travis_testsuite_1.sh || success=0
  - test $success = 0 || bash ./.github/travis_deploy.sh || success=0
  - test $success = 1

# vim:set ts=2 sw=2 et:
