View Full Version : Ubuntu
Ramon
05-23-2007, 08:51 AM
Can I install the ps2sdk with Ubuntu? I'm using Ubuntu 6.10, just in case. If I can, how do I install it?
Chilly Willy
05-23-2007, 02:49 PM
EDIT: instructions below are for psp... ps2 is the same, but with ps2 instead of psp. :D Sorry about the confusion. Also, the following are the environment variables to use for ps2:
export PS2DEV="/usr/local/ps2dev"
export PS2SDK="$PS2DEV/ps2sdk"
export PS2PATH="$PS2DEV/bin:$PS2DEV/ee/bin:$PS2DEV/iop/bin:$PS2DEV/dvp/bin:$PS2SDK/bin"
export PATH="$PATH:$PS2PATH"
/EDIT
Yes, it's pretty simple (relatively speaking). The main thing is to make sure you have all the dependencies installed. Run synaptic (the package manager) and check that all these are installed (install them if they aren't).
autogen
autoconf
automake
bison
build-essential
flex
imagemagik
libtool
libsdl
ncurses
patchutils
pkg-config
subversion
textinfo
wget
After all that's installed, then open a shell and do this:
sudo bash
mkdir -p /usr/local/pspdev
chmod a+rwx /usr/local/pspdev
cd /tmp
svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain
cd psptoolchain
./toolchain.sh
That will switch you into a shell at root level, make the pspdev directory, download the toolchain building files to /tmp/psptoolchain, then run the script to download, build, and install the psp toolchain.
When you wish to compile PSP software, be sure to use these environment variables:
export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PSPPATH="$PSPDEV/bin:$PSPDEV/psp/bin:$PSPSDK/bin"
export PATH="$PATH:$PSPPATH"
If someone wants to install the pspsdk on Mac OSX, it's virtually the same, just install the dependencies with DarwinPorts: http://darwinports.opendarwin.org/
OSX won't have build-essential, instead you'll have the latest Xcode, and the X11 SDK from the Apple Developer web site (both are free).
Note: the above switches to root level to build and install the toolchain because the /usr path cannot be written from user level. That is important to remember when build libs for the SDK. For example, let's say you decide to build SDL for the PSP (it's in the repo, so why not). You would do something like this:
export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PSPPATH="$PSPDEV/bin:$PSPDEV/psp/bin:$PSPSDK/bin"
export PATH="/opt/local/bin:$PATH:$PSPPATH"
mkdir projects
cd projects
mkdir psp
cd psp
svn co svn://svn.ps2dev.org/psp/trunk/SDL
cd SDL
sh autogen.sh
LDFLAGS="-L$(psp-config --pspsdk-path)/lib -lc -lpspuser" configure --host=psp --prefix=$(psp-config --psp-prefix)
make
sudo bash
export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PSPPATH="$PSPDEV/bin:$PSPDEV/psp/bin:$PSPSDK/bin"
export PATH="$PATH:$PSPPATH"
cd /home/username/projects/psp/SDL
make install
Note that we had to switch to root level and re-export the environment variables before doing make install. If you don't, it won't install in the toolchain correctly.
Note that some PSP SDK packages will require a pkg-config environment variable (notably, libogg/libvorbis).
export PKG_CONFIG_PATH="$PSPDEV/psp/lib/pkgconfig"
Ramon
05-24-2007, 04:21 AM
So I simply replace psp with ps2?
Chilly Willy
05-24-2007, 08:11 PM
Yes. For example, the main toolchain install would be
sudo bash
mkdir -p /usr/local/ps2dev
chmod a+rwx /usr/local/ps2dev
cd /tmp
svn co svn://svn.ps2dev.org/ps2/trunk/ps2toolchain
cd ps2toolchain
./toolchain.sh
Sorry about the mix-up. I always install both on my system, and had psp on the brain when I was answering your post, and completely missed the fact that I did the psp instead of ps2. :o
Ramon
05-26-2007, 11:33 AM
All right. Got it to compile now. :D Thank you so much! Now I have a new problem. printf() doesn't seem to work. Just in case, I'm running the .elf files using uLaunchELF. Version? I'm not sure... :confused:
Chilly Willy
05-26-2007, 04:06 PM
Uh... I think the printf() used by default tries to print to the PC via PS2Link. If you're trying to print to the PS2 display, you need to do something different. Check the source for various examples in the PS2 SDK repo and the source of various proggies, like PGen.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.