Anyone building SDL Apps with just GNU / OS X?

Anyone building SDL Apps with just GNU / OS X ?

Without Project Builder or CodeWarrior ?

I’ve been building with CodeWarrior 8.3 but want to switch to just plain old GNU and makefiles.

Looking for any advise, or “gotchas”. Isn’t SDL supposed to be (have to be ?) built as Objective C on Macintosh OS X ?

Anyone building SDL Apps with just GNU / OS X ?

No, but I have done so.

Without Project Builder or CodeWarrior ?

I’ve been building with CodeWarrior 8.3 but want to switch to just plain old GNU and makefiles.

Looking for any advise, or “gotchas”. Isn’t SDL supposed to be (have to be ?) built as Objective C on Macintosh OS X ?

I had no problems compiling it as C. Why would it have to be Objective
C?

Can’t remember offhand what it was that I compiled; but I usually grab
one of Bill K’s games (Defendguin, for example) for trial runs.

Probably won’t be able to help you much beyond that: I don’t have a
Mac OS box at the moment.

-MicahOn Thu, Oct 30, 2003 at 01:32:09PM -0500, Mark Whittemore wrote:

I’ve done it once. I wanted to see if Tux Paint would build easily on OSX.
I had never really used OSX before, and sat down at a friend’s laptop which had
the GNU compiler installed (assuming it doesn’t come standard?!), and was
able to build SDL, SDL_ttf, SDL_image and (I think) SDL_mixer from source,
install it into a place in his homedir (I didn’t have root on his laptop),
and then build Tux Paint, pointing it to the SDL libs where I placed them.

So, it CAN be done. How’s that for an answer? :wink:

-bill!
bill at newbreedsoftware.com Got kids? Get Tux Paint!
http://newbreedsoftware.com/bill/ http://newbreedsoftware.com/tuxpaint/On Thu, Oct 30, 2003 at 01:32:09PM -0500, Mark Whittemore wrote:

Anyone building SDL Apps with just GNU / OS X ?

Without Project Builder or CodeWarrior ?

Mark Whittemore wrote:

Anyone building SDL Apps with just GNU / OS X ?

That’s how I build Unreal Tournament 2003 on the Mac. :slight_smile: I started
from the Linux makefiles and added in the few oddities.

There’s a few command lines that are unique to the Mac (-framework,
-faltivec, etc), but nothing that is terribly difficult.

A given UT2003/osx compile looks like this (release settings):

ccache g++ -c -I…/…/OpenAL/Inc -g -O3 -D_REENTRANT -D_NDEBUG=1
-fno-math-errno -mdynamic-no-pic -ffast-math -fexpensive-optimizations
-faltivec -pipe -fsigned-char -fshort-wchar -DMACOSX=1
-DSUPPORTS_PRAGMA_PACK=1 -DUNICODE=1 -D__FILE_NOCASE=1 -DWITH_KARMA=1
-I…/…/metoolkit/include -DDO_CHECK=0 -DDO_CHECK_SLOW=0 -DDO_GUARD=1
-DDO_GUARD_SLOW=0 -DDO_CLOCK=1 -DDO_CLOCK_SLOW=0 -DDO_STAT=1
-DDO_STAT_SLOW=0 -D__STATIC_LINK=1 -I…/…/ALAudio/Inc
-I…/…/Engine/Inc -I…/…/Vorbis/ogg/include
-I…/…/Vorbis/vorbis/include -I…/…/Core/Inc
-DGPackage=GPackageALAudio -DThisPackage=ALAudio -o
…/…/ALAudio/release-macosx-powerpc-static/ALAudioSubsystem.o
ALAudioSubsystem.cpp

As you can see, application-specific junk aside, it’s not much different
than gcc on any other platform.

SDL itself uses Objective-C and Cocoa, and controls main() (calling your
mainline after some startup code)…you don’t have to use Objective-C or
Cocoa directly, though. UT2003 makes a few Carbon calls to figure out OS
version, etc, but overwhelmingly all of the Mac stuff is hidden in SDL.

–ryan.

So, it CAN be done. How’s that for an answer? :wink:

To follow up, if you build SDL itself from source instead of through
Project Builder, you get the whole Unix treatment…it installs in
/usr/local/, gives you an “sdl-config” script, etc…works fine.

I seriously dislike Project Builder/Xcode/CodeWarrior, so this method
works great for me. I’m a commandline weenie.

–ryan.

Anyone building SDL Apps with just GNU / OS X ?

Without Project Builder or CodeWarrior ?

I’ve been doing this in a C app using the OS X SDL
framework package (which I highly recommend, since you
can embed the framework in your OS X application
bundle when it comes time to distribute it, which
means your end users wont have to compile/install the
SDL library.)

I simply grab the SDLMain.m and SDLMain.h files from
where the SDL-devel-1.2.6.pkg installer put them and
compile them into a “.o” and then basically everything
else is in C (just remember to use “-lobjc” when
compiling.)

If you want to see an example Makefile check out this
open-source app:

http://xu4.sourceforge.net/

If you download the 0.8 source code there’s a
Makefile.macosx in the “src” directory. Also check out
the OSX-relevant stuff in the “doc” directory.

Hope that helps.

http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.

Isn’t that just the same as compiling sdl in as a static lib? Actually, a
static lib would be smaller (no headers, etc).

Not being obnoxious, or anything, just thought I’d point out that the
framework isn’t doing anything special…On Thursday 30 October 2003 5:17 pm, Steven J-S wrote:

Anyone building SDL Apps with just GNU / OS X ?

Without Project Builder or CodeWarrior ?

I’ve been doing this in a C app using the OS X SDL
framework package (which I highly recommend, since you
can embed the framework in your OS X application
bundle when it comes time to distribute it, which
means your end users wont have to compile/install the
SDL library.)


D.A.Bishop

Not being obnoxious, or anything, just thought I’d point out that the
framework isn’t doing anything special…

fwiw, I skipped the framework for ut2003 and rebuilt the library to
reside in the same directory as the game binary.

–ryan.

Isn’t that just the same as compiling sdl in as a
static lib?

It would be, except for the fact that OS X doesn’t
allow you to do static linking. You can get around
this although I had endless difficulties getting my
app to run on different versions of OS X when I did it
that way. Dynamically linking with the framework and
then copying it into the app bundle is a nice
solution.

Actually, a static lib would be smaller (no
headers, etc).

That’s why there’s a non-developer version of the
framework, which doesn’t include the headers etc.

http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.On Thu, 30 Oct 2003 17:31:38 David Bishop wrote:

Hi all ,
i’m trying to build SDL for Epoc with Symbian 6.1 SDK.
I’ve followed instructions in README.Epoc but it hangs when i issue
the bldmake bldfiles command without saying nothing else.
I’ve tried the build under Windows ( not using gnupoc nor sdk2unix ).
Anyone know how to fix this problem or has some idea ?

Best Regards,
Mario Luca

the bldmake bldfiles command without saying nothing else.

That problem was related to symbian build tools that can’t be able to
handle spaces in path names.
Anyway i’ve created the visual c++ project files ( 2 workspaces one for
sdl and one for sdlmain ). When i try to build sdl it gives me a lot of
error on headers file he can’t be able to find ( related to X11 , OpenGL
and window.h ). There’s something i miss ?

Cheers,
mrlc