[PATCH libXfont 1/2] config: notify about fontserver support in .pc file
Tiago Vignatti
tiago.vignatti at nokia.com
Wed May 26 09:44:40 PDT 2010
Some X servers don't want font server support and libxfont should notify them
when it happens. So introduce FONTSERVER definition for this case that can be
used on X server side to track about its existence.
In my machine, I see 20kB of RSS being saved in libXfont mapped in Xorg
process when I disabled font server support and other kind of fonts in the
library. I used something like this: --disable-pcfformat --disable-bdfformat
--disable-snfformat --disable-freetype --disable-fc
The default library built was taking:
text data bss dec hex filename
261743 4472 1536 267751 415e7 ./lib/libXfont.so
and with these flags, it jumps to:
text data bss dec hex filename
157684 2420 1188 161292 2760c ./lib/libXfont.so
Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
configure.ac | 5 ++++-
xfont.pc.in | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 35ac80b..19ec1e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -175,8 +175,11 @@ AC_ARG_ENABLE(fc, [ --disable-fc ],[XFONT_FC=$enableval],[XFONT_FC=yes])
AM_CONDITIONAL(XFONT_FC, [test "x$XFONT_FC" = xyes])
if test "x$XFONT_FC" = xyes; then
AC_DEFINE(XFONT_FC,1,[Support the X Font Services Protocol])
-fi
+ # used on the Xserver side
+ FONTSERVER_DEFINE="-DFONTSERVER"
+fi
+AC_SUBST(FONTSERVER_DEFINE)
AC_CHECK_LIB(m, hypot, [MATH_LIBS=-lm
AC_SUBST(MATH_LIBS)], AC_MSG_ERROR([*** libm is required]))
diff --git a/xfont.pc.in b/xfont.pc.in
index f08dea0..afffe88 100644
--- a/xfont.pc.in
+++ b/xfont.pc.in
@@ -8,6 +8,6 @@ Description: X font Library
Version: @VERSION@
Requires: xproto fontsproto
Requires.private: fontenc @FREETYPE_REQUIRES@
-Cflags: -I${includedir}
+Cflags: -I${includedir} @FONTSERVER_DEFINE@
Libs: -L${libdir} -lXfont
Libs.private: @Z_LIBS@ -lm
--
1.7.1.226.g770c5
More information about the xorg-devel
mailing list