X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Fcommon%2Fscan-build.sh;h=3782f4f32034c8118dd12e50b7999c31ebeef57a;hb=942c30466ead5ae90452bc97d61c5d761b2ad16e;hp=3b14ea7805f5aa8737f4c5d0d6928871cc25347e;hpb=fa43a231fd428b7bcfcb4c27801d53eff04fd074;p=lttng-ci.git diff --git a/scripts/common/scan-build.sh b/scripts/common/scan-build.sh index 3b14ea7..3782f4f 100755 --- a/scripts/common/scan-build.sh +++ b/scripts/common/scan-build.sh @@ -16,9 +16,19 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Required variables +WORKSPACE=${WORKSPACE:-} -# do not exit immediately if any command fails -set +e +DEPS_INC="$WORKSPACE/deps/build/include" +DEPS_LIB="$WORKSPACE/deps/build/lib" +DEPS_PKGCONFIG="$DEPS_LIB/pkgconfig" +DEPS_BIN="$WORKSPACE/deps/build/bin" + +export PATH="$DEPS_BIN:$PATH" +export LD_LIBRARY_PATH="$DEPS_LIB:${LD_LIBRARY_PATH:-}" +export PKG_CONFIG_PATH="$DEPS_PKGCONFIG" +export CPPFLAGS="-I$DEPS_INC" +export LDFLAGS="-L$DEPS_LIB" SRCDIR="$WORKSPACE/src/$PROJECT_NAME" TMPDIR="$WORKSPACE/tmp" @@ -36,7 +46,7 @@ mkdir -p "$TMPDIR" export TMPDIR # temp directory to store the scan-build report -SCAN_BUILD_TMPDIR=$( mktemp -d ) +SCAN_BUILD_TMPDIR=$(mktemp -d) case "$PROJECT_NAME" in babeltrace) @@ -74,27 +84,6 @@ linux-rseq) ;; esac -# liburcu dependency -if [ -d "$WORKSPACE/deps/liburcu" ]; then - URCU_INCS="$WORKSPACE/deps/liburcu/build/include/" - URCU_LIBS="$WORKSPACE/deps/liburcu/build/lib/" - - export CPPFLAGS="-I$URCU_INCS ${CPPFLAGS:-}" - export LDFLAGS="-L$URCU_LIBS ${LDFLAGS:-}" - export LD_LIBRARY_PATH="$URCU_LIBS:${LD_LIBRARY_PATH:-}" -fi - - -# lttng-ust dependency -if [ -d "$WORKSPACE/deps/lttng-ust" ]; then - UST_INCS="$WORKSPACE/deps/lttng-ust/build/include/" - UST_LIBS="$WORKSPACE/deps/lttng-ust/build/lib/" - - export CPPFLAGS="-I$UST_INCS ${CPPFLAGS:-}" - export LDFLAGS="-L$UST_LIBS ${LDFLAGS:-}" - export LD_LIBRARY_PATH="$UST_LIBS:${LD_LIBRARY_PATH:-}" -fi - if [ -d "$WORKSPACE/src/linux" ]; then export KERNELDIR="$WORKSPACE/src/linux" fi @@ -103,7 +92,6 @@ fi cd "$SRCDIR" # Build -echo -e "\033[33;1mRunning Coverity Scan Analysis Tool...\033[0m" case "$BUILD_TYPE" in autotools) # Prepare build dir for autotools based projects