this is my first time trying to build a compiler from the gnu compiler collection source so, inevitably, i'm having a few issues. i'm trying to build a cross compiler for arm4 targets on my virtual machine, running FreeBSD 7. I'm doing this for building arm4 code for an arm7tdmi chip in the gameboy advance for an operating system project. i have downloaded libgba and the appropriate headers but i need a compiler that will build raw binaries (not ELF compatible, should be a.out old binaries i think) that i can pull over to my flash cartridge and run on the system. here's what i've done so far:
1. downloaded binutils 2.18: won't compile for arm or i386 targets
2. downloaded binutils 2.9: won't compile for arm or i386 targets
3. downloaded binutils 2.8: won't compile for arm or i386 targets
4. make install gcc41 in /usr/ports: gcc upgraded successfully
5. tried to compile gcc43 from source: no success for i386 target: missing gmp, mpfr
6. make install gmp and mpfr in /usr/ports: successful
7. tried again to compile gcc43: no success, different error:
sed -e 's/@gcc_version@//' < > mkheadersT
Syntax error: redirection unexpected
right now i'd really just like for anything to compile properly. i'm starting to feel a bit overwhelmed. i realized building the compiler would be a huge undertaking but now i'm stuck...
should i even bother compiling from source? it seems impossible. i'm trying to gain a greater understanding of gcc and compilation for BSD systems as i'm hoping to soon make a career out of embedded systems programming... maybe i'm just a noob but i was hoping that it would be possible to download and compile gcc from source for any target OS? maybe not...
Is there some way to build a compiler using ./configure options from the ports tree? I'm thinking since that worked, perhaps there's a way to install with --prefix=/path/to/tools --target=arm4l or something like that... any help would be great.
i'd prefer to build this from the source available from gnu rather than ports just to get the experience and learn more about gcc but if that's not possible or no one has the info, compiling from ports would be sufficient.