Revision 01: Added "cygwin1.dll" file to the mingwpack (needed for genromfs.exe).
Revision 02: Symbolic link step added during the KOS compilation part (otherwise it gives a "cc" error).
[KOS MINGW 4.5.2 SETUP GUIDE BY DREAMCAST â„¢ (2010)]
MINGW INSTALLATION / SETUP1) Download mingw-get-inst:
http://sourceforge.net/projects/mingw/ and run it.
- select "download latest repository catalogues"
- set install directory to "c:\mingw"
- check boxes "c compiler", "c++ compiler", "objc compiler" and "msys basic system"
3) Once the download is complete, go to "c:\mingw\msys\1.0\" and create a folder called "kos"
4) From the "mingwpack" archive, place "patch.exe" in "c:\mingw\bin"
INSTALLING KOS (SVN won't be covered in this tutorial, but its usage is recommended.)
1) If you don't have a SVN client, go here (
http://cadcdev.svn.sourceforge.net/viewvc/cadcdev/) and download the GNU tarballs in the KOS and KOS-PORTS
directories. Extract each archive to the created "kos" folder so the paths are "kos/kos" and "kos/kos-ports".
2) Place "environ.sh" from the "mingwpack" archive in the "kos/kos" directory (overwrite any existing version).
TOOLCHAIN PREREQUISITES1) Navigate to kos/kos/utils/dc-chain. Extract "gcc-4.5.2-kos.diff" from the "mingwpack" archive and place it in the "patches" folder. Extract Makefile and
replace the existing file in the dc-chain directory.
2.1) Go
here and download these packages and extract them to a new folder called "gcc-4.5.2" created in the "dc-
chain" directory (if using WinRAR, right click on each archive and select "extract files" and set the destination path to "c:\mingw\msys\1.0
\kos\kos\utils\dc-chain"):
- gcc-core-4.5.2.tar.bz2
- gcc-objc-4.5.2.tar.bz2
- gcc-g++-4.5.2.tar.bz2
2.2) Go
here and download mpfr-2.4.2.tar.bz2 (3.0.0 currently doesn't work)
2.3) Go
here and download mpc-0.8.2.tar.tar
2.4) Go
here and download gmp-5.0.1.tar.bz2
2.5) Extract each of the above three archives to the gcc-4.5.2 directory. Rename each folder to only the text before the hypen (ex: mpfr-2.4.2 would just be
"mpfr").
3) Go
here and download binutils 2.20.1.tar.bz2. Extract it to the "dc-chain" directory (ensure the created folder
name is "binutils-2.20.1").
4) Go
here and download newlib-1.18.0.tar.gz. Extract it to the "dc-chain" directory (ensure the
created folder name is "newlib-1.18.0").
When you're done, the created paths should look like this:
- /dc-chain/gcc-4.5.2/
- /dc-chain/gcc-4.5.2/mpfr/
- /dc-chain/gcc-4.5.2/mpc/
- /dc-chain/gcc-4.5.2/gmp/
- /dc-chain/binutils-2.20.1/
- /dc-chain/newlib-1.18.0/
Ensure the files / folders from the extracted archives are at the top level of each of those subdirectories, and a folder wasn't created within the folder
you were extracting to (ex: /dc-chain/binutils-2.20.1/binutils-2.20.1 should be /dc-chain/binutils-2.20.1).
BUILDING THE TOOLCHAIN1) In the msys directory (c:/mingw/msys/1.0/), run "msys.bat" to access the bash console. From the console, type:
Code:
cd /usr/kos/kos/utils/dc-chain
The console should now show the dc-chain directory as the current path. Type "make" and press the "enter" key to begin compiling.
BUILDING KOS(Before starting, place the files in the "vqenc" folder in the "mingwpack" archive into the "/kos/kos/utils/vqenc" directory. Place the "genromfs.exe" and
"cygwin1.dll" files in the genromfs directory.
1) Type "cd ../../" and press the enter key.
2) Type "source environ.sh" and press the enter key.
3) Type "ln -s /mingw/bin/gcc.exe /mingw/bin/cc.exe" and press the enter key.
4) Type "make" and press the enter key.
BUILDING KOS PORTS1) After KOS is built, type "cd ../kos-ports" and press the enter key.
2) Type "make" and press the enter key.
FINAL STEPS1) When you're sure everything has compiled correctly, you can delete the directories created earlier in the dc-chain folder.
2) Navigate to the "c:\mingw\msys\1.0\etc" directory and edit the "profiles" file by either opening notepad and dropping the file onto it. At the bottom, add
"cd /usr/kos/kos" and then add "source environ.sh" below that. Save the file. When you start the mingw bash console, you'll now be at the root KOS directory
and have the environment variables configured.
Congratulations. If all went well, you now have a working toolchain and updated build of KOS. Happy deving.