diff options
author | André Draszik <andre.draszik@jci.com> | 2018-04-25 15:59:49 +0100 |
---|---|---|
committer | Richard Leitner <richard.leitner@skidata.com> | 2018-06-19 09:55:33 +0200 |
commit | 428cf8dfb4df230aa1e33b2321356171d7f39950 (patch) | |
tree | bfc41012be94558d904fe8a6df485286795fb10e /recipes-core | |
parent | 42c47497cf51deab3c9946c2e9e10d4d222e9dc9 (diff) | |
download | meta-java-428cf8dfb4df230aa1e33b2321356171d7f39950.tar.gz |
libecj-bootstrap-native: simplify build
Piping 'find' output into multiple files to re-read
them seems inelegant and is error prone - just use a
pipe with appropriate options instead.
This avoids potential problems with funny file names,
and now also makes use of BB_NUMBER_THREADS to speed
up compilation.
This is a better example to copy from now...
Signed-off-by: André Draszik <andre.draszik@jci.com>
Tested-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Diffstat (limited to 'recipes-core')
-rw-r--r-- | recipes-core/ecj/libecj-bootstrap.inc | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/recipes-core/ecj/libecj-bootstrap.inc b/recipes-core/ecj/libecj-bootstrap.inc index c86654d..2cdb6e4 100644 --- a/recipes-core/ecj/libecj-bootstrap.inc +++ b/recipes-core/ecj/libecj-bootstrap.inc | |||
@@ -17,13 +17,8 @@ JAR = "ecj-bootstrap-${PV}.jar" | |||
17 | 17 | ||
18 | do_unpackpost[dirs] = "${B}" | 18 | do_unpackpost[dirs] = "${B}" |
19 | do_unpackpost() { | 19 | do_unpackpost() { |
20 | if [ ! -d source ]; then | 20 | mkdir -p source |
21 | mkdir source | 21 | mkdir -p build |
22 | fi | ||
23 | |||
24 | if [ ! -d build ]; then | ||
25 | mkdir build | ||
26 | fi | ||
27 | 22 | ||
28 | # Remove crap. | 23 | # Remove crap. |
29 | rm -f about.html build.xml | 24 | rm -f about.html build.xml |
@@ -44,24 +39,18 @@ do_unpackpost() { | |||
44 | cp -R source/org build/ | 39 | cp -R source/org build/ |
45 | 40 | ||
46 | # Remove source code and other stuff. | 41 | # Remove source code and other stuff. |
47 | find build -name '*.java' -exec rm -f {} \; | 42 | find build -depth \( -name '*.java' -o -name '*.html' \) -delete |
48 | find build -name '*.html' -exec rm -f {} \; | ||
49 | } | 43 | } |
50 | 44 | ||
51 | addtask unpackpost after do_unpack before do_patch | 45 | addtask unpackpost after do_unpack before do_patch |
52 | 46 | ||
53 | do_compile() { | 47 | do_compile() { |
54 | find source -name '*.java' | LC_ALL=C sort > sourcefiles | ||
55 | split -l 25 sourcefiles ecj-sources. | ||
56 | |||
57 | # Compiling in place is done because the sources contain | 48 | # Compiling in place is done because the sources contain |
58 | # property files which need to be available at runtime. | 49 | # property files which need to be available at runtime. |
59 | for list in `find . -name 'ecj-sources.*'`; do | 50 | find source -name '*.java' -print0 \ |
60 | echo "building files in $list ..."; | 51 | | LC_ALL=C sort -z \ |
61 | echo jikes-initial -d build -source 1.4 -sourcepath source `cat $list`; | 52 | | xargs -0 -n25 -P ${BB_NUMBER_THREADS} \ |
62 | jikes-initial \ | 53 | jikes-initial -d build -source 1.4 -sourcepath source |
63 | -d build -source 1.4 -sourcepath source `cat $list`; | ||
64 | done | ||
65 | 54 | ||
66 | fastjar -c -C build . -f ${JAR} | 55 | fastjar -c -C build . -f ${JAR} |
67 | } | 56 | } |