summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/devtool-clang.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/scripts/devtool-clang.sh b/scripts/devtool-clang.sh
new file mode 100755
index 0000000..08f9214
--- /dev/null
+++ b/scripts/devtool-clang.sh
@@ -0,0 +1,41 @@
1#!/usr/bin/env sh
2# Clone the repository first if not already done locally
3# git clone https://github.com/kraj/llvm-project -b oe/main /mnt/b/yoe/master/workspace/sources/llvm-project
4#
5# if local repository exists then make a clone/copy
6# git clone /home/kraj/work/llvm-project /mnt/b/yoe/master/workspace/sources/llvm-project
7#
8layerloc="$(dirname "$0")/../conf/layer.conf"
9workspace="$(dirname "$0")/../../../workspace"
10
11origver=$(grep "LLVMVERSION =" < "$layerloc" | awk '{print $3}' | tr -d '"')
12
13major=$(grep -e "set(LLVM_VERSION_MAJOR [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//")
14minor=$(grep -e "set(LLVM_VERSION_MINOR [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//")
15patch=$(grep -e "set(LLVM_VERSION_PATCH [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//")
16
17recipes="\
18llvm-project-source-$origver \
19clang \
20clang-cross-riscv64 \
21clang-crosssdk-x86_64 \
22clang-cross-canadian-riscv64 \
23nativesdk-clang-glue \
24compiler-rt \
25compiler-rt-sanitizers \
26libclc \
27libcxx \
28openmp \
29"
30
31for recipe in $recipes; do
32 devtool modify -n "$recipe" "$workspace/sources/llvm-project"
33 sed -i "/pn-$recipe /p;s/pn-$recipe /pn-nativesdk-$recipe /g" "$workspace"/appends/"$recipe"*.bbappend
34 sed -i "/pn-$recipe /p;s/pn-$recipe /pn-$recipe-native /g" "$workspace"/appends/"$recipe"*.bbappend
35done
36
37for f in "$workspace"/appends/*.bbappend; do
38 { echo "MAJOR_VER = \"$major\"" ; echo "MINOR_VER = \"$minor\"" ; echo "PATCH_VER = \"$patch\"" ; } >> "$f"
39done
40
41sed -i -e "s/$origver/$major.$minor.$patch/g" "$workspace"/appends/llvm-project-source.bbappend