cd /tmp
git clone https://github.com/macosforge/darwinbuild.git darwinbuild
cd darwinbuild
sudo xcodebuild install DSTROOT=/
cd /tmp
git clone -b Darwin9 https://github.com/macosforge/darwinbuild.git darwinbuild
cd darwinbuild
make
sudo make install
cd /tmp
git clone -b Darwin8 https://github.com/macosforge/darwinbuild.git darwinbuild
cd darwinbuild
make
sudo make install
If you already use MacPorts for other software, you might find it easier to install Darwinbuild from there.
sudo port install darwinbuild +universal
sudo port install darwinbuild-legacy
If you had the darwinbuild port installed on Darwin 8 or 9, then sudo port upgrade darwinbuild
should trigger the replacement process to give you darwinbuild-legacy.