diff options
Diffstat (limited to 'recipes-devtools/clang/clang.inc')
-rw-r--r-- | recipes-devtools/clang/clang.inc | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc new file mode 100644 index 0000000..c4b58fc --- /dev/null +++ b/recipes-devtools/clang/clang.inc | |||
@@ -0,0 +1,58 @@ | |||
1 | # LLVM does not provide ABI stability between different versions. For this | ||
2 | # reason OE makes it possible to build and install different llvm versions | ||
3 | # at the same time. | ||
4 | # | ||
5 | # This is true for the normal recipes as well as the native ones. | ||
6 | # | ||
7 | # All regular installation directories are prefixed with 'llvm${LLVM_RELEASE}' | ||
8 | # e.g. "${STAGING_BINDIR}/llvm2.5" or "${STAGING_INCDIR}/llvm2.5" | ||
9 | # | ||
10 | # For your program or library that makes use of llvm you do should not need to | ||
11 | # modify anything as long as it uses the results of various llvm-config | ||
12 | # invocations. If you need customizations something is wrong and it needs to be | ||
13 | # fixed (report bug). | ||
14 | # | ||
15 | # However the *recipe* for your program/library *must* declare | ||
16 | # export WANT_LLVM_RELEASE = "<valid version number>" | ||
17 | # The version number is picked up by a generic wrapper script which just calls | ||
18 | # the variant of the specified version. | ||
19 | |||
20 | DEPENDS = "libffi libxml2-native llvm-native zlib" | ||
21 | |||
22 | inherit perlnative pythonnative cmake | ||
23 | |||
24 | |||
25 | EXTRA_OECMAKE="-DLLVM_ENABLE_RTTI=True \ | ||
26 | -DLLVM_ENABLE_FFI=False \ | ||
27 | -DCMAKE_SYSTEM_NAME=Linux \ | ||
28 | " | ||
29 | |||
30 | EXTRA_OECMAKE_append_class-native = "\ | ||
31 | -DLLVM_TARGETS_TO_BUILD=host \ | ||
32 | -DCMAKE_BUILD_TYPE=Release \ | ||
33 | -DCMAKE_INSTALL_PREFIX=${prefix} \ | ||
34 | " | ||
35 | EXTRA_OECMAKE_append_class-target = "\ | ||
36 | -DCMAKE_CROSSCOMPILING=True \ | ||
37 | " | ||
38 | EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1" | ||
39 | |||
40 | do_configure() { | ||
41 | # Remove RPATHs | ||
42 | sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' ${S}/Makefile.rules | ||
43 | # Drop "svn" suffix from version string | ||
44 | sed -i 's/${PV}svn/${PV}/g' ${S}/configure | ||
45 | |||
46 | # Fix paths in llvm-config | ||
47 | sed -i "s|sys::path::parent_path(CurrentPath))\.str()|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|g" ${S}/tools/llvm-config/llvm-config.cpp | ||
48 | sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" ${S}/tools/llvm-config/llvm-config.cpp | ||
49 | cmake ${S} | ||
50 | } | ||
51 | |||
52 | do_compile_class-native () { | ||
53 | oe_runmake | ||
54 | } | ||
55 | |||
56 | do_install_class-native () { | ||
57 | oe_runmake install DESTDIR=${D} | ||
58 | } | ||