| @@ -1,17 +1,17 @@ | | | @@ -1,17 +1,17 @@ |
1 | Cross-compilation in pkgsrc (user's guide) -*- outline -*- | | 1 | Cross-compilation in pkgsrc (user's guide) -*- outline -*- |
2 | Taylor R. Campbell <riastradh@NetBSD.org> | | 2 | Taylor R. Campbell <riastradh@NetBSD.org> |
3 | | | 3 | |
4 | $NetBSD: HOWTO-use-crosscompile,v 1.15 2024/04/12 19:57:06 riastradh Exp $ | | 4 | $NetBSD: HOWTO-use-crosscompile,v 1.16 2024/05/16 13:21:22 riastradh Exp $ |
5 | | | 5 | |
6 | The following steps enable you to build binary packages for a machine | | 6 | The following steps enable you to build binary packages for a machine |
7 | architecture other than the one you are building on. For example, you | | 7 | architecture other than the one you are building on. For example, you |
8 | might use them on your beefy umpteen-core amd64-based build machine | | 8 | might use them on your beefy umpteen-core amd64-based build machine |
9 | (the `native' machine) to build packages for your feeble powerpc-based | | 9 | (the `native' machine) to build packages for your feeble powerpc-based |
10 | network appliance (the `target' machine). | | 10 | network appliance (the `target' machine). |
11 | | | 11 | |
12 | These instructions assume you use the conventional privileged paths: | | 12 | These instructions assume you use the conventional privileged paths: |
13 | /usr/src for the NetBSD source tree, /usr/obj for the NetBSD object | | 13 | /usr/src for the NetBSD source tree, /usr/obj for the NetBSD object |
14 | tree, and /usr/pkgsrc for the pkgsrc tree. If you want to do it | | 14 | tree, and /usr/pkgsrc for the pkgsrc tree. If you want to do it |
15 | unprivileged, see `* Unprivileged notes' below. | | 15 | unprivileged, see `* Unprivileged notes' below. |
16 | | | 16 | |
17 | XXX This currently works only for NetBSD. | | 17 | XXX This currently works only for NetBSD. |
| @@ -24,28 +24,29 @@ mk.conf. | | | @@ -24,28 +24,29 @@ mk.conf. |
24 | | | 24 | |
25 | $ cd /usr/src | | 25 | $ cd /usr/src |
26 | $ ./build.sh -m evbppc tools | | 26 | $ ./build.sh -m evbppc tools |
27 | $ ./build.sh -m evbppc distribution | | 27 | $ ./build.sh -m evbppc distribution |
28 | | | 28 | |
29 | By default, the destdir will be /usr/obj/destdir.evbppc, and the | | 29 | By default, the destdir will be /usr/obj/destdir.evbppc, and the |
30 | tooldir will be (say) /usr/obj/tooldir.NetBSD-6.1-amd64 if you're | | 30 | tooldir will be (say) /usr/obj/tooldir.NetBSD-6.1-amd64 if you're |
31 | running NetBSD 6.1 on amd64. | | 31 | running NetBSD 6.1 on amd64. |
32 | | | 32 | |
33 | * Set up mk.conf | | 33 | * Set up mk.conf |
34 | | | 34 | |
35 | In addition to whatever else you want in your mk.conf for pkgsrc, add: | | 35 | In addition to whatever else you want in your mk.conf for pkgsrc, add: |
36 | | | 36 | |
37 | # Cross-compile by default. (Alternatively, you can cross-build | | 37 | # Cross-compile by default. (Alternatively, instead of having this |
38 | # packages with `make package USE_CROSS_COMPILE=no'.) | | 38 | # setting in mk.conf, you can cross-build packages by just running |
| | | 39 | # `make package USE_CROSS_COMPILE=yes'.) |
39 | # | | 40 | # |
40 | # Note: This must use `?=' so it doesn't override pkgsrc's internal | | 41 | # Note: This must use `?=' so it doesn't override pkgsrc's internal |
41 | # USE_CROSS_COMPILE=no when recursively building toolchain packages | | 42 | # USE_CROSS_COMPILE=no when recursively building toolchain packages |
42 | # that have to run on the host. | | 43 | # that have to run on the host. |
43 | USE_CROSS_COMPILE?= yes | | 44 | USE_CROSS_COMPILE?= yes |
44 | | | 45 | |
45 | # Point pkgsrc at the NetBSD tooldir and destdir for cross builds. | | 46 | # Point pkgsrc at the NetBSD tooldir and destdir for cross builds. |
46 | TOOLDIR= /usr/obj/tooldir.NetBSD-6.1-amd64 | | 47 | TOOLDIR= /usr/obj/tooldir.NetBSD-6.1-amd64 |
47 | CROSS_DESTDIR= /usr/obj/destdir.evbppc | | 48 | CROSS_DESTDIR= /usr/obj/destdir.evbppc |
48 | | | 49 | |
49 | # Specify the machine architecture of target packages. | | 50 | # Specify the machine architecture of target packages. |
50 | CROSS_MACHINE_ARCH= powerpc | | 51 | CROSS_MACHINE_ARCH= powerpc |
51 | | | 52 | |