summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/base.bbclass19
-rw-r--r--classes/java-library.bbclass21
-rw-r--r--classes/java.bbclass36
-rw-r--r--classes/native.bbclass9
4 files changed, 45 insertions, 40 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index b50bc8667c..93a76aa30f 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -157,6 +157,23 @@ def base_both_contain(variable1, variable2, checkvalue, d):
DEPENDS_prepend="${@base_dep_prepend(d)} "
+# Returns PN with various suffixes removed
+# or PN if no matching suffix was found.
+def base_package_name(d):
+ import bb;
+
+ pn = bb.data.getVar('PN', d, 1)
+ if pn.endswith("-native"):
+ pn = pn[0:-7]
+ elif pn.endswith("-cross"):
+ pn = pn[0:-6]
+ elif pn.endswith("-initial"):
+ pn = pn[0:-8]
+ elif pn.endswith("-intermediate"):
+ pn = pn[0:-13]
+
+ return pn
+
def base_set_filespath(path, d):
import os, bb
filespath = []
@@ -167,7 +184,7 @@ def base_set_filespath(path, d):
filespath.append(os.path.join(p, o))
return ":".join(filespath)
-FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}"
+FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}"
def oe_filter(f, str, d):
from re import match
diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass
index eced939ef0..06c3170544 100644
--- a/classes/java-library.bbclass
+++ b/classes/java-library.bbclass
@@ -10,6 +10,9 @@
inherit java
+# use java_stage for native packages
+JAVA_NATIVE_STAGE_INSTALL = "1"
+
def java_package_name(d):
import bb;
@@ -25,18 +28,6 @@ def java_package_name(d):
return pre + pn + post
-def java_base_package_name(d):
- import bb;
-
- pre=""
- post=""
-
- pn = bb.data.getVar('PN', d, 1)
- if pn.endswith("-native"):
- pn = pn[0:-7]
-
- return pn
-
JPN ?= "${@java_package_name(d)}"
DEPENDS_prepend = "virtual/javac-native fastjar-native "
@@ -47,12 +38,6 @@ PACKAGE_ARCH_${JPN} = "all"
FILES_${JPN} = "${datadir_java}"
-# Base package name
-# Automatically derives "foo" from "foo-native"
-BPN ?= ""${@java_base_package_name(d)}""
-
-BP ?= "${BPN}-${PV}"
-
# File name of the libraries' main Jar file
JARFILENAME = "${BP}.jar"
diff --git a/classes/java.bbclass b/classes/java.bbclass
index 32415d5800..7b67bcd510 100644
--- a/classes/java.bbclass
+++ b/classes/java.bbclass
@@ -84,32 +84,32 @@ oe_makeclasspath() {
#
# oe_makeclasspath cp foo baz bar
# Stores ${datadir_java}/foo.jar:${datadir_java}/baz.jar:${datadir_java}/bar.jar
- # in variable "cp".
+ # in variable "cp".
#
# oe_makeclasspath bootcp -s foo baz bar
# Stores ${STAGING_DATADIR_JAVA}/foo.jar:${STAGING_DATADIR_JAVA}/baz.jar:${STAGING_DATADIR_JAVA}/bar.jar
- # in variable "bootcp".
- #
+ # in variable "bootcp".
+ #
# Provide the -s at the beginning otherwise strange things happen.
- # If -s is given the function checks whether the requested jar file exists
- # and exits with an error message if it cannot be found.
- #
+ # If -s is given the function checks whether the requested jar file exists
+ # and exits with an error message if it cannot be found.
+ #
dir=${datadir_java}
- classpath=
- delimiter=
- retval=$1
+ classpath=
+ delimiter=
+ retval=$1
- shift
+ shift
while [ "$#" -gt 0 ]; do
case "$1" in
-s)
- # take jar files from native staging if this is a -native recipe
- if [ ${PACKAGE_ARCH} = ${BUILD_ARCH} ]; then
+ # take jar files from native staging if this is a -native recipe
+ if [ ${PACKAGE_ARCH} = ${BUILD_ARCH} ]; then
dir=${STAGING_DATADIR_JAVA_NATIVE}
- else
+ else
dir=${STAGING_DATADIR_JAVA}
- fi
+ fi
;;
-*)
oefatal "oe_makeclasspath: unknown option: $1"
@@ -117,9 +117,9 @@ oe_makeclasspath() {
*)
file=$dir/$1.jar
- if [ -z "$dir" -a ! -f $file ]; then
- oefatal "oe_makeclasspath: Jar file for '$1' not found at $file"
- fi
+ if [ -z "$dir" -a ! -f $file ]; then
+ oefatal "oe_makeclasspath: Jar file for '$1' not found at $file"
+ fi
classpath=$classpath$delimiter$file
delimiter=":"
@@ -128,7 +128,7 @@ oe_makeclasspath() {
shift
done
- eval $retval="$classpath"
+ eval $retval="$classpath"
}
# Creates a simple wrapper script for your Java program.
diff --git a/classes/native.bbclass b/classes/native.bbclass
index 8f79935040..61048b6b14 100644
--- a/classes/native.bbclass
+++ b/classes/native.bbclass
@@ -80,11 +80,14 @@ export oldincludedir = "${STAGING_DIR_NATIVE}${layout_includedir}"
do_stage () {
if [ "${INHIBIT_NATIVE_STAGE_INSTALL}" != "1" ]
then
- if [ "${AUTOTOOLS_NATIVE_STAGE_INSTALL}" != "1" ]
+ if [ "${JAVA_NATIVE_STAGE_INSTALL}" = "1" ]
+ then
+ java_stage
+ elif [ "${AUTOTOOLS_NATIVE_STAGE_INSTALL}" = "1" ]
then
- oe_runmake install
- else
autotools_stage_all
+ else
+ oe_runmake install
fi
fi
}