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 

HOWTO: Compile the SDK on OSX - Consolidated Info
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
UsefulIdiot



Joined: 17 Jan 2006
Posts: 13

PostPosted: Sun Apr 02, 2006 3:01 pm    Post subject: HOWTO: Compile the SDK on OSX - Consolidated Info Reply with quote

HOWTO: Compile the PSP-SDK on MacOSX 10.4 Tiger
After spending many hours, and many attempts of installing and using the psptoolchain on my old ibook g3, I am writing a complete guide to consolidate all the required information that is necessary to build the sdk from the subversion repository. There are a number of threads which contain the same information in here, but in less detailed, and no specific order, which makes them very hard to follow through on. The following steps were completed on a fresh install of Mac OS X Tiger, and are known to work.

1.Install XCode & GNU Compiler Collection
In order to download xcode, and the gnu compiler collection for macs, you must register at the Apple Developer Connection. Point your browser of choice to http://connect.apple.com and register. Once complete, login, go into the downloads section, followed by Developer Tools section, and download the Xcode Tools 2.2.1 (Disk Image) which weighs in at 820MB. Once Downloaded, Install everything in the XcodeTools.mpkg installer. If you desire, you can remove the java components, sdk’s, and documentation to save space.

2. Install Fink & Tools
Point your browser to http://fink.sourceforge.net/download/index.php and download the Fink binaries for OSX (Direct Link: http://prdownloads.sourceforge.net/fink/Fink-0.8.0-Installer.dmg?download ). Install fink from the disk image downloaded. During the install process, it will try to set profile variables, and fail, this is ok, we will set them ourselves in the next step. Next, open up a terminal ( Applications/Utilities/Terminal ) and enter the following command:

Code:

sudo fink -y install autogen autoconf2.5 automake1.8 libtool make svn-client wget sdl libtool14



3. Set Environment Variables
Open a Terminal, and type the following commands
Code:

cd ~/
vim .bash_profile


Once inside vim, type the following lines, then press escape, colon (: ) and then type wq (write and quit) followed by enter. It is very important to not miss any quotation marks below.

NOTE: You can do this in another editor, but make sure to save the filename correctly. For example, using TextEdit will save the file as .bash_profile.rtf instead of .bash_profile

Code:

export PSPDEV="/usr/local/pspdev"
export PSPSDK="$PSPDEV/psp/sdk"
export PSPPATH="$PSPDEV/bin:$PSPDEV/psp/bin:$PSPSDK/bin"
export PATH="/sw/bin:$PATH:$PSPPATH"



4. Create a PSPDEV directory and handle permissions
Open a Terminal and type the following commands.

Code:

sudo mkdir -p /usr/local/pspdev
sudo chmod a+rwx /usr/local/pspdev


5. Checkout the psptoolchain script from subversion, and run it.
Open a terminal and type:

Code:

svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain
cd psptoolchain
sh ./toolchain.sh


After these steps, the psp-sdk will compile, which will take a long time, sit back and relax, all your work is done(hopefully!)

Once the toolchain script is complete, The PSP SDK will be installed into /usr/local/pspdev .
Back to top
View user's profile Send private message
bronxbomber92



Joined: 21 Jul 2006
Posts: 36

PostPosted: Sun Jul 30, 2006 5:44 am    Post subject: Reply with quote

This should be stickied instead of the other one, as this less confusing, and explains better.
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Mon Aug 28, 2006 4:15 pm    Post subject: Reply with quote

I should point out that making a .rtf file in Textedit will add extra stuff to it.

Its not recommended to do it this way.

Seeing there are a small amount of apple platforms i dont see why we cant have a pre compiled toolchain binary for each of the later OS's

Im going to compile the one for my macbook and post it in a DMG file

Hopefully this saves people time and money
Back to top
View user's profile Send private message AIM Address
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Tue Aug 29, 2006 10:36 am    Post subject: Reply with quote

Well I have compiled the toolchain.

I will upload it in dmg format tomorrow
Back to top
View user's profile Send private message AIM Address
Elenaher



Joined: 03 Oct 2006
Posts: 4

PostPosted: Tue Oct 03, 2006 4:16 am    Post subject: Reply with quote

I'm just a newb in PSP development and i tried to follow exactly your instructions but i got an error :

I'm using Os 10.4.7. I'm using FinkCommander and installation seems to be a bit different with it.
When toolshain.sh made its "wget" test, I got a first error because wget wasn't recognized as a command... I just modified toolshain.sh to and change wget to "/sw/bin/wget" ( idem for svn ).
Finally, i managed to launch the script.
I didn't got any problem during the download but i got many warnings from gcc during the compilation ( especially "warning: function declaration isn't a prototype" ).
At the end i got an "fatal" error on the compilation of a file named "flat_bl.m" :

