aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@jci.com>2018-04-25 15:59:49 +0100
committerRichard Leitner <richard.leitner@skidata.com>2018-06-19 09:55:33 +0200
commit428cf8dfb4df230aa1e33b2321356171d7f39950 (patch)
treebfc41012be94558d904fe8a6df485286795fb10e
parent42c47497cf51deab3c9946c2e9e10d4d222e9dc9 (diff)
downloadmeta-java-428cf8dfb4df230aa1e33b2321356171d7f39950.tar.gz
meta-java-428cf8dfb4df230aa1e33b2321356171d7f39950.tar.bz2
meta-java-428cf8dfb4df230aa1e33b2321356171d7f39950.zip
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>
-rw-r--r--recipes-core/ecj/libecj-bootstrap.inc25
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"
do_unpackpost[dirs] = "${B}"
do_unpackpost() {
- if [ ! -d source ]; then
- mkdir source
- fi
-
- if [ ! -d build ]; then
- mkdir build
- fi
+ mkdir -p source
+ mkdir -p build
# Remove crap.
rm -f about.html build.xml
@@ -44,24 +39,18 @@ do_unpackpost() {
cp -R source/org build/
# Remove source code and other stuff.
- find build -name '*.java' -exec rm -f {} \;
- find build -name '*.html' -exec rm -f {} \;
+ find build -depth \( -name '*.java' -o -name '*.html' \) -delete
}
addtask unpackpost after do_unpack before do_patch
do_compile() {
- find source -name '*.java' | LC_ALL=C sort > sourcefiles
- split -l 25 sourcefiles ecj-sources.
-
# Compiling in place is done because the sources contain
# property files which need to be available at runtime.
- for list in `find . -name 'ecj-sources.*'`; do
- echo "building files in $list ...";
- echo jikes-initial -d build -source 1.4 -sourcepath source `cat $list`;
- jikes-initial \
- -d build -source 1.4 -sourcepath source `cat $list`;
- done
+ find source -name '*.java' -print0 \
+ | LC_ALL=C sort -z \
+ | xargs -0 -n25 -P ${BB_NUMBER_THREADS} \
+ jikes-initial -d build -source 1.4 -sourcepath source
fastjar -c -C build . -f ${JAR}
}