language: c
os: linux
dist: xenial
addons:
  apt:
    packages:
      - xmlto
      - libxml2-dev
      - libnss3-tools
      - libproxy-dev
env:
  global:
    - MARGS="-j2 check"
matrix:
  include:
    - name: Disable-all
      env: CONF="--without-libproxy --without-gssapi --without-zlib --disable-nls --disable-debug --disable-webdav"
    - name: Static UBSan w/OpenSSL
      env: CONF="--enable-static --with-ssl=openssl" CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" LIBS=-lubsan NEON_LIBS=-lubsan
    - name: Static 32-bit w/OpenSSL
      env: CONF="--enable-static --with-ssl=openssl" CC='gcc -m32'
      addons:
        apt:
          packages:
            - libc6-dev-i386
            - gcc-multilib
            - libexpat1-dev:i386
            - libssl-dev:i386
            - lib32z1-dev
    - name: OpenSSL on arm64
      arch: arm64
      env: CONF="--with-ssl=openssl"
    - name: OpenSSL on s390x
      arch: s390x
      env: CONF="--with-ssl=openssl"
    - name: Copyright check
      env: CONF="--without-libproxy --without-gssapi --without-zlib --disable-nls --disable-debug --disable-webdav" MARGS="update-copyright"
  allow_failures:
    # s390x builds currently flaky
    - name: OpenSSL on s390x
      arch: s390x
      env: CONF="--with-ssl=openssl"

script: ./autogen.sh && ./configure --enable-warnings $CONF && make $MARGS