Code:

gcc -g -O2    -c -o flat_bl.o ../../gprof/flat_bl.m
../../gprof/flat_bl.m:2: error: parse error before '%' token
make[3]: *** [flat_bl.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-gprof] Error 2
ERROR BUILDING BINUTILS


Do you have any idea to help me ? Thank you.

( I got this error twice in two tests )

( I'm french so excuse my mistakes in english )
Back to top
View user's profile Send private message
cycologist



Joined: 12 Nov 2006
Posts: 1

PostPosted: Sun Nov 12, 2006 11:43 am    Post subject: PSPSDK toolchain compilation on OSX, latest Fink & scrip Reply with quote

When compiling binutils on OSX I got errors in the gprof make, for some reason the flat_bl.m is used instead of flat_bl.c in the gcc call to produce the object file. Same happens with the other *.m files. I renamed these, since they were already used by the awk script to produce the C sources.

See also Elenaher's post from October 2nd, 2006, mentioning the same issue.

Is there an official fix, and, what is causing this mixup, error in makefile or is OSX behaving in some non-standard ways?
Back to top
View user's profile Send private message
LopsidedElf



Joined: 04 Mar 2007
Posts: 2

PostPosted: Sun Mar 04, 2007 3:48 am    Post subject: trouble with svn Reply with quote

Im kinda new to this and I'm trying to checkout the psptoolchain but when i type
Quote:

svn co svn://svn.ps2dev.org/psp/trunk/psptoolchain
it gives me a -bash: svn: Command not found
I feel like i'm doing something stupid but if anyone could help thatd be great.
Thanks :)
Back to top
View user's profile Send private message
bronxbomber92



Joined: 21 Jul 2006
Posts: 36

PostPosted: Sun Mar 04, 2007 5:39 am    Post subject: Reply with quote

You need to install the svn tool.
Back to top
View user's profile Send private message
LopsidedElf



Joined: 04 Mar 2007
Posts: 2

PostPosted: Sun Mar 04, 2007 8:13 am    Post subject: svn tool Reply with quote

How would i do that?
Back to top
View user's profile Send private message
pailes



Joined: 16 Feb 2007
Posts: 16

PostPosted: Sun Mar 04, 2007 8:43 pm    Post subject: Reply with quote

Download it here:
http://subversion.tigris.org/project_packages.html
Back to top
View user's profile Send private message Visit poster's website
seventoes



Joined: 02 Oct 2005
Posts: 79

PostPosted: Thu Mar 22, 2007 7:45 am    Post subject: Reply with quote

Elenaher wrote:
I'm just a newb in PSP development and i tried to follow exactly your instructions but i got an error :

I'm using Os 10.4.7. I'm using FinkCommander and installation seems to be a bit different with it.
When toolshain.sh made its "wget" test, I got a first error because wget wasn't recognized as a command... I just modified toolshain.sh to and change wget to "/sw/bin/wget" ( idem for svn ).
Finally, i managed to launch the script.
I didn't got any problem during the download but i got many warnings from gcc during the compilation ( especially "warning: function declaration isn't a prototype" ).
At the end i got an "fatal" error on the compilation of a file named "flat_bl.m" :

Code:

gcc -g -O2    -c -o flat_bl.o ../../gprof/flat_bl.m
../../gprof/flat_bl.m:2: error: parse error before '%' token
make[3]: *** [flat_bl.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-gprof] Error 2
ERROR BUILDING BINUTILS


Do you have any idea to help me ? Thank you.

( I got this error twice in two tests )

( I'm french so excuse my mistakes in english )


I get the same error, anyone have a fix?
Back to top
View user's profile Send private message
urchin



Joined: 02 Jun 2005
Posts: 121

PostPosted: Thu Mar 22, 2007 7:14 pm    Post subject: Reply with quote

".m" is also the extension for Objective C files, so on OS X gcc tries to compile the file and fails. If you search the other OS X threads, there's a way to fix this (you need to build with "make -r" I think)
Back to top
View user's profile Send private message
seventoes



Joined: 02 Oct 2005
Posts: 79

PostPosted: Fri Mar 23, 2007 1:33 am    Post subject: Reply with quote

How would i make the toolchain use make -r? do i just search and replace? Can make -r hurt the rest of the builds?
Back to top
View user's profile Send private message
surfchen



Joined: 10 Dec 2006
Posts: 5

PostPosted: Sat Apr 28, 2007 12:06 am    Post subject: Reply with quote

seventoes wrote:
How would i make the toolchain use make -r? do i just search and replace? Can make -r hurt the rest of the builds?

1)open the toolchain.sh
2)find "ERROR BUILDING BINUTILS
3)replace $MAKE|| with $MAKE -r||


btw:the variable CFLAGS and other similar variables may make the progress to be failure..
Back to top
View user's profile Send private message
Gardo



Joined: 04 May 2007
Posts: 7

PostPosted: Fri May 04, 2007 4:43 am    Post subject: Reply with quote

Hi,

I followed the instructons in this thread http://forums.ps2dev.org/viewtopic.php?t=2792 and in step 6.
Quote:
Grab the psptoolchain-200xxxxxxx.tgz script from http://www.oopo.net/consoledev/ . Safari should extract it as psptoolchain/ on the desktop, so type
Code:
 cd ~/Desktop/psptoolchain/
./toolchain.sh

I get:
Quote:
Error while checking the dependencies. Aborting



Any ideas?

Thanx

BTW any way to unisntall fink?

EDIT: I think the problem starts here:

Code:
  sudo fink -y install autogen autoconf2.5 automake1.8 libtool make svn-client wget sdl

as libtool14 is missing, right?

I don't have my MAC here, but I'll try as soon as I'm back home.

Anyway, still any ideas?
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Fri May 04, 2007 3:41 pm    Post subject: Reply with quote

try using the latest toolchain from svn
Back to top
View user's profile Send private message AIM Address
urchin



Joined: 02 Jun 2005
Posts: 121

PostPosted: Fri May 04, 2007 4:03 pm    Post subject: Reply with quote

Gardo wrote:

BTW any way to unisntall fink?


I got rid of fink by deleting the /sw directory.
Back to top
View user's profile Send private message
Gardo



Joined: 04 May 2007
Posts: 7

PostPosted: Fri May 04, 2007 4:34 pm    Post subject: Reply with quote

Well,
Wally4000 wrote:

try using the latest toolchain from svn


Yepp! I've allrady done that, and I tried running the script
Code:
 sh ./toolchain.sh

when I ran it, everything seemed smooth, until I've got this:
Code:

can't find file to patch at input line 2825
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN binutils-2.16.1/ld/configure.tgt binutils-psp/ld/configure.tgt
|--- binutils-2.16.1/ld/configure.tgt   2005-02-08 19:54:27.000000000 +0000
|+++ binutils-psp/ld/configure.tgt      2006-05-09 02:55:36.000000000 +0100
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
patching file ld/emulparams/elf_mipsallegrexel_psp.sh
can't find file to patch at input line 2863
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN binutils-2.16.1/ld/Makefile.am binutils-psp/ld/Makefile.am
|--- binutils-2.16.1/ld/Makefile.am     2005-01-20 19:37:49.000000000 +0000
|+++ binutils-psp/ld/Makefile.am        2006-05-09 02:55:36.000000000 +0100
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 2884
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN binutils-2.16.1/ld/Makefile.in binutils-psp/ld/Makefile.in
|--- binutils-2.16.1/ld/Makefile.in     2005-01-23 05:36:37.000000000 +0000
|+++ binutils-psp/ld/Makefile.in        2006-05-09 02:55:36.000000000 +0100
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
patching file ld/scripttempl/elf_psp.sc
can't find file to patch at input line 3405
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN binutils-2.16.1/opcodes/mips-dis.c binutils-psp/opcodes/mips-dis.c
|--- binutils-2.16.1/opcodes/mips-dis.c 2005-03-03 11:49:50.000000000 +0000
|+++ binutils-psp/opcodes/mips-dis.c    2006-05-09 02:55:36.000000000 +0100
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
4 out of 4 hunks ignored
can't find file to patch at input line 3962
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -burN binutils-2.16.1/opcodes/mips-opc.c binutils-psp/opcodes/mips-opc.c
|--- binutils-2.16.1/opcodes/mips-opc.c 2005-03-03 11:49:50.000000000 +0000
|+++ binutils-psp/opcodes/mips-opc.c    2006-05-09 02:55:36.000000000 +0100
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
22 out of 22 hunks ignored
ERROR PATCHING BINUTILS


urchin wrote:

I got rid of fink by deleting the /sw directory.


OK thanx dudes :)

BTW I did de BINUTILS fix, but I still get this errors when patching'em
Back to top
View user's profile Send private message
Gardo



Joined: 04 May 2007
Posts: 7

PostPosted: Thu May 17, 2007 1:50 pm    Post subject: Reply with quote

Well, I've found out the problem... I didn't have bison and flex installed.

