diff options
Diffstat (limited to 'recipes-core/openjdk/openjdk-common.inc')
| -rw-r--r-- | recipes-core/openjdk/openjdk-common.inc | 77 |
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 @@ | |||
| 1 | DESCRIPTION = "Java runtime based upon the OpenJDK- and Icedtea Project" | ||
| 2 | HOMEPAGE = "http://icedtea.classpath.org" | ||
| 3 | LICENSE = "GPL-2.0-with-classpath-exception" | ||
| 4 | PRIORITY = "optional" | ||
| 5 | SECTION = "libs" | ||
| 6 | |||
| 7 | ICEDTEA_VERSION = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[1].split("-")[1] or '1.0'}" | ||
| 8 | |||
| 9 | S = "${WORKDIR}/${ICEDTEA}" | ||
| 10 | B = "${S}/build" | ||
| 11 | |||
| 12 | DEPENDS_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. | ||
| 18 | DEPENDS_append = " qemu-native " | ||
| 19 | |||
| 20 | inherit 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. | ||
| 24 | def 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 | |||
| 39 | JDK_ARCH = "${@get_jdk_arch(d)}" | ||
| 40 | JDK_HOME = "${libdir_jvm}/${JDK_DIR}" | ||
| 41 | JDK_FAKE = "${WORKDIR}/fake-jdk" | ||
| 42 | |||
| 43 | # A function that is needed in the Shark builds. | ||
| 44 | def 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 ...). | ||
| 63 | DIST_ID = "Built for ${DISTRO}" | ||
| 64 | DIST_NAME = "${DISTRO}" | ||
| 65 | EXTRA_OEMAKE = 'DIST_NAME="${DIST_NAME}" DIST_ID="${DIST_ID}"' | ||
| 66 | |||
| 67 | # llvm configure and compiles stuff | ||
| 68 | |||
| 69 | export WANT_LLVM_RELEASE = "2.8" | ||
| 70 | |||
| 71 | # Provides the target architecture to the configure script. | ||
| 72 | export LLVM_CONFIGURE_ARCH="${@get_llvm_configure_arch(d)}" | ||
| 73 | |||
| 74 | # Large stack is required at least on x86_64 host, otherwise random segfaults appear: | ||
| 75 | QEMU = "${@qemu_target_binary(d)} ${QEMU_OPTIONS} -s 2097152 -L ${STAGING_DIR_TARGET} -E LD_LIBRARY_PATH=${STAGING_BASELIBDIR}" | ||
| 76 | |||
| 77 | EXTRA_OEMAKE += 'QEMU="${QEMU}"' | ||
