File: do-scan-build

package info (click to toggle)
yadifa 3.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 16,392 kB
  • sloc: ansic: 254,102; makefile: 1,409; pascal: 971; sh: 706
file content (71 lines) | stat: -rwxr-xr-x 1,262 bytes parent folder | download
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh

# sometimes it's scan-build-XXX

SB="$SCANBUILD"
SB_HI=17
SB_LO=9

if [ "x$SB" = "x" ]; then
scan_build_ver=''
for ver in $(seq $SB_HI -1 $SB_LO); do scan_build_ver="scan-build-$ver $scan_build_ver"; done
for NAME in scan-build $scan_build_ver
do
    SBPATH=$(which "$NAME" 2> /dev/null)
    if [ ! "x$SBPATH" = "x" ]
    then
        if [ -x "$SBPATH" ]
        then
#				echo "$NAME => '$SBPATH' : found"
            SB="$SBPATH"
            break;
        fi
    fi

#		echo "$NAME => '$SBPATH' : not found"
done
fi

if [ ! -f "$SB" ]
then
    SB=""
fi

if [ "x$SB" = "x" ]
then
	echo "no scan-build executable has been found"
	echo "install it or set the SCANBUILD environment variable to set your own e.g. SCANBUILD=/usr/local/bin/scan-build-99 ./do-scan-build $*"
	exit 1
fi

echo "using scanbuild: '$SB'"

YDF=$(dirname $0)
echo "YADIFA source code: $YDF"

TS=$(date +'%s%N')

TARGET=/tmp
SRC=$TARGET/yadifa-trunk-$TS
BLD=$TARGET/yadifa-trunk-build-$TS

mkdir -p $TARGET
rm -rf "$SRC"
rm -rf "$BLD"
mkdir -p "$BLD"

echo "copying to $SRC"

cp -a "$YDF" "$SRC"

echo "autogen"

cd "$SRC"
./autogen.sh

echo "building in $BLD"

cd "$BLD"
"$SRC/configure" --disable-zalloc --without-tests CFLAGS='-O0 -g3 -DDEBUG=1' $*
$SB -maxloop 10 make -j 16