Setting up binutils for cross development

This process is common to all versions of gcc, and the same binutils tree can be shared between them.

Getting the source

The binutils source rpm should be on disc 2:/SRPMS. After installing it with 'rpm -i' the binutils source tarball and one patch will be in /usr/src/RPM/SOURCES. Copy these onto the PC you'll be using to develop, and you're set to build.

Configure and build

All we have to do now is basically follow the build process described in the .spec file found in /usr/src/RPM/SPEC, which looks like this:
  1. tar xvzf binutils-2.9EE.tar.gz
  2. cd binutils-2.9EE
  3. patch -p1 < ../binutils-ps2linux-1.0.0.patch
  4. mkdir build
  5. cd build/
  6. ../configure --prefix=/usr/local/ps2 --target=mipsEEel-linux --host=i386-pc-linux-gnu --build=i386-pc-linux-gnu --enable-shared
  7. make (~5 mins on my p3 850)
Now a 'make install' (as root) should install to /usr/local/ps2.

Lastly, I like to make aliases for all the mipsEEel-linux-, especially since ps2stuff and ps2gl Makefiles depend on it ATM. :) I replace the 'mipsEEel-linux-' with 'ee-'. It's also consistent with the 'ee-dvp-as/gasp' programs. Here's a little line that does it for me:

find . -name 'mipsEE*' -exec bash -c 'ln -s {} `echo {} | sed s,\./mipsEEel\-linux,ee,`' \;