aboutsummaryrefslogtreecommitdiffstats
path: root/classes/qemu.bbclass
diff options
context:
space:
mode:
authorTom Rini <tom_rini@mentor.com>2010-03-03 14:04:57 -0700
committerTom Rini <tom_rini@mentor.com>2010-03-03 14:04:57 -0700
commit27de16184dccb7b3a49bd08c9282fe4843d00251 (patch)
tree6bcec8ec1d29302af8f8f475b88ebc85f085c43f /classes/qemu.bbclass
parent8b0202e6e3f90a772df301e8522f9deb03e50132 (diff)
downloadopenembedded-27de16184dccb7b3a49bd08c9282fe4843d00251.tar.gz
qemu: Move gcc version check, qemu-TARGET logic into qemu.bbclass
Move the logic to determine what qemu-TARGET to run into qemu.bbclass so we can check for the right binary in sanity.bbclass. This code was duplicated by glibc-package and eglibc-package anyhow and with the new fn we can clean up the usage in these classes a bit. Now that we have a class for qemu stuff, and the gcc check is just for qemu, move it there.
Diffstat (limited to 'classes/qemu.bbclass')
-rw-r--r--classes/qemu.bbclass27
1 files changed, 27 insertions, 0 deletions
diff --git a/classes/qemu.bbclass b/classes/qemu.bbclass
new file mode 100644
index 0000000000..40a3542450
--- /dev/null
+++ b/classes/qemu.bbclass
@@ -0,0 +1,27 @@
+#
+# This class contains functions for recipes that need QEMU or test for its
+# existance.
+#
+
+def check_gcc3(data):
+ # Used by qemu to make sure we have a workable gcc-3.x.
+ # Start by checking for the program name as we build it as there
+ # are some distribtuion provided gcc-3.x's that will not work.
+ gcc3_versions = 'gcc-3.4.6 gcc-3.4.4 gcc34 gcc-3.4 gcc-3.4.7 gcc-3.3 gcc33 gcc-3.3.6 gcc-3.2 gcc32'
+
+ for gcc3 in gcc3_versions.split():
+ if check_app_exists(gcc3, data):
+ return gcc3
+
+ return False
+
+def qemu_target_binary(data):
+ import bb
+
+ target_arch = bb.data.getVar("TARGET_ARCH", data, 1)
+ if target_arch in ("i486", "i586", "i686"):
+ target_arch = "i386"
+ elif target_arch == "powerpc":
+ target_arch = "ppc"
+
+ return "qemu-" + target_arch