summaryrefslogtreecommitdiffstats
path: root/recipes-core/openjdk/openjdk-6-common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/openjdk/openjdk-6-common.inc')
-rw-r--r--recipes-core/openjdk/openjdk-6-common.inc396
1 files changed, 0 insertions, 396 deletions
diff --git a/recipes-core/openjdk/openjdk-6-common.inc b/recipes-core/openjdk/openjdk-6-common.inc
deleted file mode 100644
index cf192d0..0000000
--- a/recipes-core/openjdk/openjdk-6-common.inc
+++ /dev/null
@@ -1,396 +0,0 @@
1require openjdk-common.inc
2
3ICEDTEA = "icedtea6-${ICEDTEA_VERSION}"
4
5INC_PR = "r22"
6
7SRC_URI = "\
8 ${ICEDTEA_URI} \
9 ${OPENJDK_URI} \
10 ${JAXWS_URI} \
11 ${JAF_URI} \
12 ${JAXP_URI} \
13 ${CACAO_URI} \
14 ${JAMVM_URI} \
15 ${OEPATCHES} \
16 ${ICEDTEAPATCHES} \
17 file://jvm.cfg \
18 "
19
20JDKPN = "openjdk-6"
21JDK_DIR = "java-6-openjdk"
22
23PN = "${JDKPN}-jre"
24PROVIDES += "${JDKPN} ${PACKAGES}"
25
26DEPENDS = "giflib libpng jpeg cups \
27 rhino \
28 freetype libxinerama libxt libxrender libxtst libxi \
29 alsa-lib libffi \
30 ant-native \
31 fastjar-native \
32 icedtea6-native \
33 zip-native \
34 "
35
36# No package should directly depend on this (it should require
37# java2-runtime instead).
38PRIVATE_LIBS = "\
39 lib.so libunpack.so libverify.so libjava.so libzip.so libnpt.so \
40 libjava_crw_demo.so libhprof.so libjavanet.so libnio.so \
41 libmanagement.so libinstrument.so libjsound.so libjsoundalsa.so \
42 libj2pcsc.so libj2pkcs11.so libj2gss.so libmlib_image.so \
43 libawt.so libsplashscreen.so libfreetype.so.6 libfontmanager.so \
44 libjpeg.so liblcms.so librmi.so libjawt.so libjaas_unix.so \
45 libattach.so libjdwp.so libdt_socket.so libhpi.so libjli.so \
46 libmawt.so libjvm.so \
47 libversionCheck.so libcompiledMethodLoad.so libgctest.so \
48 libheapViewer.so libheapTracker.so libminst.so libmtrace.so \
49 libwaiters.so libhprof.so \
50 "
51
52
53export ALT_CUPS_HEADERS_PATH = "${STAGING_INCDIR}"
54export ALT_FREETYPE_HEADERS_PATH = "${STAGING_INCDIR}/freetype2"
55export ALT_FREETYPE_LIB_PATH = "${STAGING_LIBDIR}"
56export CACAO_CONFIGURE_ARGS = "\
57 ${@['','--enable-softfloat'][bb.data.getVar('TARGET_FPU',d,1) == 'soft']}"
58
59JAVA_HOME[unexport] = "1"
60
61EXTRA_OECONF = "\
62 --disable-docs \
63 --disable-pulse-java \
64 \
65 --with-ecj-jar=${STAGING_DATADIR_JAVA_NATIVE}/ecj-bootstrap.jar \
66 --with-java=${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/bin/java \
67 --with-javac=${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/bin/javac \
68 --with-javah=${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/bin/javah \
69 --with-jar=${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/bin/jar \
70 --with-rmic=${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/bin/rmic \
71 --with-native2ascii=${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/bin/native2ascii \
72 --with-rhino=${STAGING_DATADIR_JAVA}/rhino.jar \
73 --without-ant-home \
74 --with-openjdk-src-dir=${WORKDIR}/openjdk-src-dir \
75 --with-parallel-jobs=${JDK_JOBS} \
76 \
77 --with-pkgversion=${PV} \
78 --with-cc-for-build=${BUILD_CC} \
79 --enable-zero \
80 --with-additional-vms=${WITH_ADDITIONAL_VMS} \
81 --enable-openjdk-cross-compilation \
82 "
83
84
85# OpenJDK supports parallel compilation but uses a plain number for this.
86# In OE we have PARALLEL_MAKE which is the actual option passed to make,
87# e.g. "-j 4".
88def get_jdk_jobs(d):
89 import bb
90
91 pm = bb.data.getVar('PARALLEL_MAKE', d, 1);
92 if not pm:
93 return "1"
94
95 pm = pm.split("j");
96 if (len(pm) == 2):
97 return pm[1]
98
99 # Whatever found in PARALLEL_MAKE was not suitable.
100 return "1"
101
102JDK_JOBS = "${@get_jdk_jobs(d)}"
103
104# Custom preparation of the sources which:
105# - cleans up the sources
106# - copies the patches into the proper directory
107# - prepares the FakeJDK directory structure
108#DISABLED because of incompatibility with oe stable 2009: do_prepareconfigure () {
109do_configure_prepend() {
110 chmod -R ug+w ${WORKDIR}/openjdk-src-dir
111 (cd ${WORKDIR}/openjdk-src-dir && sh ${S}/fsg.sh)
112
113 # Automatically copy everything that starts with "icedtea" (or "cacao") and ends with
114 # ".patch" into the patches directory.
115 find ${WORKDIR} -maxdepth 1 -name "icedtea*.patch" -exec cp {} ${S}/patches \;
116 find ${WORKDIR} -maxdepth 1 -name "cacao*.patch" -exec cp {} ${S}/patches \;
117
118 # use now the rt.jar from icedtea6-native
119 mkdir -p ${WORKDIR}/fake-jdk/jre/lib
120 ln -sf ${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/jre/lib/rt.jar ${WORKDIR}/fake-jdk/jre/lib/rt.jar
121
122 symlinked=false
123 bbnote "Creating symlinks for fake-jdk"
124 mkdir -p ${WORKDIR}/fake-jdk/include
125 for i in `find ${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/include` ;do
126 bn=`basename $i`
127 echo "Symlinking: $bn"
128 ln -sf $i ${WORKDIR}/fake-jdk/include/$bn;
129 symlinked=true
130 done
131
132 # If the symlinks have not been created the built cannot continue. This
133 # can happen if icedtea6-native is not ready at this point. The recipe
134 # should make sure this is not the case but a little sanity checking
135 # in such a complicated build can't be wrong.
136 if [ x$symlinked = xfalse ]
137 then
138 bberror "Build b0rken! Have not created any symlinks for fake-jdk!"
139 else
140 bbnote "fake-jdk setup appears sane."
141 fi
142}
143
144# Note: The following lines only work for OE.dev branch but cause an exception
145# in oe stable's 2009 bitbake. As such the function is prepended to do_configure instead.
146#addtask prepareconfigure after do_patch before do_configure
147# Makes prepareconfigure depend on icedtea6-native having being staged.
148#do_prepareconfigure[depends] += "icedtea6-native:do_populate_sysroot"
149
150
151do_configure_append() {
152 oe_runmake patch-ecj
153}
154
155# Work around broken variable quoting in oe-stable 2009 and provide the variable
156# via the environment which then overrides the erroneous value that was written
157# into '${ICETDEA}/Makefile'.
158# Icedtea's makefile is not compatible to parallelization so we cannot allow
159# passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are
160# parallelizable and we need ${PARALLEL_MAKE} to derive the proper value.
161# The base for this quirk is that GNU Make only considers the last "-j" option.
162EXTRA_OEMAKE += '-j 1 CC="${CC}" CCC="${CXX}" CPP="${CPP}" CXX="${CXX}" CC_FOR_BUILD="${BUILD_CC}"'
163
164EXTRA_OEMAKE += ' \
165 OE_CFLAGS="${TARGET_CFLAGS}" \
166 OE_CPPFLAGS="${TARGET_CPPFLAGS}" \
167 OE_CXXFLAGS="${TARGET_CXXFLAGS}" \
168 OE_LDFLAGS="${TARGET_LDFLAGS}" \
169 ZIPEXE="${STAGING_BINDIR_NATIVE}/zip" \
170 CROSS_COMPILE_ARCH="${JDK_ARCH}" \
171 '
172
173OE_LAUNCHER_LDFLAGS = "-Wl,-rpath-link,${STAGING_LIBDIR}/llvm${WANT_LLVM_RELEASE} -Wl,-rpath,/usr/lib/llvm${WANT_LLVM_RELEASE}"
174
175EXTRA_OEMAKE += 'OE_LAUNCHER_LDFLAGS="${OE_LAUNCHER_LDFLAGS}"'
176
177
178# The build of OpenJDK is a 3-part process. For better restartability and overrideability they have been split into
179# three functions.
180# 1. compile Hotspot or Cacao (this one is supposed to be implemented according to wanted VM)
181# 2. compile openjdk-ecj (to have libraries as libjvm.so and libjava.so which are needed later)
182# 3. compile openjdk (the final result)
183
184do_compilestepone() {
185 oe_runmake bootstrap-directory-ecj
186
187 # now we need to override the tools.jar to point to the normal jdk's tools.jar
188 rm bootstrap/ecj/lib/tools.jar
189 ln -s ${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/lib/tools.jar bootstrap/ecj/lib/tools.jar
190
191 # First build hotspot to get a libjvm.so (to link corba in the icedtea-ecj build)
192 bbnote "1/3 Building Hotspot"
193 oe_runmake hotspot
194
195 # Remove spurious libarch directory/symlink
196 rm -rf bootstrap/ecj/jre/lib/${JDK_ARCH} || true
197
198 # Provide a symlink to the target arch's libjvm.so (to link against)
199 ln -s `pwd`/${BUILD_DIR_ECJ}/j2sdk-image/jre/lib/${JDK_ARCH} bootstrap/jdk1.6.0/jre/lib/${JDK_ARCH}
200
201 # fake j2sdk-image
202 rm ${BUILD_DIR_ECJ}/j2sdk-image/include || true
203 cp -ar ${BUILD_DIR_ECJ}/hotspot/import/include ${BUILD_DIR_ECJ}/j2sdk-image/
204 install -d ${BUILD_DIR_ECJ}/j2sdk-image/bin
205}
206addtask compilestepone after do_configure before do_compilesteptwo
207
208# This part can be shared between cacao and hotspot-zero builds.
209do_compilesteptwo() {
210 bbnote "2/3 Building bootstrap JDK"
211
212 # Now cross-compile bootstrap JDK
213 rm stamps/icedtea-against-ecj.stamp stamps/icedtea-ecj.stamp || true
214 oe_runmake icedtea-against-ecj
215
216 ln -sf ../${BUILD_DIR_ECJ}/j2sdk-image bootstrap/icedtea
217
218 # Replace all executables with symlinks to their native equivalents.
219 for F in `find ${STAGING_LIBDIR_JVM_NATIVE}/icedtea6-native/bin -type f`
220 do
221 bf=`basename $F`
222 bbnote "Creating symlink for:" $bf
223 ln -sf $F bootstrap/icedtea/bin/$bf
224 done
225}
226addtask compilesteptwo after do_compilestepone before do_compile
227
228do_compile() {
229
230 bbnote "3/3 Building final JDK"
231
232 # Build the final Hotspot + OpenJDK
233 oe_runmake icedtea-against-icedtea
234}
235
236do_install() {
237 install -d ${D}${libdir_jvm}
238 cp -R ${B}/${BUILD_DIR}/j2sdk-image ${D}${JDK_HOME}
239
240 chmod u+rw -R ${D}${JDK_HOME}
241
242 # Fix symlink which would point into staging in the binary package.
243 ln -sf ${datadir_java}/rhino.jar ${D}${JDK_HOME}/jre/lib/rhino.jar
244
245 # JRE is a subset of JDK. So to save space and resemble what the BIG distros
246 # do we create symlinks from the JDK binaries to their counterparts in the
247 # JRE folder (which have to exist by that time b/c of dependencies).
248 for F in `find ${D}${JDK_HOME}/jre/bin -type f`
249 do
250 bf=`basename $F`
251 bbnote "replace:" $bf
252 rm ${D}${JDK_HOME}/bin/$bf
253 ln -s ${JDK_HOME}/jre/bin/$bf ${D}${JDK_HOME}/bin/$bf
254 done
255 install -m644 ${WORKDIR}/jvm.cfg ${D}${JDK_HOME}/jre/lib/${JDK_ARCH}/
256 # workaround for shared libarary searching
257 ln -sf ${JDK_HOME}/jre/lib/${JDK_ARCH}/server/libjvm.so ${D}${JDK_HOME}/jre/lib/${JDK_ARCH}/
258}
259
260# Notes about the ideas behind packaging:
261# 1) User should install openjdk-6-jre. This is a provider of 'java2-runtime'.
262# 2) This lets package mgmt install: openjdk-6-java
263# -> openjdk-6-vm-shark|openjdk-6-vm-zero|openjdk-6-vm-cacao -> openjdk-6-common
264#
265# With opkg the zero VM is chosen which is good b/c that is the best known (= compatible)
266# runtime. Installing other runtimes side-by-side is possible. Through jvm.cfg the following
267# order of precedence is enforced: zero, shark, cacao. User can chose a different runtime
268# by adding '-shark' or '-cacao' to the Java command (or by deinstalling an otherwise preferred
269# runtime)
270# 3) All other packages, including -jdk, are optional and not needed for normal Java apps.
271PACKAGES = " \
272 ${JDKPN}-jre \
273 ${JDKPN}-dbg \
274 ${JDKPN}-demo-dbg \
275 ${JDKPN}-demo \
276 ${JDKPN}-source \
277 ${JDKPN}-doc \
278 ${JDKPN}-jdk \
279 ${JDKPN}-java \
280 ${JDKPN}-vm-shark \
281 ${JDKPN}-vm-zero \
282 ${JDKPN}-vm-cacao \
283 ${JDKPN}-vm-jamvm \
284 ${JDKPN}-common \
285 "
286
287FILES_${JDKPN}-dbg = "\
288 ${JDK_HOME}/bin/.debug \
289 ${JDK_HOME}/lib/.debug \
290 ${JDK_HOME}/jre/bin/.debug \
291 ${JDK_HOME}/jre/lib/.debug \
292 ${JDK_HOME}/jre/lib/${JDK_ARCH}/.debug \
293 ${JDK_HOME}/jre/lib/${JDK_ARCH}/jli/.debug \
294 ${JDK_HOME}/lib/${JDK_ARCH}/jli/.debug \
295 ${JDK_HOME}/jre/lib/${JDK_ARCH}/native_threads/.debug \
296 ${JDK_HOME}/jre/lib/${JDK_ARCH}/server/.debug \
297 ${JDK_HOME}/jre/lib/${JDK_ARCH}/shark/.debug \
298 ${JDK_HOME}/jre/lib/${JDK_ARCH}/cacao/.debug \
299 ${JDK_HOME}/jre/lib/${JDK_ARCH}/jamvm/.debug \
300 ${JDK_HOME}/jre/lib/${JDK_ARCH}/headless/.debug \
301 ${JDK_HOME}/jre/lib/${JDK_ARCH}/xawt/.debug \
302 /usr/src \
303 "
304
305FILES_${JDKPN}-demo = "${JDK_HOME}/demo ${JDK_HOME}/sample"
306RDEPENDS_${JDKPN}-demo = "${JDKPN}-jre"
307FILES_${JDKPN}-demo-dbg = "\
308 ${JDK_HOME}/demo/jvmti/gctest/lib/.debug \
309 ${JDK_HOME}/demo/jvmti/heapTracker/lib/.debug \
310 ${JDK_HOME}/demo/jvmti/heapViewer/lib/.debug \
311 ${JDK_HOME}/demo/jvmti/hprof/lib/.debug \
312 ${JDK_HOME}/demo/jvmti/minst/lib/.debug \
313 ${JDK_HOME}/demo/jvmti/mtrace/lib/.debug \
314 ${JDK_HOME}/demo/jvmti/versionCheck/lib/.debug \
315 ${JDK_HOME}/demo/jvmti/waiters/lib/.debug \
316 ${JDK_HOME}/demo/jvmti/compiledMethodLoad/lib/.debug \
317 "
318
319FILES_${JDKPN}-source = "${JDK_HOME}/src.zip"
320
321FILES_${JDKPN}-java = "${JDK_HOME}/jre/bin/java"
322
323FILES_${JDKPN}-vm-zero = "${JDK_HOME}/jre/lib/${JDK_ARCH}/server/"
324
325FILES_${JDKPN}-vm-shark = "${JDK_HOME}/jre/lib/${JDK_ARCH}/shark/"
326
327FILES_${JDKPN}-vm-cacao = "${JDK_HOME}/jre/lib/${JDK_ARCH}/cacao/"
328
329FILES_${JDKPN}-vm-jamvm = "${JDK_HOME}/jre/lib/${JDK_ARCH}/jamvm/"
330
331FILES_${JDKPN}-common = "${JDK_HOME}/jre/ASSEMBLY_EXCEPTION \
332 ${JDK_HOME}/jre/THIRD_PARTY_README \
333 ${JDK_HOME}/jre/LICENSE \
334 ${JDK_HOME}/jre/lib \
335 "
336
337FILES_openjdk-6-jre_append = " \
338 ${JDK_HOME}/jre/bin/keytool \
339 ${JDK_HOME}/jre/bin/orbd \
340 ${JDK_HOME}/jre/bin/pack200 \
341 ${JDK_HOME}/jre/bin/rmid \
342 ${JDK_HOME}/jre/bin/rmiregistry \
343 ${JDK_HOME}/jre/bin/servertool \
344 ${JDK_HOME}/jre/bin/tnameserv \
345 ${JDK_HOME}/jre/bin/unpack200 \
346 ${JDK_HOME}/jre/bin/policytool \
347 ${JDK_HOME}/jre/bin/javaws \
348 "
349
350RDEPENDS_${JDKPN}-common = "librhino-java"
351
352RPROVIDES_${JDKPN}-vm-shark = "java2-vm"
353RPROVIDES_${JDKPN}-vm-zero = "java2-vm"
354RPROVIDES_${JDKPN}-vm-cacao = "java2-vm"
355RPROVIDES_${JDKPN}-vm-jamvm = "java2-vm"
356
357# Even though a vm is a hard dependency it is set as RRECOMMENDS so a single vm can get uninstalled:
358# root@beaglebone:~/java# opkg remove openjdk-6-vm-shark
359# No packages removed.
360# Collected errors:
361# * print_dependents_warning: Package openjdk-6-vm-shark is depended upon by packages:
362# * print_dependents_warning: openjdk-6-java
363# * print_dependents_warning: These might cease to work if package openjdk-6-vm-shark is removed.
364RRECOMMENDS_${JDKPN}-java = "java2-vm"
365
366# For some reason shark and cacao do not automatically depends on -common.
367# So we add that manually.
368RDEPENDS_${JDKPN}-vm-shark = "${JDKPN}-common"
369RDEPENDS_${JDKPN}-vm-cacao = "${JDKPN}-common"
370RDEPENDS_${JDKPN}-vm-jamvm = "${JDKPN}-common"
371
372# There is a symlink to a .so but this one is valid.
373INSANE_SKIP_${JDKPN}-vm-shark = "dev-so"
374INSANE_SKIP_${JDKPN}-vm-zero = "dev-so"
375INSANE_SKIP_${JDKPN}-vm-cacao = "dev-so"
376INSANE_SKIP_${JDKPN}-vm-jamvm = "dev-so"
377INSANE_SKIP_${JDKPN}-common = "dev-so"
378
379FILES_${JDKPN}-jdk = " \
380 ${JDK_HOME}/bin \
381 ${JDK_HOME}/lib \
382 ${JDK_HOME}/include \
383 ${JDK_HOME}/ASSEMBLY_EXCEPTION \
384 ${JDK_HOME}/THIRD_PARTY_README \
385 ${JDK_HOME}/LICENSE \
386 "
387RDEPENDS_${JDKPN}-jre = "${JDKPN}-java"
388RPROVIDES_${JDKPN}-jre = "java2-runtime"
389
390RDEPENDS_${JDKPN}-jdk = "${JDKPN}-jre"
391
392FILES_${JDKPN}-doc = "${JDK_HOME}/man"
393
394require openjdk-postinst.inc
395
396ALTERNATIVE_PRIORITY = "20"