summaryrefslogtreecommitdiffstats
path: root/recipes-core/openjdk/openjdk-8-common.inc
diff options
context:
space:
mode:
authorJens Rehsack <rehsack@gmail.com>2015-12-08 14:52:51 +0100
committerMaxin B. John <maxin.john@intel.com>2015-12-08 17:43:40 +0200
commitbac3b9acee5110390d15d38dacdb1622e31b2238 (patch)
tree1f39d7b8392576f19f77fb65f470391e2d15c6c1 /recipes-core/openjdk/openjdk-8-common.inc
parent04d5d0bf414c05ca59618d77f17ff9898aa1c566 (diff)
downloadmeta-java-bac3b9acee5110390d15d38dacdb1622e31b2238.tar.gz
openjdk-8: add recipes for openjdk-8 and openjre-8
This adds openjdk-8 for native and target builds and allows a stripped openjre-8 being built as well instead of trying to cherry-pick jre components from jdk-image. The recipes allow building openjdk-8 with or without: * x11 * cups * alsa/pulseaudio and let packager enable unlimited-crypto, if desired. To support certificate based java libraries, cacerts is created based on ca-certificates from OE-core. Since there can be only one PROVIDES for virtual/java-native and virtual/javac-native, move the provides to openjdk-8-native (I think everyone agrees it's a better choice than ecj-bootstrap-native). Plus: Applying a fix from openjdk-9 repository which fixes build issues using gcc5 Signed-off-by: Jens Rehsack <sno@netbsd.org> Signed-off-by: Maxin B. John <maxin.john@intel.com>
Diffstat (limited to 'recipes-core/openjdk/openjdk-8-common.inc')
-rw-r--r--recipes-core/openjdk/openjdk-8-common.inc231
1 files changed, 231 insertions, 0 deletions
diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc
new file mode 100644
index 0000000..ad35488
--- /dev/null
+++ b/recipes-core/openjdk/openjdk-8-common.inc
@@ -0,0 +1,231 @@
1DESCRIPTION = "Java runtime based upon the OpenJDK Project"
2HOMEPAGE = "http://http://openjdk.java.net/"
3LICENSE = "GPL-2.0-with-classpath-exception"
4
5LIC_FILES_CHKSUM = "file://LICENSE;md5=7b4baeedfe2d40cb03536573bc2c89b1"
6
7inherit java autotools gettext qemu pkgconfig
8
9AUTOTOOLS_SCRIPT_PATH = "${S}/common/autoconf/"
10export AUTOCONF_DIR="${AUTOTOOLS_SCRIPT_PATH}"
11
12FILESPATH =. "${FILE_DIRNAME}/patches-openjdk-8:"
13
14# for weird openjdk-common.inc
15S = "${WORKDIR}/${OPENJDK_HG_U}-${OPENJDK_CHANGESET}"
16
17SRC_URI = " \
18 ${OPENJDK_URI} \
19 ${HOTSPOT_URI} \
20 ${CORBA_URI} \
21 ${JAXP_URI} \
22 ${JAXWS_URI} \
23 ${JDK_URI} \
24 ${LANGTOOLS_URI} \
25 ${NASHORN_URI} \
26 file://LICENSE \
27 ${PATCHES_URI} \
28"
29
30do_unpack_extract_submodules () {
31 cd "${S}"
32 # tar --transform
33 tar xjf ${WORKDIR}/${CORBA_FILE} --transform "s,-${CORBA_CHANGESET},,g"
34 tar xjf ${WORKDIR}/${HOTSPOT_FILE} --transform "s,-${HOTSPOT_CHANGESET},,g"
35 tar xjf ${WORKDIR}/${JAXP_FILE} --transform "s,-${JAXP_CHANGESET},,g"
36 tar xjf ${WORKDIR}/${JAXWS_FILE} --transform "s,-${JAXWS_CHANGESET},,g"
37 tar xjf ${WORKDIR}/${JDK_FILE} --transform "s,-${JDK_CHANGESET},,g"
38 tar xjf ${WORKDIR}/${LANGTOOLS_FILE} --transform "s,-${LANGTOOLS_CHANGESET},,g"
39 tar xjf ${WORKDIR}/${NASHORN_FILE} --transform "s,-${NASHORN_CHANGESET},,g"
40}
41
42def package_config_option_cleanup(d):
43 distro_x11 = bb.utils.contains('DISTRO_FEATURES', 'x11', True, False, d)
44 distro_alsa = bb.utils.contains('DISTRO_FEATURES', 'alsa', True, False, d)
45 distro_pulseaudio = bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', True, False, d)
46
47 with_x11 = bb.utils.contains('PACKAGECONFIG', 'x11', True, False, d)
48 with_cups = bb.utils.contains('PACKAGECONFIG', 'cups', True, False, d)
49 with_alsa = bb.utils.contains('PACKAGECONFIG', 'alsa', True, False, d)
50 with_pulseaudio = bb.utils.contains('PACKAGECONFIG', 'pulseaudio', True, False, d)
51
52 option_headless = bb.utils.contains('PACKAGECONFIG', 'headless', True, False, d)
53 option_headful = bb.utils.contains('PACKAGECONFIG', 'headful', True, False, d)
54 option_soundless = bb.utils.contains('PACKAGECONFIG', 'soundless', True, False, d)
55
56 if option_headless and option_headful:
57 option_headless = False
58
59 if option_headful and not with_x11:
60 with_x11 = True
61
62 if option_headful and not with_cups:
63 with_cups = True
64
65 if option_soundless and with_alsa:
66 with_alsa = False
67
68 if option_soundless and with_pulseaudio:
69 with_pulseaudio = False
70
71 if with_x11 and not distro_x11:
72 with_x11 = False
73
74 if with_alsa and not distro_alsa:
75 with_alsa = False
76
77 if with_pulseaudio and not distro_pulseaudio:
78 with_pulseaudio = False
79
80 if option_headful and not with_x11:
81 option_headful = False
82
83 if option_headful and not with_cups:
84 option_headful = False
85
86 if not option_headless and not with_x11:
87 option_headless = True
88
89 if not option_headless and not with_cups:
90 option_headless = True
91
92 if not option_soundless and not with_alsa:
93 option_soundless = True
94
95 if not option_soundless and not with_pulseaudio:
96 option_soundless = True
97
98 options = {'make': [], 'cpp': [], 'env': [], 'configure': ["--disable-ccache"] }
99
100 if option_headful:
101 options['configure'].append("--enable-headful")
102
103 if option_headless:
104 options['configure'].append("--disable-headful")
105 options['make'].append("BUILD_HEADLESS_ONLY=1")
106 options['make'].append("BUILD_HEADLESS=true")
107 options['cpp'].append("-DHEADLESS=true")
108
109 if option_soundless:
110 options['make'].append("BUILD_SOUNDLESS_ONLY=1")
111
112 if not with_x11:
113 options['make'].append("X11_NOT_NEEDED=1")
114 options['env'].append("X11_NOT_NEEDED=yes")
115
116 if not with_cups:
117 options['make'].append("CUPS_NOT_NEEDED=1")
118 options['env'].append("CUPS_NOT_NEEDED=yes")
119
120 if not with_alsa:
121 options['make'].append("ALSA_NOT_NEEDED=1")
122 options['env'].append("ALSA_NOT_NEEDED=yes")
123
124 if not with_pulseaudio:
125 options['make'].append("PULSE_NOT_NEEDED=1")
126 options['env'].append("PULSE_NOT_NEEDED=yes")
127
128 options = [ ' '.join(options['make']), ' '.join(options['cpp']), ' '.join(options['env']), ' '.join(options['configure']) ]
129
130 return options
131
132def jdk_make_options(d):
133 options = package_config_option_cleanup(d)
134 return options[0]
135
136def jdk_cpp_options(d):
137 options = package_config_option_cleanup(d)
138 if not options[1]:
139 return ""
140
141 return " " + options[1]
142
143def jdk_environment_options(d):
144 options = package_config_option_cleanup(d)
145 return options[2]
146
147def jdk_configure_options(d):
148 options = package_config_option_cleanup(d)
149 return options[3]
150
151do_unpack[postfuncs] += "do_unpack_extract_submodules"
152
153POST_CONFIGURE_CLEAN_X11 = "${@base_contains('PACKAGECONFIG', 'x11', '', 'rm -f jdk/src/solaris/classes/sun/awt/X11/*.java', d)}"
154
155do_patch_openjdk8() {
156 olddir=`pwd`
157 cd "${S}"
158 ${POST_CONFIGURE_CLEAN_X11}
159 for OJ8P in ${WORKDIR}/openjdk8-*.patch; do
160 patch -p0 < ${OJ8P}
161 done
162}
163
164do_patch[postfuncs] += "do_patch_openjdk8"
165
166do_configure_prepend() {
167 export ${@jdk_environment_options(d)}
168}
169
170# OpenJDK supports parallel compilation but uses a plain number for this.
171# In OE we have PARALLEL_MAKE which is the actual option passed to make,
172# e.g. "-j 4".
173OPENJDK8_PARALLEL_MAKE := "${PARALLEL_MAKE}"
174PARALLEL_MAKE = ""
175def get_jdk8_native_jobs(d):
176 import bb
177
178 pm = bb.data.getVar('OPENJDK8_PARALLEL_MAKE', d, 1);
179 if not pm:
180 return "1"
181
182 pm = pm.split("j");
183 if (len(pm) == 2):
184 return pm[1].strip()
185
186 # Whatever found in PARALLEL_MAKE was not suitable.
187 return "1"
188
189# A function that is needed in the Shark builds.
190def get_llvm_configure_arch(d):
191 import bb;
192
193 arch = bb.data.getVar('TRANSLATED_TARGET_ARCH', d, 1)
194 if arch == "x86-64" or arch == "i486" or arch == "i586" or arch == "i686":
195 arch = "x86"
196 elif arch == "arm":
197 arch = "arm"
198 elif arch == "mipsel" or arch == "mips":
199 arch = "mips"
200 elif arch == "powerpc" or arch == "powerpc64":
201 arch = "powerpc"
202 else:
203 bb.warn("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) );
204
205 return arch
206
207# Provides the target architecture to the configure script.
208export LLVM_CONFIGURE_ARCH="${@get_llvm_configure_arch(d)}"
209
210# OpenJDK uses slightly different names for certain arches. We need to know
211# this to create some files which are expected by the build.
212def get_jdk_arch(d):
213 import bb
214
215 jdk_arch = bb.data.getVar('TRANSLATED_TARGET_ARCH', d, 1)
216 if jdk_arch == "x86-64":
217 jdk_arch = "amd64"
218 elif jdk_arch == "powerpc":
219 jdk_arch = "ppc"
220 elif jdk_arch == "powerpc64":
221 jdk_arch = "ppc64"
222 elif (jdk_arch == "i486" or jdk_arch == "i586" or jdk_arch == "i686"):
223 jdk_arch = "i386"
224
225 return jdk_arch
226
227JDK_ARCH = "${@get_jdk_arch(d)}"
228
229export DEBUG_BINARIES = "true"
230
231ALTERNATIVE_PRIORITY = "50"