X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=scripts%2Fcommon%2Fscan-build.sh;h=7a703e1cf52de529402cd00e8e7e4b11480adf40;hb=4d27af8f99434c6dcadf1d22430d4e8a27b8bee2;hp=f0819bee5e1e53583274281c761623f3ee131a5b;hpb=ae3ca8a0e72315a894909240d775887ee2fc83c2;p=lttng-ci.git diff --git a/scripts/common/scan-build.sh b/scripts/common/scan-build.sh index f0819be..7a703e1 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" @@ -35,12 +45,18 @@ mkdir -p "$TMPDIR" export TMPDIR +# Builds configured with '-Werror=missing-include-dirs' if this directory +# doesn't exist +mkdir -p "$DEPS_INC" + # temp directory to store the scan-build report -SCAN_BUILD_TMPDIR=$( mktemp -d ) +SCAN_BUILD_TMPDIR=$(mktemp -d) case "$PROJECT_NAME" in babeltrace) export BABELTRACE_DEV_MODE=1 + export BABELTRACE_DEBUG_MODE=1 + export BABELTRACE_MINIMAL_LOG_LEVEL=TRACE CONF_OPTS="--enable-python-bindings --enable-python-bindings-doc --enable-python-plugins" BUILD_TYPE="autotools" ;; @@ -72,27 +88,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 @@ -101,7 +96,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