Building a GCC toolkit ---------------------- No changes to syscalls have been done. Commands are entered within the default cygwin shell. Hint: temporarily shut down or turn off virusscanners to speed up compiling. Download neccesary packages --------------------------- http://sources.redhat.com/cygwin This will be the UNIX-like environment we're using. You need to select the binaries for: make, gcc, autoconf, flex, bison, automake?, gettext-devel (for GDB) Install it in /cygwin http://sources.redhat.com/newlib ftp://sources.redhat.com/pub/newlib This is the low-level library for embedded systems. Probably need a change in the syscall function if the BIOS doesn't have the proper SWI calls. http://www.gnu.org/software/binutils ftp://sources.redhat.com/pub/binutils Assembler, linker and other stuff that is needed by gcc. http://www.gnu.org/software/gcc ftp://sources.redhat.com/pub/gcc The source for the latest version of the GNU compiler. Grab the big all-in-one file or just the core,c,c++,whatever. The CVS snapshots might give some problems with cygwin. http://www.gnu.org/software/gdb The GNU debugger. Get this if you want to use JTAG/USB/serial/whatever debugging. http://sources.redhat.com/insight/cygwin.html The GNU debugger with Windows GUI. Get this instead of the normal gdb if you want an additional GUI. I needed to patch tcl/tk and install gettext-devel in cygwin for this to build. After the build, the executable gave some application error. Probably the new tcl/tk cygwin dll's don't work with the reverted insight. Therefore replace the tcl/tk dll's with the ones from http://vboy.emuhq.com/downloads/InsightGDB.zip You can ofcourse also use the prebuilt Insight from that website. Script ------ #!/bin/sh # # The procedure is simple... execute the commands in a cygwin bash shell. # Either copy/paste in your console or modify and execute this script to your liking. # Each package must be unpacked, configured, made and installed. # Note that an asterisk (*) is used for version numbers in the hope that it keeps working on # newer versions. You should replace these if you have multiple files that match these wildcards. # For more configuration flags, see: http://gcc.gnu.org/install/configure.html. Or use ./configure --help #### Settings #### # for GP32 #export TARGET_OPT=--target=arm-elf # for GameCube export TARGET_OPT=--target=powerpc-eabi-elf export CPU_OPT=--with-cpu=750 export MULTILIB_OPT=--disable-multilib export FLOAT_OPT=--disable-softfloat # other settings export VERBOSE_OPT=-v export LANGUAGES_OPT="--enable-languages=c,c++" export NLS_OPT=--disable-nls export THREADS_OPT=--disable-threads export SHARED_OPT=--disable-shared export LONGLONG_OPT=--disable-long-long #### Unpacking #### # Unpack binutils, gcc, newlib, gdb into /usr/src # If you're low on diskspace and have NTFS, you might want to compress /usr/src before unpacking cd /usr/src tar xzf *.tar.gz tar xjf *.tar.bz2 #patch -p 0 < *.diff # patch whatever you want #### Build binutils #### mkdir ~/binutils cd ~/binutils /usr/src/binutils-*/configure $VERBOSE_OPT $TARGET_OPT $CPU_OPT make all install #### Add newlib to gcc source tree #### # Link newlib and libgloss directories into gcc so that these are compiled along with gcc ln -s /usr/src/newlib-*/newlib/ `echo /usr/src/gcc-*/`newlib ln -s /usr/src/newlib-*/libgloss/ `echo /usr/src/gcc-*/`libgloss #ln -s /usr/src/linux/sys-include `echo /usr/src/gcc-*/`sys-include #### Build gcc with newlib #### mkdir ~/gcc cd ~/gcc /usr/src/gcc-*/configure $VERBOSE_OPT $TARGET_OPT $CPU_OPT --with-gnu-as --with-gnu-ld --with-newlib $LANGUAGES_OPT $NLS_OPT $THREADS_OPT $SHARED_OPT $LONGLONG_OPT $FLOAT_OPT $MULTILIB_OPT make all install #make all-gcc install-gcc # this might work better #### Optionally build gdb (=without GUI) ##### mkdir ~/gdb cd ~/gdb /usr/src/gdb-5.3/configure $VERBOSE_OPT $TARGET_OPT make all install #### Optionally build insight (=gdb with GUI) #### mkdir ~/insight cd ~/insight # if you followed http://sources.redhat.com/insight/cygwin.html you might have a src directory somewhere instead of insight-* # /usr/src/insight-*/configure $VERBOSE_OPT $TARGET_OPT /usr/src/src/configure $VERBOSE_OPT $TARGET_OPT make all install #### Cleanup #### # After installation and the binaries work, you can safely remove the build folders in the home directory (~). # You can also remove the sources in /usr/src. # rm ... Feedback -------- I gladly hear any documentation/script errors and fixes.