Gentoo Archives: gentoo-bsd

From: Javier Villavicencio <the_paya@g.o>
To: gentoo-bsd@l.g.o
Subject: Re: [gentoo-bsd] freebsd.eclass change
Date: Mon, 02 Jul 2012 06:14:51
Message-Id: 4FF13334.6010605@gentoo.org
In Reply to: [gentoo-bsd] freebsd.eclass change by Richard Yao
1 On 01/07/2012 20:48, Richard Yao wrote:
2 > I want to add freebsd_get_cpuarch() to freebsd.eclass. This will give us
3 > a platform-independent way of generating MACHINE_CPUARCH, which will
4 > make building FreeBSD components on other platforms (i.e. Linux and
5 > Prefix) easier.
6 >
7 > --- freebsd.eclass.old 2012-07-01 19:15:56.157277000 -0400
8 > +++ freebsd.eclass 2012-07-01 19:44:08.093698000 -0400
9 > @@ -58,6 +58,24 @@ freebsd_get_bmake() {
10 > echo "${bmake}"
11 > }
12 >
13 > +freebsd_get_cpuarch() {
14 > + local arch=$(uname -m)
15 > + case $(uname -m) in
16 > + x86_64)
17 > + return 'amd64';;
18 > + arm*)
19 > + return 'arm';;
20 > + i?86)
21 > + return 'i386';;
22 > + ppc*)
23 > + return 'powerpc';;
24 > + mips*)
25 > + return 'mips';;
26 > + sparc*)
27 > + return 'sparc';;
28 > + *)
29 > + return arch;
30 > + esac
31 > +}
32 > +
33 > freebsd_do_patches() {
34 > if [[ ${#PATCHES[@]} -gt 1 ]] ; then
35 > for x in "${PATCHES[@]}"; do
36 >
37 > Does anyone have any objections?
38 >
39
40 Wouldn't you want to echo '...' instead of return?
41 Last one should be return $arch;; btw.
42
43 And I think the tc-arch() function of toolchain-funcs.eclass is pretty
44 complete, what is it missing (besides powerpc that we may never support)?