summaryrefslogtreecommitdiffstats
path: root/contrib/jenkins_common.sh
blob: bc4ac65b695ca2bc4a859f7e02f8d7f8afc1e39b (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
#!/bin/sh

set -ex

if [ -z "$MAKE" ]; then
    set +x
    echo "Error: you need to set \$MAKE before invoking, e.g. MAKE=make"
    exit 1
fi

verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")

prep_build() {
    _src_dir="$1"
    _build_dir="$2"

    cd "$_src_dir"

    # a failed 'make distcheck' may leave files without write permissions
    chmod -R a+w .
    git clean -dxf
    # make absolutely sure no src files have modifications
    git checkout -f HEAD

    autoreconf --install --force

    mkdir -p "$_build_dir"
    cd "$_build_dir"
}