summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2018-05-15 19:54:03 -0700
committerKhem Raj <raj.khem@gmail.com>2018-05-15 19:54:03 -0700
commit8c55c6713395a88aaa4f00ee65e3d0af23bab18c (patch)
tree82b2f95f9ba03093d330750374df914081ff3afd
parente92587be210e380bdd93c94689c43e0c5bdbe7de (diff)
downloadmeta-clang-8c55c6713395a88aaa4f00ee65e3d0af23bab18c.tar.gz
scan-build.bbclass: Do not depend on clang-native
- Dependency on clang-native causes circular dependency - Use spaces instead of tabs in shell functions - Convert do_configure_prepend into a prefunc, makes it work with non-shell do_configure - Use TARGET_CC_ARCH instead of HOST_CC_ARCH Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--classes/scan-build.bbclass40
1 files changed, 20 insertions, 20 deletions
diff --git a/classes/scan-build.bbclass b/classes/scan-build.bbclass
index 6948bde..4643635 100644
--- a/classes/scan-build.bbclass
+++ b/classes/scan-build.bbclass
@@ -1,10 +1,8 @@
1# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com> 1# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
2# Released under the MIT license (see COPYING.MIT for the terms) 2# Released under the MIT license (see COPYING.MIT for the terms)
3 3
4CFLAGS =+ "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 4CFLAGS =+ "${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
5CXXFLAGS =+ "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" 5CXXFLAGS =+ "${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS}"
6
7DEPENDS += "clang-native"
8 6
9#EXTRA_ANALYZER_OPTIONS ?= "-analyze-headers" 7#EXTRA_ANALYZER_OPTIONS ?= "-analyze-headers"
10CLANG_SCAN_ENABLED ??= "1" 8CLANG_SCAN_ENABLED ??= "1"
@@ -13,29 +11,31 @@ CLANG_SCAN_SERVER_IP ??= "10.0.0.10"
13CLANG_SCAN_PORT ??= "8181" 11CLANG_SCAN_PORT ??= "8181"
14SCAN_RESULTS_DIR ?= "${TMPDIR}/static-scan/${PN}" 12SCAN_RESULTS_DIR ?= "${TMPDIR}/static-scan/${PN}"
15 13
16do_configure_prepend() { 14scanbuild_munge_cc_cxx() {
17 cc="`echo ${CC} | cut -f1 -d " "`" 15 cc="`echo ${CC} | cut -f1 -d " "`"
18 cxx="`echo ${CXX} | cut -f1 -d " "`" 16 cxx="`echo ${CXX} | cut -f1 -d " "`"
19 export CC="${cc}" 17 export CC="${cc}"
20 export CXX="${cxx}" 18 export CXX="${cxx}"
21} 19}
22 20
21do_configure[prefuncs] += "scanbuild_munge_cc_cxx"
22
23do_buildscan() { 23do_buildscan() {
24 cc="`echo ${CC} | cut -f1 -d " "`" 24 cc="`echo ${CC} | cut -f1 -d " "`"
25 cxx="`echo ${CXX} | cut -f1 -d " "`" 25 cxx="`echo ${CXX} | cut -f1 -d " "`"
26# mk="scan-build --use-cc=${cc} --use-c++=${cxx} --analyzer-target=${HOST_SYS} --html-title="${BP}" -o ${SCAN_RESULTS_DIR} ${EXTRA_ANALYZER_OPTIONS} make" 26 #mk="scan-build --use-cc=${cc} --use-c++=${cxx} --analyzer-target=${HOST_SYS} --html-title="${BP}" -o ${SCAN_RESULTS_DIR} ${EXTRA_ANALYZER_OPTIONS} make"
27# export MAKE="${mk}" 27 #export MAKE="${mk}"
28 export CC="${cc}" 28 export CC="${cc}"
29 export CXX="${cxx}" 29 export CXX="${cxx}"
30 scan-build --use-cc=${cc} --use-c++=${cxx} --analyzer-target=${HOST_SYS} --html-title="${BP}" -o ${SCAN_RESULTS_DIR} ${EXTRA_ANALYZER_OPTIONS} ${MAKE} ${EXTRA_OEMAKE} "$@" -C ${S} 30 scan-build --use-cc=${cc} --use-c++=${cxx} --analyzer-target=${HOST_SYS} --html-title="${BP}" -o ${SCAN_RESULTS_DIR} ${EXTRA_ANALYZER_OPTIONS} ${MAKE} ${EXTRA_OEMAKE} "$@" -C ${S}
31} 31}
32 32
33do_viewscan() { 33do_viewscan() {
34 bbplain "================================================================" 34 bbplain "================================================================"
35 bbplain "Stating scan-view server at: http://${CLANG_SCAN_SERVER_IP}:${CLANG_SCAN_PORT}" 35 bbplain "Stating scan-view server at: http://${CLANG_SCAN_SERVER_IP}:${CLANG_SCAN_PORT}"
36 bbplain "Use Ctrl-C to exit" 36 bbplain "Use Ctrl-C to exit"
37 bbplain "================================================================" 37 bbplain "================================================================"
38 scan-view --host ${CLANG_SCAN_SERVER_IP} --port ${CLANG_SCAN_PORT} --allow-all-hosts ${SCAN_RESULTS_DIR}/*/ 38 scan-view --host ${CLANG_SCAN_SERVER_IP} --port ${CLANG_SCAN_PORT} --allow-all-hosts ${SCAN_RESULTS_DIR}/*/
39} 39}
40 40
41do_viewscan[depends] += "${PN}:do_buildscan" 41do_viewscan[depends] += "${PN}:do_buildscan"