RFR: JDK-8001922, JDK-8001927, JDK-8001921 Improve freetype detection
Erik Joelsson
erik.joelsson at oracle.com
Fri Oct 25 09:47:01 UTC 2013
I did some experiments using jdk8/tl to avoid the new changes. Configure
succeeds and sets FREETYPE_LIBS=-lfreetype. Compilation succeeds. There
is no extra -L added to the link line. I then tried to remove -lfreetype
from the link line of libfontmanager.so and the linking is still
successful. The difference is that now ldd doesn't show freetype to be a
dependency.
I'm guessing we aren't explicitly referencing anything in freetype that
makes the linker require access to it, but use dynamic lookup at runtime?
Anyway, since the build won't fail if freetype is missing, it's even
more important to have configure fail. We should add that environment
variable on the call to pkg-config to solve this.
/Erik
On 2013-10-25 10:58, Andreas Rieber wrote:
> Hi Magnus,
>
> its not related to the ubuntu version. I have the problem on ubuntu
> 12.04. The configure of jdk8 fails with:
>
> checking if we can compile and link with freetype... no
> configure: Could not compile and link with freetype. This might be a
> 32/64-bit mismatch.
> configure: Using FREETYPE_CFLAGS=-I/usr/include/freetype2 and
> FREETYPE_LIBS=-lfreetype
> configure: error: Can not continue without freetype. You might be able
> to fix this by running 'sudo apt-get install libfreetype6-dev'.
>
> The configure in jdk8tl works fine.
>
> Andreas
>
>
> On 25.10.2013 10:49, Magnus Ihse Bursie wrote:
>> 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