Commit 676335e0 authored by Marek Vavruša's avatar Marek Vavruša

travis: prepared for multi-os, clang

parent 64fedee8
language: c
os:
- linux
- osx
compiler:
- gcc
- clang
env:
global:
- PATH="${PATH}:${HOME}/.local/bin"
- PKG_CONFIG_PATH="${HOME}/fakeroot/lib/pkgconfig"
- LD_LIBRARY_PATH="${HOME}/fakeroot/lib"
- PKG_CONFIG_PATH="${HOME}/.local/lib/pkgconfig"
- LD_LIBRARY_PATH="${HOME}/.local/lib"
- CFLAGS="${CFLAGS} -O0 -g -DNDEBUG"
- MAKEOPTS="-j2"
before_script:
- ./scripts/bootstrap-depends.sh ${HOME}/fakeroot
- ./scripts/bootstrap-depends.sh ${HOME}/.local
- pip install --user travis -r tests/pydnstest/requirements.txt cpp-coveralls
script:
- make check COVERAGE=1 LDFLAGS="-L${HOME}/fakeroot/lib"
- make ${MAKEOPTS} check COVERAGE=1 LDFLAGS="-L${HOME}/.local/lib"
- coveralls -i lib -x ".c" --gcov-options '\-lp'
sudo: false
cache:
directories:
- ${HOME}/fakeroot
- ${HOME}/.local
- ${HOME}/.cache/pip
#!/bin/sh
#!/bin/bash
set -e
CMOCKA_TAG="cmocka-0.4.1"
PKG_CONFIG_PATH="${1}/lib/pkgconfig"
URCU_TAG="v0.8.6"
LIBUV_TAG="v1.3.0"
KNOT_TAG="master"
if [ -z ${1} ]; then
echo "$0 <fakeroot>"
exit 1
fi
install -d ${1}
# prepare build env
PREFIX=${1}; [ -z ${PREFIX} ] && PREFIX="${HOME}/.local"
PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
install -d ${PREFIX}/{lib,libexec,include,bin,sbin,man,share,etc,info,doc,var}
[ ! -d .depend ] && mkdir .depend; cd .depend
# lmdb
if [ ! -e ${1}/include/lmdb.h ]; then
if [ ! -e ${PREFIX}/include/lmdb.h ]; then
git clone https://gitorious.org/mdb/mdb.git || true
cd mdb/libraries/liblmdb
make
install -d ${1}/lib ${1}/include
install -t ${1}/lib liblmdb.so
install -t ${1}/include lmdb.h
install -d ${PREFIX}/man/man1
make ${MAKEOPTS} CC="${CC}" && make install DESTDIR=${PREFIX} prefix=
cd ../../..
fi
# liburcu
if [ ! -e ${1}/include/urcu.h ]; then
git clone git://git.urcu.so/userspace-rcu.git || true
if [ ! -e ${PREFIX}/include/urcu.h ]; then
git clone -b ${URCU_TAG} git://git.urcu.so/userspace-rcu.git || true
cd userspace-rcu
./bootstrap
./configure --prefix=${1}
make
make install
./configure --prefix=${PREFIX} --disable-dependency-tracking --disable-rpath
( make ${MAKEOPTS} ; make install ) || true
cd ..
fi
# libknot
if [ ! -e ${1}/include/libknot ]; then
git clone https://github.com/CZNIC-Labs/knot.git || true
if [ ! -e ${PREFIX}/include/libknot ]; then
git clone -b ${KNOT_TAG} https://github.com/CZNIC-Labs/knot.git || true
cd knot
autoreconf -i
./configure --prefix=${1}
make
make install
if [ $(uname) == "Darwin" ]; then # Workaround for crypto version check on OS X
export libcrypto_CFLAGS="-I /usr/local/opt/openssl/include"
export libcrypto_LIBS="-L/usr/local/opt/openssl/lib -lcrypto"
fi
./configure --prefix=${PREFIX} --disable-fastparser --disable-dependency-tracking
make ${MAKEOPTS} && make install
cd ..
fi
# cmocka
if [ ! -e ${1}/include/cmocka.h ]; then
wget http://git.cryptomilk.org/projects/cmocka.git/snapshot/${CMOCKA_TAG}.tar.gz
tar xvzf ${CMOCKA_TAG}.tar.gz
cd ${CMOCKA_TAG}
if [ ! -e ${PREFIX}/include/cmocka.h ]; then
git clone -b ${CMOCKA_TAG} git://git.cryptomilk.org/projects/cmocka.git
cd cmocka
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${1} ..
make
make install
cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} ..
make ${MAKEOPTS} && make install
cd ../..
fi
# libuv
if [ ! -e ${1}/include/uv.h ]; then
git clone -b v1.3.0 https://github.com/libuv/libuv.git || true
if [ ! -e ${PREFIX}/include/uv.h ]; then
git clone -b ${LIBUV_TAG} https://github.com/libuv/libuv.git || true
cd libuv
sh autogen.sh
./configure --prefix=${1}
make
make install
./configure --prefix=${PREFIX} --disable-dependency-tracking
make ${MAKEOPTS} && make install
fi
#!/usr/bin/python -Es
# vim: et:sw=4:ts=4:sts=4
#
# Script regenerates project file list from the list of files tracked by Git.
#
SOURCES = [
# documentation
"README", "KNOWN_ISSUES",
"Doxyfile*", "Doxy.file.h", "doc/*.rst",
# build-system
"*.ac", "*.am",
# sources
"lib/*.c", "lib/*.h", "lib/layer/*.h", "lib/layer/*.c",
"tests/*.c", "tests/*.h", "tests/*.py",
"daemon/*.c", "daemon/*.h", "daemon/layer/*.c", "daemon/layer/*.h"
]
OUTPUT_FILE = "knot-resolver.files"
# ----------------------------------------------------------------------------
from subprocess import Popen, PIPE
import os
import sys
def run(command):
p = Popen(command, stdout=PIPE, stderr=PIPE)
(out, errout) = p.communicate()
if p.returncode != 0:
raise Exception("Command %s failed.", command)
return out
print >>sys.stderr, "Updating %s." % OUTPUT_FILE
git_root = run(["git", "rev-parse", "--show-toplevel"]).strip()
os.chdir(git_root)
command = ["git", "ls-files"] + SOURCES
files = run(command).splitlines()
with open(OUTPUT_FILE, "w") as output:
output.write("\n".join(sorted(files)))
output.write("\n")
*.pyc
tmp*
test_cache
test_context
test_resolve
test_rplan
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment