source: rtems-testing/clang/do_clang @ 0a0993f

Last change on this file since 0a0993f was ef065c7, checked in by Joel Sherrill <joel.sherrill@…>, on May 15, 2012 at 9:07:33 PM

rtems-testing - Remove CVS Ids (manual edits)

  • Property mode set to 100755
File size: 1.9 KB
Line 
1#! /bin/sh
2#
3#  This script automates running clang-analyzer on RTEMS.
4#
5# NOTE:
6#    + clang/scan does not support -B option so no code which needs bsp.h
7#    + clang/scan has bug about embedded space in RHS of -D option.
8#
9
10#
11# TODO:
12#   + parse arguments for some of the hard-coded items.
13#   + better instructions on setup. Where to download, etc.
14#
15
16OUTPUTDIR=/home/joel/rtems-4.11-work/build/clang/output
17RTEMS_BIN=/opt/rtems-4.11/bin
18RTEMS_TARGET=sparc-rtems4.11
19RTEMS_BSP=sis
20#RTEMS_TARGET=i386-rtems4.11
21#RTEMS_BSP=pc386
22
23#
24#  Checks the status returned by executables and exits if it is non-zero.
25#
26check_fatal()
27{
28  if [ $1 -ne 0 ] ; then
29    shift
30    echo "ERROR: $*" >&2
31    exit 1
32  fi
33}
34
35type ${RTEMS_TARGET}-gcc
36check_fatal $? "gcc not in path"
37
38type scan-build >/dev/null 2>&1
39check_fatal $? "scan-build not in PATH"
40
41# How many jobs in parallel
42if [ -r /usr/bin/getconf ] ; then
43  cpus=`/usr/bin/getconf _NPROCESSORS_ONLN`
44  cpus=`expr ${cpus} + 1`
45else
46  cpus=2
47fi
48# Clean build directory and start over
49rm     -rf  b-clang-${RTEMS_TARGET}
50check_fatal $? "Could not remove build directory"
51mkdir  -p   b-clang-${RTEMS_TARGET}
52check_fatal $? "Could not make build directory"
53cd          b-clang-${RTEMS_TARGET}
54check_fatal $? "Could not cd to build directory"
55
56# Configure RTEMS
57#$r/configure --target=${RTEMS_TARGET} --enable-multilib \
58#  --disable-networking --disable-itron --disable-tests \
59#  --enable-rtemsbsp=${RTEMS_BSP} >c.log 2>&1
60$r/configure --target=${RTEMS_TARGET} --disable-multilib \
61  --disable-networking --disable-itron --disable-tests \
62  --enable-rtemsbsp=${RTEMS_BSP} >c.log 2>&1
63check_fatal $? "could not configure RTEMS"
64
65# Build RTEMS
66BASE=`pwd`
67#cd ${RTEMS_TARGET}/cpukit
68#check_fatal $? "could not cd ${RTEMS_TARGET}/cpukit"
69
70scan-build -o ${OUTPUTDIR} --experimental-checks \
71  --use-cc ${RTEMS_TARGET}-gcc \
72  --use-c++ ${RTEMS_TARGET}-g++ \
73  make -j${cpus} >${BASE}/b.log 2>&1
74check_fatal $? "could not make RTEMS"
75
76# Ran completed OK
77exit 0
Note: See TracBrowser for help on using the repository browser.