Difference between revisions of "Compiling ScummVM/PlayStation Portable"

Jump to navigation Jump to search
m
Updated Link from Hard Way to a newer Site because the old Site is down
(Tidy up PSP compilation page and add link to MinPSPW)
m (Updated Link from Hard Way to a newer Site because the old Site is down)
 
(2 intermediate revisions by one other user not shown)
Line 4: Line 4:


The hard way is obtaining and building everything from source manually:
The hard way is obtaining and building everything from source manually:
The website for this is [https://pspdev.github.io/ here], but they host all their code on Github.


Required:
Required:
* PSP Toolchain (svn co svn://svn.pspdev.org/psp/trunk/psptoolchain)
* [https://github.com/pspdev/psptoolchain PSP Toolchain]
* PSPSDK (svn co svn://svn.pspdev.org/psp/trunk/pspsdk) - This usually gets installed by the PSP toolchain, so you don't have to do it manually.
* [https://github.com/pspdev/pspsdk PSPSDK] - This usually gets installed by the PSP toolchain, so you should not have to do it manually.
* SDL (svn co svn://svn.pspdev.org/psp/trunk/SDL)
* [https://github.com/pspdev/psp-ports/tree/master/SDL SDL]
* zlib (svn co svn://svn.pspdev.org/psp/trunk/zlib)
* [https://github.com/pspdev/psp-ports/tree/master/zlib zlib]
* libmad (svn co svn://svn.pspdev.org/psp/trunk/libmad)
* [https://github.com/pspdev/psp-ports/tree/master/libmad libmad]
* libpng (needed for the image browser and visual keyboard)
* [https://github.com/pspdev/psp-ports/tree/master/libpng libpng] (needed for the image browser and visual keyboard)


Optional:
Optional:
* libTremor (svn co svn://svn.pspdev.org/psp/trunk/libTremor)
* [https://github.com/pspdev/psp-ports/tree/master/libTremor libTremor]
* [http://libmpeg2.sf.net libmpeg2] - As this is not in pspdev svn, you'll need to build it manually. Adding a psp target/host to config.sub and using a configure line similar to the SDL port worked.
* [http://libmpeg2.sf.net libmpeg2] - As this is not in [https://github.com/pspdev/psp-ports pspdev/psp-ports], you'll need to build it manually. Adding a psp target/host to config.sub and using a configure line similar to the SDL port worked.
 
<br>
The following guidance notes on doing this were written by Nitrus on 2014-03-14:
<pre>
Built on Xubuntu 13.04 (Raring Ringtail).
 
I did this by building the toolchain myself, since I ran into various problems with PSPMinW (I think it might have been the x64 against x32 architecture, not sure).
The SVN for the toolchain failed more times than I can count, it's experiencing server downtime or something.
The jim was a bit old I think, so I went with Git.
 
First, download ScummVM source code:
git clone https://github.com/scummvm/scummvm.git ~/scummsource
 
Next before building, download the following build dependency libraries and install:
autoconf, automake, bison, flex, gcc, g++/gcc-c++, libusb-dev, make, ncurses, patch, readline, subversion, texinfo, wget, mpc, gmp, libelf, mpfr, git
 
This did the trick for me (different linux distros may vary):
sudo apt-get install autoconf build-essential automake bison flex gcc libusb-dev make libncurses5-dev patch libreadline-dev subversion texinfo wget libmpc-dev libgmp3-dev libgmp-dev libelf-dev libmpfr-dev git
 
Note: most of these are probably installed already.
 
Next, some environment variables:
export PSPDEV=/usr/local/pspdev && export PSPSDK=$PSPDEV/psp/sdk && PATH=$PATH:$PSPDEV/bin:$PSPSDK/bin
 
For good measure, I added these to ~/.bashrc at the end of the file, in case I miss something.
Then:
source ~/.bashrc
 
Next, I downloaded the toolchain into a psptoolchain folder:
git clone https://github.com/pspdev/psptoolchain.git ~/psptoolchain
 
Now, we let it download/compile/build, and it takes a long time (around half an hour, to an hour and a half). Change directory then execute:
cd psptoolchain
sudo ./toolchain-sudo.sh
 
It will check if all the needed dependencies are there.
Some of the scripts in psptoolchain/scripts do tend to fail (Git fetching is not always ideal, or FTP anon login gets rejected sometimes, in this case the ./toolchain-sudo.sh needs to be run again, until it's done).
This can be due to DNS resolve errors, or sometimes a connection cannot be established. Sometimes it ends before it even begins.
 
Next comes zlib.
I got this one, newest at time of writing:
version 1.2.8, tar.gz format (558K, MD5 checksum 44d667c142d7cda120332623eab69f40)
 
Went into home by typing cd, and then downloaded and unpacked by:
wget http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz && tar -xzf zlib-1.2.8.tar.gz && rm zlib-1.2.8.tar.gz
cd zlib-1.2.8
 
Then, I downloaded the configure, Makefile and Makefile.in from https://github.com/pspdev/psp-ports/tree/master/zlib sincce they were good for this version too.
 
wget -O ./configure https://raw.github.com/pspdev/psp-ports/master/zlib/configure
wget -O ./Makefile https://raw.github.com/pspdev/psp-ports/master/zlib/Makefile
wget -O ./Makefile.in  https://raw.github.com/pspdev/psp-ports/master/zlib/Makefile.in
 
Next I typed make, but for the install (unless I wanted to chown the whole /usr/local/pspdev folder), I needed to go in sudo.
So:
sudo su
Next we need the environment variables again:
export PSPDEV=/usr/local/pspdev && export PSPSDK=$PSPDEV/psp/sdk && export PATH=$PATH:$PSPDEV/bin:$PSPSDK/bin
And finally:
make install
 
Then, we exit sudo with:
exit
 
You can check whether it has correctly cross compiled by doing 'objdump -f /usr/local/pspdev/psp/lib/libz.a', and it should find an unknown architecture, while 'psp-objdump -f /usr/local/pspdev/psp/lib/libz.a' should correctly point out the mipsallegrex arch.
 
Next, we download libPNG. I used version 1.2.50. I tried the newest one, but libpng has undergone some significant API changes, which would require extensive of ScummVM.
fedd8c66d106c28f8d527f9397c265a2  libpng-1.2.50.tar.gz
 
Go to home, and type:
wget http://sourceforge.net/projects/libpng/files/libpng12/1.2.50/libpng-1.2.50.tar.gz && tar -xzf libpng-1.2.50.tar.gz && rm libpng-1.2.50.tar.gz
 
We will modify the config.sub a bit, so we wouldn't fiddle around with makefiles, to make them include build.mak.
After line 273 add:
| mipsallegrex | mipsallegrexel \
After line 358 (now 359 because of previous addition) add:
| mipsallegrex-* | mipsallegrexel-* \
After line 928 (now 930 because of previous addition) add:
psp)
basic_machine=mipsallegrexel-psp
;;
 
Save and quit the editor.
 
Now run following config script from the lib-1.2.50 folder:
 
./configure --prefix=/usr/local/pspdev/psp --host=psp CC=psp-gcc LDFLAGS="-L/usr/local/pspdev/psp/sdk/lib -lc -lpspuser" CFLAGS="-isystem /usr/local/pspdev/psp/sdk/include"
 
Then once again:
make
sudo su
export PSPDEV=/usr/local/pspdev && export PSPSDK=$PSPDEV/psp/sdk && export PATH=$PATH:$PSPDEV/bin:$PSPSDK/bin
make install
exit
 
Now, for compiling ScummVM:
 
Create a builds/psp/folder in scummsource:
cd ~/scummsource && mkdir builds && cd builds && mkdir psp && cd psp
 
Then, I compiled ScummVM with this:
../../configure --host=psp --enable-plugins --default-dynamic --enable-debug && make clean && make
 
This does not include instructions on any of the optional plugins.
</pre>


== Easy Way ==
== Easy Way ==
2,049

edits

Navigation menu