So let's say you're a retrocomputing aficionado who enjoys running modern Unix on classic hardware. You're running NetBSD (after all, it's one of very few OSes which doesn't treat alternate architectures with disdain) but you cringe whenever Perl is updated because it'll take something like a week to update everything on your m68030. Sure, you already know how to crosscompile the OS, but that doesn't work for pkgsrc packages. On the other hand, you're not one to knowingly run insecure software, so waiting for binary packages for your platform isn't an option.
This guide will help you set up distcc to distribute pkgsrc compile tasks to another machine over your network.
These days you can pick up a Raspberry Pi for $40 USD, a BeagleBone Black for $50 or a PogoPlug for $20 or less. I like PogoPlugs because they're physically robust and are really hard to accidentally unplug, whereas if you sneeze the wrong way around a Pi you might be waiting for it to finish a reboot (Ok, it's not really that bad, but you get the point).
In my examples I'm using a PogoPlug Mobile with a rather modest 16 gig USB flash drive. It has an 800 MHz StrongARM (Kirkwood ARMv5), 128 megs of memory and gigabit ethernet and cost $14 USD when Radio Shack still had them. See my article on how to install NetBSD without needing a serial console if you're interested here:
The retrocomputer this machine will assist is a VAXstation 4000/60 with 56 megs of memory. I'll refer to them as retro and modern. retro in these examples is at 10.12.26.190 and modern is at 10.12.26.189.
Start by installing devel/distcc from pkgsrc on both retro and modern machines (or use whatever package method you like to install distcc if you're running GNU/Linux or something else). If you'd prefer to use distcc 3.2rc1 instead of 3.1, remove patches/patch-ad, patches/patch-src_emaillog.c and patches/patch-src_dotd.c, then change PKGREVISION in Makefile to 0 and DISTCC_VERSION to 3.2rc1 in Makefile.common, then run make with NO_CHECKSUM=yes.
While that's running, we'll compile a toolchain targetting retro on modern using NetBSD's build.sh. The locations below are chosen simply because they're easy to remember. Here's how we make a VAX toolchain. In /usr/src/:
./build.sh -O /usr/obj-vax -T /usr/tools -m vax tools
Note that in this case, "vax" is the same for both machine and architecture. If running m68k, you'd select a machine (-m) name such as sun3, netx68k, mac68k or amiga, not m68k, but the path would end up being /usr/tools/m68k--netbsdelf/bin/.
A little while later you'll have everything you need in /usr/tools/. If you look in /usr/tools/bin/, you'll see vax--netbsdelf-c++, vax--netbsdelf-gcc and...Read more »