summaryrefslogtreecommitdiffstats
path: root/recipes-core/openjdk/openjdk-common.inc
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 /recipes-core/openjdk/openjdk-common.inc
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>
Diffstat (limited to 'recipes-core/openjdk/openjdk-common.inc')
-rw-r--r--recipes-core/openjdk/openjdk-common.inc77
1 files changed, 77 insertions, 0 deletions
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}"'