summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-07-22 18:58:55 +0200
committerKoen Kooi <koen@dominion.thruhere.net>2011-07-22 18:58:55 +0200
commitfa1547f54bc5e4e06fc2cc314c1b0c5b785e2f33 (patch)
treef5b76b8e3eeb7f964b4d28c3cd0a459c2385e466 /meta-oe/classes
parent7127ec564fc69524d210f6ba81682c3847d71681 (diff)
downloadmeta-openembedded-fa1547f54bc5e4e06fc2cc314c1b0c5b785e2f33.tar.gz
siteinfo bbclass: remove, it has been synced back to oe-core
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/classes')
-rw-r--r--meta-oe/classes/siteinfo.bbclass222
1 files changed, 0 insertions, 222 deletions
diff --git a/meta-oe/classes/siteinfo.bbclass b/meta-oe/classes/siteinfo.bbclass
deleted file mode 100644
index a33b95f0a7..0000000000
--- a/meta-oe/classes/siteinfo.bbclass
+++ /dev/null
@@ -1,222 +0,0 @@
1# This class exists to provide information about the targets that
2# may be needed by other classes and/or recipes. If you add a new
3# target this will probably need to be updated.
4
5#
6# Returns information about 'what' for the named target 'target'
7# where 'target' == "<arch>-<os>"
8#
9# 'what' can be one of
10# * target: Returns the target name ("<arch>-<os>")
11# * endianess: Return "be" for big endian targets, "le" for little endian
12# * bits: Returns the bit size of the target, either "32" or "64"
13# * libc: Returns the name of the c library used by the target
14#
15# It is an error for the target not to exist.
16# If 'what' doesn't exist then an empty value is returned
17#
18def siteinfo_data(d):
19 archinfo = {
20 "allarch": "endian-little bit-32", # bogus, but better than special-casing the checks below for allarch
21 "arm": "endian-little bit-32 arm-common",
22 "armeb": "endian-big bit-32 arm-common",
23 "avr32": "endian-big bit-32 avr32-common",
24 "bfin": "endian-little bit-32 bfin-common",
25 "i386": "endian-little bit-32 ix86-common",
26 "i486": "endian-little bit-32 ix86-common",
27 "i586": "endian-little bit-32 ix86-common",
28 "i686": "endian-little bit-32 ix86-common",
29 "ia64": "endian-little bit-64",
30 "mips": "endian-big bit-32 mips-common",
31 "mips64": "endian-big bit-64 mips64-common",
32 "mips64el": "endian-little bit-64 mips64-common",
33 "mipsel": "endian-little bit-32 mips-common",
34 "powerpc": "endian-big bit-32 powerpc-common",
35 "nios2": "endian-little bit-32 nios2-common",
36 "powerpc64": "endian-big bit-64 powerpc-common powerpc64-linux",
37 "ppc": "endian-big bit-32 powerpc-common",
38 "ppc64": "endian-big bit-64 powerpc-common powerpc64-linux",
39 "sh3": "endian-little bit-32 sh-common",
40 "sh4": "endian-little bit-32 sh-common",
41 "sparc": "endian-big bit-32",
42 "viac3": "endian-little bit-32 ix86-common",
43 "x86_64": "endian-little bit-64",
44 }
45 osinfo = {
46 "darwin": "common-darwin",
47 "darwin9": "common-darwin",
48 "linux": "common-linux common-glibc",
49 "linux-gnueabi": "common-linux common-glibc",
50 "linux-gnuspe": "common-linux common-glibc",
51 "linux-uclibc": "common-linux common-uclibc",
52 "linux-uclibceabi": "common-linux common-uclibc",
53 "linux-uclibcspe": "common-linux common-uclibc",
54 "uclinux-uclibc": "common-uclibc",
55 "cygwin": "common-cygwin",
56 "mingw32": "common-mingw",
57 }
58 targetinfo = {
59 "arm-linux-gnueabi": "arm-linux",
60 "arm-linux-uclibceabi": "arm-linux-uclibc",
61 "armeb-linux-gnueabi": "armeb-linux",
62 "armeb-linux-uclibceabi": "armeb-linux-uclibc",
63 "powerpc-linux-gnuspe": "powerpc-linux",
64 "powerpc-linux-uclibcspe": "powerpc-linux-uclibc",
65 }
66
67 arch = d.getVar("HOST_ARCH", True)
68 os = d.getVar("HOST_OS", True)
69 target = "%s-%s" % (arch, os)
70
71 sitedata = []
72 if arch in archinfo:
73 sitedata.extend(archinfo[arch].split())
74 if os in osinfo:
75 sitedata.extend(osinfo[os].split())
76 if target in targetinfo:
77 sitedata.extend(targetinfo[target].split())
78 sitedata.append(target)
79 sitedata.append("common")
80
81 return sitedata
82
83python () {
84 sitedata = set(siteinfo_data(d))
85 if "endian-little" in sitedata:
86 d.setVar("SITEINFO_ENDIANNESS", "le")
87 elif "endian-big" in sitedata:
88 d.setVar("SITEINFO_ENDIANNESS", "be")
89 else:
90 bb.error("Unable to determine endianness for architecture '%s'" %
91 d.getVar("HOST_ARCH", True))
92 bb.fatal("Please add your architecture to siteinfo.bbclass")
93
94 if "bit-32" in sitedata:
95 d.setVar("SITEINFO_BITS", "32")
96 elif "bit-64" in sitedata:
97 d.setVar("SITEINFO_BITS", "64")
98 else:
99 bb.error("Unable to determine bit size for architecture '%s'" %
100 d.getVar("HOST_ARCH", True))
101 bb.fatal("Please add your architecture to siteinfo.bbclass")
102}
103
104# Old class from oe-core pasted in below for compat
105
106def get_siteinfo_list(d):
107 target = bb.data.getVar('HOST_ARCH', d, 1) + "-" + bb.data.getVar('HOST_OS', d, 1)
108
109 targetinfo = {\
110 "allarch-linux": "",\
111 "armeb-linux": "endian-big bit-32 common-glibc arm-common",\
112 "armeb-linux-gnueabi": "endian-big bit-32 common-glibc arm-common armeb-linux",\
113 "armeb-linux-uclibc": "endian-big bit-32 common-uclibc arm-common",\
114 "armeb-linux-uclibceabi": "endian-big bit-32 common-uclibc arm-common armeb-linux-uclibc",\
115 "arm-darwin": "endian-little bit-32 common-darwin",\
116 "arm-darwin8": "endian-little bit-32 common-darwin",\
117 "arm-linux": "endian-little bit-32 common-glibc arm-common",\
118 "arm-linux-gnueabi": "endian-little bit-32 common-glibc arm-common arm-linux",\
119 "arm-linux-uclibc": "endian-little bit-32 common-uclibc arm-common",\
120 "arm-linux-uclibceabi": "endian-little bit-32 common-uclibc arm-common arm-linux-uclibc",\
121 "avr32-linux": "endian-big bit-32 common-glibc avr32-common",\
122 "avr32-linux-uclibc": "endian-big bit-32 common-uclibc avr32-common",\
123 "bfin-uclinux-uclibc": "endian-little bit-32 common-uclibc bfin-common",\
124 "i386-linux": "endian-little bit-32 common-glibc ix86-common",\
125 "i486-linux": "endian-little bit-32 common-glibc ix86-common",\
126 "i586-linux": "endian-little bit-32 common-glibc ix86-common",\
127 "i686-linux": "endian-little bit-32 common-glibc ix86-common",\
128 "i386-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\
129 "i486-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\
130 "i586-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\
131 "i686-linux-uclibc": "endian-little bit-32 common-uclibc ix86-common",\
132 "microblaze-linux-gnu": "endian-big bit-32 common-glibc microblaze-common",\
133 "mipsel-linux": "endian-little bit-32 common-glibc mips-common",\
134 "mipsel-linux-uclibc": "endian-little bit-32 common-uclibc mips-common",\
135 "mips-linux": "endian-big bit-32 common-glibc mips-common",\
136 "mips-linux-uclibc": "endian-big bit-32 common-uclibc mips-common",\
137 "powerpc-darwin": "endian-big bit-32 common-darwin",\
138 "ppc-linux": "endian-big bit-32 common-glibc powerpc-common",\
139 "powerpc-linux": "endian-big bit-32 common-glibc powerpc-common",\
140 "powerpc-linux-gnuspe": "endian-big bit-32 common-glibc powerpc-common",\
141 "powerpc-linux-uclibc": "endian-big bit-32 common-uclibc powerpc-common",\
142 "sh3-linux": "endian-little bit-32 common-glibc sh-common",\
143 "sh4-linux": "endian-little bit-32 common-glibc sh-common",\
144 "sh4-linux-uclibc": "endian-little bit-32 common-uclibc sh-common",\
145 "sparc-linux": "endian-big bit-32 common-glibc",\
146 "x86_64-linux": "endian-little bit-64 common-glibc",\
147 "x86_64-linux-uclibc": "endian-little bit-64 common-uclibc"}
148 if target in targetinfo:
149 info = targetinfo[target].split()
150 info.append(target)
151 info.append("common")
152 return info
153 else:
154 bb.error("Information not available for target '%s'" % target)
155
156
157#
158# Define which site files to use. We check for several site files and
159# use each one that is found, based on the list returned by get_siteinfo_list()
160#
161# Search for the files in the following directories:
162# 1) ${BBPATH}/site (in reverse) - app specific, then site wide
163# 2) ${FILE_DIRNAME}/site-${PV} - app version specific
164#
165def siteinfo_get_files(d):
166 sitefiles = ""
167
168 # Determine which site files to look for
169 sites = get_siteinfo_list(d)
170
171 # Check along bbpath for site files and append in reverse order so
172 # the application specific sites files are last and system site
173 # files first.
174 path_bb = bb.data.getVar('BBPATH', d, 1)
175 for p in (path_bb or "").split(':'):
176 tmp = ""
177 for i in sites:
178 fname = os.path.join(p, 'site', i)
179 if os.path.exists(fname):
180 tmp += fname + " "
181 sitefiles = tmp + sitefiles;
182
183 # Now check for the applications version specific site files
184 path_pkgv = os.path.join(bb.data.getVar('FILE_DIRNAME', d, 1), "site-" + bb.data.getVar('PV', d, 1))
185 for i in sites:
186 fname = os.path.join(path_pkgv, i)
187 if os.path.exists(fname):
188 sitefiles += fname + " "
189
190 # Now check for siteconfig cache files
191 path_siteconfig = bb.data.getVar('SITECONFIG_SYSROOTCACHE', d, 1)
192 if os.path.isdir(path_siteconfig):
193 for i in os.listdir(path_siteconfig):
194 fname = os.path.join(path_siteconfig, i)
195 sitefiles += fname + " "
196
197 bb.debug(1, "SITE files " + sitefiles);
198 return sitefiles
199
200def siteinfo_get_endianess(d):
201 info = get_siteinfo_list(d)
202 if 'endian-little' in info:
203 return "le"
204 elif 'endian-big' in info:
205 return "be"
206 bb.error("Site info could not determine endianess for target")
207
208def siteinfo_get_bits(d):
209 info = get_siteinfo_list(d)
210 if 'bit-32' in info:
211 return "32"
212 elif 'bit-64' in info:
213 return "64"
214 bb.error("Site info could not determine bit size for target")
215
216#
217# Make some information available via variables
218#
219SITEINFO_ENDIANESS = "${@siteinfo_get_endianess(d)}"
220SITEINFO_BITS = "${@siteinfo_get_bits(d)}"
221SITECONFIG_SYSROOTCACHE = "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d"
222