Merge branch 'osx-travis-homebrew' (#152, #249)

This commit is contained in:
Sebastian Pipping 2019-01-27 22:39:58 +01:00
commit 0e7efe2b01
4 changed files with 34 additions and 2 deletions

View file

@ -30,6 +30,10 @@
set -e
if [[ ${TRAVIS_OS_NAME} = osx ]]; then
export PATH="/usr/local/opt/coreutils/libexec/gnubin${PATH:+:}${PATH}"
fi
PS4='# '
set -x

View file

@ -2,6 +2,9 @@
# Licensed under the MIT license
language: cpp
os:
- linux
- osx
dist: trusty
# Unbreak clang address sanitizer, needs SYS_PTRACE
@ -22,7 +25,15 @@ env:
- MODE=distcheck
- MODE=lib-coverage
matrix:
exclude:
- os: osx
env: MODE=lib-coverage
addons:
homebrew:
update: true
brewfile: true
apt:
packages:
- cmake

12
Brewfile Normal file
View file

@ -0,0 +1,12 @@
brew "automake"
brew "autoconf"
brew "libtool"
brew "cmake"
brew "docbook2x"
brew "rpm"
brew "coreutils"
brew "ghostscript"
brew "gcc"
brew "m4"
brew "gettext"
brew "dos2unix"

View file

@ -16,6 +16,7 @@ set -o nounset
: ${MAKE:=make}
: ${BASE_COMPILE_FLAGS:="-pipe -Wall -Wextra -pedantic -Wno-overlength-strings -Wno-long-long"}
: ${BASE_LINK_FLAGS:=}
ANNOUNCE() {
local open='\e[1m'
@ -43,7 +44,9 @@ main() {
# http://clang.llvm.org/docs/AddressSanitizer.html
local CC="${CLANG_CC}"
local CXX="${CLANG_CXX}"
local LD="${CLANG_CXX}"
BASE_COMPILE_FLAGS+=" -g -fsanitize=address -fno-omit-frame-pointer"
BASE_LINK_FLAGS+=" -g -Wc,-fsanitize=address" # "-Wc," is for libtool
;;
coverage | lib-coverage | app-coverage)
local CC="${GCC_CC}"
@ -78,6 +81,7 @@ main() {
local CFLAGS="-std=c89 ${BASE_COMPILE_FLAGS} ${CFLAGS:-}"
local CXXFLAGS="-std=c++98 ${BASE_COMPILE_FLAGS} ${CXXFLAGS:-}"
local LDFLAGS="${BASE_LINK_FLAGS} ${LDFLAGS:-}"
(
set -e
@ -85,8 +89,9 @@ main() {
RUN CC="${CC}" CFLAGS="${CFLAGS}" \
CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
AR="${AR}" \
LD="${LD}" \
./configure "$@"
LD="${LD}" LDFLAGS="${LDFLAGS}" \
./configure "$@" \
|| { RUN cat config.log ; false ; }
RUN "${MAKE}" \
CFLAGS="${CFLAGS} -Werror" \