forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Startup from nothing, Ubuntu + PSP devkit. HELP!

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Shaker



Joined: 25 Jul 2007
Posts: 3

PostPosted: Fri Jul 27, 2007 6:47 am    Post subject: Startup from nothing, Ubuntu + PSP devkit. HELP! Reply with quote

Hi there.
I'm new to the PSP development community, and I am as new to Linux. I've been using Windows and I am no computer noob, but I completely do not understand Linux and I don't know if I will ever like it :D

I've read so many threads now and hints and howto's, and I finally managed to install a few prerequisites now, but ... still there are a lot of hang-ups, so any help that doesn't confuse me more is very apreciated ;)

1) What exactly do I need, if I want to write a program and compile it and pack it to get a PBP for the PSP? I think it is the toolchain and die PSPSDK, which I have downloaded.

With the Package-manager I have installed autoconf, automake, m4, gcc, texinfo, wget, bison, ncurse and subversion, which are said to be necessary.

2) How exactly do I set up the environment. PSPDEV=... I've read stuff about startup-script, the .bash-profile and so on. Confused! Where exactly do I put the correct lines and what do they look like? set PSPDEV in the terminal does NOT work. Dependency check fails.

3) Which has to be installed first? toolchain or pspsdk? What does each of them offer ?

4) Where can I find a tutorial, a good step-by step tutorial with a working example for the first program ever to be written with these tools and run on the PSP? I'd like to know what is necessary that a C program would run on the PSP. Special named functions, includes, main routines objects, that have to be initialized... whatever.

THANKS A LOT!!! :)
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Jul 27, 2007 4:36 pm    Post subject: Reply with quote

In Ubuntu, use Synaptic as your package manager. It's a nice point-n-click gui for the package system, and will automatically handle any dependencies for packages you select.

Packages to select in Synaptic: autoconf, autogen, automake, bison, flex, imagemagik, libsdl, libtool, ncurses, patchutils, pkg-config, subversion, texinfo, and wget. Make sure gcc and g++ are also selected, of course.

The exports are:
Code:
export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PSPPATH="$PSPDEV/bin:$PSPDEV/psp/bin:$PSPSDK/bin"
export PATH="$PATH:$PSPPATH"


You enter those lines into the shell before doing anything.

You run the toolchain.sh script first, which will build the toolchain and then the needed sdk libs. Note, it doesn't make ALL the libs. You'll need to compile SDL and various other libs after that.

Here's what you do after installing all the packages with Synaptic:

Code:
sudo mkdir -p /usr/local/pspdev
sudo chmod a+rwx /usr/local/pspdev
sudo chown username:groupname /usr/local/pspdev
svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain
cd psptoolchain
./toolchain.sh


username:groupname is YOUR username and groupname for your user account. For example, mine is "jlf65:jlf65". If you aren't sure, just do a "ls -l" of you user folder and look at who the owner of stuff is listed as. That'll be you. :)
Back to top
View user's profile Send private message AIM Address
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri Jul 27, 2007 5:19 pm    Post subject: Reply with quote

Actually, if you're using Ubuntu you can use the toolchain-sudo.sh script to make it easier:

Code:
svn export svn://svn.ps2dev.org/psp/trunk/psptoolchain
cd psptoolchain
sudo ./toolchain-sudo.sh

The reason for this wrapper script is because sudo clears your path when you run it. This wrapper resets the path and then runs the process normally, as root. No need to fool with permissions. You'll still have to install the packages and set up your environment as stated in the readme.txt, though.

The psptoolchain package installs the toolchain (binutils/gcc/newlib) as well as the latest version of the pspsdk. You can then download and install other libraries as needed, like SDL.
Back to top
View user's profile Send private message Visit poster's website
Shaker



Joined: 25 Jul 2007
Posts: 3

PostPosted: Fri Jul 27, 2007 9:23 pm    Post subject: Reply with quote

Hi again.

Thanks for the quick help! I've just tried the Synaptic thing and selected a few of the required packages and had to notice, that the gcc base has been installed, but the gcc bin was not. Similar to ncurses.
Before, I intended to install the newest versions from ftp.gnu.org, but they are all sources... :)

Then I did this export thing. Before I read something about
SET ...
and THEN
EXPORT which did not work at all. The export commands you wrote worked now!

Is it correct to put them into the .bash_profile?

I installed the toolchain 20070626 directly as root but without subversion. It finished without error.

Now, having tried to install die PSPDSK1.0-beta I got an error message about a double definition, which I cannot locate. To me there is no double-definition in the .h or .c files... strange.
But - you said, the PSPSDK is included in the toolchain???

How can I test that? What commands must work, if I really have the pspsdk? What I don't have is the /usr/local/pspdev/psp/sdk/bin folder. The bin is not there...

Anyway: What do I do with this error? It occurs after some time that I've executed "make" without any parameters, as I was told by the readme:
Code:

psp-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../src/libc/include -I../../src/base -I../../src/kernel -I../../src/user -I../../src/debug -g -O2 -G0 -Wall -DF_atoi stdlib.c -c -o atoi.o
stdlib.c:125: Fehler: redefinition of ğatoiĞ
./stdlib.h:100: Fehler: previous definition of ğatoiĞ was here
make[3]: *** [atoi.o] Fehler 1
make[3]: Verlasse Verzeichnis ′/home/satria/Downloads/pspsdk_1.0-beta2/src/libc′
make[2]: *** [all-recursive] Fehler 1
make[2]: Verlasse Verzeichnis ′/home/satria/Downloads/pspsdk_1.0-beta2/src′
make[1]: *** [all-recursive] Fehler 1
make[1]: Verlasse Verzeichnis ′/home/satria/Downloads/pspsdk_1.0-beta2′
make: *** [all] Fehler 2
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jul 28, 2007 6:58 am    Post subject: Reply with quote

ooPo wrote:
Actually, if you're using Ubuntu you can use the toolchain-sudo.sh script to make it easier:

Code:
svn export svn://svn.ps2dev.org/psp/trunk/psptoolchain
cd psptoolchain
sudo ./toolchain-sudo.sh

The reason for this wrapper script is because sudo clears your path when you run it. This wrapper resets the path and then runs the process normally, as root. No need to fool with permissions. You'll still have to install the packages and set up your environment as stated in the readme.txt, though.

The psptoolchain package installs the toolchain (binutils/gcc/newlib) as well as the latest version of the pspsdk. You can then download and install other libraries as needed, like SDL.


If you noticed in my list of commands, I chown'd the pspdev directory. That means never having to ever do sudo again. I'm doing that on my own system now. It's a lot easier to do those libs now - just make, then make install and don't worry about needing superuser to install since I own that particular directory. No need to worry about sudo clearing the environment either.
Back to top
View user's profile Send private message AIM Address
Shaker



Joined: 25 Jul 2007
Posts: 3

PostPosted: Sat Jul 28, 2007 8:58 pm    Post subject: Reply with quote

I simply gave anyone rwx rights on the target directory, but still installed as root, because... sometimes I heared tools complain "must be installed as super user"... :)

So, but what about my error in my previous post?
Back to top
View user's profile Send private message Visit poster's website
pspwill



Joined: 17 Nov 2005
Posts: 51

PostPosted: Sun Jul 29, 2007 3:23 am    Post subject: Reply with quote

I added the environment variables to /etc/environment on mine and then ran toolchain-sudo.sh and everything worked fine for me.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group