From: "André Draszik" <git@andred.net>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-java][PATCH v2 1/2] java.bbclass: move openjdk/icedtea specific code into new class
Date: Mon, 13 Aug 2018 16:09:17 +0100 [thread overview]
Message-ID: <20180813150918.26582-2-git@andred.net> (raw)
In-Reply-To: <20180813150918.26582-1-git@andred.net>
From: André Draszik <andre.draszik@jci.com>
The code moved is not relevant to anything using java, just for
compiling java itself. It doesn't make sense to have here.
Move it into openjdk-build-helper
Signed-off-by: André Draszik <andre.draszik@jci.com>
---
classes/java.bbclass | 17 -----------------
classes/openjdk-build-helper.bbclass | 16 ++++++++++++++++
recipes-core/icedtea/icedtea7-native.inc | 3 ++-
recipes-core/openjdk/openjdk-7-common.inc | 2 +-
recipes-core/openjdk/openjdk-8-common.inc | 1 +
recipes-core/openjdk/openjdk-8-cross.inc | 2 +-
recipes-core/openjdk/openjdk-8-native.inc | 2 +-
recipes-core/openjdk/openjdk-common.inc | 1 +
8 files changed, 23 insertions(+), 21 deletions(-)
create mode 100644 classes/openjdk-build-helper.bbclass
diff --git a/classes/java.bbclass b/classes/java.bbclass
index aa012ab..fc97295 100644
--- a/classes/java.bbclass
+++ b/classes/java.bbclass
@@ -21,23 +21,6 @@ STAGING_DATADIR_JAVA_NATIVE ?= "${STAGING_DATADIR_NATIVE}/java"
STAGING_LIBDIR_JNI_NATIVE ?= "${STAGING_LIBDIR_NATIVE}/jni"
STAGING_LIBDIR_JVM_NATIVE ?= "${STAGING_LIBDIR_NATIVE}/jvm"
-# Icedtea's makefile is not compatible to parallelization so we cannot allow
-# passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are
-# parallelizable and we need ${PARALLEL_MAKE} to derive the proper value.
-# The base for this quirk is that GNU Make only considers the last "-j" option.
-EXTRA_OEMAKE_remove_task-compile = "${PARALLEL_MAKE}"
-EXTRA_OEMAKE_remove_task-install = "${PARALLEL_MAKEINST}"
-
-# OpenJDK supports parallel compilation but uses a plain number for this.
-# In OE we have PARALLEL_MAKE which is the actual option passed to make,
-# e.g. "-j 4".
-def java_get_parallel_make(d):
- pm = d.getVar('PARALLEL_MAKE', True);
- if not pm or '-j' not in pm:
- return 1
-
- return pm.partition('-j')[2].strip().split(' ')[0]
-
oe_jarinstall() {
# Purpose: Install a jar file and create all the given symlinks to it.
# Example:
diff --git a/classes/openjdk-build-helper.bbclass b/classes/openjdk-build-helper.bbclass
new file mode 100644
index 0000000..785ddf0
--- /dev/null
+++ b/classes/openjdk-build-helper.bbclass
@@ -0,0 +1,16 @@
+# Icedtea's makefile is not compatible to parallelization so we cannot allow
+# passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are
+# parallelizable and we need ${PARALLEL_MAKE} to derive the proper value.
+# The base for this quirk is that GNU Make only considers the last "-j" option.
+EXTRA_OEMAKE_remove_task-compile = "${PARALLEL_MAKE}"
+EXTRA_OEMAKE_remove_task-install = "${PARALLEL_MAKEINST}"
+
+# OpenJDK supports parallel compilation but uses a plain number for this.
+# In OE we have PARALLEL_MAKE which is the actual option passed to make,
+# e.g. "-j 4".
+def openjdk_build_helper_get_parallel_make(d):
+ pm = d.getVar('PARALLEL_MAKE', True);
+ if not pm or '-j' not in pm:
+ return 1
+
+ return pm.partition('-j')[2].strip().split(' ')[0]
diff --git a/recipes-core/icedtea/icedtea7-native.inc b/recipes-core/icedtea/icedtea7-native.inc
index 93463be..30fb24a 100644
--- a/recipes-core/icedtea/icedtea7-native.inc
+++ b/recipes-core/icedtea/icedtea7-native.inc
@@ -25,6 +25,7 @@ CXXFLAGS_append = " -fno-tree-dse"
CXX_append = " -std=gnu++98"
inherit native java autotools pkgconfig
+inherit openjdk-build-helper
JAVA_HOME[unexport] = "1"
@@ -58,7 +59,7 @@ export ALT_FREETYPE_LIB_PATH = "${STAGING_LIBDIR}"
INSANE_SKIP_${PN} = "already-stripped"
EXTRA_OECONF = "\
- --with-parallel-jobs=${@java_get_parallel_make(d)} \
+ --with-parallel-jobs=${@openjdk_build_helper_get_parallel_make(d)} \
\
--disable-tests \
--disable-hotspot-tests \
diff --git a/recipes-core/openjdk/openjdk-7-common.inc b/recipes-core/openjdk/openjdk-7-common.inc
index 1ac3154..0ef6758 100644
--- a/recipes-core/openjdk/openjdk-7-common.inc
+++ b/recipes-core/openjdk/openjdk-7-common.inc
@@ -84,7 +84,7 @@ EXTRA_OECONF = " \
--with-jdk-src-zip=${WORKDIR}/${JDK_FILE} \
--with-langtools-src-zip=${WORKDIR}/${LANGTOOLS_FILE} \
\
- --with-parallel-jobs=${@java_get_parallel_make(d)} \
+ --with-parallel-jobs=${@openjdk_build_helper_get_parallel_make(d)} \
\
--with-pkgversion=${PV} \
--with-cc-for-build=${BUILD_CC} \
diff --git a/recipes-core/openjdk/openjdk-8-common.inc b/recipes-core/openjdk/openjdk-8-common.inc
index aaa4483..97bf6e1 100644
--- a/recipes-core/openjdk/openjdk-8-common.inc
+++ b/recipes-core/openjdk/openjdk-8-common.inc
@@ -5,6 +5,7 @@ LICENSE = "GPL-2.0-with-classpath-exception"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3e0b59f8fac05c3c03d4a26bbda13f8f"
inherit java autotools gettext qemu pkgconfig
+inherit openjdk-build-helper
AUTOTOOLS_SCRIPT_PATH = "${S}/common/autoconf/"
export AUTOCONF_DIR="${AUTOTOOLS_SCRIPT_PATH}"
diff --git a/recipes-core/openjdk/openjdk-8-cross.inc b/recipes-core/openjdk/openjdk-8-cross.inc
index d0b2ec8..939155b 100644
--- a/recipes-core/openjdk/openjdk-8-cross.inc
+++ b/recipes-core/openjdk/openjdk-8-cross.inc
@@ -52,7 +52,7 @@ SRC_URI_append = "\
"
EXTRA_OECONF_append = "\
- --with-jobs=${@java_get_parallel_make(d)} \
+ --with-jobs=${@openjdk_build_helper_get_parallel_make(d)} \
\
--with-sys-root=${STAGING_DIR_HOST} \
--with-tools-dir=${STAGING_DIR_NATIVE} \
diff --git a/recipes-core/openjdk/openjdk-8-native.inc b/recipes-core/openjdk/openjdk-8-native.inc
index b782c32..e6f7933 100644
--- a/recipes-core/openjdk/openjdk-8-native.inc
+++ b/recipes-core/openjdk/openjdk-8-native.inc
@@ -20,7 +20,7 @@ PACKAGECONFIG[png] = "--with-libpng=system,--with-libpng=bundled,libpng-native"
PACKAGECONFIG[zlib] = "--with-zlib=system,--with-zlib=bundled,zlib-native"
EXTRA_OECONF_append = "\
- --with-jobs=${@java_get_parallel_make(d)} \
+ --with-jobs=${@openjdk_build_helper_get_parallel_make(d)} \
\
--with-sys-root=${STAGING_DIR_NATIVE} \
--with-tools-dir=${STAGING_DIR_NATIVE} \
diff --git a/recipes-core/openjdk/openjdk-common.inc b/recipes-core/openjdk/openjdk-common.inc
index 816b463..8aa04f5 100644
--- a/recipes-core/openjdk/openjdk-common.inc
+++ b/recipes-core/openjdk/openjdk-common.inc
@@ -17,6 +17,7 @@ DEPENDS_append_libc-uclibc = " virtual/libiconv "
DEPENDS_append = " qemu-native "
inherit java autotools gettext qemu pkgconfig
+inherit openjdk-build-helper
B = "${S}/build"
--
2.18.0
next prev parent reply other threads:[~2018-08-13 15:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-13 15:09 [meta-java] prepare for openjdk-8 build infra re-use André Draszik
2018-08-13 15:09 ` André Draszik [this message]
2018-08-13 15:09 ` [meta-java][PATCH v2 2/2] openjdk-build-helper: move c compiler flags retrieval to here (from openjdk-8) André Draszik
2018-08-13 20:57 ` [meta-java] prepare for openjdk-8 build infra re-use Richard Leitner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180813150918.26582-2-git@andred.net \
--to=git@andred.net \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox