Discussion:
SDL on osX
Benjamin Grauer
2005-10-23 14:34:54 UTC
Permalink
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
Jeff Jackowski
2005-10-25 01:29:58 UTC
Permalink
Post by Benjamin Grauer
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.
--
Jeff Jackowski
http://ro.com/~jeffj/
Benjamin Grauer
2005-10-25 07:25:58 UTC
Permalink
Post by Jeff Jackowski
Post by Benjamin Grauer
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
Christian Walther
2005-10-26 11:57:34 UTC
Permalink
Post by Benjamin Grauer
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
Donny Viszneki
2005-10-25 05:28:47 UTC
Permalink
Post by Benjamin Grauer
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
Post by Benjamin Grauer
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

Ciao

Continue reading on narkive:
Loading...