diff options
author | Marcin Juszkiewicz <hrw@openedhand.com> | 2008-01-03 14:07:44 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <hrw@openedhand.com> | 2008-01-03 14:07:44 +0000 |
commit | 66ff85a04873f307baeed7c0d2c92e195bda4b96 (patch) | |
tree | e1dc793e40122d4ce5a947956fc44be89f2980d8 /meta | |
parent | 67eaa28a3d2bebb2e5f1d46244db248afd3545e7 (diff) | |
download | poky-66ff85a04873f307baeed7c0d2c92e195bda4b96.tar.gz |
base and sanity bbclasses + qemu: move gcc3 availability checking into base.bbclass
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3402 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/base.bbclass | 17 | ||||
-rw-r--r-- | meta/classes/sanity.bbclass | 10 | ||||
-rw-r--r-- | meta/packages/qemu/qemu-gcc3-check.inc | 17 |
3 files changed, 21 insertions, 23 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index d4cae4931c..816f872f0b 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -897,6 +897,23 @@ python () { | |||
897 | base_after_parse(d) | 897 | base_after_parse(d) |
898 | } | 898 | } |
899 | 899 | ||
900 | def check_app_exists(app, d): | ||
901 | from bb import which, data | ||
902 | |||
903 | app = data.expand(app, d) | ||
904 | path = data.getVar('PATH', d) | ||
905 | return len(which(path, app)) != 0 | ||
906 | |||
907 | def check_gcc3(data): | ||
908 | |||
909 | gcc3_versions = 'gcc-3.4 gcc34 gcc-3.4.4 gcc-3.4.6 gcc-3.4.7 gcc-3.3 gcc33 gcc-3.3.6 gcc-3.2 gcc32' | ||
910 | |||
911 | for gcc3 in gcc3_versions.split(): | ||
912 | if check_app_exists(gcc3, data): | ||
913 | return gcc3 | ||
914 | |||
915 | return False | ||
916 | |||
900 | # Patch handling | 917 | # Patch handling |
901 | inherit patch | 918 | inherit patch |
902 | 919 | ||
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 8b5526075c..957e24e1e1 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -24,14 +24,6 @@ def check_conf_exists(fn, data): | |||
24 | return True | 24 | return True |
25 | return False | 25 | return False |
26 | 26 | ||
27 | def check_app_exists(app, d): | ||
28 | from bb import which, data | ||
29 | |||
30 | app = data.expand(app, d) | ||
31 | path = data.getVar('PATH', d) | ||
32 | return len(which(path, app)) != 0 | ||
33 | |||
34 | |||
35 | def check_sanity(e): | 27 | def check_sanity(e): |
36 | from bb import note, error, data, __version__ | 28 | from bb import note, error, data, __version__ |
37 | from bb.event import Handled, NotHandled, getName | 29 | from bb.event import Handled, NotHandled, getName |
@@ -96,7 +88,7 @@ def check_sanity(e): | |||
96 | if "qemu-native" not in assume_provided: | 88 | if "qemu-native" not in assume_provided: |
97 | gcc_version = commands.getoutput("${BUILD_PREFIX}gcc --version | head -n 1 | cut -f 3 -d ' '") | 89 | gcc_version = commands.getoutput("${BUILD_PREFIX}gcc --version | head -n 1 | cut -f 3 -d ' '") |
98 | 90 | ||
99 | if not check_app_exists('gcc-3.4', e.data) and not check_app_exists('gcc-3.3', e.data) and gcc_version[0] != '3': | 91 | if not check_gcc3(e.data) and gcc_version[0] != '3': |
100 | missing = missing + "gcc-3.x (needed for qemu-native)," | 92 | missing = missing + "gcc-3.x (needed for qemu-native)," |
101 | else: | 93 | else: |
102 | required_utilities = required_utilities + " qemu-arm" | 94 | required_utilities = required_utilities + " qemu-arm" |
diff --git a/meta/packages/qemu/qemu-gcc3-check.inc b/meta/packages/qemu/qemu-gcc3-check.inc index 658e72ffc3..81c3555b48 100644 --- a/meta/packages/qemu/qemu-gcc3-check.inc +++ b/meta/packages/qemu/qemu-gcc3-check.inc | |||
@@ -4,19 +4,8 @@ python __anonymous() { | |||
4 | path = data.getVar('PATH', d, 1) | 4 | path = data.getVar('PATH', d, 1) |
5 | oldOeConf = data.getVar('EXTRA_OECONF', d, 1) | 5 | oldOeConf = data.getVar('EXTRA_OECONF', d, 1) |
6 | if not oldOeConf: oldOeConf = "" | 6 | if not oldOeConf: oldOeConf = "" |
7 | if len(which(path, 'gcc-3.4.4')) != 0: | 7 | gcc3 = check_gcc3(d) |
8 | data.setVar('EXTRA_OECONF', oldOeConf + " --cc=gcc-3.4.4", d) | 8 | if gcc3: |
9 | elif len(which(path, 'gcc-3.4')) != 0: | 9 | data.setVar('EXTRA_OECONF', oldOeConf + " --cc=" + gcc3, d) |
10 | data.setVar('EXTRA_OECONF', oldOeConf + " --cc=gcc-3.4", d) | ||
11 | elif len(which(path, 'gcc34')) != 0: | ||
12 | data.setVar('EXTRA_OECONF', oldOeConf + " --cc=gcc34", d) | ||
13 | elif len(which(path, 'gcc33')) != 0: | ||
14 | data.setVar('EXTRA_OECONF', oldOeConf + " --cc=gcc33", d) | ||
15 | elif len(which(path, 'gcc-3.3')) != 0: | ||
16 | data.setVar('EXTRA_OECONF', oldOeConf + " --cc=gcc-3.3", d) | ||
17 | elif len(which(path, 'gcc-3.3.6')) != 0: | ||
18 | data.setVar('EXTRA_OECONF', oldOeConf + " --cc=gcc-3.3.6", d) | ||
19 | elif len(which(path, 'gcc-3.4.6')) != 0: | ||
20 | data.setVar('EXTRA_OECONF', oldOeConf + " --cc=gcc-3.4.6", d) | ||
21 | } | 10 | } |
22 | 11 | ||