1 |
There is a small error in this. It should be 's/return/echo/'. |
2 |
|
3 |
On 07/01/2012 07:48 PM, Richard Yao wrote: |
4 |
> I want to add freebsd_get_cpuarch() to freebsd.eclass. This will give us |
5 |
> a platform-independent way of generating MACHINE_CPUARCH, which will |
6 |
> make building FreeBSD components on other platforms (i.e. Linux and |
7 |
> 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 |
> |