pkgsrc/cross
riastradh a1abd9761c mk: Cross-eyed hacks to support cross-libtool.
For a long time, when cross-building, say from native=amd64 to
target=powerpc, it was necessary to:

1. cross-build a _powerpc_ package called cross-libtool-base-powerpc,
   and then

2. install the powerpc package _natively_ with `pkg_add -m x86_64' to
   override the architecture check that normally forbids this kind of
   shenanigans,

in order to cross-build anything that uses libtool as a tool.

This is partly because libtool doesn't follow the normal GNU
convention of `./configure --build=<native platform> --host=<platform
package will run on> --target=<platform package is configured to
operate on>' -- in this example, build=amd64, host=amd64,
target=powerpc.

Instead, libtool expects to be cross-built itself, even if it's going
to run as a tool.  It's not as bonkers as it sounds at first: libtool
is just a shell script, and it caches various information about the
(cross-building!) toolchain it is built with so it can use that
information later when it is run as a tool itself to cross-compile
other software.

To make this work, we need to create the toolchain wrappers for
libtool _as if_ we were cross-building even if we are building a
native package.  So mk/tools uses a new flag TOOLS_USE_CROSS_COMPILE
instead of USE_CROSS_COMPILE, and libtool internally sets
MACHINE_ARCH=${TARGET_ARCH} (in the example above, powerpc) to make
it look like we're cross-building.  The new TOOLS_CROSS_DESTDIR is an
alias for the (defaulted) CROSS_DESTDIR, which must now be set
unconditionally in mk.conf in order for libtool to know where the
cross-destdir will be; _CROSS_DESTDIR remains empty when building any
native packages (including the native cross-libtool package).

Finally, we need to make the resulting package be a native package,
with MACHINE_ARCH set to the one that it will be installed on (in the
example above, amd64), so I added an indirection _BUILD_DEFS.${var}
to replace var on its own in the build definitions that get baked
into the package, shown by `pkg_info -B'.  Setting
_BUILD_DEFS.MACHINE_ARCH=${NATIVE_MACHINE_ARCH} ensures that this
mutant hybrid cross-built libtool still produces a native package.

All of this logic is gated on setting USE_CROSS_COMPILE in mk.conf or
LIBTOOL_CROSS_COMPILE in the package makefile, so it should be safe
for non-cross-builds -- when USE_CROSS_COMPILE=no and you're not
building cross-libtool, everything is as before.
2022-04-04 11:23:06 +00:00
..
aarch64-none-elf-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
aarch64-none-elf-gcc cross/*: fix bare-metal ARM toolchains on netbsd-9. PR pkg/56609 2022-01-16 21:10:17 +00:00
arm-none-eabi-binutils arm-none-eabi-*: Add ALTERNATIVES. 2021-12-14 10:33:57 +00:00
arm-none-eabi-gcc cross/*: fix bare-metal ARM toolchains on netbsd-9. PR pkg/56609 2022-01-16 21:10:17 +00:00
arm-none-eabi-gdb arm-none-eabi-*: Add ALTERNATIVES. 2021-12-14 10:33:57 +00:00
asm6809 cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
atasm cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
avr-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
avr-gcc avr-gcc: use BLAKE2s. Remove isl 2021-11-15 17:22:41 +00:00
avr-gdb cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
avr-libc Remove the global BUILD_DEPENDS on tex-alphalph as it's option-specific and 2022-01-19 03:50:32 +00:00
avrdude Update to avrdude 6.4 2021-12-29 23:03:21 +00:00
bfd-crunchide Don't build bfd-crunchide and bfd-mdsetimage as PIE, they link against a 2020-03-29 00:58:31 +00:00
bfd-mdsetimage Don't build bfd-crunchide and bfd-mdsetimage as PIE, they link against a 2020-03-29 00:58:31 +00:00
binutils-mips-current cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
bossa revbump for icu and libffi 2021-12-08 16:01:42 +00:00
cc65 cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
cross-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
cross-libtool-base mk: Cross-eyed hacks to support cross-libtool. 2022-04-04 11:23:06 +00:00
dasm cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
dfu-programmer cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
freemint-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
freemint-cflib cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
freemint-gcc freemint-gcc: Enable ObjC and ObjC++ 2022-01-29 18:33:17 +00:00
freemint-gemlib cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
freemint-ldg cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
freemint-mintbin cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
freemint-mintlib freemint-mintlib: various build fixes 2021-11-18 15:43:27 +00:00
freemint-pml freemint-*: disable MKPIE some more 2021-11-18 16:05:28 +00:00
gcc-mips-current cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
GenFw cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
h8300-elf-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
h8300-elf-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
icdprog cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mingw *: Convert broken sourceforge HOMEPAGEs back to http 2020-03-20 11:57:22 +00:00
mingw-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mingw-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mingw-runtime-bin cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mingw-w32api-bin cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mingw-w64 mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mingw-w64-i686-binutils mingw-w64-i686-binutils: Update to 2.36 2021-01-28 12:43:28 +00:00
mingw-w64-i686-crt mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mingw-w64-i686-gcc mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mingw-w64-i686-gcc-bootstrap mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mingw-w64-i686-gcc-winpthreads mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mingw-w64-i686-headers cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mingw-w64-i686-winpthreads mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mingw-w64-x86_64-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mingw-w64-x86_64-crt mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mingw-w64-x86_64-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mingw-w64-x86_64-gcc-bootstrap mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mingw-w64-x86_64-gcc-winpthreads mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mingw-w64-x86_64-headers cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mingw-w64-x86_64-winpthreads mingw-w64: Update to 9.0.0 2021-08-27 14:11:06 +00:00
mipsel-none-elf-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
mipsel-none-elf-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
nios2 cross/nios2: skip check for unknown configure script and portability 2020-05-15 13:01:52 +00:00
nios2-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
nios2-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
objconv cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
or1k-none-elf-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
or1k-none-elf-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
pdp11-aout-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
pdp11-aout-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
powerpc-none-elf-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
powerpc-none-elf-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
ppc-morphos-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
ppc-morphos-gcc-9 cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
ppc-morphos-gcc-10 cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
ppc-morphos-sdk Update cross/ppc-morphos-sdk to 20220309 2022-03-20 20:27:22 +00:00
stlink cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
uisp cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
xtensa-esp32-elf-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
xtensa-esp32-elf-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
xtensa-lx106-elf-binutils cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
xtensa-lx106-elf-gcc cross: Replace RMD160 checksums with BLAKE2s checksums 2021-10-26 10:07:50 +00:00
Makefile Add ppc-morphos-gcc-10 2021-07-25 15:06:25 +00:00