freetype: Add 2.4.3
[openembedded.git] / classes / siteinfo.bbclass
blob2ce0f718eb536af3159f3612bd18e2077ca7ca9d
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.
6 # Returns information about 'what' for the named target 'target'
7 # where 'target' == "<arch>-<os>"
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
15 # It is an error for the target not to exist.
16 # If 'what' doesn't exist then an empty value is returned
18 def siteinfo_data(d):
19     archinfo = {
20         "arm": "endian-little bit-32 arm-common",
21         "armeb": "endian-big bit-32 arm-common",
22         "avr32": "endian-big bit-32 avr32-common",
23         "bfin": "endian-little bit-32 bfin-common",
24         "i386": "endian-little bit-32 ix86-common",
25         "i486": "endian-little bit-32 ix86-common",
26         "i586": "endian-little bit-32 ix86-common",
27         "i686": "endian-little bit-32 ix86-common",
28         "ia64": "endian-little bit-64",
29         "mips": "endian-big bit-32 mips-common",
30         "mips64": "endian-big bit-64 mips-common",
31         "mips64el": "endian-little bit-64 mips-common",
32         "mipsel": "endian-little bit-32 mips-common",
33         "powerpc": "endian-big bit-32 powerpc-common",
34         "nios2": "endian-little bit-32 nios2-common",
35         "powerpc64": "endian-big bit-64 powerpc-common powerpc64-linux",
36         "ppc": "endian-big bit-32 powerpc-common",
37         "ppc64": "endian-big bit-64 powerpc-common powerpc64-linux",
38         "sh3": "endian-little bit-32 sh-common",
39         "sh4": "endian-little bit-32 sh-common",
40         "sparc": "endian-big bit-32",
41         "viac3": "endian-little bit-32 ix86-common",
42         "x86_64": "endian-little bit-64",
43     }
44     osinfo = {
45         "darwin": "common-darwin",
46         "darwin9": "common-darwin",
47         "linux": "common-linux common-glibc",
48         "linux-gnueabi": "common-linux common-glibc",
49         "linux-gnuspe": "common-linux common-glibc",
50         "linux-uclibc": "common-linux common-uclibc",
51         "linux-uclibceabi": "common-linux common-uclibc",
52         "linux-uclibcspe": "common-linux common-uclibc",
53         "uclinux-uclibc": "common-uclibc",
54         "cygwin": "common-cygwin",
55         "mingw32": "common-mingw",
56     }
57     targetinfo = {
58         "arm-linux-gnueabi":    "arm-linux",
59         "arm-linux-uclibceabi":    "arm-linux-uclibc",
60         "armeb-linux-gnueabi":     "armeb-linux",
61         "armeb-linux-uclibceabi":  "armeb-linux-uclibc",
62         "powerpc-linux-gnuspe":    "powerpc-linux",
63         "powerpc-linux-uclibcspe": "powerpc-linux-uclibc",
64     }
66     arch = d.getVar("HOST_ARCH", True)
67     os = d.getVar("HOST_OS", True)
68     target = "%s-%s" % (arch, os)
70     sitedata = []
71     if arch in archinfo:
72         sitedata.extend(archinfo[arch].split())
73     if os in osinfo:
74         sitedata.extend(osinfo[os].split())
75     if target in targetinfo:
76         sitedata.extend(targetinfo[target].split())
77     sitedata.append(target)
78     sitedata.append("common")
80     return sitedata
82 python () {
83     sitedata = set(siteinfo_data(d))
84     if "endian-little" in sitedata:
85         d.setVar("SITEINFO_ENDIANNESS", "le")
86     elif "endian-big" in sitedata:
87         d.setVar("SITEINFO_ENDIANNESS", "be")
88     else:
89         bb.error("Unable to determine endianness for architecture '%s'" %
90                  d.getVar("HOST_ARCH", True))
91         bb.fatal("Please add your architecture to siteinfo.bbclass")
93     if "bit-32" in sitedata:
94         d.setVar("SITEINFO_BITS", "32")
95     elif "bit-64" in sitedata:
96         d.setVar("SITEINFO_BITS", "64")
97     else:
98         bb.error("Unable to determine bit size for architecture '%s'" %
99                  d.getVar("HOST_ARCH", True))
100         bb.fatal("Please add your architecture to siteinfo.bbclass")