Hello, this is a “Tutorial” on how to install the psptoolchain and pspsdk on Mac(OS X 10.11.2). I’m doing this because when I decided to install and prepare everything for developing Homebrew for the psp I had lots of trouble with the toolchain and sdk.
Some knowledge of Bash would be great and also being comfortable with the Terminal.
First off we need a couple of things before we can start with the installation of the toolchain and sdk.
Part I
Main Software needed:
Xcode -> you can get it at the App Store.
Command Line Tools -> you can get it from the developer apple website.
MacPorts -> https://www.macports.org/install.php, follow instructions on the Quickstart section(The top one). Download the appropriate one and install it. After installing MacPorts remember to add it to your paths file. This can be done by:
* Opening a terminal Window
* Typing:
Code: Select all
sudo nano /etc/pathsCode: Select all
/opt/local/bin* CTRL + X
* It will ask you if to save changes, type:
Code: Select all
y* It will ask for the file name, just click Enter
* Close Terminal and reopen, type “port” to see if the changes were made.(Without double quotes)
Git -> you can get it through MacPorts (sudo port install git-core) or by going to the official git website, I think there is pkg or something, I always compile from source.
Part II
Installing the dependencies needed.
Using Git we will clone the repo from pspdev.
I recommend making a temporary folder for the builds,
Open terminal and type:
Code: Select all
mkdir tempPSPThen we cd to it:
Code: Select all
cd tempPSPCode: Select all
git clone https://github.com/pspdev/psptoolchain.gitGo into psptoolchain folder by typing on terminal:
Code: Select all
cd psptoolchainCode: Select all
lsCode: Select all
sudo ./prepare-mac-os.shJust close and reopen terminal and type:
Code: Select all
xcode-select --installCode: Select all
sudo ./prepare-mac-os.shAfter that’s done, let’s do some modifications to some scripts and patch a certain file.
Go to the root of psptoolchain folder using terminal and open the file “toolchain.sh”, I recommend using VIM or nano, or some text editor.
Delete lines 14 and 15 and save the file.
Now let’s do manually what those lines were doing, on terminal type:
Code: Select all
mkdir -p buildCode: Select all
cd buildThe gdb(GNU Debugger) that is used doesn’t quite work out of the box with OS X but there is patch. So we need to patch it manually.
After you’re in the build folder we must download the gdb by typing:
Code: Select all
wget ftp://ftp.gnu.org/pub/gnu/gdb/gdb-7.3.1.tar.bz2To extract type:
Code: Select all
tar jxf gdb-7.3.1.tar.bz2Code: Select all
cd gdb-7.3.1/gdb/tuiCode: Select all
wget https://trac.macports.org/raw-attachment/ticket/46291/0005-tui-Unkown-function.patchCode: Select all
mv 0005-tui-Unkown-function.patch tui-io.patchCode: Select all
patch < tui-io.patchCode: Select all
tui-io.cCode: Select all
rm -rf tui-io.patchCode: Select all
cd ../../../Code: Select all
rm -rf gdb-7.3.1.tar.bz2Code: Select all
sudo tar -cvjSf gdb-7.3.1.tar.bz2 *Code: Select all
rm -rf gdb-7.3.1More dependencies.
First is automake-1.9
We can now be in any folder and type in terminal:
Code: Select all
wget http://ftp.gnu.org/gnu/automake/automake-1.9.tar.bz2Code: Select all
tar jxf automake-1.9.tar.bz2Code: Select all
cd automake-1.9Code: Select all
./configureCode: Select all
makeCode: Select all
sudo make installCode: Select all
sudo port install cmakeCode: Select all
sudo port install libsdlCode: Select all
sudo port install doxygenType:
Code: Select all
sudo ./toolchain-sudo.shIf everything went well(or at least it tried), it should say:
Remember to add /usr/local/pspdev/bin to your path…
So let’s go ahead and do that,
type:
Code: Select all
cd && clearCode: Select all
sudo nano /etc/pathsCode: Select all
/usr/local/pspdev/binCTRL + X , it will ask if you want to save just type: y
And when prompted for the file name and location just click Enter.
That will add the path for the binaries.
Now let’s add the path for the PSPSDK itself,
This next part is if you’re using the bash shell. In my case I’m using Z shell (zsh) so the file changes, depends on the shell etc..
Type:
Code: Select all
sudo nano ~/.bash_profileCode: Select all
export PSPSDK="/usr/local/pspdev/psp/sdk" #SDK for pspThen press Enter for file name and location.
This should export the path for the pspsdk.
After everything is done you can delete de tempPSP folder:
Code: Select all
rm -rf tempPSPNow we’re ready to start compiling!
I’ve tested this by doing a simple hello world and everything went good.
There are a couple of tutorials for C in PSP and such. Just do a couple of searches.
Happy Coding!
