Bug 420 - X fails to build because of fontconfig
Summary: X fails to build because of fontconfig
Alias: None
Product: xorg
Classification: Unclassified
Component: Build/Monolithic (show other bugs)
Version: 6.7.0
Hardware: x86 (IA32) FreeBSD
: high critical
Assignee: Xorg Project Team
QA Contact:
: 598 (view as bug list)
Depends on:
Reported: 2004-04-07 15:34 UTC by John Hixson
Modified: 2011-10-15 16:14 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

patch to X11.tmpl in order to build with freetype in /usr/X11R6 (1.01 KB, patch)
2004-04-18 19:16 UTC, rtuck99
no flags Details | Splinter Review

Description John Hixson 2004-04-07 15:34:02 UTC
X will die with the following error(s),

In file included from /usr/include/stdlib.h:40,
                 from ../../extras/fontconfig/src/fcint.h:28,
                 from fcatomic.c:50:
/usr/include/sys/cdefs.h:273: warning: `_POSIX_C_SOURCE' is not defined
/usr/include/sys/cdefs.h:279: warning: `_POSIX_C_SOURCE' is not defined
In file included from ../../extras/fontconfig/src/fcint.h:39,
                 from fcatomic.c:50:
../../exports/include/fontconfig/fcfreetype.h:27: ft2build.h: No such file or
../../exports/include/fontconfig/fcfreetype.h:28: `#include' expects "FILENAME"
Comment 1 John Hixson 2004-04-07 22:48:22 UTC
sorry, this happens on a FreeBSD 4.9-STABLE box, freetype and fontconfig give me
hell, rather i specify to use them or not, the build still fails with the errors.
Comment 2 rtuck99 2004-04-18 03:38:00 UTC

I am having similar problems - I have freetype 2.1.7 and fontconfig-2.2.2 already installed in /usr/
X11R6 - when I compile with the default configuration (on linux) I get
gcc -c -O2 -fno-strength-reduce  -ansi -pedantic -Wall -Wpointer-arith -Wundef   -I/usr/include/
freetype2 -I/usr/include/freetype2/config -I../../extras/fontconfig/src         -I../../extras/fontconfig 
-I../../exports/include/X11  -I../.. -I../../exports/include   -Dlinux -D__i386__ 
-DFONTCONFIG_PATH='"/etc/fonts"'  -DXVENDORNAME='"The X.Org Foundation"' 
-DXVENDORNAMESHORT='"X.Org"'    -fPIC fcatomic.c
In file included from ../../extras/fontconfig/src/fcint.h:39,
                 from fcatomic.c:50:
../../extras/fontconfig/fontconfig/fcfreetype.h:27:22: ft2build.h: No such file or directory
../../extras/fontconfig/fontconfig/fcfreetype.h:28:10: #include expects "FILENAME" or <FILENAME>
In file included from ../../extras/fontconfig/src/fcint.h:39,
                 from fcatomic.c:50:
../../extras/fontconfig/fontconfig/fcfreetype.h:31: parse error before "FcFreeTypeCharIndex"

It looks as though Xorg expects them to be installed in /usr and it doesn't bother to check freetype-
config to see where they really are.
Comment 3 Alan Coopersmith 2004-04-18 03:54:23 UTC
Try adding lines like this to xc/config/cf/host.def to change where it looks
for preinstalled versions of FreeType & FontConfig:
#define Freetype2Dir /usr/X11R6
#define FontconfigDir /usr/X11R6

See the section for these in xc/config/cf/X11.tmpl if you need finer control
over where it looks for libs & headers than just looking in the lib & include
subdirs of the dirs listed.
Comment 4 rtuck99 2004-04-18 04:21:29 UTC
I think I have part of the problem:

ft2build.h resides in /usr/X11R6/include, not /usr/X11R6/include/freetype2

I think adding this to FREETYPE2INCLUDES in X11.tmpl should fix this - will report back if it works.

Comment 5 rtuck99 2004-04-18 19:16:41 UTC
Created attachment 210 [details] [review]
patch to X11.tmpl in order to build with freetype in /usr/X11R6


attached is the patch I applied to get X11R6.70 to build on my system. I didn't
change the host.def. You may need to change Freetype2Dir to taste...
Other things I did was remove all old copies of libfreetype.a from my
/usr/X11R6/lib and /usr/X11R6/lib/modules/fonts directories (these were causing
duplicate symbol errors when running X)
According to the RELNOTES there isn't any need to mess around with fontconfig
and it seems this is accurate as I have had no problems with it.
Comment 6 Egbert Eich 2004-05-07 03:49:34 UTC
*** Bug 598 has been marked as a duplicate of this bug. ***
Comment 7 Egbert Eich 2004-05-07 03:54:21 UTC
You must either install the development packages of libfreetype
or set
#define HasFreetype2 NO
in config/cf/host.def.
With the latest CVS sources this is required if you have 2.1.7 as we 
now depend on a feature introduced in 2.1.8.

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.