summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/clang/llvm-project-source.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/clang/llvm-project-source.inc')
-rw-r--r--recipes-devtools/clang/llvm-project-source.inc31
1 files changed, 19 insertions, 12 deletions
diff --git a/recipes-devtools/clang/llvm-project-source.inc b/recipes-devtools/clang/llvm-project-source.inc
index c954f4e..8ccc4b1 100644
--- a/recipes-devtools/clang/llvm-project-source.inc
+++ b/recipes-devtools/clang/llvm-project-source.inc
@@ -19,19 +19,26 @@ INHIBIT_DEFAULT_DEPS = "1"
19DEPENDS = "" 19DEPENDS = ""
20PACKAGES = "" 20PACKAGES = ""
21 21
22# additional TARGET_VENDOR values we want to support 22# space separated list of additional distro vendor values we want to support e.g.
23# "yoe webos" or "-yoe -webos" '-' is optional
23CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR}" 24CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR}"
24 25
25add_more_target_vendors() { 26python add_distro_vendor() {
26 local cases="" triples="" 27 import subprocess
27 for dash_vendor in ${CLANG_EXTRA_OE_VENDORS}; do 28 case = ""
28 vendor=`echo $dash_vendor | sed 's/^-//g'` 29 triple = ""
29 cases="$cases.Case(\"$vendor\", Triple::OpenEmbedded)" 30 vendors = d.getVar('CLANG_EXTRA_OE_VENDORS')
30 triples="$triples\"x86_64-$vendor-linux\"," 31 for vendor in vendors.split():
31 done 32 # convert -yoe into yoe
32 bbnote "Adding support following TARGET_VENDOR values: ${CLANG_EXTRA_OE_VENDORS} in ${S}/llvm/lib/Support/Triple.cpp and ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" 33 vendor = vendor.lstrip('-')
33 sed "s#//CLANG_EXTRA_OE_VENDORS_CASES#$cases#g" -i ${S}/llvm/lib/Support/Triple.cpp 34 if vendor == "oe":
34 sed "s#//CLANG_EXTRA_OE_VENDORS_TRIPLES#$triples#g" -i ${S}/clang/lib/Driver/ToolChains/Gnu.cpp 35 continue
36 case += '\\n .Case("' + vendor + '", Triple::OpenEmbedded)'
37 triple += ' "x86_64-' + vendor + '-linux",'
38 cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_TRIPLES#%s#g' ${S}/clang/lib/Driver/ToolChains/Gnu.cpp" % (triple))
39 subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
40 cmd = d.expand("sed -i 's#//CLANG_EXTRA_OE_VENDORS_CASES#%s#g' -i ${S}/llvm/lib/Support/Triple.cpp" % (case))
41 subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
35} 42}
36 43
37do_patch[postfuncs] += "add_more_target_vendors" 44do_patch[postfuncs] += "add_distro_vendor"