How to setup the psp toolchain on ubuntu
[UPDATE] If you want to setup the psp toolchain I recommand using MINPSPW. It supports Windows, GNU/Linux and OpenSolaris and is much easier to setup. You can of course still use this tutorial if you like.
I know that there are some guides out there how to setup the psptoolchain but when I followed them I still had problems compiling SDL programs. So here is my guide to installing the psptoolchain and psplibraries on Linux. I figured these out by myself and with the help of J.F.’ post on the ps2dev forums, so my thanks to him. I assume that you have basic shell knowledge like how to make a folder and how to change folders and stuff like that.
1. The first step is to have a couple of programs and libraries setup before you can compile the toolchain. These programs are stated in the readme file included in the psptoolchain package, but it wasn’t complete at the time i downloaded it, so i’ll write them here just in case. Get these programs and/or libraries (ubuntu users can use Synaptic Package Manager to install these):
- autoconf
- automake v1.9
- bison
- flex
- gcc
- imagemagick
- libreadline-dev
- libusb-dev
- libtool
- make
- ncurses (I have ncurses-base, ncurses-bin, ncurses-hex and ncurses-term)
- patch
- readline (readline-common in Synaptic)
- subversion
- texinfo
- wget
- (ubuntu-users: build-essential)
2. Now you have to get the latest psptoolchain (pspsdk is included). Open up a terminal and make a folder somewhere you’d like to have your downloaded files to reside. I use ~/Downloads where the ~/ means that it’s in my Home folder, so as an absolute path, that would be: /home/username/Downloads (username is obviously your own username).
mkdir Downloads
cd Downloads
svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain psptoolchain
You will see a message like “Checked out revision xxxx” where xxxx is the newest revision, which means you just have succesfully downloaded the last version of the psptoolchain. Read the Readme file located in your Downloads/psptoolchain folder.
3. Time to compile the toolchain, but first you have to set some paths. Type this in the (still open) terminal.
cd psptoolchain
export PSPDEV=/usr/local/pspdev
export PATH=$PATH:$PSPDEV/bin
You also need to make the /usr/local/pspdev folder and give it permission to be writable by your user.
sudo mkdir -p /usr/local/pspdev
sudo chmod a+rxw /usr/local/pspdev
sudo chown username:group /usr/local/pspdev
Pay attention to the last line. You should replace username with your username and group also with your username (that’s how i do it).
Now to compile this baby:
./toolchain.sh
Ok time to sit back and relax, because now it should start compiling without errors and it can take a long time. Most people talk about an average about 3 hours, but on my laptop (Core Duo 2Ghz) it takes about 20-30 minutes. Don’t close the terminal when it’s done, we still need it. If by some accident you closed the terminal don’t worry. Just type those export-lines above here in the terminal and you are good to go.
4. When you have no errors (you should have no errors), it’s time to download and install the psplibraries package. It contains a collections of libraries such as SDL, SDL_mixer, jpeg, png, zlib etc. I recommend that you download this as well. On the terminal type the following commands:
cd ..
svn co svn://svn.ps2dev.org/psp/trunk/psplibraries psplibraries
Now you will have downloaded the lastest psplibraries package. Again read the Readme file inside the psplibraries folder.
5. Time to compile the libraries. Type these commands in the terminal:
cd psplibraries
./libraries.sh
And it should compile, again with no errors. On my laptop it takes about 20 minutes to compile so go get something to drink and relax, we are almost done.
6. Last thing you need to do is add a couple of lines to your .bashrc file in your home folder.
gedit ~/.bashrc
Add the following lines at the end of the file (and save of course):
export PSPDEV=”/usr/local/pspdev”
export PSPSDK=”$PSPDEV/psp/sdk”
export PATH=”$PATH:$PSPDEV/bin:$PSPSDK/bin”
And now you should have everything setup to start developing applications for the psp!
7. (optional) If you also want to use the pspusblink package follow these steps. On the terminal:
cd ..
cd psptoolchain/build/psplinkusb
make release
Now go to the release_oe folder inside the pspusblink folder and copy the psplink folder to your psp. On my psp the directory is the PSP/GAME folder, but yours may differ. How to use psplink can be found in the manual found in the pspusblink folder.
Congratulations, everything should be setup and working correctly now! If you have any problems, found a mistake in my guide, just mail me by clicking on the about me link and filling in the form.