So I've decided to try getting my hands dirty at building a gcc cross compiler targeting i386-pc-mingw32. Why? Two reasons:
1: I'm really starting to like developing on Linux.
2: I'm really starting to dislike developing on Windows.
However, I do still need to produce Windows EXE's and DLL's, so if I'm to begin developing exclusively on Linux, I need a gcc -b i386-pc-mingw32.
So, I'm going to see if I can get a cross compiler up & running, and log my efforts here. I'm not there yet. Hopefully this thread can eventually serve as an impetus for three things:
1) Making it easier for others to do the same if they so desire.
2) Give others the opportunity to help me if they have been through this before. I googled my heart out, but I can't seem to find specific instructions for Fedora 8 + GCC 4.1.2
3) It would be really cool if you could just go to Package Manager, and tell Fedora to download and install a cross-compiler for some target. Obviously, I'm interested in i386-pc-mingw32, but others may want other targets too. Having such a capability would IMHO make Linux (esp Fedora) even more attractive as a development platform.
I'm using http://vmlinux.org/crash/mirror/www....GCC/FAQ-4.html
as a basic guide, although it appears that parts are out of sync with reality :-(
First, I created a directory called ~/Projects/gcc-4.1.2-mingw/, since I'm trying to build gcc 4.1.2 (to match Fedora 8's gcc version).
I then downloaded binutils-2.18.tar.bz2. It looks like Fedora8 comes with 2.17.5, but I couldn't find that in the GCC mirrors, so I went with the next version up, 2.18. I then decompressed it, configured, and built it:
$ tar -xjvf binutils-2.18.tar.bz2
$ cd binutils-2.18
$ ./configure --target=i386-pc-mingw32 --prefix=~/Projects/gcc-4.1.2-mingw/bin -v
$ make all
$ make install
I was a bit nervous doing the "make install" bit, because I was concerned it would install these binutils into the main GCC installation. That will be fine once I'm confident I know what I'm doing, but for now, caution is the word of the day.
Luckily, this put the binutil files under ~/Projects/gcc-4.1.2-mingw/bin/bin/, 1 level deeper than I would've liked, but it's good enough.
Next post: building GCC itself.