summaryrefslogtreecommitdiffstats
path: root/recipes-core/ecj
diff options
context:
space:
mode:
authorHenning Heinold <heinold@inf.fu-berlin.de>2011-11-12 20:58:34 +0100
committerHenning Heinold <heinold@inf.fu-berlin.de>2011-11-26 23:41:44 +0100
commit57e069cde6617f00ca8834a82c6f360af43d5067 (patch)
tree48cbe15e96d217c45acfa64b0c13aad8c6424980 /recipes-core/ecj
downloadmeta-java-57e069cde6617f00ca8834a82c6f360af43d5067.tar.gz
meta-java: initial commit
* taken over mostly stuff from oe classic * cleaned up recipes * added license checksums * bump icedtea6-native to 1.8.11 * use jamvm from git as native
Diffstat (limited to 'recipes-core/ecj')
-rw-r--r--recipes-core/ecj/ecj-bootstrap-native.bb38
-rw-r--r--recipes-core/ecj/ecj-initial.bb32
-rwxr-xr-xrecipes-core/ecj/files/ecj-initial.in1
-rwxr-xr-xrecipes-core/ecj/files/ecj.in12
-rw-r--r--recipes-core/ecj/libecj-bootstrap.inc68
-rw-r--r--recipes-core/ecj/libecj-bootstrap_3.6.2.bb7
6 files changed, 158 insertions, 0 deletions
diff --git a/recipes-core/ecj/ecj-bootstrap-native.bb b/recipes-core/ecj/ecj-bootstrap-native.bb
new file mode 100644
index 0000000..df05be5
--- /dev/null
+++ b/recipes-core/ecj/ecj-bootstrap-native.bb
@@ -0,0 +1,38 @@
1# ECJ as a bootstrap compiler is a drop-in replacement for Sun's javac. It offers no more
2# and no less features.
3#
4# This recipe uses the jar created by libecj-bootstrap.
5
6DESCRIPTION = "JDT Core Batch Compiler - Bootstrap variant"
7HOMEPAGE = "http://www.eclipse.org/"
8SECTION = "devel"
9LICENSE = "MIT"
10LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
11 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \
12 "
13
14DEPENDS = "libecj-bootstrap virtual/java-native"
15
16PROVIDES = "virtual/javac-native"
17
18SRC_URI = "file://ecj.in"
19
20S = "${WORKDIR}"
21
22JAR = "ecj-bootstrap.jar"
23
24inherit native
25
26do_compile() {
27 # Create the start script
28 echo "#!/bin/sh" > ecj-bootstrap
29 echo "ECJ_JAR=${STAGING_DATADIR}/java/${JAR}" >> ecj-bootstrap
30 echo "RUNTIME=java" >> ecj-bootstrap
31 cat ecj.in >> ecj-bootstrap
32}
33
34do_install() {
35 install -d ${D}${bindir}
36 install -m 755 ${S}/ecj-bootstrap ${D}${bindir}
37 install -m 755 ${S}/ecj-bootstrap ${D}${bindir}/javac
38}
diff --git a/recipes-core/ecj/ecj-initial.bb b/recipes-core/ecj/ecj-initial.bb
new file mode 100644
index 0000000..45317a6
--- /dev/null
+++ b/recipes-core/ecj/ecj-initial.bb
@@ -0,0 +1,32 @@
1# ECJ as a bootstrap compiler is a drop-in replacement for Sun's javac. It offers no more
2# and no less features.
3
4# This variant runs on the initial (not Java5-compatible runtime).
5
6DESCRIPTION = "JDT Core Batch Compiler - Bootstrap variant"
7HOMEPAGE = "http://www.eclipse.org/"
8LICENSE = "MIT"
9LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
10
11DEPENDS = "libecj-bootstrap"
12
13SRC_URI = "file://ecj-initial.in"
14
15S = "${WORKDIR}"
16
17inherit native
18
19JAR = "ecj-bootstrap.jar"
20
21do_compile() {
22 # Create the start script
23 echo "#!/bin/sh" > ecj-initial
24 echo "ECJ_JAR=${STAGING_DATADIR}/java/${JAR}" >> ecj-initial
25 echo "RUNTIME=java-initial" >> ecj-initial
26 cat ecj-initial.in >> ecj-initial
27}
28
29do_install() {
30 install -d ${D}${bindir}
31 install -m 755 ${S}/ecj-initial ${D}${bindir}
32}
diff --git a/recipes-core/ecj/files/ecj-initial.in b/recipes-core/ecj/files/ecj-initial.in
new file mode 100755
index 0000000..2099991
--- /dev/null
+++ b/recipes-core/ecj/files/ecj-initial.in
@@ -0,0 +1 @@
${RUNTIME} -Xmx512m -cp ${ECJ_JAR} org.eclipse.jdt.internal.compiler.batch.Main ${1+"$@"}
diff --git a/recipes-core/ecj/files/ecj.in b/recipes-core/ecj/files/ecj.in
new file mode 100755
index 0000000..30c3862
--- /dev/null
+++ b/recipes-core/ecj/files/ecj.in
@@ -0,0 +1,12 @@
1error_counter=0;
2error_occured=139
3while [ ${error_counter} -le 50 -a ${error_occured} -eq 139 ]; do
4 ${RUNTIME} -Xmx1024m -cp ${ECJ_JAR} org.eclipse.jdt.internal.compiler.batch.Main ${1+"$@"}
5 error_occured=$?
6 if [ ${error_occured} -eq 139 ]; then
7 echo "ecj crashed - silently trying again"
8 error_counter=$(( $error_counter + 1 ))
9 fi
10done
11
12exit ${error_occured}
diff --git a/recipes-core/ecj/libecj-bootstrap.inc b/recipes-core/ecj/libecj-bootstrap.inc
new file mode 100644
index 0000000..e704a87
--- /dev/null
+++ b/recipes-core/ecj/libecj-bootstrap.inc
@@ -0,0 +1,68 @@
1# This package compiles and stages only the Jar.
2
3DESCRIPTION = "JDT Core Batch Compiler - Jar only"
4HOMEPAGE = "http://www.eclipse.org/"
5LICENSE = "EPL-1"
6LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/EPL-1;md5=d830412fb40c35122cb4d78375d30f76"
7
8DEPENDS = "fastjar-native jikes-initial virtual/java-initial"
9
10inherit native java
11
12S = "${WORKDIR}"
13
14JAR = "ecj-bootstrap-${PV}.jar"
15
16do_unpackpost() {
17 if [ ! -d source ]; then
18 mkdir source
19 fi
20
21 if [ ! -d build ]; then
22 mkdir build
23 fi
24
25 # Remove crap.
26 rm about.html build.xml
27 rm -rf META-INF
28
29 # Move source into separate subdir.
30 mv org source/
31
32 # Remove stuff unneeded for the bootstrap compiler.
33 rm -rf source/org/eclipse/jdt/internal/compiler/apt
34 rm -rf source/org/eclipse/jdt/internal/compiler/tool
35 rm -rf source/org/eclipse/jdt/internal/antadapter
36 rm source/org/eclipse/jdt/core/JDTCompilerAdapter.java
37
38 # Make a copy of the remaining source to get the embedded
39 # resources.
40 cp -R source/org build/
41
42 # Remove source code and other stuff.
43 find build -name '*.java' -exec rm -f {} \;
44 find build -name '*.html' -exec rm -f {} \;
45}
46
47addtask unpackpost after do_unpack before do_patch
48
49do_compile() {
50 find source -name '*.java' > sourcefiles
51 split -l 25 sourcefiles ecj-sources.
52
53 # Compiling in place is done because the sources contain
54 # property files which need to be available at runtime.
55 for list in `find . -name 'ecj-sources.*'`; do
56 echo "building files in $list ...";
57 echo jikes-initial -d build -source 1.4 -sourcepath source `cat $list`;
58 jikes-initial \
59 -d build -source 1.4 -sourcepath source `cat $list`;
60 done
61
62 fastjar -c -C build . -f ${JAR}
63}
64
65do_install() {
66 oe_jarinstall ${JAR} ecj-bootstrap.jar
67}
68
diff --git a/recipes-core/ecj/libecj-bootstrap_3.6.2.bb b/recipes-core/ecj/libecj-bootstrap_3.6.2.bb
new file mode 100644
index 0000000..98edc01
--- /dev/null
+++ b/recipes-core/ecj/libecj-bootstrap_3.6.2.bb
@@ -0,0 +1,7 @@
1require libecj-bootstrap.inc
2
3SRC_URI = " http://mirrors.ibiblio.org/pub/mirrors/eclipse/eclipse/downloads/drops/R-3.6.2-201102101200/ecjsrc-${PV}.zip"
4
5SRC_URI[md5sum] = "3f3ca1973dd7a21780525c9ffba7a263"
6SRC_URI[sha256sum] = "94f2095d38d71b414a593ec56847008bec267a926ec935959fecdde44f98467f"
7