summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2013-04-02 20:34:12 -0700
committerKhem Raj <raj.khem@gmail.com>2013-04-04 00:05:30 -0700
commit4afce8c0adba43ab1df8a7b5f3fb27c5416951a3 (patch)
tree9e1139a571d6dcdd089b2ff08245f7de2260b2fd
parent95d2eee93801618044e6cc1fe73cbc03fdb0d303 (diff)
downloadmeta-java-4afce8c0adba43ab1df8a7b5f3fb27c5416951a3.tar.gz
openjdk: Create a common inc file between openjdk 6 and 7
we hit below errors ERROR: The function get_jdk_arch defined in openjdk-7-common.inc was already declared in openjdk-6-common.inc. BitBake has a global python function namespace so shared functions should be declared in a common include file rather than being duplicated, or if the functions are different, please use different function names. ERROR: The function get_llvm_configure_arch defined in openjdk-7-common.inc was already declared in openjdk-6-c ommon.inc. BitBake has a global python function namespace so shared functions should be declared in a common in clude file rather than being duplicated, or if the functions are different, please use different function names This patch fixes the above Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-core/openjdk/openjdk-6-common.inc80
-rw-r--r--recipes-core/openjdk/openjdk-7-common.inc78
-rw-r--r--recipes-core/openjdk/openjdk-common.inc77
3 files changed, 81 insertions, 154 deletions
diff --git a/recipes-core/openjdk/openjdk-6-common.inc b/recipes-core/openjdk/openjdk-6-common.inc
index f186e91..49808d7 100644
--- a/recipes-core/openjdk/openjdk-6-common.inc
+++ b/recipes-core/openjdk/openjdk-6-common.inc
@@ -1,15 +1,7 @@
1DESCRIPTION = "Java runtime based upon the OpenJDK- and Icedtea Project" 1require openjdk-common.inc
2HOMEPAGE = "http://icedtea.classpath.org"
3LICENSE = "GPL-2.0-with-classpath-exception"
4PRIORITY = "optional"
5SECTION = "libs"
6 2
7ICEDTEA_VERSION = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[1].split("-")[1] or '1.0'}"
8ICEDTEA = "icedtea6-${ICEDTEA_VERSION}" 3ICEDTEA = "icedtea6-${ICEDTEA_VERSION}"
9 4
10S = "${WORKDIR}/${ICEDTEA}"
11B = "${S}/build"
12
13INC_PR = "r21" 5INC_PR = "r21"
14 6
15SRC_URI = "\ 7SRC_URI = "\
@@ -41,15 +33,6 @@ DEPENDS = "giflib libpng jpeg cups \
41 zip-native \ 33 zip-native \
42 " 34 "
43 35
44DEPENDS_append_libc-uclibc = " virtual/libiconv "
45
46# The OpenJDK build with interpreter optimizations for ARM depends on a binary
47# that generates constants for an assembler source file. There is no other
48# way than to generate this on a pseudo machine. Cross-compiling would not help
49# because structure sizes and/or alignment may differ.
50DEPENDS_append = " qemu-native "
51
52
53# No package should directly depend on this (it should require 36# No package should directly depend on this (it should require
54# java2-runtime instead). 37# java2-runtime instead).
55PRIVATE_LIBS = "\ 38PRIVATE_LIBS = "\
@@ -67,8 +50,6 @@ PRIVATE_LIBS = "\
67 " 50 "
68 51
69 52
70inherit java autotools gettext qemu
71
72export ALT_CUPS_HEADERS_PATH = "${STAGING_INCDIR}" 53export ALT_CUPS_HEADERS_PATH = "${STAGING_INCDIR}"
73export ALT_FREETYPE_HEADERS_PATH = "${STAGING_INCDIR}/freetype2" 54export ALT_FREETYPE_HEADERS_PATH = "${STAGING_INCDIR}/freetype2"
74export ALT_FREETYPE_LIB_PATH = "${STAGING_LIBDIR}" 55export ALT_FREETYPE_LIB_PATH = "${STAGING_LIBDIR}"
@@ -101,26 +82,6 @@ EXTRA_OECONF = "\
101 " 82 "
102 83
103 84
104# OpenJDK uses slightly different names for certain arches. We need to know
105# this to create some files which are expected by the build.
106def get_jdk_arch(d):
107 import bb
108
109 jdk_arch = bb.data.getVar('TARGET_ARCH', d, 1)
110 if jdk_arch == "x86_64":
111 jdk_arch = "amd64"
112 elif jdk_arch == "powerpc":
113 jdk_arch = "ppc"
114 elif jdk_arch == "powerpc64":
115 jdk_arch = "ppc64"
116 elif (jdk_arch == "i486" or jdk_arch == "i586" or jdk_arch == "i686"):
117 jdk_arch = "i386"
118
119 return jdk_arch
120
121JDK_ARCH = "${@get_jdk_arch(d)}"
122JDK_HOME = "${libdir_jvm}/${JDK_DIR}"
123
124# OpenJDK supports parallel compilation but uses a plain number for this. 85# OpenJDK supports parallel compilation but uses a plain number for this.
125# In OE we have PARALLEL_MAKE which is the actual option passed to make, 86# In OE we have PARALLEL_MAKE which is the actual option passed to make,
126# e.g. "-j 4". 87# e.g. "-j 4".
@@ -140,24 +101,6 @@ def get_jdk_jobs(d):
140 101
141JDK_JOBS = "${@get_jdk_jobs(d)}" 102JDK_JOBS = "${@get_jdk_jobs(d)}"
142 103
143# A function that is needed in the Shark builds.
144def get_llvm_configure_arch(d):
145 import bb;
146
147 arch = bb.data.getVar('TARGET_ARCH', d, 1)
148 if arch == "x86_64" or arch == "i486" or arch == "i586" or arch == "i686":
149 arch = "x86"
150 elif arch == "arm":
151 arch = "arm"
152 elif arch == "mipsel" or arch == "mips":
153 arch = "mips"
154 elif arch == "powerpc" or arch == "powerpc64":
155 arch = "powerpc"
156 else:
157 bb.warn("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) );
158
159 return arch
160
161# Custom preparation of the sources which: 104# Custom preparation of the sources which:
162# - cleans up the sources 105# - cleans up the sources
163# - copies the patches into the proper directory 106# - copies the patches into the proper directory
@@ -216,7 +159,7 @@ do_configure_append() {
216# passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are 159# passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are
217# parallelizable and we need ${PARALLEL_MAKE} to derive the proper value. 160# parallelizable and we need ${PARALLEL_MAKE} to derive the proper value.
218# The base for this quirk is that GNU Make only considers the last "-j" option. 161# The base for this quirk is that GNU Make only considers the last "-j" option.
219EXTRA_OEMAKE = '-j 1 CC="${CC}" CCC="${CXX}" CPP="${CPP}" CXX="${CXX}" CC_FOR_BUILD="${BUILD_CC}"' 162EXTRA_OEMAKE += '-j 1 CC="${CC}" CCC="${CXX}" CPP="${CPP}" CXX="${CXX}" CC_FOR_BUILD="${BUILD_CC}"'
220 163
221EXTRA_OEMAKE += ' \ 164EXTRA_OEMAKE += ' \
222 OE_CFLAGS="${TARGET_CFLAGS}" \ 165 OE_CFLAGS="${TARGET_CFLAGS}" \
@@ -226,30 +169,11 @@ EXTRA_OEMAKE += ' \
226 ZIPEXE="${STAGING_BINDIR_NATIVE}/zip" \ 169 ZIPEXE="${STAGING_BINDIR_NATIVE}/zip" \
227 ' 170 '
228 171
229# Puts an OE specific string into the binary making it possible for the user
230# to know where it comes from (and blame the right people ...).
231DIST_ID = "Built for ${DISTRO}"
232DIST_NAME = "${DISTRO}"
233EXTRA_OEMAKE += 'DIST_NAME="${DIST_NAME}" DIST_ID="${DIST_ID}"'
234
235
236# llvm configure and compiles stuff
237
238export WANT_LLVM_RELEASE = "2.8"
239
240# Provides the target architecture to the configure script.
241export LLVM_CONFIGURE_ARCH="${@get_llvm_configure_arch(d)}"
242
243OE_LAUNCHER_LDFLAGS = "-Wl,-rpath-link,${STAGING_LIBDIR}/llvm${WANT_LLVM_RELEASE} -Wl,-rpath,/usr/lib/llvm${WANT_LLVM_RELEASE}" 172OE_LAUNCHER_LDFLAGS = "-Wl,-rpath-link,${STAGING_LIBDIR}/llvm${WANT_LLVM_RELEASE} -Wl,-rpath,/usr/lib/llvm${WANT_LLVM_RELEASE}"
244 173
245EXTRA_OEMAKE += 'OE_LAUNCHER_LDFLAGS="${OE_LAUNCHER_LDFLAGS}"' 174EXTRA_OEMAKE += 'OE_LAUNCHER_LDFLAGS="${OE_LAUNCHER_LDFLAGS}"'
246 175
247 176
248# Large stack is required at least on x86_64 host, otherwise random segfaults appear:
249QEMU = "${@qemu_target_binary(d)} ${QEMU_OPTIONS} -s 1048576 -L ${STAGING_DIR_TARGET} -E LD_LIBRARY_PATH=${STAGING_BASELIBDIR}"
250
251EXTRA_OEMAKE += 'QEMU="${QEMU}"'
252
253# The build of OpenJDK is a 3-part process. For better restartability and overrideability they have been split into 177# The build of OpenJDK is a 3-part process. For better restartability and overrideability they have been split into
254# three functions. 178# three functions.
255# 1. compile Hotspot or Cacao (this one is supposed to be implemented according to wanted VM) 179# 1. compile Hotspot or Cacao (this one is supposed to be implemented according to wanted VM)
diff --git a/recipes-core/openjdk/openjdk-7-common.inc b/recipes-core/openjdk/openjdk-7-common.inc
index 1d5f2ca..5194d9f 100644
--- a/recipes-core/openjdk/openjdk-7-common.inc
+++ b/recipes-core/openjdk/openjdk-7-common.inc
@@ -1,15 +1,6 @@
1DESCRIPTION = "Java runtime based upon the OpenJDK- and Icedtea Project" 1require openjdk-common.inc
2HOMEPAGE = "http://icedtea.classpath.org"
3LICENSE = "GPL-2.0-with-classpath-exception"
4PRIORITY = "optional"
5SECTION = "libs"
6
7ICEDTEA_VERSION = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[1].split("-")[1] or '1.0'}"
8ICEDTEA = "icedtea-${ICEDTEA_VERSION}" 2ICEDTEA = "icedtea-${ICEDTEA_VERSION}"
9 3
10S = "${WORKDIR}/${ICEDTEA}"
11B = "${S}/build"
12
13INC_PR = "r5" 4INC_PR = "r5"
14 5
15SRC_URI = " \ 6SRC_URI = " \
@@ -45,15 +36,6 @@ DEPENDS = " \
45 freetype alsa-lib libffi \ 36 freetype alsa-lib libffi \
46 " 37 "
47 38
48DEPENDS_append_libc-uclibc = " virtual/libiconv "
49
50# The OpenJDK build with interpreter optimizations for ARM depends on a binary
51# that generates constants for an assembler source file. There is no other
52# way than to generate this on a pseudo machine. Cross-compiling would not help
53# because structure sizes and/or alignment may differ.
54DEPENDS_append = " qemu-native "
55
56
57# No package should directly depend on this (it should require 39# No package should directly depend on this (it should require
58# java2-runtime instead). 40# java2-runtime instead).
59PRIVATE_LIBS = "\ 41PRIVATE_LIBS = "\
@@ -69,7 +51,6 @@ PRIVATE_LIBS = "\
69 libheapViewer.so libheapTracker.so libminst.so libmtrace.so \ 51 libheapViewer.so libheapTracker.so libminst.so libmtrace.so \
70 libwaiters.so libhprof.so \ 52 libwaiters.so libhprof.so \
71 " 53 "
72inherit java autotools gettext qemu
73 54
74export ALT_CUPS_HEADERS_PATH = "${STAGING_INCDIR}" 55export ALT_CUPS_HEADERS_PATH = "${STAGING_INCDIR}"
75export ALT_FREETYPE_HEADERS_PATH = "${STAGING_INCDIR}/freetype2" 56export ALT_FREETYPE_HEADERS_PATH = "${STAGING_INCDIR}/freetype2"
@@ -140,45 +121,6 @@ EXTRA_OECONF = " \
140 --with-cc-for-build=${BUILD_CC} \ 121 --with-cc-for-build=${BUILD_CC} \
141 " 122 "
142 123
143# OpenJDK uses slightly different names for certain arches. We need to know
144# this to create some files which are expected by the build.
145def get_jdk_arch(d):
146 import bb
147
148 jdk_arch = bb.data.getVar('TRANSLATED_TARGET_ARCH', d, 1)
149 if jdk_arch == "x86-64":
150 jdk_arch = "amd64"
151 elif jdk_arch == "powerpc":
152 jdk_arch = "ppc"
153 elif jdk_arch == "powerpc64":
154 jdk_arch = "ppc64"
155 elif (jdk_arch == "i486" or jdk_arch == "i586" or jdk_arch == "i686"):
156 jdk_arch = "i386"
157
158 return jdk_arch
159
160JDK_ARCH = "${@get_jdk_arch(d)}"
161JDK_HOME = "${libdir_jvm}/${JDK_DIR}"
162JDK_FAKE = "${WORKDIR}/fake-jdk"
163
164# A function that is needed in the Shark builds.
165def get_llvm_configure_arch(d):
166 import bb;
167
168 arch = bb.data.getVar('TRANSLATED_TARGET_ARCH', d, 1)
169 if arch == "x86-64" or arch == "i486" or arch == "i586" or arch == "i686":
170 arch = "x86"
171 elif arch == "arm":
172 arch = "arm"
173 elif arch == "mipsel" or arch == "mips":
174 arch = "mips"
175 elif arch == "powerpc" or arch == "powerpc64":
176 arch = "powerpc"
177 else:
178 bb.warn("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) );
179
180 return arch
181
182do_configure_prepend() { 124do_configure_prepend() {
183 echo "Configure with parallel-jobs: ${JDK_JOBS}" 125 echo "Configure with parallel-jobs: ${JDK_JOBS}"
184 126
@@ -199,7 +141,7 @@ do_configure_append() {
199# passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are 141# passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are
200# parallelizable and we need ${PARALLEL_MAKE} to derive the proper value. 142# parallelizable and we need ${PARALLEL_MAKE} to derive the proper value.
201# The base for this quirk is that GNU Make only considers the last "-j" option. 143# The base for this quirk is that GNU Make only considers the last "-j" option.
202EXTRA_OEMAKE = 'CC="${CC}" CCC="${CXX}" CPP="${CPP}" CXX="${CXX}" CC_FOR_BUILD="${BUILD_CC}"' 144EXTRA_OEMAKE += 'CC="${CC}" CCC="${CXX}" CPP="${CPP}" CXX="${CXX}" CC_FOR_BUILD="${BUILD_CC}"'
203 145
204EXTRA_OEMAKE += ' \ 146EXTRA_OEMAKE += ' \
205 OE_CFLAGS="${TARGET_CFLAGS}" \ 147 OE_CFLAGS="${TARGET_CFLAGS}" \
@@ -211,17 +153,6 @@ EXTRA_OEMAKE += ' \
211 REQUIRED_ALSA_VERSION="" \ 153 REQUIRED_ALSA_VERSION="" \
212 ' 154 '
213 155
214# Puts an OE specific string into the binary making it possible for the user
215# to know where it comes from (and blame the right people ...).
216DIST_ID = "Built for ${DISTRO}"
217DIST_NAME = "${DISTRO}"
218EXTRA_OEMAKE += 'DIST_NAME="${DIST_NAME}" DIST_ID="${DIST_ID}"'
219
220
221# llvm configure and compiles stuff
222
223export WANT_LLVM_RELEASE = "2.8"
224
225# Provides the target architecture to the configure script. 156# Provides the target architecture to the configure script.
226export LLVM_CONFIGURE_ARCH="${@get_llvm_configure_arch(d)}" 157export LLVM_CONFIGURE_ARCH="${@get_llvm_configure_arch(d)}"
227 158
@@ -231,11 +162,6 @@ OE_LAUNCHER_LDFLAGS_arm = ""
231 162
232EXTRA_OEMAKE += 'OE_LAUNCHER_LDFLAGS="${OE_LAUNCHER_LDFLAGS}"' 163EXTRA_OEMAKE += 'OE_LAUNCHER_LDFLAGS="${OE_LAUNCHER_LDFLAGS}"'
233 164
234# Large stack is required at least on x86_64 host, otherwise random segfaults appear:
235QEMU = "${@qemu_target_binary(d)} ${QEMU_OPTIONS} -s 2097152 -L ${STAGING_DIR_TARGET} -E LD_LIBRARY_PATH=${STAGING_BASELIBDIR}"
236
237EXTRA_OEMAKE += 'QEMU="${QEMU}"'
238
239do_compile() { 165do_compile() {
240 166
241 bbnote "3/3 Building final JDK" 167 bbnote "3/3 Building final JDK"
diff --git a/recipes-core/openjdk/openjdk-common.inc b/recipes-core/openjdk/openjdk-common.inc
new file mode 100644
index 0000000..a993ea0
--- /dev/null
+++ b/recipes-core/openjdk/openjdk-common.inc
@@ -0,0 +1,77 @@
1DESCRIPTION = "Java runtime based upon the OpenJDK- and Icedtea Project"
2HOMEPAGE = "http://icedtea.classpath.org"
3LICENSE = "GPL-2.0-with-classpath-exception"
4PRIORITY = "optional"
5SECTION = "libs"
6
7ICEDTEA_VERSION = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[1].split("-")[1] or '1.0'}"
8
9S = "${WORKDIR}/${ICEDTEA}"
10B = "${S}/build"
11
12DEPENDS_append_libc-uclibc = " virtual/libiconv "
13
14# The OpenJDK build with interpreter optimizations for ARM depends on a binary
15# that generates constants for an assembler source file. There is no other
16# way than to generate this on a pseudo machine. Cross-compiling would not help
17# because structure sizes and/or alignment may differ.
18DEPENDS_append = " qemu-native "
19
20inherit java autotools gettext qemu
21
22# OpenJDK uses slightly different names for certain arches. We need to know
23# this to create some files which are expected by the build.
24def get_jdk_arch(d):
25 import bb
26
27 jdk_arch = bb.data.getVar('TRANSLATED_TARGET_ARCH', d, 1)
28 if jdk_arch == "x86-64":
29 jdk_arch = "amd64"
30 elif jdk_arch == "powerpc":
31 jdk_arch = "ppc"
32 elif jdk_arch == "powerpc64":
33 jdk_arch = "ppc64"
34 elif (jdk_arch == "i486" or jdk_arch == "i586" or jdk_arch == "i686"):
35 jdk_arch = "i386"
36
37 return jdk_arch
38
39JDK_ARCH = "${@get_jdk_arch(d)}"
40JDK_HOME = "${libdir_jvm}/${JDK_DIR}"
41JDK_FAKE = "${WORKDIR}/fake-jdk"
42
43# A function that is needed in the Shark builds.
44def get_llvm_configure_arch(d):
45 import bb;
46
47 arch = bb.data.getVar('TRANSLATED_TARGET_ARCH', d, 1)
48 if arch == "x86-64" or arch == "i486" or arch == "i586" or arch == "i686":
49 arch = "x86"
50 elif arch == "arm":
51 arch = "arm"
52 elif arch == "mipsel" or arch == "mips":
53 arch = "mips"
54 elif arch == "powerpc" or arch == "powerpc64":
55 arch = "powerpc"
56 else:
57 bb.warn("%s does not support %s yet" % (bb.data.getVar('PN', d, 1), arch) );
58
59 return arch
60
61# Puts an OE specific string into the binary making it possible for the user
62# to know where it comes from (and blame the right people ...).
63DIST_ID = "Built for ${DISTRO}"
64DIST_NAME = "${DISTRO}"
65EXTRA_OEMAKE = 'DIST_NAME="${DIST_NAME}" DIST_ID="${DIST_ID}"'
66
67# llvm configure and compiles stuff
68
69export WANT_LLVM_RELEASE = "2.8"
70
71# Provides the target architecture to the configure script.
72export LLVM_CONFIGURE_ARCH="${@get_llvm_configure_arch(d)}"
73
74# Large stack is required at least on x86_64 host, otherwise random segfaults appear:
75QEMU = "${@qemu_target_binary(d)} ${QEMU_OPTIONS} -s 2097152 -L ${STAGING_DIR_TARGET} -E LD_LIBRARY_PATH=${STAGING_BASELIBDIR}"
76
77EXTRA_OEMAKE += 'QEMU="${QEMU}"'