Random Homebrew: Space Rocks 2
A Space Shooter.
Friends: Coding 'n Cracking - Nymphaea - PS3 Forum - darkforestgroup - daxhordes.org - Tgames - coldbird - gopsp.it - pspstation.org - prometheus - hgoel.info - MakeSmartTV - ps vita

PSPSDK on Mac OS X 10.6.7?

Forum rules
Any post not directly related to programming will be moderated.
Do not request people to code something for you.
Avoid posting messages that do not bring anything to the conversation. We want the threads in this subforum to stay focused.

PSPSDK on Mac OS X 10.6.7?

Postby Stinkee2 » Sat Jun 16, 2012 3:21 pm

Greetings! I've migrated to here from what used to be PSP-Hacks.com, but is now under new management. Since the change, it's died quite a bit unfortunately. But anyway I'd like to introduce myself to become a little more familiar with this forum and the people in it.

My name is Michael and I've been programming for years, I used to be very much into the PSP development scene. After PSP-Hacks went away I lost touch with the scene and moved to iOS development because getting paid for things appealed to me. I've been missing the PSP scene for a while now so I thought I'd come back to it now. I've chosen this forum because I've noticed that there is a bunch of activity on it, and I've got a sense of respect for this place for reasons unknown to me.

So, yes, hello everybody!

Now on to my actual question.
I've been trying for about a week now to compile the psptoolchain on my installation of OS X Snow Leopard. I always get errors around the part with newlib. Sometimes saying that the program "AS" in my "usr/libexec/gcc/darwin/x86_64/" folder is complaining that it doesn't understand the -G parameter or something else completely remote that nobody seemed to have trouble with but me... I did find people with the error above, and most of the errors that I got, but none of them were solved in a clear way and were so old that I wouldn't get any response from registering an account and asking in the thread.

So I tried to install devkitPSP but I got that same AS error, and then I backed up the AS executable in that directory and replaced it with "psp-as" and renamed it to "AS." Then I had issues with ld not knowing what the "-EL" parameter was, so I figured it was looking in the wrong compiler directories again like it was with AS and I backed up and replaced "usr/bin/ld" with "psp-gcc" and renamed it like with AS. I stopped getting those errors and started getting errors about not finding certain headers or static libraries. So I modified the Build.mak file to search in the directories with those files and now it ALMOST compiles the basic controller sample in the SDK. Here's what I get:
Code: Select all
MacBook-Pro:basic Computer$ makepsp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -I. -I/usr/local/pspdev/lib/gcc/psp/4.6.2/include -I. -I/usr/local/pspdev/psp/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150  -L. -L/usr/local/pspdev/psp/sdk/lib -L. -L/usr/local/pspdev/psp/lib -L. -L/usr/local/pspdev/lib/gcc/psp/4.6.2/   main.o  -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o controller_basic.elf
ld: error: crt0.o: No such file or directory
ld: error: crti.o: No such file or directory
ld: error: crtbegin.o: No such file or directory
ld: error: crtend.o: No such file or directory
ld: error: crtn.o: No such file or directory
make: *** [controller_basic.elf] Error 1


Which is very strange to me, because I added the directories with those files in them to the linker search directories!

Here's the modified lines in build.mak if necessary:
Code: Select all
...
# Add in PSPSDK includes and libraries.
INCDIR   := $(INCDIR) . $(PSPSDK)/include . $(PSPDEV)/lib/gcc/psp/4.6.2/include . $(PSPDEV)/psp/include
LIBDIR   := $(LIBDIR) . $(PSPSDK)/lib . $(PSPDEV)/psp/lib . $(PSPDEV)/lib/gcc/psp/4.6.2/
...

I know people have compiled the PSPSDK for OS X 10.6.7 before because I've seen it in a few threads, I'm just making some stupid mistake somewhere or missing something. Is there a patched toolchain or a precompiled sdk somewhere or something?

Thanks for any help in advanced!

EDIT:
I do have bootcamp and Windows 7 installed, but I don't fancy switching operating systems and copying all my engine's files when I want to compile it for the PSP rather than OS X or iOS.
User avatar
Stinkee2
 
Posts: 6
Joined: Sat Jun 16, 2012 2:44 pm
Location: Woodstock, NY

Re: PSPSDK on Mac OS X 10.6.7?

Postby joevar » Sat Jun 16, 2012 4:36 pm

I think you can get it working on the first try if you use this instead: https://github.com/pspdev/psptoolchain
But, you'll need to install git first. http://git-scm.com/

You also may want to use homebrew as a package manager (instead of macports or fink): http://mxcl.github.com/homebrew/
This is for installing the prerequisite libraries.
User avatar
joevar
 
Posts: 9
Joined: Wed Feb 01, 2012 11:37 pm

Re: PSPSDK on Mac OS X 10.6.7?

Postby Stinkee2 » Sat Jun 16, 2012 4:40 pm

I've tried that, using macports and all the packages I had installed, I didn't have git as far as I know. I'll try it right now, thanks!

EDIT:
I'm using macports again because Homebrew didn't install more than half of the dependencies.
User avatar
Stinkee2
 
Posts: 6
Joined: Sat Jun 16, 2012 2:44 pm
Location: Woodstock, NY

Re: PSPSDK on Mac OS X 10.6.7?

Postby joevar » Sat Jun 16, 2012 5:39 pm

