diff options
| -rw-r--r-- | meta/lib/oe/utils.py | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index 779c5e593f..8aa15373f1 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
| @@ -174,18 +174,14 @@ def any_distro_features(d, features, truevalue="1", falsevalue=""): | |||
| 174 | """ | 174 | """ |
| 175 | return bb.utils.contains_any("DISTRO_FEATURES", features, truevalue, falsevalue, d) | 175 | return bb.utils.contains_any("DISTRO_FEATURES", features, truevalue, falsevalue, d) |
| 176 | 176 | ||
| 177 | def parallel_make(d, makeinst=False): | 177 | def parallel_make_value(pm): |
| 178 | """ | 178 | """ |
| 179 | Return the integer value for the number of parallel threads to use when | 179 | Return the integer value for the number of parallel threads to use when |
| 180 | building, scraped out of PARALLEL_MAKE. If no parallelization option is | 180 | building, scraped out of given string. If no parallelization option is |
| 181 | found, returns None | 181 | found, returns empty string |
| 182 | 182 | ||
| 183 | e.g. if PARALLEL_MAKE = "-j 10", this will return 10 as an integer. | 183 | e.g. if string is "-j 10", this will return 10 as an integer. |
| 184 | """ | 184 | """ |
| 185 | if makeinst: | ||
| 186 | pm = (d.getVar('PARALLEL_MAKEINST') or '').split() | ||
| 187 | else: | ||
| 188 | pm = (d.getVar('PARALLEL_MAKE') or '').split() | ||
| 189 | # look for '-j' and throw other options (e.g. '-l') away | 185 | # look for '-j' and throw other options (e.g. '-l') away |
| 190 | while pm: | 186 | while pm: |
| 191 | opt = pm.pop(0) | 187 | opt = pm.pop(0) |
| @@ -200,6 +196,20 @@ def parallel_make(d, makeinst=False): | |||
| 200 | 196 | ||
| 201 | return '' | 197 | return '' |
| 202 | 198 | ||
| 199 | def parallel_make(d, makeinst=False): | ||
| 200 | """ | ||
| 201 | Return the integer value for the number of parallel threads to use when | ||
| 202 | building, scraped out of PARALLEL_MAKE. If no parallelization option is | ||
| 203 | found, returns empty string | ||
| 204 | |||
| 205 | e.g. if PARALLEL_MAKE = "-j 10", this will return 10 as an integer. | ||
| 206 | """ | ||
| 207 | if makeinst: | ||
| 208 | pm = (d.getVar('PARALLEL_MAKEINST') or '').split() | ||
| 209 | else: | ||
| 210 | pm = (d.getVar('PARALLEL_MAKE') or '').split() | ||
| 211 | return parallel_make_value(pm) | ||
| 212 | |||
| 203 | def parallel_make_argument(d, fmt, limit=None, makeinst=False): | 213 | def parallel_make_argument(d, fmt, limit=None, makeinst=False): |
| 204 | """ | 214 | """ |
| 205 | Helper utility to construct a parallel make argument from the number of | 215 | Helper utility to construct a parallel make argument from the number of |