Code:
 sudo fink -y install bison flex


Now I've PSP SDK installed... the fun begins
Back to top
View user's profile Send private message
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Fri May 18, 2007 1:29 am    Post subject: Reply with quote

Ah cool,

what ya goin to be workin on?
Back to top
View user's profile Send private message AIM Address
Gardo



Joined: 04 May 2007
Posts: 7

PostPosted: Sat May 19, 2007 7:49 am    Post subject: Reply with quote

Wally4000 wrote:
Ah cool,

what ya goin to be workin on?


I first want to start "understanding" how the PSP works, so I think before working an app from scrach I'll look at some open source apps, and from there we'll see; I'm interested in making plugins more than apps.

By the way, I've compiled some of the examples in /usr/local/pspdev/psp/sdk/samples with no problems, but I've tried to compile the neogeoCD 0.91 in order to be able to compile the MP3 Player plugin from IRshell (irsmp3) but i get:

Code:
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make: *** [neocd.elf] Error 1


before I was getting an other error, something to do with the zlib, I think something about the zlib.h missing.( I copied the zlib folder to the zip folder in the source code)

Any ideas what Im doing wrong?

cheers
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat May 19, 2007 5:28 pm    Post subject: Reply with quote

Build and install zlib for the psp. svn://svn.ps2dev.org/psp/trunk/zlib
Back to top
View user's profile Send private message
Gardo



Joined: 04 May 2007
Posts: 7

PostPosted: Sat May 19, 2007 7:03 pm    Post subject: Reply with quote

jimparis wrote:
Build and install zlib for the psp. svn://svn.ps2dev.org/psp/trunk/zlib


great tip, I've forgotten to run
Code:
make install


thanx
Back to top
View user's profile Send private message
isis



Joined: 05 Jun 2007
Posts: 1

PostPosted: Wed Jun 06, 2007 6:41 am    Post subject: Reply with quote

hi !

here are the error I got when I run toolchain.sh

/bin/sh ./libtool --mode=link gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -o ld-new ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_mipsallegrexel_psp.o eelf32elmip.o ../bfd/libbfd.la ../libiberty/libiberty.a ./../intl/libintl.a
mkdir .libs
gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -g -O2 -o ld-new ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_mipsallegrexel_psp.o eelf32elmip.o ../bfd/.libs/libbfd.a ../libiberty/libiberty.a ./../intl/libintl.a
../scripts/001-binutils-2.16.1.sh: Failed.


can anybody help me ?
thx
Back to top
View user's profile Send private message
azza



Joined: 03 Sep 2007
Posts: 3

PostPosted: Mon Sep 03, 2007 7:13 pm    Post subject: Reply with quote

HELLO!
I'm a new developper in the psp world and, I did the installation but , in the last command it displayed
Code:
ERROR: Set $PSPDEV before continuing.
../depends/check-pspdev.sh: Failed.

How can I do?
Back to top
View user's profile Send private message
PSPJunkie



Joined: 23 Jan 2007
Posts: 14
Location: Jersey

PostPosted: Tue Sep 04, 2007 2:57 am    Post subject: Reply with quote

If you would read the readme, you would get the answer.

Type:
Code:

$ nano .bash_profile


Paste the following lines into .bash_profile:
Quote:

export PSPDEV=/usr/local/pspdev
export PATH=$PATH:$PSPDEV/bin


Press CTRL + 'X', then type 'y', then hit enter.

Finally, type:
Code:

$ source .bash_profile


Then try to run the toolchain script again.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
azza



Joined: 03 Sep 2007
Posts: 3

PostPosted: Tue Sep 04, 2007 3:52 am    Post subject: Reply with quote

When I type "$ nano .bash_profile ", it puts "-bash: $:command not found"
then , now , What can I do ?
(sorry , but it's the first time I use the terminal to install something ...)
Back to top
View user's profile Send private message
PSPJunkie



Joined: 23 Jan 2007
Posts: 14
Location: Jersey

PostPosted: Tue Sep 04, 2007 3:59 am    Post subject: Reply with quote

:/ The '$' just meant for you to type it into the terminal. Don't actually type it. :P
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
azza



Joined: 03 Sep 2007
Posts: 3

PostPosted: Tue Sep 04, 2007 4:22 am    Post subject: Reply with quote

AAAHH,thank you but now, when I try to run the toolchain script , it puts "ERROR: Install subversion before continuing.
../depends/check-subversion.sh: Failed."
???
thx
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Tue Sep 04, 2007 10:16 am    Post subject: Reply with quote

Install subversion. Before continuing.

The readme.txt has a list of stuff you need to install before running the script.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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