[Magically Solved] Developing SDL application for CFW 3xx

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You're probably installing the toolchain wrong... here's my list of steps. Check it against what you do.

1 - make sure all dependencies are installed. They include:

Code: Select all

autoconf
autogen
automake
bison
build-essential
flex
imagemagick
libreadline-dev
libsdl-dev
libtools
libusb-dev
ncurses
patchutils
pkg-config
subversion
texinfo
wget
I just use Synaptic Package Manager in Ubuntu to load all of them and their dependencies.

2 - from a newly opened shell, enter

Code: Select all

mkdir projects
cd projects
svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain
cd psptoolchain
sudo mkdir -p /usr/local/pspdev
sudo chmod a+rwx /usr/local/pspdev
sudo chown user:group /usr/local/pspdev
export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PSPPATH="$PSPDEV/bin:$PSPDEV/psp/bin:$PSPSDK/bin"
export PATH="$PATH:$PSPPATH"
export PKG_CONFIG_PATH="$PSPDEV/psp/lib/pkgconfig"
./toolchain.sh
That will give you a complete toolchain accessible in user mode by the user user:group. Remember to change that to YOU. It's normally just the username you log in with, twice. For me in Ubuntu or Fedora, it's just jlfenton:jlfenton.

Making the pspdev specific to the user means the only sudos you'll ever use are the ones to make and chmod and chown the directory, as you see above. If you don't, and forget about sudo, you'll wind up installing libraries and such to the wrong place, or not at all (might be your problem).

Now let's install the libraries.

3 - Still in the same shell after running ./toolchain, do this

Code: Select all

cd ..
svn co svn://svn.ps2dev.org/psp/trunk/psplibraries
cd psplibraries
./libraries.sh
You are now done. You should have a good toolchain and all the libraries. Remember those exports later when you need to compile something. If you don't edit the bash resource for the user, you'll need to enter these lines every time you open a new shell:

Code: Select all

export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PSPPATH="$PSPDEV/bin:$PSPDEV/psp/bin:$PSPSDK/bin"
export PATH="$PATH:$PSPPATH"
export PKG_CONFIG_PATH="$PSPDEV/psp/lib/pkgconfig"
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Bad news, I did all that step-by-step, and it still doesn't working. :(

Well, thank you for all your help.
x295
Posts: 2
Joined: Thu Nov 29, 2007 8:10 am

Post by x295 »

I use the toolchain from Dan Peori (http://www.oopo.net/consoledev/). Just go at the end of the page, and grab the two tarballs psptoolchain and psplibraries

Just uncompress, and launch the toolchain.sh (you need to have libusb), then libraries.sh

This works for me :D (tm)
Today was my first attempt to build and run a binary on my psp.
fungos
Posts: 41
Joined: Wed Oct 31, 2007 10:43 am
Location: cwb br
Contact:

Post by fungos »

Hi all,

I just came back from my vacancy and I'm starting again with psp dev, then I wanted to try again to get my code working with a new firmware, I upgraded my phat to 3.80M33-4, updated my psplibraries and then just ran make in that test project (without any line change but the 380 cfw version in makefile). The test app just worked! Now, I will try to develop some test game just for fun finally. :)

I appreciate the help of everyone here, I can't explain why it works now and I have no idea what was wrong.

Thank you all.
avisphoenix
Posts: 1
Joined: Sun Apr 13, 2008 6:38 am
Location: México

Don't compile

Post by avisphoenix »

Well I follow this tutorial, step by step, but i have a problems:

First this:

Code: Select all

User:$./toolchain.sh 
/usr/bin/autoconf: 44: cannot create conf15520.sh: Permission denied
/usr/bin/autoconf: 44: cannot create conf15520.sh: Permission denied
chmod: no se puede acceder a `conf15520.sh': Don't exist the file or directory
touch: can't run `touch' over `/usr/local/pspdev/test.tmp': Permission denied
ERROR: Grant write permissions for /usr/local/pspdev before continuing.
../depends/check-pspdev.sh: Failed.
But i put a permitions, however i run in root then:

Code: Select all

User:$ sudo ./toolchain.sh
[sudo] password for Root:
ERROR: Add /usr/local/pspdev/bin to your path before continuing.
../depends/check-pspdev.sh: Failed.
then i review the PATH:

Code: Select all

User:$ echo $PATH
/usr/local/pspdev/bin:/usr/local/pspdev/bin:/usr/local/Trolltech/Qt-4.3.2:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/pspdev/bin:/usr/local/pspdev/bin:/usr/local/pspdev/psp/bin:/usr/local/pspdev/psp/sdk/bin
Maybe is the PATH in root:

Code: Select all

User:$  sudo echo $PATH
/usr/local/pspdev/bin:/usr/local/pspdev/bin:/usr/local/Trolltech/Qt-4.3.2:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/pspdev/bin:/usr/local/pspdev/bin:/usr/local/pspdev/psp/bin:/usr/local/pspdev/psp/sdk/bin
Then I edit the check-pspdev, and run another time in root:
After compile about an hour say this:

Code: Select all

User:$ sudo ./toolchain.sh
...
make[3]: psp-ar: Can't find the program
make[3]: *** [libgcc.a] Error 127
make[3]: *** Wait finish the another task....
make[3]: out of directory `/home/user/PSP/Develop/toolchain/psptoolchain/build/gcc-4.1.0/build-psp/gcc'
make[2]: *** [stmp-multilib] Error 2
make[2]: out of directory `/home/user/PSP/Develop/toolchain/psptoolchain/build/gcc-4.1.0/build-psp/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: out of directory `/home/user/PSP/Develop/toolchain/psptoolchain/build/gcc-4.1.0/build-psp'
make: *** [all] Error 2
../scripts/002-gcc-4.1.0-stage1.sh: Failed.
Then I look in /usr/local/pspdev/bin:

Code: Select all

User:/usr/local/pspdev/bin$ ls
psp-addr2line  psp-c++filt  psp-nm       psp-ranlib   psp-strings
psp-ar         psp-gprof    psp-objcopy  psp-readelf  psp-strip
psp-as         psp-ld       psp-objdump  psp-size
Whats up??? :'( i'm frustrated
I translate the message of console because i speak spanish and have my pc in spanish; then maybe the message are wrong, but is the idea.
Sorry for my bad english :(
Please help me
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You need to either run toolchain-sudo.sh or chown the pspdev directory. Personally, I chown the directory so I never have to worry about sudo again.
Post Reply