Bug 104622

Summary: fontconfig.pc introduces hardcoded -I/usr/include/glib-2.0
Product: fontconfig Reporter: Mohan R <mohan43u>
Component: libraryAssignee: fontconfig-bugs
Status: RESOLVED FIXED QA Contact: Behdad Esfahbod <freedesktop>
Severity: normal    
Priority: medium CC: akira
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Mohan R 2018-01-14 09:59:42 UTC
fontconfig.pc.in contains "Cflags: -I${includedir} @EXPAT_CFLAGS@ @FREETYPE_CFLAGS@ @ICONV_CFLAGS@ @LIBXML2_CFLAGS@" which hardcodes -I/usr/include/glib-2.0 into fontconfig.pc after compilation.

when pkg-config used with PKG_CONFIG_PATH=<custompath>/usr/lib/pkgconfig:/usr/lib/pkgconfig, pkg-config puts -I/usr/include/glib-2.0 instead of -I<custompath>/usr/include/glib-2.0

I think its better to use Requires: instead of using Cflags: to include dependency libraries
Comment 1 Akira TAGOH 2018-01-14 10:11:01 UTC
No dependencies in fontconfig to glib. you might get confused with  other library.
Comment 2 Mohan R 2018-01-14 10:24:18 UTC
$ pkg-config --cflags libxml-2.0
-I/usr/include/glib-2.0

this gets into @LIBXML2_CFLAGS@ and used in fontconfig.pc.in
Comment 3 Mohan R 2018-01-14 10:32:24 UTC
apologies, not libxml2, its freetype2 which depends on harfbuzz which depends on glib2 introduces -I/usr/include/glib-2.0

$ pkg-config -cflags freetype2
-I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include

this whole line gets into @FREETYPE_CFLAGS@ and gets hardcoded into fontconfig.pc
Comment 4 Akira TAGOH 2018-01-14 10:49:58 UTC
Fixed in git

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.