|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64405 Use freetype-config for determining freetype2 dir(s)
Submitted: 2013-03-11 12:45 UTC Modified: 2013-12-11 22:04 UTC
From: Assigned: aharvey
Status: Closed Package: GD related
PHP Version: 5.4.12 OS:
Private report: No CVE-ID:
 [2013-03-11 12:45 UTC]
Currently PHP does not use pkg-config to determine the location of freetype2 
header files. Instead it looks for freetype.h in a set of dirs. On e.g multilib 
systems this causes ./configure to fail when using --with-freetype-dir

pkg-config --cflags freetype2                                                                                                                                                                                                           
-I/usr/lib64/freetype2/include/freetype2 -I/usr/lib64/freetype2/include 

And header files like:

Downstream bug:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-12-11 21:19 UTC] pgnet dot dev+phpbugs at gmail dot com
referencing my duplicate #66259, pkg-config or freetype-config are flexible options.  here, they produce different results:

	pkg-config --cflags --libs freetype2
		-I/usr/include/freetype2  -lfreetype  

	freetype-config --cflags --libs
		-lfreetype -lz -lpng15

a quick workaround @ php config-time, changing both

	perl -pi -e 's|(FREETYPE2_INC_DIR)=.*|$1=\$i/include|g'               ./configure
	perl -pi -e 's|freetype2/freetype/freetype.h|freetype2/freetype.h|g'  ./configure


	export CPPFLAGS="`pkg-config --cflags freetype2`"

which 'fixes' missing incorrect path references in GD ext, allows config & build to complete.
 [2013-12-11 22:04 UTC]
-Summary: Use pkg-config for determining freetype2 dir(s) +Summary: Use freetype-config for determining freetype2 dir(s) -Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2013-12-11 22:04 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2013-12-20 03:23 UTC] vidurri at hotmail dot com
Solution in bug #66328 by Rafael Rocha Vidaurri

Let's search for the file on both directories replacing (on PHP "configure" file):
if test -f "$i/include/freetype2/freetype/freetype.h"; then

if test -f "$i/include/freetype2/freetype/freetype.h" || test -f "$i/include/freetype2/freetype.h";  then

Bye ;)
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sat Nov 28 20:01:31 2015 UTC