SDL Install / Usage Trouble

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

Moderators: cheriff, TyRaNiD

Post Reply
Garak
Posts: 46
Joined: Wed Jul 27, 2005 1:59 am

SDL Install / Usage Trouble

Post by Garak »

Greetings,

I am attempting to install the PSP SDL. I am currently running cygwin on Windows. I am using the PSPSDK 4.01 & Toolchain
psptoolchain-20050725.tar for linux. I have compiled numerous programs, so I am sure my basic environment is setup correctly. I believe I successfully installed the SDL from SVN (build 1025). It would seem the header files were copied to /usr/local/include/SDL, while some library files were placed in /usr/local/lib.

I would like to write a simple app that includes and uses the SDL environment. My first attempt was to hijack one of the very simple sample files from the PSPSDK, but that was quite a failure. I attempted to edit the make file to include the SDL header files and library, but that turned out so bad I won't bother embarrassing myself by posting it here.

I know that SDL has some test apps I can build, but after looking at them I have no idea how to build them. And from the looks of it they do not appear to be PSP "ready".

Does anyone have an example of how to setup a makefile and compile an SDL app? Also, based on my description of the location of my SDL files, did they get installed to the right directories? Any help would be really appreciated!
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

There's a file SDL for PSP distribution named README.PSP that contains instructions on how to build and link against SDL.
Garak
Posts: 46
Joined: Wed Jul 27, 2005 1:59 am

Post by Garak »

Thank you,

The build instructions state:

To build for the PSP, make sure psp-config is in the path and run:

./autogen.sh
LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser" \
./configure --host psp --prefix=`psp-config --psp-prefix`
make
make install

OK... Whats with the
LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser" \

What do I do with that portion? Is that a command in itself, or a command line argument to autogen.sh?
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post by cheriff »

the \ at the end of the line usually means that while stuff is written over two lines, it should really be entered as a single one.

so that line sets the LDFLAGS environment varible for when you run ./configure. So you should be able to just enter:

Code: Select all

 LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser" ./configure --host psp --prefix=`psp-config --psp-prefix` 
as one command.
Damn, I need a decent signature!
Garak
Posts: 46
Joined: Wed Jul 27, 2005 1:59 am

Post by Garak »

I figured that may be the case, but I have had no luck installing the SDL with any combiniation of typing stuff on a single, or multiple lines. I typed the line just as you stated, and I received the following error:

@gold-leader:~/psphome/devtools/SDL
>LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser" ./configure --host psp
--prefix=`psp-config --psp-prefix`
LDFLAGS=-L/usr/local/pspdev/psp/sdk/lib -lc -lpspuser: Command not found.

Any ideas as to what the problem could be?
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post by cheriff »

are you doing this in a normal winXP command box, or the funky cygwin bash shell? You need the cygwin one, i guess.

IF that still fails to work, look in you're .bashrc file in your homedir in cygwin. Hopefully there's some samples on how to set environment values. (you should have at least managed to set PSPSDK in there, to get thus far, right?) and do the same to set LDFLAGS to "-L`psp-config --pspsdk-path`/lib -lc -lpspuser" .
then

Code: Select all

source ~/.bashrc
./configure --host psp --prefix=`psp-config --psp-prefix` 
would be equivalent. Of course, you then have to remove that lkine from .bashrc and re source it, coz that LDFLAGS will prolly cock up other stuff if you leave it there.

Of course, there's always the possiblilty that something else in your setup is broken and crappy workarounds such as this wont do squat. I dunno ..:)
Damn, I need a decent signature!
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post by rinco »

Best place to start would be tests/SDL/ in the psp repository.

Failing that, there are several SDL games in the pspware repository....
trailblazer, vecteroids, abrick, REminiscence, lopan, eggchess, SMC. Maybe even VisualBoyAdvance...?.

And somewhere in the forums is a Makefile for SMS/SDL.
Garak
Posts: 46
Joined: Wed Jul 27, 2005 1:59 am

Post by Garak »

Thank you all for your help.

