SDL on osX

hi there

i am trying to include a good test for
SDL
SDL_ttf
SDL_image
on mac OSX
into my configure.ac

so far, the configure.ac script does not like my including
LIBS="$LIBS -framework SDL -framework SDL_ttf -framework SDL_image"

if i afterwards check for the Headers
SDL/SDL.h -> found
SDL/SDL_ttf.h -> !! NOT FOUND !!

does anyone know how to do this properly (in a configure.ac)??
cheers
benjamin–
visit the worlds most furious open-source 3D-action game
http://www.orxonox.net

hi there

i am trying to include a good test for
SDL
SDL_ttf
SDL_image
on mac OSX
into my configure.ac

so far, the configure.ac script does not like my including
LIBS="$LIBS -framework SDL -framework SDL_ttf -framework SDL_image"

if i afterwards check for the Headers
SDL/SDL.h -> found
SDL/SDL_ttf.h -> !! NOT FOUND !!

does anyone know how to do this properly (in a configure.ac)??

You could try installing SDL, SDL_ttf, and SDL_image from source, adding
/usr/local/bin (I think; it’ll be wherever sdl-config shows up) to your
path (I remeber editing /etc/profile to do this), and use the non-OSX way
of linking ("-lSDL -lSDL_ttf -lSDL_image"). That is how I got a game I’m
working on now to build on OS X using the makefile that I use on Linux. It
took a while for all that installing, but it saved me from having to find
another way to build the program.On Sun, 23 Oct 2005, Benjamin Grauer wrote:


Jeff Jackowski
http://ro.com/~jeffj/

Jeff Jackowski wrote:>On Sun, 23 Oct 2005, Benjamin Grauer wrote:

hi there

i am trying to include a good test for
SDL
SDL_ttf
SDL_image
on mac OSX
into my configure.ac

so far, the configure.ac script does not like my including
LIBS="$LIBS -framework SDL -framework SDL_ttf -framework SDL_image"

if i afterwards check for the Headers
SDL/SDL.h -> found
SDL/SDL_ttf.h -> !! NOT FOUND !!

does anyone know how to do this properly (in a configure.ac)??

You could try installing SDL, SDL_ttf, and SDL_image from source, adding
/usr/local/bin (I think; it’ll be wherever sdl-config shows up) to your
path (I remeber editing /etc/profile to do this), and use the non-OSX way
of linking ("-lSDL -lSDL_ttf -lSDL_image"). That is how I got a game I’m
working on now to build on OS X using the makefile that I use on Linux. It
took a while for all that installing, but it saved me from having to find
another way to build the program.

Thanks for the answer, but what i mean is, if it would be possible, to
build my game with the BUILT-IN Frameworks, that osX is so proud of. It
would be much nicer to use them because then the game would be really
native, and not dependent of externally built libraries

-> so what i would need, is a check in configure.ac for the SDL.framework

if someone knows about this, it would be greate, otherwise, i really use
the fink-libs, and compile SDL_ttf from source


visit the worlds most furious open-source 3D-action game
http://www.orxonox.net

SDL/SDL.h -> found
SDL/SDL_ttf.h -> !! NOT FOUND !!

does anyone know how to do this properly (in a configure.ac)??

I deal with this on a regular basis, it’s pretty simple.

Firstly, if you’d read the SDL docs properly you’d know you aren’t
supposed to include “SDL/SDL.h”, you are supposed to include “SDL.h”.

Now to continue down that vein, you should pass compiler flags like
these:

-I/Library/Frameworks/SDL.framework/Headers
-I/Library/Frameworks/SDL_image.framework/Headers
-I/Library/Frameworks/SDL_ttf.framework/Headers

so far, the configure.ac script does not like my including
LIBS="$LIBS -framework SDL -framework SDL_ttf -framework SDL_image"

Your linker flags are alright, however I’ve noticed most
autoconf-generated configure scripts check for the existence of a
main() routine resulting from trying to link a main-less program to
SDL. The problem then is that you must also link to libSDLmain.a, which
you will generally do by using the linker flag -lSDlmain. If
libSDLmain.a isn’t in your linker’s search path, you’ll have to add it
to your linker’s search path using -L/path/to/libSDLmain.a. To give you
some idea where to find it, in the source distribution, before
installing, it ends up here: SDL-1.2.8/src/main/libSDLmain.a

CiaoOn Oct 23, 2005, at 10:34 AM, Benjamin Grauer wrote:

Benjamin Grauer wrote:

so far, the configure.ac script does not like my including
LIBS="$LIBS -framework SDL -framework SDL_ttf -framework SDL_image"

if i afterwards check for the Headers
SDL/SDL.h -> found
SDL/SDL_ttf.h -> !! NOT FOUND !!

I know approximately nothing about autoconf (I’m using Xcode on Mac OS X
and custom makefiles for Linux and Mingw), but what you write doesn’t
look surprising to me - SDL_ttf.h is not in SDL.framework, but in
SDL_ttf.framework, so I’d try checking for “SDL_ttf/SDL_ttf.h” rather
than “SDL/SDL_ttf.h”. (And in the source code, you should ‘#include
"SDL_ttf.h"’ anyway and have the build system specify its path to the
compiler.)

-Christian

so far, the configure.ac script does not like my
including LIBS="$LIBS -framework SDL -framework
SDL_ttf -framework SDL_image"

Your linker flags are alright, however I’ve noticed most
autoconf-generated configure scripts check for the existence
of a main() routine resulting from trying to link a
main-less program to SDL. The problem then is that you must
also link to libSDLmain.a, which you will generally do by
using the linker flag -lSDlmain.

The framework version of the SDL library doesn’t come with a
libSDLmain.a… but it does come with an SDLmain.h and an SDLmain.m
file instead (they’re in the devel-lite directory of the
SDL-1.2.9.dmg file.)

When using the frameworks you build these files instead of linking
against a pre-built libSDLmain.a. E.g.:

gcc -I/Library/Frameworks/SDL.framework/Headers -c -o SDLMain.o

SDLMain.m

To make life easier when I’m trying to build autoconf based apps, I
created a custom sdl-config script so that configure can find my
SDLMain.o file. Its outputs are:

$ sdl-config --cflags
-F/Library/Frameworks -I/Library/Frameworks/SDL.framework/Headers

$ sdl-config --libs
/Users/username/path-to-SDL-stuff/SDLMain.o -L/Library/Frameworks

-framework Cocoa -framework SDL -lobjc____________________________________________________
Do you Yahoo!?
Messenger 7.0: Free worldwide PC to PC calls