1 |
On Sun, 1 Jul 2012 19:48:58 -0400 |
2 |
Richard Yao <ryao@×××××××××××××.edu> wrote: |
3 |
|
4 |
> I want to add freebsd_get_cpuarch() to freebsd.eclass. This will give |
5 |
> us a platform-independent way of generating MACHINE_CPUARCH, which |
6 |
> will make building FreeBSD components on other platforms (i.e. Linux |
7 |
> and Prefix) easier. |
8 |
> |
9 |
> --- freebsd.eclass.old 2012-07-01 19:15:56.157277000 -0400 |
10 |
> +++ freebsd.eclass 2012-07-01 19:44:08.093698000 -0400 |
11 |
> @@ -58,6 +58,24 @@ freebsd_get_bmake() { |
12 |
> echo "${bmake}" |
13 |
> } |
14 |
> |
15 |
> +freebsd_get_cpuarch() { |
16 |
> + local arch=$(uname -m) |
17 |
> + case $(uname -m) in |
18 |
> + x86_64) |
19 |
> + return 'amd64';; |
20 |
> + arm*) |
21 |
> + return 'arm';; |
22 |
> + i?86) |
23 |
> + return 'i386';; |
24 |
> + ppc*) |
25 |
> + return 'powerpc';; |
26 |
> + mips*) |
27 |
> + return 'mips';; |
28 |
> + sparc*) |
29 |
> + return 'sparc';; |
30 |
> + *) |
31 |
> + return arch; |
32 |
> + esac |
33 |
> +} |
34 |
> + |
35 |
> freebsd_do_patches() { |
36 |
> if [[ ${#PATCHES[@]} -gt 1 ]] ; then |
37 |
> for x in "${PATCHES[@]}"; do |
38 |
> |
39 |
> Does anyone have any objections? |
40 |
> |
41 |
|
42 |
hu? yes, as already pointed out, uname is not reliable when |
43 |
cross-compiling. You should use CHOST, and then you get tc-arch-kernel. |
44 |
See freebsd-lib ebuild for how it is handled. |
45 |
|
46 |
A. |