RFR: JDK-8001922, JDK-8001927, JDK-8001921 Improve freetype detection

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Fri Oct 25 08:49:49 UTC 2013


On 2013-10-25 09:59, Magnus Ihse Bursie wrote:
> I notice that freetype was found using pkg-config, but FREETYPE_LIBS 
> is only "-lfreetype". That is weird, and possibly a bug in the 
> pkg-config description of freetype on Ubuntu 13.10. As comparison, on 
> my ancient Ubuntu 11.04, FREETYPE_LIBS gets set to 
> "-L/usr/lib/x86_64-linux-gnu -lfreetype".

I checked on a newer Ubuntu (13.04). It turns out that pkg-config is 
stripping the -L provided by the freetype pkg-config metadata file! This 
is apparantly the default behavior of pkg-config, unless 
PKG_CONFIG_ALLOW_SYSTEM_LIBS=true is set. The difference between the 
older and newer Ubuntus seems to be wether pkg-config considers the 
freetype library path to be a system library or not. :-&

I think the best way to proceed is to set PKG_CONFIG_ALLOW_SYSTEM_LIBS 
to force pkg-config to always report system libraries. There's a related 
flag for include files, I should probably turn that on just as well.

I'm still curious to how this could ever have worked before my rewrite 
-- we used pkg-config in much the same way, only we didn't try to 
compile with the flags found out in configure. Maybe that's the clue; 
that later on we included the correct library path by chance. Oh well.

/Magnus



More information about the build-dev mailing list