aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-core/ecj
diff options
context:
space:
mode:
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 @@
+# ECJ as a bootstrap compiler is a drop-in replacement for Sun's javac. It offers no more
+# and no less features.
+#
+# This recipe uses the jar created by libecj-bootstrap.
+
+DESCRIPTION = "JDT Core Batch Compiler - Bootstrap variant"
+HOMEPAGE = "http://www.eclipse.org/"
+SECTION = "devel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
+ file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \
+ "
+
+DEPENDS = "libecj-bootstrap virtual/java-native"
+
+PROVIDES = "virtual/javac-native"
+
+SRC_URI = "file://ecj.in"
+
+S = "${WORKDIR}"
+
+JAR = "ecj-bootstrap.jar"
+
+inherit native
+
+do_compile() {
+ # Create the start script
+ echo "#!/bin/sh" > ecj-bootstrap
+ echo "ECJ_JAR=${STAGING_DATADIR}/java/${JAR}" >> ecj-bootstrap
+ echo "RUNTIME=java" >> ecj-bootstrap
+ cat ecj.in >> ecj-bootstrap
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 755 ${S}/ecj-bootstrap ${D}${bindir}
+ install -m 755 ${S}/ecj-bootstrap ${D}${bindir}/javac
+}
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 @@
+# ECJ as a bootstrap compiler is a drop-in replacement for Sun's javac. It offers no more
+# and no less features.
+
+# This variant runs on the initial (not Java5-compatible runtime).
+
+DESCRIPTION = "JDT Core Batch Compiler - Bootstrap variant"
+HOMEPAGE = "http://www.eclipse.org/"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+DEPENDS = "libecj-bootstrap"
+
+SRC_URI = "file://ecj-initial.in"
+
+S = "${WORKDIR}"
+
+inherit native
+
+JAR = "ecj-bootstrap.jar"
+
+do_compile() {
+ # Create the start script
+ echo "#!/bin/sh" > ecj-initial
+ echo "ECJ_JAR=${STAGING_DATADIR}/java/${JAR}" >> ecj-initial
+ echo "RUNTIME=java-initial" >> ecj-initial
+ cat ecj-initial.in >> ecj-initial
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 755 ${S}/ecj-initial ${D}${bindir}
+}
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 @@
+error_counter=0;
+error_occured=139
+while [ ${error_counter} -le 50 -a ${error_occured} -eq 139 ]; do
+ ${RUNTIME} -Xmx1024m -cp ${ECJ_JAR} org.eclipse.jdt.internal.compiler.batch.Main ${1+"$@"}
+ error_occured=$?
+ if [ ${error_occured} -eq 139 ]; then
+ echo "ecj crashed - silently trying again"
+ error_counter=$(( $error_counter + 1 ))
+ fi
+done
+
+exit ${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 @@
+# This package compiles and stages only the Jar.
+
+DESCRIPTION = "JDT Core Batch Compiler - Jar only"
+HOMEPAGE = "http://www.eclipse.org/"
+LICENSE = "EPL-1"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/EPL-1;md5=d830412fb40c35122cb4d78375d30f76"
+
+DEPENDS = "fastjar-native jikes-initial virtual/java-initial"
+
+inherit native java
+
+S = "${WORKDIR}"
+
+JAR = "ecj-bootstrap-${PV}.jar"
+
+do_unpackpost() {
+ if [ ! -d source ]; then
+ mkdir source
+ fi
+
+ if [ ! -d build ]; then
+ mkdir build
+ fi
+
+ # Remove crap.
+ rm about.html build.xml
+ rm -rf META-INF
+
+ # Move source into separate subdir.
+ mv org source/
+
+ # Remove stuff unneeded for the bootstrap compiler.
+ rm -rf source/org/eclipse/jdt/internal/compiler/apt
+ rm -rf source/org/eclipse/jdt/internal/compiler/tool
+ rm -rf source/org/eclipse/jdt/internal/antadapter
+ rm source/org/eclipse/jdt/core/JDTCompilerAdapter.java
+
+ # Make a copy of the remaining source to get the embedded
+ # resources.
+ 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 {} \;
+}
+
+addtask unpackpost after do_unpack before do_patch
+
+do_compile() {
+ find source -name '*.java' > 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
+
+ fastjar -c -C build . -f ${JAR}
+}
+
+do_install() {
+ oe_jarinstall ${JAR} ecj-bootstrap.jar
+}
+
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 @@
+require libecj-bootstrap.inc
+
+SRC_URI = " http://mirrors.ibiblio.org/pub/mirrors/eclipse/eclipse/downloads/drops/R-3.6.2-201102101200/ecjsrc-${PV}.zip"
+
+SRC_URI[md5sum] = "3f3ca1973dd7a21780525c9ffba7a263"
+SRC_URI[sha256sum] = "94f2095d38d71b414a593ec56847008bec267a926ec935959fecdde44f98467f"
+