SDL_ttf and SDL_image with autoconf/automake/libtool


I have a projects which needs SDL_ttf and SDL_image. It also uses the
auto*/libtool tools. To find SDL I copied sdl.m4 to my m4 directory and
called AM_PATH_SDL in Then I check for SDL_ttf with

AC_CHECK_LIB(SDL_ttf, TTF_Quit, have_sdl_ttf=yes)

If it’s found I add -lSDL_ttf to LIBS through

LIBS="$LIBS -lSDL_ttf"

Same procedure with SDL_image.

All works fine if the libraries are installed in the “right” places
(eg. /usr/local). But if SDL/SDL_ttf/SDL_image is installed in eg.
~/local/lib (and I pass --with-sdl-prefix=~/local to my configure
script) and in /usr/local/lib (/usr/local/lib is another version
of the libs), libtool tries to link with SDL in ~/local and /usr/local
like this:

gcc -SOME_PARAMS -L/home/user/local/lib /home/user/local/lib/ -lm -L/usr/X11R6/lib -lX11 -lXv /home/user/local/lib/ -lpng -lz /usr/local/lib/ /usr/local/lib/ -lpthread -lfreetype …

There is no /usr/local/lib/ so the link fails.

So my question is: how do I setup the auto*/libtool tools with the SDL
library gang the right way?

So long
___ Obviously we do not want to leave zombies around.
/\ - W. Richard Stevens
( ^ > Thomas Krennwallner
/ \ 1024D/67A1DA7B 9484 D99D 2E1E 4E02 5446 DAD9 FF58 4E59 67A1 DA7B
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available

There is no /usr/local/lib/ so the link fails.

You need to install the SDL_ttf development package, available from
the SDL_ttf page on the SDL website (in the libraries section).

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment