summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorFlorian Boor <florian.boor@kernelconcepts.de>2008-01-21 21:09:09 +0000
committerFlorian Boor <florian.boor@kernelconcepts.de>2008-01-21 21:09:09 +0000
commitafd58cdcce656ced784bfca78d7d96e2edca8cee (patch)
treeb49291fedc042760b35f74afa9b7e82b591147e5 /classes
parentac6de0f3c0d8d5fe5708d9125c1319fbf5d627a6 (diff)
parenta7a4c7d6f9bbcda53d3bf07d51142d41e1a4558b (diff)
merge of '1cc9d40e03f431fac4150580f6a58521cae55509'
and 'a250ef0b1707ead866fe051ca88c56e538d51bfb'
Diffstat (limited to 'classes')
-rw-r--r--classes/cmake.bbclass5
-rw-r--r--classes/java-library.bbclass37
-rw-r--r--classes/java.bbclass62
-rw-r--r--classes/kernel.bbclass39
-rw-r--r--classes/nslu2-mirrors.bbclass4
-rw-r--r--classes/nylon-mirrors.bbclass4
-rw-r--r--classes/oplinux-mirrors.bbclass8
-rw-r--r--classes/own-mirrors.bbclass2
8 files changed, 132 insertions, 29 deletions
diff --git a/classes/cmake.bbclass b/classes/cmake.bbclass
index cec74349dc..823635c24d 100644
--- a/classes/cmake.bbclass
+++ b/classes/cmake.bbclass
@@ -1,7 +1,10 @@
+DEPENDS += " cmake-native "
+
+# We want the staging and installing functions from autotools
inherit autotools
cmake_do_configure() {
- cmake . -DCMAKE_INSTALL_PREFIX:PATH=${prefix}
+ cmake . -DCMAKE_INSTALL_PREFIX:PATH=${prefix}
}
EXPORT_FUNCTIONS do_configure
diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass
new file mode 100644
index 0000000000..8aecfef1b9
--- /dev/null
+++ b/classes/java-library.bbclass
@@ -0,0 +1,37 @@
+# Inherit this bbclass for each java recipe that builds a Java library (jar file[s]).
+#
+# It automatically adds important build dependencies, defines JPN (Java Package Name)
+# a package named ${JPN} whose contents are those of ${datadir}/java (the jar location).
+#
+# The JPN is basically lib${PN}-java but takes care of the fact that ${PN} already
+# starts with "lib" and/or ends with "-java". In case the "lib" prefix is part of
+# your package's normal name (e.g. liberator) the guessing is wrong and you have
+# to set JPN manually!
+
+inherit java
+
+def java_package_name(d):
+ import bb;
+
+ pre=""
+ post=""
+
+ pn = bb.data.getVar('PN', d, 1)
+ if not pn.startswith("lib"):
+ pre='lib'
+
+ if not pn.endswith("-java"):
+ post='-java'
+
+ return pre + pn + post
+
+JPN ?= "${@java_package_name(d)}"
+
+DEPENDS_prepend = "virtual/javac-native fastjar-native "
+
+PACKAGES = "${JPN}"
+
+PACKAGE_ARCH_${JPN} = "all"
+
+FILES_${JPN} = "${datadir_java}"
+
diff --git a/classes/java.bbclass b/classes/java.bbclass
new file mode 100644
index 0000000000..7fa6dc1786
--- /dev/null
+++ b/classes/java.bbclass
@@ -0,0 +1,62 @@
+# Defines the commonly used target directories and provides a convenience
+# function to install jar files.
+
+# Jar location on target
+datadir_java ?= ${datadir}/java
+
+# JNI library location on target
+libdir_jni ?= ${libdir}/jni
+
+STAGING_DATADIR_JAVA ?= ${STAGING_DATADIR}/java
+STAGING_LIBDIR_JNI ?= ${STAGING_LIBDIR}/jni
+
+oe_jarinstall() {
+ # Purpose: Install a jar file and create all the given symlinks to it.
+ # Example:
+ # oe_jarinstall foo-1.3.jar foo.jar
+ # Installs foo-1.3.jar and creates symlink foo.jar.
+ #
+ # oe_jarinstall -s foo-1.3.jar foo.jar
+ # Installs foo-1.3.jar to staging and creates symlink foo.jar.
+ #
+ # oe_jarinstall -r foo-1.3.jar foo_1_3.jar foo.jar
+ # Installs foo_1_3.jar as foo-1.3.jar and creates a symlink to this.
+ #
+ dir=${D}${datadir_java}
+ destname=""
+ while [ "$#" -gt 0 ]; do
+ case "$1" in
+ -s)
+ dir=${STAGING_DATADIR_JAVA}
+ ;;
+ -r)
+ shift
+ destname=$1
+ ;;
+ -*)
+ oefatal "oe_jarinstall: unknown option: $1"
+ ;;
+ *)
+ break;
+ ;;
+ esac
+ shift
+ done
+
+ jarname=$1
+ destname=${destname:-`basename $jarname`}
+ shift
+
+ install -d $dir
+ install -m 0644 $jarname $dir/$destname
+
+ # Creates symlinks out of the remaining arguments.
+ while [ "$#" -gt 0 ]; do
+ if [ -e $dir/$1 ]; then
+ oewarn "file was in the way. removing:" $dir/$1
+ rm $dir/$1
+ fi
+ ln -s $destname $dir/$1
+ shift
+ done
+}
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass
index c00d0f3f58..f896492364 100644
--- a/classes/kernel.bbclass
+++ b/classes/kernel.bbclass
@@ -80,25 +80,12 @@ kernel_do_stage() {
mkdir -p ${STAGING_KERNEL_DIR}/include/pcmcia
cp -fR include/pcmcia/* ${STAGING_KERNEL_DIR}/include/pcmcia/
- if [ -d drivers/crypto ]; then
- mkdir -p ${STAGING_KERNEL_DIR}/drivers/crypto
- cp -fR drivers/crypto/* ${STAGING_KERNEL_DIR}/drivers/crypto/
- fi
-
- if [ -d include/media ]; then
- mkdir -p ${STAGING_KERNEL_DIR}/include/media
- cp -fR include/media/* ${STAGING_KERNEL_DIR}/include/media/
- fi
-
- if [ -d include/acpi ]; then
- mkdir -p ${STAGING_KERNEL_DIR}/include/acpi
- cp -fR include/acpi/* ${STAGING_KERNEL_DIR}/include/acpi/
- fi
-
- if [ -d include/sound ]; then
- mkdir -p ${STAGING_KERNEL_DIR}/include/sound
- cp -fR include/sound/* ${STAGING_KERNEL_DIR}/include/sound/
- fi
+ for entry in drivers/crypto include/media include/acpi include/sound include/video; do
+ if [ -d $entry ]; then
+ mkdir -p ${STAGING_KERNEL_DIR}/$entry
+ cp -fR $entry/* ${STAGING_KERNEL_DIR}/$entry/
+ fi
+ done
if [ -d drivers/sound ]; then
# 2.4 alsa needs some headers from this directory
@@ -418,3 +405,17 @@ python populate_packages_prepend () {
packages.append(metapkg)
bb.data.setVar('PACKAGES', ' '.join(packages), d)
}
+
+# Support checking the kernel size since some kernels need to reside in partitions
+# with a fixed length or there is a limit in transferring the kernel to memory
+do_sizecheck() {
+ if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
+ size=`ls -l arch/${ARCH}/boot/${KERNEL_IMAGETYPE} | awk '{ print $5}'`
+ if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
+ rm arch/${ARCH}/boot/${KERNEL_IMAGETYPE}
+ die "This kernel (size=$size > ${KERNEL_IMAGE_MAXSIZE}) is too big for your device. Please reduce the size of the kernel by making more of it modular."
+ fi
+ fi
+}
+
+addtask sizecheck before do_install after do_compile
diff --git a/classes/nslu2-mirrors.bbclass b/classes/nslu2-mirrors.bbclass
index 1181edc716..b5ad01adea 100644
--- a/classes/nslu2-mirrors.bbclass
+++ b/classes/nslu2-mirrors.bbclass
@@ -1,4 +1,4 @@
MIRRORS_append () {
-ftp://.*/.*/ http://sources.nslu2-linux.org/sources/
-http://.*/.*/ http://sources.nslu2-linux.org/sources/
+ftp://.*/.* http://sources.nslu2-linux.org/sources/
+https?://.*/.* http://sources.nslu2-linux.org/sources/
}
diff --git a/classes/nylon-mirrors.bbclass b/classes/nylon-mirrors.bbclass
index 2986bd8f80..25a8b87d9b 100644
--- a/classes/nylon-mirrors.bbclass
+++ b/classes/nylon-mirrors.bbclass
@@ -1,6 +1,6 @@
MIRRORS_append () {
ftp://.*/.*/ http://meshcube.org/nylon/stable/sources/
-http://.*/.*/ http://meshcube.org/nylon/stable/sources/
+https?://.*/.*/ http://meshcube.org/nylon/stable/sources/
ftp://.*/.*/ http://meshcube.org/nylon/unstable/sources/
-http://.*/.*/ http://meshcube.org/nylon/unstable/sources/
+https?://.*/.*/ http://meshcube.org/nylon/unstable/sources/
} \ No newline at end of file
diff --git a/classes/oplinux-mirrors.bbclass b/classes/oplinux-mirrors.bbclass
index 076cd6f1fe..c76e822ce3 100644
--- a/classes/oplinux-mirrors.bbclass
+++ b/classes/oplinux-mirrors.bbclass
@@ -3,12 +3,12 @@
MIRRORS_append () {
ftp://.*/.*/ http://digital-opsis.com/oplinux/stable/sources/
-http://.*/.*/ http://digital-opsis.com/oplinux/stable/sources/
+https?://.*/.*/ http://digital-opsis.com/oplinux/stable/sources/
ftp://.*/.*/ http://digital-opsis.com/oplinux/unstable/sources/
-http://.*/.*/ http://digital-opsis.com/oplinux/unstable/sources/
+https?://.*/.*/ http://digital-opsis.com/oplinux/unstable/sources/
ftp://.*/.*/ http://digital-opsis.com/oplinux-uclibc/stable/sources/
-http://.*/.*/ http://digital-opsis.com/oplinux-uclibc/stable/sources/
+https?://.*/.*/ http://digital-opsis.com/oplinux-uclibc/stable/sources/
ftp://.*/.*/ http://digital-opsis.com/oplinux-uclibc/unstable/sources/
-http://.*/.*/ http://digital-opsis.com/oplinux-uclibc/unstable/sources/
+https?://.*/.*/ http://digital-opsis.com/oplinux-uclibc/unstable/sources/
}
diff --git a/classes/own-mirrors.bbclass b/classes/own-mirrors.bbclass
index 32763ed24f..e8a0f481d7 100644
--- a/classes/own-mirrors.bbclass
+++ b/classes/own-mirrors.bbclass
@@ -1,4 +1,4 @@
PREMIRRORS() {
-http://.*/.* ${SOURCE_MIRROR_URL}
+https?://.*/.* ${SOURCE_MIRROR_URL}
ftp://.*/.* ${SOURCE_MIRROR_URL}
}