[MPlayer-users] zlib and fontconfig

John Brown johnbrown105 at hotmail.com
Fri Nov 3 03:52:30 CET 2006


Nicholas Schell wrote:
>Interesting problem came up for me when attempting to build mplayer with a
>static fontconfig, thanks to reimar's recent patches. Building in a
>MSYS-MinGW environment (windows obviously, I hope you are still reading) 
>and
>building zlib, libiconv, freetype, expat and fontconfig all as static. Also
>not using any --enable parameters for external libs at mplayer configure,
>only the following:
>
>./configure --prefix=mplayer_install --enable-runtime-cpudetection
>
>Freetype can make use of zlib and this becomes a problem because freetype
>itself is also a dependency of fontconfig. When mplayer attempts to find
>fontconfig it will only add -lexpat -lfreetype, but not -lz with ld. It 
>will
>throw out errors from freetype that point to functions which make use of
>zlib (inflate*).
<snip>
>
>Thus in the end causing the fontconfig check to come back negative, so no
>static fontconfig in mplayer. I manually added -lz into the ld settings for
>fontconfig in the configure file and this seemed to "solve" the issue. The
>above errors don't appear and the fontconfig check comes back positive.
>Previously I had been building freetype, expat, and fontconfig as shared
>libs with mplayer and none of these issues came up (I also had freetype
>depending on zlib at this time). Should this be something fixed in the
>configure file? Or perhaps just an extra meaningless parameter,
>--with-freetype-lz ?, or am I just a fool for building freetype with zlib.
>Hopefully not a windows only issue :(.

I am on Windows too, so I don't know.

>
>My "solution" was just adding another else if for the fontconfig ld
>settings.
>  elif cc_check -lfontconfig -lexpat -lfreetype -lz ; then
>    _ld_fontconfig="-lfontconfig -lexpat -lfreetype -lz"
>
MPlayer (and every program that depends on freetype, fontconfig, etc.) gets 
this information from pkg-config scripts, so what I normally do in a case 
like this is edit the scripts. So if freetype2.pc says:
Libs: -L${libdir} -lfreetype
I add -lz to it. fontconfig.pc had only -lfontconfig, if I recall correctly. 
I manually added -lexpat -lfreetype -lz.

Reimar's patch will fix MPlayer, but if one day you should try to compile 
another application that depends on fontconfig (or any of the many libraries 
that MPlayer can use but does not have a "correct" pkg-config script), you 
will probably run into the same problem. Fix the relevant .pc file, and you 
solve the problem permanently.
>
>Also previously with a shared fontconfig mplayer build, a friend and I
>noticed we could control the location of the fonts.conf by making a very
>small edit in the fontconfig src. Line 1468 in "fontconfig/src/fccfg.c"
>change "\\etc\\fonts" to "\\mplayer". Just a handy thing he actually 
>thought
>of in order to put all of the .conf files in one folder. However with a
>static fontconfig compile we noticed that no longer works, and were 
>guessing
>that there was something in the mplayer code itself which is controlling
>where it expects to find fonts.conf, because it now only works in
>"/etc/fonts". Any idea where that is, or if that is true at all?

Editing the source should not be necessary. fontconfig's configure script 
has a parameter --with-confdir=DIR. I have not tried it myself, but see if 
it works for you.

_________________________________________________________________
Get today's hot entertainment gossip  
http://movies.msn.com/movies/hotgossip?icid=T002MSN03A07001




More information about the MPlayer-users mailing list