Poster | Thread |
spotUP
| |
Need help compiling a SDL app for OS4! Posted on 18-May-2005 19:23:45
| | [ #1 ] |
|
|
|
Elite Member |
Joined: 19-Aug-2003 Posts: 2896
From: Up Rough Demo Squad | | |
|
| Hi! I have kind of got to like Linux during the last week, as it offers a lot more apps than OS4. OS4 is my big love though, and Linux a needed compliment ATM..
An app that I have wanted ported to AOS4 for a while is CGTerm. A program that let's you telnet to C64 BBS:es and view the petski just as if you where on a real C64. Find more info here http://paradroid.net/cgterm/
When I compiled it for Debian I noticed it was a SDL app (Aaa-hah! Easilly ported to AOS4!) So I did apt-get install libsdl-dev and then make followed by make install. Bam. There was CGTerm ready for me to be abused under Linux.
OK, now for my question, is it much hassle to compile SDL apps for OS4?
Could someone tell me the exact line to type to compile cgterm under AOS4? If I could get help with this, I might learn something and get really busy on SDL porting. :)
_________________ AOS4 Betatester, Peg2, G4@1ghz, Radeon 9250 256mb, 1gb RAM.
http://www.asciiarena.com http://www.uprough.net |
|
Status: Offline |
|
|
Mr_Capehill
| |
Re: Need help compiling a SDL app for OS4! Posted on 18-May-2005 20:28:24
| | [ #2 ] |
|
|
|
Super Member |
Joined: 15-Mar-2003 Posts: 1933
From: Yharnam | | |
|
| @spotUP
Judging from the makefile, it seems simple. Maybe small changes needed. ("/usr/local" is not "Amigaish")
You need to install SDK, and the SDL files (from evilrich's page).
|
|
Status: Offline |
|
|
lionstorm
| |
Re: Need help compiling a SDL app for OS4! Posted on 18-May-2005 20:28:42
| | [ #3 ] |
|
|
|
Super Member |
Joined: 31-Jul-2003 Posts: 1588
From: the french side | | |
|
| @spotUP
maybe you could ask on amigadev (link on the left of AW.net) or subscribe to amiga-c on yahoo. Lio |
|
Status: Offline |
|
|
AlexC
| |
Re: Need help compiling a SDL app for OS4! Posted on 18-May-2005 20:32:30
| | [ #4 ] |
|
|
|
Super Member |
Joined: 22-Jan-2004 Posts: 1300
From: City of Lost Angels, California. | | |
|
| @spotUP
Get D-Fragmenta from os4depot and take a look at the source and makefile to get some hints. If your SDL setup is installed properly that one should compile without a hitch.
And check at http://rcdrummond.net for the latest SDL libs.
_________________ AlexC's free OS4 software collection
AmigaOne XE/X1000/X5000/UAE-PPC OS4 laptop/X-10 Home Automation |
|
Status: Offline |
|
|
AlexC
| |
Re: Need help compiling a SDL app for OS4! Posted on 18-May-2005 21:18:41
| | [ #5 ] |
|
|
|
Super Member |
Joined: 22-Jan-2004 Posts: 1300
From: City of Lost Angels, California. | | |
|
| Hmm, after making minor adjustments to the makefile only I got as far as compiling it but no luck with linking. It looks like SDL_gfx is needed or my Makefile isn't 100% correct.
gcc -o cgterm cgterm.o kernal.o gfx.o net.o config.o keyboard.o menu.o font.o timer.o crc.o sound.o macro.o ui.o xfer.o xmodem.o punter.o diskimage.o dir.o fileselector.o ui_term.o gfx.o(.text+0x8c): In function `gfx_loadfont': : undefined reference to `SDL_CreateRGBSurface' gfx.o(.text+0x9c): In function `gfx_loadfont': : undefined reference to `SDL_DisplayFormat'
etc..
_________________ AlexC's free OS4 software collection
AmigaOne XE/X1000/X5000/UAE-PPC OS4 laptop/X-10 Home Automation |
|
Status: Offline |
|
|
spotUP
| |
Re: Need help compiling a SDL app for OS4! Posted on 18-May-2005 22:43:29
| | [ #6 ] |
|
|
|
Elite Member |
Joined: 19-Aug-2003 Posts: 2896
From: Up Rough Demo Squad | | |
|
| @AmigAlex
oh... tough luck... if an SDL lib is missing then it's way beyond me... :/ I thought this would be an easy one. Thanks for the help though!
_________________ AOS4 Betatester, Peg2, G4@1ghz, Radeon 9250 256mb, 1gb RAM.
http://www.asciiarena.com http://www.uprough.net |
|
Status: Offline |
|
|
spotUP
| |
Re: Need help compiling a SDL app for OS4! Posted on 18-May-2005 22:45:42
| | [ #7 ] |
|
|
|
Elite Member |
Joined: 19-Aug-2003 Posts: 2896
From: Up Rough Demo Squad | | |
|
| @Amigalex
hmm.. but looking at the output you got, isn't that pointers to things that should be in the basic SDL installation?
_________________ AOS4 Betatester, Peg2, G4@1ghz, Radeon 9250 256mb, 1gb RAM.
http://www.asciiarena.com http://www.uprough.net |
|
Status: Offline |
|
|
MagicSN
| |
Re: Need help compiling a SDL app for OS4! Posted on 18-May-2005 23:27:06
| | [ #8 ] |
|
|
|
Hyperion |
Joined: 10-Mar-2003 Posts: 670
From: Unknown | | |
|
| @AmigAlex
Hmmm, if that line you posted is complete, then obviously there is a -lSDL missing. Both symbols listed are in libSDL.a.
Steffen
|
|
Status: Offline |
|
|
NutsAboutAmiga
| |
Re: Need help compiling a SDL app for OS4! Posted on 18-May-2005 23:30:40
| | [ #9 ] |
|
|
|
Elite Member |
Joined: 9-Jun-2004 Posts: 12833
From: Norway | | |
|
| @spotUP
gfx.o(.text+0x8c): In function `gfx_loadfont': : undefined reference to `SDL_CreateRGBSurface' gfx.o(.text+0x9c): In function `gfx_loadfont': : undefined reference to `SDL_DisplayFormat'
the SDL_CreateRGBSurface and SDL_DisplayFormat is defined in SDL.h or SDL.i I think, check the #include in the object file, look for Linux type of paths and try to make this more amiga like. you normaly need -lSDL I don't think you need it for the objects doh. _________________ http://lifeofliveforit.blogspot.no/ Facebook::LiveForIt Software for AmigaOS |
|
Status: Offline |
|
|
spotUP
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 3:01:53
| | [ #10 ] |
|
|
|
Elite Member |
Joined: 19-Aug-2003 Posts: 2896
From: Up Rough Demo Squad | | |
|
| @NutsAboutAmiga
mmmm mmm.... it's not possible to crosscompile aos4 binaries from linux yet?
EDIT: Yea, well, I know it's possible for guys like MagicSN, but for the average Joe? Does someone have any info? It would be far simpler to port stuff from linux via cross compiling right? Or, how does that work, if you cross compile a linux sdl app, would the cross compiler use the linux paths, so that I don't have to change the makefile?....... Orr.... ..r....r.. ... the more I think of it, cross compiling isn't that simple is it?
Last edited by spotUP on 19-May-2005 at 03:04 AM.
_________________ AOS4 Betatester, Peg2, G4@1ghz, Radeon 9250 256mb, 1gb RAM.
http://www.asciiarena.com http://www.uprough.net |
|
Status: Offline |
|
|
drHirudo
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 4:50:45
| | [ #11 ] |
|
|
|
Super Member |
Joined: 26-Apr-2004 Posts: 1113
From: Sofia | | |
|
| @spotUP
To ensure yourself than you won't miss any lib, on the AmigaOS 4 CLI use: gcc -Wall -O3 -ISDK:Local/clib2/include/SDL/ main.c -o main -lSDL_mixer -lSDL_image -lSDLmain -lSDL -ljpeg -lvorbisfile -lvorbis -lpng -logg -lz -lm -lAuto
The above example works for almost all the SDL sources, with some exceptions.
I could have ported even more SDL games and apps, but currently there is no SDL_ttf for AmigaOS 4 and compiling it from the sources need some freetype sources (dependency hell) and I gave up.
_________________ Games, programs, reviews |
|
Status: Offline |
|
|
NutsAboutAmiga
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 6:52:40
| | [ #12 ] |
|
|
|
Elite Member |
Joined: 9-Jun-2004 Posts: 12833
From: Norway | | |
|
| |
Status: Offline |
|
|
Mr_Capehill
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 8:40:49
| | [ #13 ] |
|
|
|
Super Member |
Joined: 15-Mar-2003 Posts: 1933
From: Yharnam | | |
|
| @drHirudo
There is. At least Cyborg and I have recompiled SDL_ttf if I don't mix things now with my bad memory ;). E-mail if you want it.
|
|
Status: Offline |
|
|
Anonymous
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 8:43:44
| | [ # ] |
|
| Not pertinent to this, but the main reason people miss symbols is failing to include proto files. |
|
|
|
|
Mr_Capehill
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 8:44:36
| | [ #15 ] |
|
|
|
Super Member |
Joined: 15-Mar-2003 Posts: 1933
From: Yharnam | | |
|
| @spotUP
It is possible. But is the cross-compiler kit released to public yet?
There may be some problems with cross-compiling too. For example, not all sources are designed to be cross-compiled. Worst ones try to run some cross-compiled code during build process :) But if you have time & patience, you can hack your way out.
Thing will be easier when Ixemul.library is released I think. |
|
Status: Offline |
|
|
Anonymous
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 8:46:22
| | [ # ] |
|
| @Mr_Capehill
Personally Im against ixemul usage, but thats just me. |
|
|
|
|
Mr_Capehill
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 8:51:46
| | [ #17 ] |
|
|
|
Super Member |
Joined: 15-Mar-2003 Posts: 1933
From: Yharnam | | |
|
| @Wiffy
I don't like ixemul thing too much either, but using GeekGadget tools would make building easier I think. Of course there is great effort like ABC Shell. |
|
Status: Offline |
|
|
Varthall
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 10:16:48
| | [ #18 ] |
|
|
|
Super Member |
Joined: 17-Feb-2004 Posts: 1559
From: Up Rough | | |
|
| @spotUP
In general, compiling SDL stuff on OS4 isn't a difficult task, once you've done your first successful compile, before you might need some time to find how to do things. An SDL porting tutorial would be nice! There's already a nice one on an italian webpage, sadly it's in italian only. These are the things that usually give most problems:
- you have to check which SDL libraries are needed. For example, SDL_sound and the OpenGL libraries do not exist yet for Os4.
- change the sdl-config calls. SDL-config is a script which ATM doesn't run on Os4 due to lack of an Unix-type shell (and probably some commands from Unix, too). I usually just leave out `sdl-config --libs`, while for `sdl-config --cflags` I use a predefined string of library switches (like -ljpeg -lSDL and so on). The important thing here is to put every library switch in the correct order, otherwise you would get linking errors. Also, in most of cases -lauto and -lm must be added too.
- adapt the makefile. Usually is just a matter of changing paths like /usr/local/, as mentioned earlier. Unfortunately, sometimes the makefile is missing, but it's generated with a tool like automake, which under Linux is called by ./configure. In this case I run configure under Linux and then create my own makefile basing on the output.
- sometimes, math constants like M_PI are used which are not included in clib2's math.h include, you just have to use newlib instead which have more constants defines, adding -newlib among the compiler switches.
- there might some more minor incompatilbilities in the sources which have to be fixed. For example, if you get an undefined reference to "__reentr_magic" at linking stage, try searching fprintf(stderr, "..."), which would print some text in a log file, and change every instance of it with a simpler printf("...");
- note that the public SDL library has some known issues (for example, the slowdown of Workbench during SDL program's execution, which can be fixed adding an "SDL_Delay(50);" line at the end of the main loop); a newer release of SDL is planned which should have these issues fixed.
Varthall Last edited by Varthall on 19-May-2005 at 10:17 AM.
_________________ AmigaOne XE - AmigaOS 4.1 - Freescale 7457 1GHz - 1GB ram |
|
Status: Offline |
|
|
Varthall
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 10:19:59
| | [ #19 ] |
|
|
|
Super Member |
Joined: 17-Feb-2004 Posts: 1559
From: Up Rough | | |
|
| @NutsAboutAmiga
Quote:
NutsAboutAmiga wrote: @spotUP
Yes you can, I cross compiled few progs, ISpell is one, you find the cross compilers on the pre devloper cd, don't know if they updated the cross compilers doh
info about it all is some where on the CD too. |
Don't use the cross-compiling stuff from the first prerelease CD, it generates executables which are incompatible with the current version of Os4. Actually, I'd like to know where to get up-to-date cross-compiling libraries.
VarthallLast edited by Varthall on 19-May-2005 at 10:21 AM.
_________________ AmigaOne XE - AmigaOS 4.1 - Freescale 7457 1GHz - 1GB ram |
|
Status: Offline |
|
|
MagicSN
| |
Re: Need help compiling a SDL app for OS4! Posted on 19-May-2005 10:21:56
| | [ #20 ] |
|
|
|
Hyperion |
Joined: 10-Mar-2003 Posts: 670
From: Unknown | | |
|
| @Mr_Capehill
>It is possible. But is the cross-compiler kit released to public yet?
Not sure. It is on the Betatester site, but not sure if also for non-testers. I do all my programs using a crosscompiler (reason: If my Amiga crashes due to a bug in the program I work on , I do not have to reboot the machine the source-code is on).
For SDL-based Linux-programs cross-compilation is the "king's way" to handle things IMHO. Especially if a Makefile/configure script uses stuff like autoconf and whatever which might not be available on AmigaOS.
Here it is how I do it:
./configure --help
Check the options
./configure --target=ppc-amigaos --host=ppc-amigaos
With possible other options added, based on what I read on --help...
If the configure script aborted due to an sdltest program being run (which doesn't work on cross compilation of course) edit it out of the configure script (yes, I know this is a crude way of doing things ) and configuring again.
make
Now some Programs insisted of still using gcc, though most use ppc-amigaos-gcc after this process. If they still use gcc -> manually modify Makefiles.
Also as no sdl-config program and such on AmigaOS I need to modify SDL paths and such in the Makefiles manually.
After that the program will hopefully build.
Once it builds check the source for Linux-specific stuff like getuid and whatever, and Linux paths, and edit them out and/or replace by more Amiga-friendly stuff...
Steffen
|
|
Status: Offline |
|
|