diff options
Diffstat (limited to 'classes/clang.bbclass')
-rw-r--r-- | classes/clang.bbclass | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/classes/clang.bbclass b/classes/clang.bbclass index f6cb648..b560289 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass | |||
@@ -1,10 +1,41 @@ | |||
1 | |||
2 | # Add the necessary override | 1 | # Add the necessary override |
3 | TOOLCHAINOVERRIDES = ":toolchain-${TOOLCHAIN}" | 2 | CC_toolchain-clang = "${TARGET_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
4 | TOOLCHAINOVERRIDES[vardepsexclude] = "TOOLCHAIN" | 3 | CXX_toolchain-clang = "${TARGET_PREFIX}clang++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" |
4 | CPP_toolchain-clang = "${TARGET_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} -E" | ||
5 | CCLD_toolchain-clang = "${TARGET_PREFIX}clang ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" | ||
6 | THUMB_TUNE_CCARGS_remove_toolchain-clang = "-mthumb-interwork" | ||
7 | TUNE_CCARGS_append_toolchain-clang = " -D__extern_always_inline=inline -no-integrated-as" | ||
8 | |||
9 | TOOLCHAIN_OPTIONS_append_toolchain-clang_class-nativesdk_x86-64 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux-x86-64.so.2" | ||
10 | TOOLCHAIN_OPTIONS_append_toolchain-clang_class-nativesdk_x86 = " -Wl,-dynamic-linker,${base_libdir}/ld-linux.so.2" | ||
11 | |||
12 | # choose between 'gcc' 'clang' an empty '' can be used as well | ||
13 | TOOLCHAIN ??= "clang" | ||
14 | |||
15 | TOOLCHAIN_class-native = "gcc" | ||
16 | |||
17 | OVERRIDES .= "${@['', ':toolchain-${TOOLCHAIN}']['${TOOLCHAIN}' != '']}" | ||
18 | OVERRIDES[vardepsexclude] += "TOOLCHAIN" | ||
19 | |||
20 | #DEPENDS_append_toolchain-clang_class-target = " clang-cross-${TARGET_ARCH} " | ||
21 | #DEPENDS_remove_toolchain-clang_allarch = "clang-cross-${TARGET_ARCH}" | ||
22 | |||
23 | def clang_dep_prepend(d): | ||
24 | # | ||
25 | # Ideally this will check a flag so we will operate properly in | ||
26 | # the case where host == build == target, for now we don't work in | ||
27 | # that case though. | ||
28 | # | ||
5 | 29 | ||
6 | OVERRIDES .= "${TOOLCHAINOVERRIDES}" | 30 | deps = "" |
7 | OVERRIDES[vardepsexclude] += "TOOLCHAINOVERRIDES" | 31 | # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not |
32 | # we need that built is the responsibility of the patch function / class, not | ||
33 | # the application. | ||
34 | if not d.getVar('INHIBIT_DEFAULT_DEPS', False): | ||
35 | if not oe.utils.inherits(d, 'allarch'): | ||
36 | deps += " clang-cross-${TARGET_ARCH} " | ||
37 | return deps | ||
8 | 38 | ||
9 | require conf/clang.conf | 39 | CLANGDEPENDS = "${@clang_dep_prepend(d)}" |
10 | 40 | ||
41 | DEPENDS_prepend_toolchain-clang_class-target = "${CLANGDEPENDS} " | ||