travis-ci/osx: install gcc and fix CC

Since there is no gcc in osx_image [1]:
    ls: /usr/local/bin/gcc-?.?: No such file or directory

  [1]: https://travis-ci.org/libevent/libevent/jobs/484794192#L95

And use ls(1) over echo(1) to show an error if there is no such file.
This commit is contained in:
Azat Khuzhin 2019-01-28 20:30:57 +03:00
parent 4ffc711617
commit 9432fa2ec6
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -50,7 +50,7 @@ before_install:
- export TIMEOUT=50
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
if [ "$CC" == "gcc" ]; then
export CC=$(ls -t /usr/local/bin/gcc-?.?);
export CC=$(ls /usr/local/Cellar/gcc/*/bin/gcc-?);
fi
export OPENSSL_ROOT=$(echo /usr/local/Cellar/openssl/*);
@ -82,6 +82,7 @@ addons:
- openssl
- lcov
- libtool
- gcc
script: