File: build.sh

package info (click to toggle)
sip-tester 1%3A3.7.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,932 kB
  • sloc: cpp: 29,383; xml: 13,436; ansic: 2,381; python: 2,218; sh: 505; makefile: 13
file content (44 lines) | stat: -rwxr-xr-x 1,268 bytes parent folder | download | duplicates (2)
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
41
42
43
44
#!/bin/sh

set -e  # abort on error

SRC_DIR=$(dirname "$0")

if test -z "$*"; then
    echo "build.sh: Please specify configure options," \
        "--none for defaults, or --full for all" >&2
    exit 1
elif test "$*" = "--help" || test "$*" = "-h"; then
    echo "build.sh: Please specify configure options," \
        "--none for defaults, or --full for all" >&2
    exit 1
fi

if test "$*" = "--none"; then
    cmake $SRC_DIR -DUSE_GSL=0 -DUSE_SSL=0 -DUSE_SCTP=0 -DUSE_PCAP=0
elif test "$*" = "--common"; then
    cmake $SRC_DIR -DUSE_GSL=1 -DUSE_PCAP=1 -DUSE_SSL=0 -DUSE_SCTP=0
elif test "$*" = "--full"; then
    cmake $SRC_DIR -DUSE_GSL=1 -DUSE_PCAP=1 -DUSE_SSL=1 -DUSE_SCTP=1
else
    # Debug build? Add -DDEBUG=1
    # Adjusted SIP max size? Add -DSIPP_MAX_MSG_SIZE=262144
    cmake $SRC_DIR "$@"
fi

if test -f build.ninja; then
    MAKE=ninja
else
    MAKE=`which gmake make 2>/dev/null | head -n1`  # prefer GNU make
    test -z "$MAKE" && echo "No (g)make found" >&2 && exit 1
    CPUCOUNT=$(nproc --all 2>/dev/null || echo 1)
    MAKEFLAGS="-j$CPUCOUNT"
fi
# For git checkout, run unit tests.
if test -e $SRC_DIR/gtest/.git; then
	"$MAKE" $MAKEFLAGS sipp_unittest
	./sipp_unittest
fi

# You want verbose or NOISY_BUILD? Use VERBOSE=1
"$MAKE" $MAKEFLAGS