diff options
author | Kyle Russell <bkylerussell@gmail.com> | 2016-08-24 09:28:40 -0400 |
---|---|---|
committer | Maxin B. John <maxin.john@intel.com> | 2016-08-30 16:49:09 +0300 |
commit | 8c663efa4f8efccf50d094dbc61c7b78031b3b7d (patch) | |
tree | d002a12d3fc2167d960fdf85dcb196847ed1c370 /classes | |
parent | b2827bf00734331fa6776909e2bfee8f94790fda (diff) | |
download | meta-java-8c663efa4f8efccf50d094dbc61c7b78031b3b7d.tar.gz |
Reimplement helper method for parallelizing JDK builds
Simplifies duplicated implementation across multiple recipes that all
inherited from java.bbclass.
Previously implementation was not flexible in supporting other make
job-limiting flags (like -l for load) that are typically passed in
through PARALLEL_MAKE. (OpenJDK doesn't know about these other flags
that might have gotten tagged on after the value for -j.)
Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
Diffstat (limited to 'classes')
-rw-r--r-- | classes/java.bbclass | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/classes/java.bbclass b/classes/java.bbclass index fc97295..aa012ab 100644 --- a/classes/java.bbclass +++ b/classes/java.bbclass | |||
@@ -21,6 +21,23 @@ STAGING_DATADIR_JAVA_NATIVE ?= "${STAGING_DATADIR_NATIVE}/java" | |||
21 | STAGING_LIBDIR_JNI_NATIVE ?= "${STAGING_LIBDIR_NATIVE}/jni" | 21 | STAGING_LIBDIR_JNI_NATIVE ?= "${STAGING_LIBDIR_NATIVE}/jni" |
22 | STAGING_LIBDIR_JVM_NATIVE ?= "${STAGING_LIBDIR_NATIVE}/jvm" | 22 | STAGING_LIBDIR_JVM_NATIVE ?= "${STAGING_LIBDIR_NATIVE}/jvm" |
23 | 23 | ||
24 | # Icedtea's makefile is not compatible to parallelization so we cannot allow | ||
25 | # passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are | ||
26 | # parallelizable and we need ${PARALLEL_MAKE} to derive the proper value. | ||
27 | # The base for this quirk is that GNU Make only considers the last "-j" option. | ||
28 | EXTRA_OEMAKE_remove_task-compile = "${PARALLEL_MAKE}" | ||
29 | EXTRA_OEMAKE_remove_task-install = "${PARALLEL_MAKEINST}" | ||
30 | |||
31 | # OpenJDK supports parallel compilation but uses a plain number for this. | ||
32 | # In OE we have PARALLEL_MAKE which is the actual option passed to make, | ||
33 | # e.g. "-j 4". | ||
34 | def java_get_parallel_make(d): | ||
35 | pm = d.getVar('PARALLEL_MAKE', True); | ||
36 | if not pm or '-j' not in pm: | ||
37 | return 1 | ||
38 | |||
39 | return pm.partition('-j')[2].strip().split(' ')[0] | ||
40 | |||
24 | oe_jarinstall() { | 41 | oe_jarinstall() { |
25 | # Purpose: Install a jar file and create all the given symlinks to it. | 42 | # Purpose: Install a jar file and create all the given symlinks to it. |
26 | # Example: | 43 | # Example: |