I don't have a mac in front of me, so I'm going off memory. I remember having to do some extra tinkering with macports due to differences in the system architecture and duplicated libs. I want to say specifically with elf.h, gelf, udev and libiconv. For homebrew, they are either under different names or their formulae is somehwere on github ( eg. https://github.com/adamv/homebrew-alt https://github.com/adamv/homebrew/tree/ ... ry/Formula ). It's possible install either way, but homebrew isn't as hackish.
User avatar
joevar
 
Posts: 9
Joined: Wed Feb 01, 2012 11:37 pm

Re: PSPSDK on Mac OS X 10.6.7?

Postby Stinkee2 » Sat Jun 16, 2012 6:07 pm

I got libusb installed unlike last time when I couldn't find it, as well as libelf. But the toolchain script is still complaining that "elf" isn't installed because it can't find elf.h in /usr/local/include/. So I tried copying libelf.h from /opt/include/libelf/ and then it says:

Code: Select all
MacBook-Pro:psptoolchain Computer$ sudo ./toolchain.sh
Password:
ls: /usr/include/elf.h: No such file or directory
ls: /usr/include/gmp.h: No such file or directory
ls: /usr/include/gelf.h: No such file or directory
ls: /usr/include/libelf.h: No such file or directory
ls: /usr/local/include/gelf.h: No such file or directory
ls: /usr/local/include/libelf.h: No such file or directory
ERROR: Install elf before continuing.
../depends/check-libelf.sh: Failed.
User avatar
Stinkee2
 
Posts: 6
Joined: Sat Jun 16, 2012 2:44 pm
Location: Woodstock, NY

Re: PSPSDK on Mac OS X 10.6.7?

Postby joevar » Sat Jun 16, 2012 6:53 pm

Yeah, I remember getting my hands dirty with this one. I think edited the scripts to check inside both /opt and /usr in depends as they came up. This was last summer, so I don't remember exactly what I did. You're probably going to have a few more hiccups with macports when building. It's honestly a lot easier with homebrew.


Edit:
For example this file.
psptoolchain/depends/check-libelf.sh
Code: Select all
#!/bin/sh
# check-elf.sh by SamRH (samr.hegarty@gmail.com)

## Check for the libelf library.
ls /usr/include/gelf.h 1> /dev/null || \
ls /usr/include/libelf.h 1> /dev/null || \
ls /usr/local/include/gelf.h 1> /dev/null || \
ls /usr/local/include/libelf.h 1> /dev/null || \
  { echo "ERROR: Install elf before continuing."; exit 1; }


to something like this:

Code: Select all

#!/bin/sh
# check-elf.sh by SamRH (samr.hegarty@gmail.com)

## Check for the libelf library.
ls /usr/include/gelf.h 1> /dev/null || \
ls /usr/include/libelf.h 1> /dev/null || \
ls /usr/local/include/gelf.h 1> /dev/null || \
ls /usr/local/include/libelf.h 1> /dev/null || \
ls /opt/include/gelf.h 1> /dev/null || \
ls /opt/include/libelf.h 1> /dev/null || \
ls /opt/local/include/gelf.h 1> /dev/null || \
ls /opt/local/include/libelf.h 1> /dev/null || \
  { echo "ERROR: Install elf before continuing."; exit 1; }
User avatar
joevar
 
Posts: 9
Joined: Wed Feb 01, 2012 11:37 pm

Re: PSPSDK on Mac OS X 10.6.7?

Postby Stinkee2 » Sat Jun 16, 2012 7:37 pm

After modifying some of the dependency scripts, I got toolchain.sh to begin running. *awaits thousands of errors*

EDIT:
Yeah that's pretty much what I did.

Thanks for all this, by the way.
User avatar
Stinkee2
 
Posts: 6
Joined: Sat Jun 16, 2012 2:44 pm
Location: Woodstock, NY

Re: PSPSDK on Mac OS X 10.6.7?

Postby joevar » Sat Jun 16, 2012 8:38 pm

No problem. I understand your frustrations. :D
User avatar
joevar
 
Posts: 9
Joined: Wed Feb 01, 2012 11:37 pm

Re: PSPSDK on Mac OS X 10.6.7?

Postby Stinkee2 » Sat Jun 16, 2012 9:07 pm

Well, how strange, it worked. I must be nearing the end of my life for something to work out this smoothly.

psplinkusb didn't compile correctly, but everything else did. And that's perfectly fine, I don't really need psplink.

THANK YOU!
Now, what to make...

EDIT:
If there's not already something to make the use of the PSPSDK and xCode easier, I'll make a template project and an executable that generates your makefile based on your project directory and the libraries to link specified in a text file. So that you don't have to add all of the OBJS when building a large project.

EDIT:
I'm getting this when I try to build the basic controller sample:
Code: Select all
make: psp-config: Command not found
Makefile:16: /lib/build.mak: No such file or directory
make: *** No rule to make target `/lib/build.mak'.  Stop.


I think it's just a problem with it not knowing where to look for the files though, because $(PSPSDK)/lib/build.mak does exist as well as $(PSPDEV)/bin/psp-config.

If I can fix it I'll post it here.

EDIT AGAIN:
I got it, I just had my pspdev folder in /usr rather than /usr/local... I forgot to move it all the way I guess. I forgot to set $PSPDEV before compiling so I installed to / rather than /usr/local/pspdev.

But anyway it's fixed now. Woo!
User avatar
Stinkee2
 
Posts: 6
Joined: Sat Jun 16, 2012 2:44 pm
Location: Woodstock, NY

Re: PSPSDK on Mac OS X 10.6.7?

Postby arnold » Tue Jul 31, 2012 11:46 am

Hm.

Sorry I didn't see this earlier. I've been busy.

http://lan.st/showthread.php?t=1927&page=3

That was for OSX Leopard.

It might have changed but last time I tried it with OSX Lion it still worked.

LibUSB, just install the PKG.
As for PSPLink, it should just build.

I'm not sure how well the new XCode works with all this though.

-arnold
arnold
 
Posts: 93
Joined: Tue Nov 23, 2010 10:17 am


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests