summaryrefslogtreecommitdiff
path: root/.ci/osx-build.sh
blob: f8facebeb0213449267da658e9af05aff8bb846c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

set -o errexit

CFLAGS="-Werror $CFLAGS"
EXTRA_OPTS=""

on_exit() {
    if [ $? = 0 ]; then
        exit
    fi
    FILES_TO_PRINT="config.log"
    FILES_TO_PRINT="$FILES_TO_PRINT */_build/sub/tests/testsuite.log"

    for pr_file in $FILES_TO_PRINT; do
        cat "$pr_file" 2>/dev/null
    done
}
# We capture the error logs as artifacts in Github Actions, no need to dump
# them via a EXIT handler.
[ -n "$GITHUB_WORKFLOW" ] || trap on_exit EXIT

function configure_ovs()
{
    ./boot.sh && ./configure $*
}

configure_ovs $EXTRA_OPTS $*

if [ "$CC" = "clang" ]; then
    make CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument"
else
    make CFLAGS="$CFLAGS $BUILD_ENV"
fi

if [ "$TESTSUITE" ] && [ "$CC" != "clang" ]; then
    make distcheck RECHECK=yes
fi

exit 0