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 /recipes-core/openjdk/openjdk-7-common.inc | |
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 'recipes-core/openjdk/openjdk-7-common.inc')
-rw-r--r-- | recipes-core/openjdk/openjdk-7-common.inc | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/recipes-core/openjdk/openjdk-7-common.inc b/recipes-core/openjdk/openjdk-7-common.inc index f848a06..c491195 100644 --- a/recipes-core/openjdk/openjdk-7-common.inc +++ b/recipes-core/openjdk/openjdk-7-common.inc | |||
@@ -59,30 +59,6 @@ export CACAO_CONFIGURE_ARGS = " \ | |||
59 | 59 | ||
60 | JAVA_HOME[unexport] = "1" | 60 | JAVA_HOME[unexport] = "1" |
61 | 61 | ||
62 | # OpenJDK supports parallel compilation but uses a plain number for this. | ||
63 | # In OE we have PARALLEL_MAKE which is the actual option passed to make, | ||
64 | # e.g. "-j 4". | ||
65 | |||
66 | OPENJDK_PARALLEL_MAKE := "${PARALLEL_MAKE}" | ||
67 | PARALLEL_MAKE = "" | ||
68 | |||
69 | def get_jdk7_jobs(d): | ||
70 | import bb | ||
71 | |||
72 | pm = bb.data.getVar('OPENJDK_PARALLEL_MAKE', d, 1); | ||
73 | if not pm: | ||
74 | return "1" | ||
75 | |||
76 | pm = pm.split("j"); | ||
77 | if (len(pm) == 2): | ||
78 | return pm[1].strip() | ||
79 | |||
80 | # Whatever found in PARALLEL_MAKE was not suitable. | ||
81 | return "1" | ||
82 | |||
83 | get_jdk7_jobs[vardepsexclude] += "OPENJDK_PARALLEL_MAKE" | ||
84 | JDK_JOBS = "${@get_jdk7_jobs(d)}" | ||
85 | |||
86 | EXTRA_OECONF = " \ | 62 | EXTRA_OECONF = " \ |
87 | --enable-downloading=no \ | 63 | --enable-downloading=no \ |
88 | \ | 64 | \ |
@@ -108,7 +84,7 @@ EXTRA_OECONF = " \ | |||
108 | --with-jdk-src-zip=${WORKDIR}/${JDK_FILE} \ | 84 | --with-jdk-src-zip=${WORKDIR}/${JDK_FILE} \ |
109 | --with-langtools-src-zip=${WORKDIR}/${LANGTOOLS_FILE} \ | 85 | --with-langtools-src-zip=${WORKDIR}/${LANGTOOLS_FILE} \ |
110 | \ | 86 | \ |
111 | --with-parallel-jobs=${JDK_JOBS} \ | 87 | --with-parallel-jobs=${@java_get_parallel_make(d)} \ |
112 | \ | 88 | \ |
113 | --with-pkgversion=${PV} \ | 89 | --with-pkgversion=${PV} \ |
114 | --with-cc-for-build=${BUILD_CC} \ | 90 | --with-cc-for-build=${BUILD_CC} \ |
@@ -123,8 +99,6 @@ EXTRA_OECONF += " \ | |||
123 | " | 99 | " |
124 | 100 | ||
125 | do_configure_prepend() { | 101 | do_configure_prepend() { |
126 | echo "Configure with parallel-jobs: ${JDK_JOBS}" | ||
127 | |||
128 | # Automatically copy everything that starts with "icedtea" (or "cacao") and ends with | 102 | # Automatically copy everything that starts with "icedtea" (or "cacao") and ends with |
129 | # ".patch" into the patches directory. | 103 | # ".patch" into the patches directory. |
130 | find ${WORKDIR} -maxdepth 1 -name "icedtea*.patch" -exec cp {} ${S}/patches \; | 104 | find ${WORKDIR} -maxdepth 1 -name "icedtea*.patch" -exec cp {} ${S}/patches \; |
@@ -138,10 +112,6 @@ do_configure_append() { | |||
138 | # Work around broken variable quoting in oe-stable 2009 and provide the variable | 112 | # Work around broken variable quoting in oe-stable 2009 and provide the variable |
139 | # via the environment which then overrides the erroneous value that was written | 113 | # via the environment which then overrides the erroneous value that was written |
140 | # into '${ICETDEA}/Makefile'. | 114 | # into '${ICETDEA}/Makefile'. |
141 | # Icedtea's makefile is not compatible to parallelization so we cannot allow | ||
142 | # passing a valid ${PARALLEL_MAKE} to it. OTOH OpenJDK's makefiles are | ||
143 | # parallelizable and we need ${PARALLEL_MAKE} to derive the proper value. | ||
144 | # The base for this quirk is that GNU Make only considers the last "-j" option. | ||
145 | EXTRA_OEMAKE += 'CC="${CC}" CCC="${CXX}" CPP="${CPP}" CXX="${CXX}" CC_FOR_BUILD="${BUILD_CC}"' | 115 | EXTRA_OEMAKE += 'CC="${CC}" CCC="${CXX}" CPP="${CPP}" CXX="${CXX}" CC_FOR_BUILD="${BUILD_CC}"' |
146 | 116 | ||
147 | EXTRA_OEMAKE += ' \ | 117 | EXTRA_OEMAKE += ' \ |