Cheriff, I am using the funky cygwin c-shell. As it turns out that was my problem. I switched to the BASH shell (Cygwin's default) and ran the commnd as 1 line as you sudgested earlier. In Bash it compiled with no problems. I even compiled the test program sudgested by rinco and it worked great.

Again thank you all for the help, it's greatly appreciated!
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post by cheriff »

cool. I didnt even realise cygwin shipped with anything other than bash!
glad to help, tho :)
Damn, I need a decent signature!
pspblizz
Posts: 15
Joined: Tue Sep 13, 2005 8:35 pm

Post by pspblizz »

I have two problems following those instructions after having downloaded the libsdl with svn.

First this part: "--prefix=`psp-config --psp-prefix`" gives this error:

Code: Select all

Invalid option '?'
Usage: psp-config [opts]
Options:
--pspsdk-path       : Print the base directory of PSPSDK
Next up the .configure gives these two errors:

Code: Select all

configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
And finally, ends with the error:

Code: Select all

checking for psp-gcc... psp-gcc
checking for C compiler default output file name... configure: error: C compiler
 cannot create executables
See `config.log' for more details.
Any feedback to what I need to do?

I used cygwin and have devkitPRO installed with version 4.0.1 of PSPSDK.
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post by rinco »

The --psp-prefix parameter was added to psp-config long long ago. So you need to update your toolchain. Perhaps there is a newer version of devkitpro...? If not, hassle WinterMute.
ayatollah
Posts: 15
Joined: Sun Sep 04, 2005 10:49 am

Same Problem on WinXP with DevKitPSP5.0

Post by ayatollah »

I have the same problem when I try to build SDL!

I have been searching here for hours but I can not find a solution on this problem. I downloaded devkitProUpdater-1.0.9.exe, have the FULL install and work on MinSys with msysDTK-1.0.1.exe.

I installed:
msys-autoconf-2.59-src.tar.bz2
msys-automake-1.8.2-src.tar.bz2

and when I follow the Instructions in the README.PSP in SDL SVN repository:

Code: Select all

   ./autogen.sh
   LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser" \
     ./configure --host psp --prefix=`psp-config --psp-prefix`
   make
   make install 
I get this Error Message:

Code: Select all

cd builds/unix; ./configure --host psp --prefix=/c/devkitPro/devkitPSP/psp
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-mingw32
checking host system type... mipsallegrexel-psp-elf
checking target system type... mipsallegrexel-psp-elf
checking for psp-gcc... psp-gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** [builds/unix/unix-def.mk] Error 77
make: ver: Command not found
make: type: Command not found
make: *** [dos_setup] Error 127
make: ver: Command not found
make: *** No rule to make target `install'.  Stop.
It's the same if I try to install Freetype too..

Any Solution out there???

I tried to install the whole SDK using CYGWIN and the latest Toolchain however that gave me an error message after 2 Hours when building NEWLIB so I figured to go back to MinSys which works like a charm on existing Samples etc.

PLEASE HELP !!! :)
skeezixcodejedi
Posts: 29
Joined: Tue Aug 30, 2005 10:37 am
Contact:

Post by skeezixcodejedi »

Check the logfile it mentions, and scan up to the actual 'error' lines in question. You'll be able to see the tiny 'C' program it wrote to do the test, and the error messages. Chances are it just can't find the libs needed to produce the executable.. ie: For PSP, it needs to have the pspkernel and other libs. So in the LDOCNFIG= part, you may need to add some -L to locate the right lism or even some -l's to include the right libs.

jeff
--
Have you played Atari today?
ayatollah
Posts: 15
Joined: Sun Sep 04, 2005 10:49 am

Post by ayatollah »

Thanx for the HINT...

I checked the log file but there was only some strange char in the Path to the SDK so I simply used

Code: Select all

$ LDFLAGS="-L/c/devkitPro/devkitPSP/psp/sdk/lib -lc -lpspuser ./configure --host psp --prefix=/c/devkitPro/devkitPSP/psp
(not with the PSP-CONFIG Option) and it worked like a charm..

THANKS A LOT!
Post Reply