sudo: false

language: c

os:
  - linux
  - osx

compiler:
  - gcc
  - clang

env:
  - CONFIGURE_OPTIONS='--with-threads=pthread'
  - CONFIGURE_OPTIONS='--with-threads=fork'
  - CONFIGURE_OPTIONS='--with-threads=ucontext'
  - CONFIGURE_OPTIONS='--disable-ipv6 --disable-fips --disable-systemd --disable-libwrap'

addons:
  apt:
    packages:
    - autoconf-archive
    - libssl-dev
    - libwrap0-dev
    - nmap

before_script:
  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; brew install openssl autoconf-archive nmap expect; fi; true
  - autoreconf -fvi && touch src/dhparam.c

script:
  - ./configure $CONFIGURE_OPTIONS
  - make
  - make test || ( for FILE in tests/logs/*.log; do echo "*** $FILE ***"; cat "$FILE"; done; false )
