language: c
compiler:
    - gcc
    - clang
matrix:
    include:
        - compiler: gcc
          env: ANDROID_TOOLCHAIN=/tmp/toolchains/arm
before_install:
    - if [ -z "$ANDROID_TOOLCHAIN" ]; then sudo apt-get update -qq; fi
    - if [ -z "$ANDROID_TOOLCHAIN" ]; then sudo apt-get install -qq libexpat1-dev libssl-dev libev-dev uuid-dev; fi
    - if [ -n "$ANDROID_TOOLCHAIN" ]; then curl http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2 | tar xjf -; fi
    - if [ -n "$ANDROID_TOOLCHAIN" ]; then mv android-ndk-r8e android-ndk; fi
    - if [ -n "$ANDROID_TOOLCHAIN" ]; then cd android-ndk; build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=arm-linux-androideabi-4.6 --arch=arm --system=linux-x86 --install-dir=/tmp/toolchains/arm; fi
script:
    - if [ -n "$ANDROID_TOOLCHAIN" ]; then ./build_android.sh; else ./waf configure build test; fi

language: c
compiler:
    - gcc
    - clang
matrix:
    include:
        - compiler: gcc
          env: ANDROID_TOOLCHAIN=/tmp/toolchains/arm
before_install:
    - if [ -z "$ANDROID_TOOLCHAIN" ]; then sudo apt-get update -qq; fi
    - if [ -z "$ANDROID_TOOLCHAIN" ]; then sudo apt-get install -qq libexpat1-dev libssl-dev libev-dev uuid-dev; fi
    - if [ -n "$ANDROID_TOOLCHAIN" ]; then curl http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2 | tar xjf -; fi
    - if [ -n "$ANDROID_TOOLCHAIN" ]; then mv android-ndk-r8e android-ndk; fi
    - if [ -n "$ANDROID_TOOLCHAIN" ]; then pushd android-ndk; build/tools/make-standalone-toolchain.sh --platform=android-9 --toolchain=arm-linux-androideabi-4.6 --arch=arm --system=linux-x86 --install-dir=/tmp/toolchains/arm; popd; fi
script:
    - if [ -n "$ANDROID_TOOLCHAIN" ]; then ./build_android.sh; else ./waf configure build test; fi

Return to the correct directory after building toolchain.
Travis: Return to the correct directory after building toolchain.
