diff options
author | Martin Jansa <Martin.Jansa@gmail.com> | 2013-06-29 22:54:52 +0200 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2013-07-12 12:06:00 +0200 |
commit | 71e91988bba3e81c53ece72c00f23106b68dc408 (patch) | |
tree | 1d12ecb89c5668f78c8af9a3d281d2bcd60ab1b5 /meta-oe/recipes-core | |
parent | a8e0bfb91214f1f387b781b89340eee582496c01 (diff) | |
download | meta-openembedded-71e91988bba3e81c53ece72c00f23106b68dc408.tar.gz |
llvm: Consolidate .inc files
* unlike other recipes where we have a rule to keep only one
version, llvm is different so we'll keep .inc files
* llvm.inc is shared by all, llvm[23].inc are separated because
2.* is built with cmake and 3.* with automake
* fix staticdev packaging and move it to shared llvm.inc
FILES_${PN}-static-dev = "${libdir}/${LLVM_DIR}/*.a"
(it's staticdev not static-dev)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-core')
-rw-r--r-- | meta-oe/recipes-core/llvm/llvm.inc | 210 | ||||
-rw-r--r-- | meta-oe/recipes-core/llvm/llvm2.8_2.8.bb | 9 | ||||
-rw-r--r-- | meta-oe/recipes-core/llvm/llvm2.9_2.9.bb | 30 | ||||
-rw-r--r-- | meta-oe/recipes-core/llvm/llvm2.inc | 194 | ||||
-rw-r--r-- | meta-oe/recipes-core/llvm/llvm3.2_3.2.bb | 104 | ||||
-rw-r--r-- | meta-oe/recipes-core/llvm/llvm3.3_3.3.bb | 100 | ||||
-rw-r--r-- | meta-oe/recipes-core/llvm/llvm3.inc | 84 |
7 files changed, 303 insertions, 428 deletions
diff --git a/meta-oe/recipes-core/llvm/llvm.inc b/meta-oe/recipes-core/llvm/llvm.inc index fcd26668b..20588f3f3 100644 --- a/meta-oe/recipes-core/llvm/llvm.inc +++ b/meta-oe/recipes-core/llvm/llvm.inc | |||
@@ -19,208 +19,24 @@ | |||
19 | 19 | ||
20 | DESCRIPTION = "The Low Level Virtual Machine" | 20 | DESCRIPTION = "The Low Level Virtual Machine" |
21 | HOMEPAGE = "http://llvm.org" | 21 | HOMEPAGE = "http://llvm.org" |
22 | |||
22 | # 3-clause BSD-like | 23 | # 3-clause BSD-like |
24 | # University of Illinois/NCSA Open Source License | ||
23 | LICENSE = "NCSA" | 25 | LICENSE = "NCSA" |
24 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=0ac5f799a2d89477c75b0a378b221855" | 26 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=d0a3ef0d3e0e8f5cf59e5ffc273ab1f8" |
25 | |||
26 | DEPENDS = "llvm${LLVM_RELEASE}-native llvm-common" | ||
27 | DEPENDS_virtclass-native = "llvm-common-native cmake-native" | ||
28 | |||
29 | INC_PR = "r2" | ||
30 | |||
31 | SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.tgz" | ||
32 | |||
33 | S = "${WORKDIR}/llvm-${PV}" | ||
34 | |||
35 | inherit cmake perlnative pythonnative | ||
36 | 27 | ||
37 | # Defines the LLVM supported arches. By now we always build either for ${BUILD} | 28 | # 2.* inherits also cmake |
38 | # (native) or ${TARGET}. In the future it may make sense to enable all backends | 29 | # 3.* inherits also automake |
39 | # for the non-native build. The decision which backends are used is made by | 30 | inherit perlnative pythonnative |
40 | # the 3rd party program or library that uses llvm anyway. | ||
41 | LLVM_ARCH = "${@get_llvm_arch(d)}" | ||
42 | 31 | ||
43 | # This is used for generating the install directory for the llvm libraries, | ||
44 | # binaries and headers. It makes side by side installation of those possible. | ||
45 | LLVM_RELEASE = "${PV}" | 32 | LLVM_RELEASE = "${PV}" |
33 | LLVM_DIR = "llvm${LLVM_RELEASE}" | ||
46 | 34 | ||
47 | # llvm *must* be built out of tree | 35 | FILES_${PN}-dbg += "${bindir}/${LLVM_DIR}/.debug \ |
48 | OECMAKE_SOURCEPATH = ".." | 36 | ${libdir}/${LLVM_DIR}/.debug \ |
49 | OECMAKE_BUILDPATH = "build" | ||
50 | EXTRA_OECMAKE = "\ | ||
51 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm${LLVM_RELEASE}/tblgen \ | ||
52 | -DLLVM_TARGETS_TO_BUILD=${LLVM_ARCH} \ | ||
53 | -DCMAKE_LINKER:FILEPATH=${LD} \ | ||
54 | -DCMAKE_AR:FILEPATH=${AR} \ | ||
55 | -DCMAKE_OBJCOPY:FILEPATH=${OBJCOPY} \ | ||
56 | -DCMAKE_OBJDUMP:FILEPATH=${OBJDUMP} \ | ||
57 | -DCMAKE_RANLIB:FILEPATH=${RANLIB} \ | ||
58 | -DCMAKE_STRIP:FILEPATH=${STRIP} \ | ||
59 | -DNM_PATH:FILEPATH=${NM} \ | ||
60 | -DLLVM_ENABLE_PIC:BOOL=ON \ | ||
61 | -DLLVM_TARGET_ARCH:STRING=${LLVM_ARCH} \ | ||
62 | -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \ | ||
63 | -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ | ||
64 | -DBUILD_SHARED_LIBS:BOOL=ON \ | ||
65 | -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \ | ||
66 | " | 37 | " |
67 | # We need to reset this to avoid breakage as we build out of tree | 38 | FILES_${PN}-dev += "${bindir} \ |
68 | TOOLCHAIN_OPTIONS = "" | 39 | ${libdir}/${LLVM_DIR}/BugpointPasses.so \ |
69 | 40 | ${libdir}/${LLVM_DIR}/LLVMHello.so \ | |
70 | PACKAGES_DYNAMIC = "llvm-*" | ||
71 | |||
72 | # the difference to the non-native build is that we do not need | ||
73 | # to declare the location of the tblgen executable. | ||
74 | EXTRA_OECMAKE_virtclass-native = "\ | ||
75 | -DLLVM_TARGETS_TO_BUILD=${LLVM_ARCH} \ | ||
76 | -DCMAKE_LINKER:FILEPATH=${LD} \ | ||
77 | -DCMAKE_AR:FILEPATH=${AR} \ | ||
78 | -DCMAKE_OBJCOPY:FILEPATH=${OBJCOPY} \ | ||
79 | -DCMAKE_OBJDUMP:FILEPATH=${OBJDUMP} \ | ||
80 | -DCMAKE_RANLIB:FILEPATH=${RANLIB} \ | ||
81 | -DCMAKE_STRIP:FILEPATH=${STRIP} \ | ||
82 | -DNM_PATH:FILEPATH=${NM} \ | ||
83 | " | 41 | " |
84 | 42 | FILES_${PN}-staticdev = "${libdir}/${LLVM_DIR}/*.a" | |
85 | PACKAGES_virtclass-native = "" | ||
86 | |||
87 | PACKAGES_DYNAMIC_virtclass-native = "" | ||
88 | |||
89 | python populate_packages_prepend () { | ||
90 | libllvm_libdir = bb.data.expand('${libdir}/llvm${LLVM_RELEASE}', d) | ||
91 | do_split_packages(d, libllvm_libdir, '^lib(.*)\.so$', 'libllvm-%s', 'Split package for %s', allow_dirs=True) | ||
92 | } | ||
93 | |||
94 | FILES_${PN} = "" | ||
95 | ALLOW_EMPTY_${PN} = "1" | ||
96 | |||
97 | FILES_${PN}-dbg += "${libdir}/llvm${LLVM_RELEASE}/.debug ${bindir}/llvm${LLVM_RELEASE}/.debug" | ||
98 | |||
99 | FILES_${PN}-dev = " \ | ||
100 | ${includedir} \ | ||
101 | ${bindir}/* \ | ||
102 | ${libdir}/llvm${LLVM_RELEASE}/LLVMHello.so \ | ||
103 | ${libdir}/llvm${LLVM_RELEASE}/BugpointPasses.so \ | ||
104 | ${libdir}/llvm${LLVM_RELEASE}/*.a \ | ||
105 | " | ||
106 | |||
107 | base_do_compile_prepend() { | ||
108 | # Avoid *** No rule to make target `native/bin/tblgen', needed by `include/llvm/Intrinsics.gen.tmp' | ||
109 | oe_runmake tblgen | ||
110 | } | ||
111 | |||
112 | do_install() { | ||
113 | # Install into a private directory to be able to reorganize the files. | ||
114 | |||
115 | cd ${OECMAKE_BUILDPATH} | ||
116 | |||
117 | oe_runmake DESTDIR=${WORKDIR}/llvm-install install | ||
118 | |||
119 | # Create our custom target directories | ||
120 | install -d ${D}${bindir}/llvm${LLVM_RELEASE} | ||
121 | install -d ${D}${includedir}/llvm${LLVM_RELEASE} | ||
122 | install -d ${D}${libdir}/llvm${LLVM_RELEASE} | ||
123 | |||
124 | # Move headers into their own directory | ||
125 | cp -R ${WORKDIR}/llvm-install/${prefix}/include/llvm \ | ||
126 | ${D}${includedir}/llvm${LLVM_RELEASE}/ | ||
127 | cp -R ${WORKDIR}/llvm-install/${prefix}/include/llvm-c \ | ||
128 | ${D}${includedir}/llvm${LLVM_RELEASE}/ | ||
129 | |||
130 | find ${WORKDIR}/llvm-install/${prefix}/lib -name "*" -maxdepth 1 -exec \ | ||
131 | install {} ${D}${libdir}/llvm${LLVM_RELEASE} \; | ||
132 | |||
133 | # I dont know another way out. Binaries are installed into a special subdir | ||
134 | find ${WORKDIR}/llvm-install/${prefix}/bin -name "*" -maxdepth 1 -exec \ | ||
135 | install {} ${D}${bindir}/llvm${LLVM_RELEASE} \; | ||
136 | |||
137 | # LLVM does not install this by default. | ||
138 | install bin/tblgen ${D}${bindir}/llvm${LLVM_RELEASE} | ||
139 | |||
140 | # we install it here unmodified for native and none native and overwrite it | ||
141 | # later for native case | ||
142 | install -d ${D}${bindir} | ||
143 | install -m 0755 bin/llvm-config ${D}${bindir} | ||
144 | } | ||
145 | |||
146 | SYSROOT_PREPROCESS_FUNCS_append_class-target = " llvm_sysroot_preprocess" | ||
147 | |||
148 | llvm_sysroot_preprocess() { | ||
149 | cd ${OECMAKE_BUILDPATH} | ||
150 | |||
151 | # Fix the paths in the config script to make it find the binaries and | ||
152 | # library files. Doing so allows 3rd party configure scripts working | ||
153 | # unmodified. | ||
154 | sed -e's!my.*ABS_RUN_DIR =.*!my $ABS_RUN_DIR = "${STAGING_DIR_TARGET}";!' \ | ||
155 | -e's!my.*INCLUDEDIR =.*!my $INCLUDEDIR = "${STAGING_INCDIR}/llvm${LLVM_RELEASE}";!' \ | ||
156 | -e's!my.*LIBDIR.*!my $LIBDIR = "${STAGING_LIBDIR}/llvm${LLVM_RELEASE}";!' \ | ||
157 | -e's!my.*BINDIR.*!my $BINDIR = "${STAGING_BINDIR}/llvm${LLVM_RELEASE}";!' \ | ||
158 | bin/llvm-config > bin/llvm-config${LLVM_RELEASE} | ||
159 | |||
160 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
161 | install -m 0755 bin/llvm-config${LLVM_RELEASE} ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
162 | } | ||
163 | |||
164 | do_install_virtclass-native() { | ||
165 | # Install into a private directory to be able to reorganize the files. | ||
166 | |||
167 | cd ${OECMAKE_BUILDPATH} | ||
168 | |||
169 | oe_runmake DESTDIR=${WORKDIR}/llvm-install install | ||
170 | |||
171 | # Create our custom target directories | ||
172 | install -d ${D}${bindir}/llvm${LLVM_RELEASE} | ||
173 | install -d ${D}${includedir}/llvm${LLVM_RELEASE} | ||
174 | install -d ${D}${libdir}/llvm${LLVM_RELEASE} | ||
175 | |||
176 | # Move headers into their own directory | ||
177 | cp -R ${WORKDIR}/llvm-install/${prefix}/include/llvm \ | ||
178 | ${D}${includedir}/llvm${LLVM_RELEASE}/ | ||
179 | cp -R ${WORKDIR}/llvm-install/${prefix}/include/llvm-c \ | ||
180 | ${D}${includedir}/llvm${LLVM_RELEASE}/ | ||
181 | |||
182 | find ${WORKDIR}/llvm-install/${prefix}/lib -name "*" -maxdepth 1 -exec \ | ||
183 | install {} ${D}${libdir}/llvm${LLVM_RELEASE} \; | ||
184 | |||
185 | # I dont know another way out. Binaries are installed into a special subdir | ||
186 | find ${WORKDIR}/llvm-install/${prefix}/bin -name "*" -maxdepth 1 -exec \ | ||
187 | install {} ${D}${bindir}/llvm${LLVM_RELEASE} \; | ||
188 | |||
189 | # LLVM does not install this by default. | ||
190 | install bin/tblgen ${D}${bindir}/llvm${LLVM_RELEASE} | ||
191 | |||
192 | # Fix the paths in the config script to make it find the binaries and | ||
193 | # library files. Doing so allows 3rd party configure scripts working | ||
194 | # unmodified. | ||
195 | sed -e's!my.*ABS_RUN_DIR =.*!my $ABS_RUN_DIR = "${STAGING_DIR_TARGET}";!' \ | ||
196 | -e's!my.*INCLUDEDIR =.*!my $INCLUDEDIR = "${STAGING_INCDIR}/llvm${LLVM_RELEASE}";!' \ | ||
197 | -e's!my.*LIBDIR.*!my $LIBDIR = "${STAGING_LIBDIR}/llvm${LLVM_RELEASE}";!' \ | ||
198 | -e's!my.*BINDIR.*!my $BINDIR = "${STAGING_BINDIR}/llvm${LLVM_RELEASE}";!' \ | ||
199 | bin/llvm-config > bin/llvm-config${LLVM_RELEASE} | ||
200 | |||
201 | install -d ${D}${bindir} | ||
202 | install -m 0755 bin/llvm-config${LLVM_RELEASE} ${D}${bindir} | ||
203 | } | ||
204 | |||
205 | |||
206 | # Retrieve the target in a way that is compatible to the arch | ||
207 | # value in llvm (>= 2.5) | ||
208 | def get_llvm_arch(d): | ||
209 | import bb; | ||
210 | |||
211 | arch = bb.data.getVar('TARGET_ARCH', d, 1) | ||
212 | if arch == "x86_64" or arch == "i486" or arch == "i586" or arch == "i686": | ||
213 | arch = "X86" | ||
214 | elif arch == "arm": | ||
215 | arch = "ARM" | ||
216 | elif arch == "mipsel" or arch == "mips": | ||
217 | arch = "mips" | ||
218 | elif arch == "powerpc" or arch == "powerpc64": | ||
219 | arch = "PowerPC" | ||
220 | else: | ||
221 | bb.warn("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) ); | ||
222 | |||
223 | return arch | ||
224 | |||
225 | BBCLASSEXTEND = "native" | ||
226 | |||
diff --git a/meta-oe/recipes-core/llvm/llvm2.8_2.8.bb b/meta-oe/recipes-core/llvm/llvm2.8_2.8.bb index 8dc22e501..4d0b3c83c 100644 --- a/meta-oe/recipes-core/llvm/llvm2.8_2.8.bb +++ b/meta-oe/recipes-core/llvm/llvm2.8_2.8.bb | |||
@@ -1,10 +1,7 @@ | |||
1 | require llvm.inc | 1 | require llvm.inc |
2 | require llvm2.inc | ||
2 | 3 | ||
3 | #LICENSE = "University of Illinois/NCSA Open Source License" | 4 | PR = "r3" |
4 | LICENSE = "NCSA" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=0ac5f799a2d89477c75b0a378b221855" | ||
6 | |||
7 | PR = "${INC_PR}.2" | ||
8 | 5 | ||
9 | SRC_URI += " \ | 6 | SRC_URI += " \ |
10 | file://30may-llvm2.8-pr399-ppc-arm.patch \ | 7 | file://30may-llvm2.8-pr399-ppc-arm.patch \ |
@@ -13,8 +10,6 @@ SRC_URI += " \ | |||
13 | file://llvm-mc_disable.patch \ | 10 | file://llvm-mc_disable.patch \ |
14 | " | 11 | " |
15 | 12 | ||
16 | LLVM_RELEASE = "2.8" | ||
17 | |||
18 | EXTRA_OECMAKE += " -DBUILD_SHARED_LIBS:BOOL=OFF " | 13 | EXTRA_OECMAKE += " -DBUILD_SHARED_LIBS:BOOL=OFF " |
19 | 14 | ||
20 | SRC_URI[md5sum] = "220d361b4d17051ff4bb21c64abe05ba" | 15 | SRC_URI[md5sum] = "220d361b4d17051ff4bb21c64abe05ba" |
diff --git a/meta-oe/recipes-core/llvm/llvm2.9_2.9.bb b/meta-oe/recipes-core/llvm/llvm2.9_2.9.bb index 1cd68be11..44504b8e1 100644 --- a/meta-oe/recipes-core/llvm/llvm2.9_2.9.bb +++ b/meta-oe/recipes-core/llvm/llvm2.9_2.9.bb | |||
@@ -1,9 +1,12 @@ | |||
1 | require llvm.inc | 1 | require llvm.inc |
2 | require llvm2.inc | ||
2 | 3 | ||
3 | PR = "${INC_PR}.0" | 4 | PR = "r3" |
4 | 5 | ||
5 | SRC_URI += "file://0035-gcc-4.7.patch" | 6 | SRC_URI += "file://0035-gcc-4.7.patch" |
6 | 7 | ||
8 | ARM_INSTRUCTION_SET = "arm" | ||
9 | |||
7 | # 0019-issue6065.patch is still needed but a bit modified, because it was resolved by | 10 | # 0019-issue6065.patch is still needed but a bit modified, because it was resolved by |
8 | # http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?r1=120304&r2=124694&pathrev=124694 | 11 | # http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?r1=120304&r2=124694&pathrev=124694 |
9 | # http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?diff_format=h&r1=57911&r2=57910&pathrev=57911 | 12 | # http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?diff_format=h&r1=57911&r2=57910&pathrev=57911 |
@@ -11,33 +14,8 @@ SRC_URI += "file://0035-gcc-4.7.patch" | |||
11 | # {standard input}:31: Error: invalid register list to push/pop instruction -- `pop {r0,r1,r2,r3,lr}' | 14 | # {standard input}:31: Error: invalid register list to push/pop instruction -- `pop {r0,r1,r2,r3,lr}' |
12 | # make[2]: *** [lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMJITInfo.cpp.o] Error 1 | 15 | # make[2]: *** [lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMJITInfo.cpp.o] Error 1 |
13 | # SRC_URI += "file://0019-issue6065.patch" | 16 | # SRC_URI += "file://0019-issue6065.patch" |
14 | ARM_INSTRUCTION_SET = "arm" | ||
15 | 17 | ||
16 | SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch " | 18 | SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch " |
17 | 19 | ||
18 | LLVM_EXTRA_ARCH = "X86;" | ||
19 | LLVM_EXTRA_ARCH_x86 = "" | ||
20 | LLVM_EXTRA_ARCH_x86-64 = "" | ||
21 | |||
22 | EXTRA_OECMAKE = "\ | ||
23 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm${LLVM_RELEASE}/tblgen \ | ||
24 | -DLLVM_TARGETS_TO_BUILD="${LLVM_EXTRA_ARCH}${LLVM_ARCH}" \ | ||
25 | -DCMAKE_LINKER:FILEPATH=${LD} \ | ||
26 | -DCMAKE_AR:FILEPATH=${AR} \ | ||
27 | -DCMAKE_OBJCOPY:FILEPATH=${OBJCOPY} \ | ||
28 | -DCMAKE_OBJDUMP:FILEPATH=${OBJDUMP} \ | ||
29 | -DCMAKE_RANLIB:FILEPATH=${RANLIB} \ | ||
30 | -DCMAKE_STRIP:FILEPATH=${STRIP} \ | ||
31 | -DNM_PATH:FILEPATH=${NM} \ | ||
32 | -DLLVM_ENABLE_PIC:BOOL=ON \ | ||
33 | -DLLVM_TARGET_ARCH:STRING=${LLVM_ARCH} \ | ||
34 | -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \ | ||
35 | -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ | ||
36 | -DBUILD_SHARED_LIBS:BOOL=ON \ | ||
37 | -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \ | ||
38 | " | ||
39 | |||
40 | LLVM_RELEASE = "2.9" | ||
41 | |||
42 | SRC_URI[md5sum] = "793138412d2af2c7c7f54615f8943771" | 20 | SRC_URI[md5sum] = "793138412d2af2c7c7f54615f8943771" |
43 | SRC_URI[sha256sum] = "661236cfa17428b48cfa9cbb9909f7569c64b8ecd219fd91dbc00e3b557b3779" | 21 | SRC_URI[sha256sum] = "661236cfa17428b48cfa9cbb9909f7569c64b8ecd219fd91dbc00e3b557b3779" |
diff --git a/meta-oe/recipes-core/llvm/llvm2.inc b/meta-oe/recipes-core/llvm/llvm2.inc new file mode 100644 index 000000000..b5bad45f9 --- /dev/null +++ b/meta-oe/recipes-core/llvm/llvm2.inc | |||
@@ -0,0 +1,194 @@ | |||
1 | DEPENDS = "llvm${LLVM_RELEASE}-native llvm-common" | ||
2 | DEPENDS_virtclass-native = "llvm-common-native cmake-native" | ||
3 | |||
4 | SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.tgz" | ||
5 | S = "${WORKDIR}/llvm-${PV}" | ||
6 | |||
7 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=0ac5f799a2d89477c75b0a378b221855" | ||
8 | |||
9 | inherit cmake | ||
10 | |||
11 | # Defines the LLVM supported arches. By now we always build either for ${BUILD} | ||
12 | # (native) or ${TARGET}. In the future it may make sense to enable all backends | ||
13 | # for the non-native build. The decision which backends are used is made by | ||
14 | # the 3rd party program or library that uses llvm anyway. | ||
15 | LLVM_ARCH = "${@get_llvm_arch(d)}" | ||
16 | |||
17 | # This is used for generating the install directory for the llvm libraries, | ||
18 | # binaries and headers. It makes side by side installation of those possible. | ||
19 | LLVM_RELEASE = "${PV}" | ||
20 | |||
21 | BBCLASSEXTEND = "native" | ||
22 | |||
23 | LLVM_BUILD_DIR = "${B}/build" | ||
24 | LLVM_INSTALL_DIR = "${B}/llvm-install" | ||
25 | |||
26 | # llvm *must* be built out of tree | ||
27 | OECMAKE_SOURCEPATH = ".." | ||
28 | OECMAKE_BUILDPATH = "build" | ||
29 | |||
30 | # other architectures require X86 available, | ||
31 | LLVM_EXTRA_ARCH = "X86;" | ||
32 | LLVM_EXTRA_ARCH_x86 = "" | ||
33 | LLVM_EXTRA_ARCH_x86-64 = "" | ||
34 | |||
35 | EXTRA_OECMAKE = "\ | ||
36 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/${LLVM_DIR}/tblgen \ | ||
37 | -DLLVM_TARGETS_TO_BUILD="${LLVM_EXTRA_ARCH}${LLVM_ARCH}" \ | ||
38 | -DCMAKE_LINKER:FILEPATH=${LD} \ | ||
39 | -DCMAKE_AR:FILEPATH=${AR} \ | ||
40 | -DCMAKE_OBJCOPY:FILEPATH=${OBJCOPY} \ | ||
41 | -DCMAKE_OBJDUMP:FILEPATH=${OBJDUMP} \ | ||
42 | -DCMAKE_RANLIB:FILEPATH=${RANLIB} \ | ||
43 | -DCMAKE_STRIP:FILEPATH=${STRIP} \ | ||
44 | -DNM_PATH:FILEPATH=${NM} \ | ||
45 | -DLLVM_ENABLE_PIC:BOOL=ON \ | ||
46 | -DLLVM_TARGET_ARCH:STRING=${LLVM_ARCH} \ | ||
47 | -DLLVM_ENABLE_ASSERTIONS:BOOL=ON \ | ||
48 | -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ | ||
49 | -DBUILD_SHARED_LIBS:BOOL=ON \ | ||
50 | -DCMAKE_SKIP_BUILD_RPATH:BOOL=ON \ | ||
51 | " | ||
52 | |||
53 | # We need to reset this to avoid breakage as we build out of tree | ||
54 | TOOLCHAIN_OPTIONS = "" | ||
55 | |||
56 | PACKAGES_DYNAMIC = "llvm-*" | ||
57 | |||
58 | # the difference to the non-native build is that we do not need | ||
59 | # to declare the location of the tblgen executable. | ||
60 | EXTRA_OECMAKE_virtclass-native = "\ | ||
61 | -DLLVM_TARGETS_TO_BUILD=${LLVM_ARCH} \ | ||
62 | -DCMAKE_LINKER:FILEPATH=${LD} \ | ||
63 | -DCMAKE_AR:FILEPATH=${AR} \ | ||
64 | -DCMAKE_OBJCOPY:FILEPATH=${OBJCOPY} \ | ||
65 | -DCMAKE_OBJDUMP:FILEPATH=${OBJDUMP} \ | ||
66 | -DCMAKE_RANLIB:FILEPATH=${RANLIB} \ | ||
67 | -DCMAKE_STRIP:FILEPATH=${STRIP} \ | ||
68 | -DNM_PATH:FILEPATH=${NM} \ | ||
69 | " | ||
70 | |||
71 | PACKAGES_virtclass-native = "" | ||
72 | |||
73 | PACKAGES_DYNAMIC_virtclass-native = "" | ||
74 | |||
75 | python populate_packages_prepend () { | ||
76 | libllvm_libdir = bb.data.expand('${libdir}/${LLVM_DIR}', d) | ||
77 | do_split_packages(d, libllvm_libdir, '^lib(.*)\.so$', 'libllvm-%s', 'Split package for %s', allow_dirs=True) | ||
78 | } | ||
79 | |||
80 | FILES_${PN} = "" | ||
81 | ALLOW_EMPTY_${PN} = "1" | ||
82 | |||
83 | base_do_compile_prepend() { | ||
84 | # Avoid *** No rule to make target `native/bin/tblgen', needed by `include/llvm/Intrinsics.gen.tmp' | ||
85 | oe_runmake tblgen | ||
86 | } | ||
87 | |||
88 | do_install() { | ||
89 | # Install into a private directory to be able to reorganize the files. | ||
90 | cd ${LLVM_BUILD_DIR} | ||
91 | oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install | ||
92 | |||
93 | # Create our custom target directories | ||
94 | install -d ${D}${bindir}/${LLVM_DIR} | ||
95 | install -d ${D}${includedir}/${LLVM_DIR} | ||
96 | install -d ${D}${libdir}/${LLVM_DIR} | ||
97 | |||
98 | # Move headers into their own directory | ||
99 | cp -R ${LLVM_INSTALL_DIR}/${prefix}/include/llvm \ | ||
100 | ${D}${includedir}/${LLVM_DIR}/ | ||
101 | cp -R ${LLVM_INSTALL_DIR}/${prefix}/include/llvm-c \ | ||
102 | ${D}${includedir}/${LLVM_DIR}/ | ||
103 | |||
104 | find ${LLVM_INSTALL_DIR}/${prefix}/lib -name "*" -maxdepth 1 -exec \ | ||
105 | install {} ${D}${libdir}/${LLVM_DIR} \; | ||
106 | |||
107 | # I dont know another way out. Binaries are installed into a special subdir | ||
108 | find ${LLVM_INSTALL_DIR}/${prefix}/bin -name "*" -maxdepth 1 -exec \ | ||
109 | install {} ${D}${bindir}/${LLVM_DIR} \; | ||
110 | |||
111 | # LLVM does not install this by default. | ||
112 | install bin/tblgen ${D}${bindir}/${LLVM_DIR} | ||
113 | |||
114 | # we install it here unmodified for native and none native and overwrite it | ||
115 | # later for native case | ||
116 | install -d ${D}${bindir} | ||
117 | install -m 0755 bin/llvm-config ${D}${bindir} | ||
118 | } | ||
119 | |||
120 | SYSROOT_PREPROCESS_FUNCS_append_class-target = " llvm_sysroot_preprocess" | ||
121 | |||
122 | llvm_sysroot_preprocess() { | ||
123 | cd ${LLVM_BUILD_DIR} | ||
124 | |||
125 | # Fix the paths in the config script to make it find the binaries and | ||
126 | # library files. Doing so allows 3rd party configure scripts working | ||
127 | # unmodified. | ||
128 | sed -e's!my.*ABS_RUN_DIR =.*!my $ABS_RUN_DIR = "${STAGING_DIR_TARGET}";!' \ | ||
129 | -e's!my.*INCLUDEDIR =.*!my $INCLUDEDIR = "${STAGING_INCDIR}/${LLVM_DIR}";!' \ | ||
130 | -e's!my.*LIBDIR.*!my $LIBDIR = "${STAGING_LIBDIR}/${LLVM_DIR}";!' \ | ||
131 | -e's!my.*BINDIR.*!my $BINDIR = "${STAGING_BINDIR}/${LLVM_DIR}";!' \ | ||
132 | bin/llvm-config > bin/llvm-config${LLVM_RELEASE} | ||
133 | |||
134 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
135 | install -m 0755 bin/llvm-config${LLVM_RELEASE} ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
136 | } | ||
137 | |||
138 | do_install_virtclass-native() { | ||
139 | # Install into a private directory to be able to reorganize the files. | ||
140 | cd ${LLVM_BUILD_DIR} | ||
141 | oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install | ||
142 | |||
143 | # Create our custom target directories | ||
144 | install -d ${D}${bindir}/${LLVM_DIR} | ||
145 | install -d ${D}${includedir}/${LLVM_DIR} | ||
146 | install -d ${D}${libdir}/${LLVM_DIR} | ||
147 | |||
148 | # Move headers into their own directory | ||
149 | cp -R ${LLVM_INSTALL_DIR}/${prefix}/include/llvm \ | ||
150 | ${D}${includedir}/${LLVM_DIR}/ | ||
151 | cp -R ${LLVM_INSTALL_DIR}/${prefix}/include/llvm-c \ | ||
152 | ${D}${includedir}/${LLVM_DIR}/ | ||
153 | |||
154 | find ${LLVM_INSTALL_DIR}/${prefix}/lib -name "*" -maxdepth 1 -exec \ | ||
155 | install {} ${D}${libdir}/${LLVM_DIR} \; | ||
156 | |||
157 | # I dont know another way out. Binaries are installed into a special subdir | ||
158 | find ${LLVM_INSTALL_DIR}/${prefix}/bin -name "*" -maxdepth 1 -exec \ | ||
159 | install {} ${D}${bindir}/${LLVM_DIR} \; | ||
160 | |||
161 | # LLVM does not install this by default. | ||
162 | install bin/tblgen ${D}${bindir}/${LLVM_DIR} | ||
163 | |||
164 | # Fix the paths in the config script to make it find the binaries and | ||
165 | # library files. Doing so allows 3rd party configure scripts working | ||
166 | # unmodified. | ||
167 | sed -e's!my.*ABS_RUN_DIR =.*!my $ABS_RUN_DIR = "${STAGING_DIR_TARGET}";!' \ | ||
168 | -e's!my.*INCLUDEDIR =.*!my $INCLUDEDIR = "${STAGING_INCDIR}/${LLVM_DIR}";!' \ | ||
169 | -e's!my.*LIBDIR.*!my $LIBDIR = "${STAGING_LIBDIR}/${LLVM_DIR}";!' \ | ||
170 | -e's!my.*BINDIR.*!my $BINDIR = "${STAGING_BINDIR}/${LLVM_DIR}";!' \ | ||
171 | bin/llvm-config > bin/llvm-config${LLVM_RELEASE} | ||
172 | |||
173 | install -d ${D}${bindir} | ||
174 | install -m 0755 bin/llvm-config${LLVM_RELEASE} ${D}${bindir} | ||
175 | } | ||
176 | |||
177 | # Retrieve the target in a way that is compatible to the arch | ||
178 | # value in llvm (>= 2.5) | ||
179 | def get_llvm_arch(d): | ||
180 | import bb; | ||
181 | |||
182 | arch = bb.data.getVar('TARGET_ARCH', d, 1) | ||
183 | if arch == "x86_64" or arch == "i486" or arch == "i586" or arch == "i686": | ||
184 | arch = "X86" | ||
185 | elif arch == "arm": | ||
186 | arch = "ARM" | ||
187 | elif arch == "mipsel" or arch == "mips": | ||
188 | arch = "mips" | ||
189 | elif arch == "powerpc" or arch == "powerpc64": | ||
190 | arch = "PowerPC" | ||
191 | else: | ||
192 | bb.warn("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) ); | ||
193 | |||
194 | return arch | ||
diff --git a/meta-oe/recipes-core/llvm/llvm3.2_3.2.bb b/meta-oe/recipes-core/llvm/llvm3.2_3.2.bb index 71a53c1f5..48e27b992 100644 --- a/meta-oe/recipes-core/llvm/llvm3.2_3.2.bb +++ b/meta-oe/recipes-core/llvm/llvm3.2_3.2.bb | |||
@@ -1,105 +1,9 @@ | |||
1 | DESCRIPTION = "The Low Level Virtual Machine" | 1 | require llvm.inc |
2 | HOMEPAGE = "http://llvm.org" | 2 | require llvm3.inc |
3 | # 3-clause BSD-like | ||
4 | LICENSE = "NCSA" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=60fdd7739841f04a2ce2171a726be8f3" | ||
6 | 3 | ||
7 | DEPENDS = "libffi libxml2-native llvm-common" | 4 | # 3.2 is different then 2.8, 2.9 and 3.3 |
5 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=60fdd7739841f04a2ce2171a726be8f3" | ||
8 | 6 | ||
9 | SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz" | ||
10 | SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch " | 7 | SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch " |
11 | |||
12 | SRC_URI[md5sum] = "71610289bbc819e3e15fdd562809a2d7" | 8 | SRC_URI[md5sum] = "71610289bbc819e3e15fdd562809a2d7" |
13 | SRC_URI[sha256sum] = "125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343" | 9 | SRC_URI[sha256sum] = "125090c4d26740f1d5e9838477c931ed7d9ad70d599ba265f46f3a42cb066343" |
14 | |||
15 | S = "${WORKDIR}/llvm-${PV}.src" | ||
16 | |||
17 | inherit autotools perlnative pythonnative | ||
18 | |||
19 | LLVM_BUILD_DIR = "${WORKDIR}/llvm-${PV}.build" | ||
20 | LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install" | ||
21 | LLVM_DIR = "llvm${PV}" | ||
22 | |||
23 | EXTRA_OECONF += "--disable-assertions \ | ||
24 | --enable-debug-runtime \ | ||
25 | --disable-expensive-checks \ | ||
26 | --enable-bindings=none \ | ||
27 | --enable-keep-symbols \ | ||
28 | --enable-libffi \ | ||
29 | --enable-optimized \ | ||
30 | --enable-shared \ | ||
31 | --enable-targets=host-only" | ||
32 | EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1" | ||
33 | FILES_${PN} = "${libdir}/lib*.so \ | ||
34 | ${libdir}/${LLVM_DIR}/*" | ||
35 | FILES_${PN}-dbg = "${bindir}/${LLVM_DIR}/.debug \ | ||
36 | ${libdir}/${LLVM_DIR}/.debug \ | ||
37 | ${libdir}/.debug \ | ||
38 | /usr/src/debug" | ||
39 | FILES_${PN}-dev = "${bindir}/${LLVM_DIR} \ | ||
40 | ${includedir}/${LLVM_DIR} \ | ||
41 | ${libdir}/${LLVM_DIR}/BugpointPasses.so \ | ||
42 | ${libdir}/${LLVM_DIR}/LLVMHello.so" | ||
43 | FILES_${PN}-static-dev = "${libdir}/${LLVM_DIR}/*.a" | ||
44 | FILES_SOLIBSDEV = "" | ||
45 | INSANE_SKIP_${PN} = "dev-so" | ||
46 | |||
47 | do_configure_prepend() { | ||
48 | # Remove RPATHs | ||
49 | sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules | ||
50 | |||
51 | # Drop "svn" suffix from version string | ||
52 | sed -i 's/3\.2svn/3.2/g' configure | ||
53 | |||
54 | # Fix paths in llvm-config | ||
55 | sed -i "s|sys::path::parent_path(CurrentPath))\.str()|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|g" tools/llvm-config/llvm-config.cpp | ||
56 | sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" tools/llvm-config/llvm-config.cpp | ||
57 | |||
58 | # Fails to build unless using separate directory from source | ||
59 | mkdir -p ${LLVM_BUILD_DIR} | ||
60 | cd ${LLVM_BUILD_DIR} | ||
61 | } | ||
62 | |||
63 | do_compile() { | ||
64 | cd ${LLVM_BUILD_DIR} | ||
65 | oe_runmake \ | ||
66 | AR="${BUILD_AR}" \ | ||
67 | CC="${BUILD_CC}" \ | ||
68 | CFLAGS="${BUILD_CFLAGS}" \ | ||
69 | CXX="${BUILD_CXX}" \ | ||
70 | CXXFLAGS="${BUILD_CXXFLAGS}" \ | ||
71 | CPP="${BUILD_CPP}" \ | ||
72 | CPPFLAGS="${BUILD_CPPFLAGS}" \ | ||
73 | NM="${BUILD_NM}" \ | ||
74 | RANLIB="${BUILD_RANLIB}" \ | ||
75 | PATH="${STAGING_BINDIR_NATIVE}:$PATH" \ | ||
76 | cross-compile-build-tools | ||
77 | oe_runmake | ||
78 | } | ||
79 | |||
80 | do_install() { | ||
81 | cd ${LLVM_BUILD_DIR} | ||
82 | oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install | ||
83 | |||
84 | mv ${LLVM_INSTALL_DIR}${bindir}/${HOST_SYS}-llvm-config-host ${LLVM_INSTALL_DIR}/llvm-config-host | ||
85 | |||
86 | install -d ${D}${bindir}/${LLVM_DIR} | ||
87 | mv ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/ | ||
88 | |||
89 | install -d ${D}${includedir}/${LLVM_DIR} | ||
90 | mv ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/ | ||
91 | |||
92 | install -d ${D}${libdir}/${LLVM_DIR} | ||
93 | mv ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/ | ||
94 | ln -s ${LLVM_DIR}/libLLVM-${PV}.so ${D}${libdir}/libLLVM-${PV}.so | ||
95 | |||
96 | install -d ${D}${docdir}/${LLVM_DIR} | ||
97 | mv ${LLVM_INSTALL_DIR}${prefix}/docs/llvm/* ${D}${docdir}/${LLVM_DIR} | ||
98 | } | ||
99 | |||
100 | SYSROOT_PREPROCESS_FUNCS += "llvm_sysroot_preprocess" | ||
101 | |||
102 | llvm_sysroot_preprocess() { | ||
103 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
104 | mv ${LLVM_INSTALL_DIR}/llvm-config-host ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} | ||
105 | } | ||
diff --git a/meta-oe/recipes-core/llvm/llvm3.3_3.3.bb b/meta-oe/recipes-core/llvm/llvm3.3_3.3.bb index d3aa963af..3fca57560 100644 --- a/meta-oe/recipes-core/llvm/llvm3.3_3.3.bb +++ b/meta-oe/recipes-core/llvm/llvm3.3_3.3.bb | |||
@@ -1,105 +1,9 @@ | |||
1 | DESCRIPTION = "The Low Level Virtual Machine" | 1 | require llvm.inc |
2 | HOMEPAGE = "http://llvm.org" | 2 | require llvm3.inc |
3 | # 3-clause BSD-like | ||
4 | LICENSE = "NCSA" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=d0a3ef0d3e0e8f5cf59e5ffc273ab1f8" | ||
6 | 3 | ||
7 | DEPENDS = "libffi libxml2-native llvm-common" | ||
8 | |||
9 | SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz" | ||
10 | SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch " | 4 | SRC_URI_append_libc-uclibc = " file://arm_fenv_uclibc.patch " |
11 | |||
12 | SRC_URI[md5sum] = "40564e1dc390f9844f1711c08b08e391" | 5 | SRC_URI[md5sum] = "40564e1dc390f9844f1711c08b08e391" |
13 | SRC_URI[sha256sum] = "68766b1e70d05a25e2f502e997a3cb3937187a3296595cf6e0977d5cd6727578" | 6 | SRC_URI[sha256sum] = "68766b1e70d05a25e2f502e997a3cb3937187a3296595cf6e0977d5cd6727578" |
14 | 7 | ||
15 | S = "${WORKDIR}/llvm-${PV}.src" | ||
16 | |||
17 | inherit autotools perlnative pythonnative | ||
18 | |||
19 | LLVM_BUILD_DIR = "${WORKDIR}/llvm-${PV}.build" | ||
20 | LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install" | ||
21 | LLVM_DIR = "llvm${PV}" | ||
22 | |||
23 | PACKAGECONFIG ??= "" | 8 | PACKAGECONFIG ??= "" |
24 | PACKAGECONFIG[r600] = "--enable-experimental-targets=R600,,," | 9 | PACKAGECONFIG[r600] = "--enable-experimental-targets=R600,,," |
25 | |||
26 | EXTRA_OECONF += "--disable-assertions \ | ||
27 | --enable-debug-runtime \ | ||
28 | --disable-expensive-checks \ | ||
29 | --enable-bindings=none \ | ||
30 | --enable-keep-symbols \ | ||
31 | --enable-libffi \ | ||
32 | --enable-optimized \ | ||
33 | --enable-shared \ | ||
34 | --enable-targets=host-only" | ||
35 | EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1" | ||
36 | FILES_${PN} = "${libdir}/lib*.so \ | ||
37 | ${libdir}/${LLVM_DIR}/*" | ||
38 | FILES_${PN}-dbg = "${bindir}/${LLVM_DIR}/.debug \ | ||
39 | ${libdir}/${LLVM_DIR}/.debug \ | ||
40 | ${libdir}/.debug \ | ||
41 | /usr/src/debug" | ||
42 | FILES_${PN}-dev = "${bindir}/${LLVM_DIR} \ | ||
43 | ${includedir}/${LLVM_DIR} \ | ||
44 | ${libdir}/${LLVM_DIR}/BugpointPasses.so \ | ||
45 | ${libdir}/${LLVM_DIR}/LLVMHello.so" | ||
46 | FILES_${PN}-static-dev = "${libdir}/${LLVM_DIR}/*.a" | ||
47 | FILES_SOLIBSDEV = "" | ||
48 | INSANE_SKIP_${PN} = "dev-so" | ||
49 | |||
50 | do_configure_prepend() { | ||
51 | # Remove RPATHs | ||
52 | sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules | ||
53 | |||
54 | # Fix paths in llvm-config | ||
55 | sed -i "s|sys::path::parent_path(CurrentPath))\.str()|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|g" tools/llvm-config/llvm-config.cpp | ||
56 | sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" tools/llvm-config/llvm-config.cpp | ||
57 | |||
58 | # Fails to build unless using separate directory from source | ||
59 | mkdir -p ${LLVM_BUILD_DIR} | ||
60 | cd ${LLVM_BUILD_DIR} | ||
61 | } | ||
62 | |||
63 | do_compile() { | ||
64 | cd ${LLVM_BUILD_DIR} | ||
65 | oe_runmake \ | ||
66 | AR="${BUILD_AR}" \ | ||
67 | CC="${BUILD_CC}" \ | ||
68 | CFLAGS="${BUILD_CFLAGS}" \ | ||
69 | CXX="${BUILD_CXX}" \ | ||
70 | CXXFLAGS="${BUILD_CXXFLAGS}" \ | ||
71 | CPP="${BUILD_CPP}" \ | ||
72 | CPPFLAGS="${BUILD_CPPFLAGS}" \ | ||
73 | NM="${BUILD_NM}" \ | ||
74 | RANLIB="${BUILD_RANLIB}" \ | ||
75 | PATH="${STAGING_BINDIR_NATIVE}:$PATH" \ | ||
76 | cross-compile-build-tools | ||
77 | oe_runmake | ||
78 | } | ||
79 | |||
80 | do_install() { | ||
81 | cd ${LLVM_BUILD_DIR} | ||
82 | oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install | ||
83 | |||
84 | mv ${LLVM_INSTALL_DIR}${bindir}/${HOST_SYS}-llvm-config-host ${LLVM_INSTALL_DIR}/llvm-config-host | ||
85 | |||
86 | install -d ${D}${bindir}/${LLVM_DIR} | ||
87 | mv ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/ | ||
88 | |||
89 | install -d ${D}${includedir}/${LLVM_DIR} | ||
90 | mv ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/ | ||
91 | |||
92 | install -d ${D}${libdir}/${LLVM_DIR} | ||
93 | mv ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/ | ||
94 | ln -s ${LLVM_DIR}/libLLVM-${PV}.so ${D}${libdir}/libLLVM-${PV}.so | ||
95 | |||
96 | install -d ${D}${docdir}/${LLVM_DIR} | ||
97 | mv ${LLVM_INSTALL_DIR}${prefix}/docs/llvm/* ${D}${docdir}/${LLVM_DIR} | ||
98 | } | ||
99 | |||
100 | SYSROOT_PREPROCESS_FUNCS += "llvm_sysroot_preprocess" | ||
101 | |||
102 | llvm_sysroot_preprocess() { | ||
103 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
104 | mv ${LLVM_INSTALL_DIR}/llvm-config-host ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} | ||
105 | } | ||
diff --git a/meta-oe/recipes-core/llvm/llvm3.inc b/meta-oe/recipes-core/llvm/llvm3.inc new file mode 100644 index 000000000..b04fe24fd --- /dev/null +++ b/meta-oe/recipes-core/llvm/llvm3.inc | |||
@@ -0,0 +1,84 @@ | |||
1 | DEPENDS = "libffi libxml2-native llvm-common" | ||
2 | |||
3 | SRC_URI = "http://llvm.org/releases/${PV}/llvm-${PV}.src.tar.gz" | ||
4 | S = "${WORKDIR}/llvm-${PV}.src" | ||
5 | |||
6 | inherit autotools | ||
7 | |||
8 | LLVM_BUILD_DIR = "${WORKDIR}/llvm-${PV}.build" | ||
9 | LLVM_INSTALL_DIR = "${WORKDIR}/llvm-install" | ||
10 | |||
11 | EXTRA_OECONF += "--disable-assertions \ | ||
12 | --enable-debug-runtime \ | ||
13 | --disable-expensive-checks \ | ||
14 | --enable-bindings=none \ | ||
15 | --enable-keep-symbols \ | ||
16 | --enable-libffi \ | ||
17 | --enable-optimized \ | ||
18 | --enable-shared \ | ||
19 | --enable-targets=host-only" | ||
20 | EXTRA_OEMAKE += "REQUIRES_RTTI=1 VERBOSE=1" | ||
21 | FILES_${PN} = "${libdir}/lib*.so \ | ||
22 | ${libdir}/${LLVM_DIR}/*" | ||
23 | FILES_SOLIBSDEV = "" | ||
24 | INSANE_SKIP_${PN} = "dev-so" | ||
25 | |||
26 | do_configure_prepend() { | ||
27 | # Remove RPATHs | ||
28 | sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules | ||
29 | |||
30 | # Drop "svn" suffix from version string | ||
31 | sed -i 's/${PV}svn/${PV}/g' configure | ||
32 | |||
33 | # Fix paths in llvm-config | ||
34 | sed -i "s|sys::path::parent_path(CurrentPath))\.str()|sys::path::parent_path(sys::path::parent_path(CurrentPath))).str()|g" tools/llvm-config/llvm-config.cpp | ||
35 | sed -ri "s#/(bin|include|lib)(/?\")#/\1/${LLVM_DIR}\2#g" tools/llvm-config/llvm-config.cpp | ||
36 | |||
37 | # Fails to build unless using separate directory from source | ||
38 | mkdir -p ${LLVM_BUILD_DIR} | ||
39 | cd ${LLVM_BUILD_DIR} | ||
40 | } | ||
41 | |||
42 | do_compile() { | ||
43 | cd ${LLVM_BUILD_DIR} | ||
44 | oe_runmake \ | ||
45 | AR="${BUILD_AR}" \ | ||
46 | CC="${BUILD_CC}" \ | ||
47 | CFLAGS="${BUILD_CFLAGS}" \ | ||
48 | CXX="${BUILD_CXX}" \ | ||
49 | CXXFLAGS="${BUILD_CXXFLAGS}" \ | ||
50 | CPP="${BUILD_CPP}" \ | ||
51 | CPPFLAGS="${BUILD_CPPFLAGS}" \ | ||
52 | NM="${BUILD_NM}" \ | ||
53 | RANLIB="${BUILD_RANLIB}" \ | ||
54 | PATH="${STAGING_BINDIR_NATIVE}:$PATH" \ | ||
55 | cross-compile-build-tools | ||
56 | oe_runmake | ||
57 | } | ||
58 | |||
59 | do_install() { | ||
60 | cd ${LLVM_BUILD_DIR} | ||
61 | oe_runmake DESTDIR=${LLVM_INSTALL_DIR} install | ||
62 | |||
63 | mv ${LLVM_INSTALL_DIR}${bindir}/${HOST_SYS}-llvm-config-host ${LLVM_INSTALL_DIR}/llvm-config-host | ||
64 | |||
65 | install -d ${D}${bindir}/${LLVM_DIR} | ||
66 | mv ${LLVM_INSTALL_DIR}${bindir}/* ${D}${bindir}/${LLVM_DIR}/ | ||
67 | |||
68 | install -d ${D}${includedir}/${LLVM_DIR} | ||
69 | mv ${LLVM_INSTALL_DIR}${includedir}/* ${D}${includedir}/${LLVM_DIR}/ | ||
70 | |||
71 | install -d ${D}${libdir}/${LLVM_DIR} | ||
72 | mv ${LLVM_INSTALL_DIR}${libdir}/* ${D}${libdir}/${LLVM_DIR}/ | ||
73 | ln -s ${LLVM_DIR}/libLLVM-${PV}.so ${D}${libdir}/libLLVM-${PV}.so | ||
74 | |||
75 | install -d ${D}${docdir}/${LLVM_DIR} | ||
76 | mv ${LLVM_INSTALL_DIR}${prefix}/docs/llvm/* ${D}${docdir}/${LLVM_DIR} | ||
77 | } | ||
78 | |||
79 | SYSROOT_PREPROCESS_FUNCS += "llvm_sysroot_preprocess" | ||
80 | |||
81 | llvm_sysroot_preprocess() { | ||
82 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
83 | mv ${LLVM_INSTALL_DIR}/llvm-config-host ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} | ||
84 | } | ||