summaryrefslogtreecommitdiffstats
path: root/recipes-core/ecj/ecj-bootstrap-native.bb
blob: 874bd99edaf5c6e8ce3ce40201a73afd8484eb13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 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.

SUMMARY = "JDT Core Batch Compiler - Bootstrap variant"
HOMEPAGE = "http://www.eclipse.org/"
SECTION = "devel"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \
                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \
                   "
PR = "r1"

DEPENDS = "libecj-bootstrap-native 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

  # get absolute path to parent directory, and use that as base path for the jar
  echo "SH_DIR=\`dirname "\$0"\`" >> ecj-bootstrap
  echo "CURRENT_DIR=\`cd "\${SH_DIR}" && pwd\`" >> ecj-bootstrap
  echo "PARENT_DIR=\`dirname \${CURRENT_DIR}\`" >> ecj-bootstrap

  echo "ECJ_JAR=\${PARENT_DIR}/share/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
}