[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] SDL_ttf linking

From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] SDL_ttf linking
Date: Sun, 9 May 2010 02:31:29 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Martin Gerhardy <address@hidden> schrieb:
> btw. SDL_ttf isn't linked statically against freetype. Is that correct
> and intended?

It _is_ statically linked, but statically linked libraries do not
include each other, i.e. you'll have to state all dependency libs

The same holds e.g. for libpng which depends on zlib. So if you
link an application against the static libpng, you'll have to
use the flags "-lpng -lz" and not just "-lpng".

> There is nothing like pkg-config --libs or sdl-ttf-config --libs.

That's the failure of SDL_ttf. I don't know why they don't provide
*.pc files.

We could provide some, but those would be unofficial and not portable.
You could try to persuade the SDL_ttf project into providing a *.pc
file, if you have some time for that. :-)

> It's
> not very nice to add a hardcoded -lfreetype to my configure.ac to fix
> this. Any ideas?

Simply check for Freetype before checking for SDL_ttf. That way,
if Freetype is available, it is added to $LIBS and thus available
when the system checks for SDL_ttf.

However, the check for Freetype shouldn't be mandatory, i.e. it
should be allowed to fail, because not every system that provides
SDL_ttf also provides Freetype.

So your configure.ac code should look like that:

    PKG_CHECK_MODULES([FREETYPE], [freetype2],
    AC_CHECK_LIB([SDL_ttf], ...)



Volker Grabsch
NotJustHosting GbR

reply via email to

[Prev in Thread] Current Thread [Next in Thread]