[PATCH] configure: introduce --{enable, disable}-fontserver

Tiago Vignatti tiago.vignatti at nokia.com
Tue Apr 13 03:36:19 PDT 2010


Some system might not want font servers support. This patch is sort of revert
of f3b29efc.

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 +++++
 dix/dixfonts.c          |    2 ++
 include/dix-config.h.in |    3 +++
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4c1034f..b36bc74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -635,6 +635,7 @@ AC_ARG_ENABLE(tslib,          AS_HELP_STRING([--enable-tslib], [Build kdrive tsl
 AC_ARG_ENABLE(multibuffer,    AS_HELP_STRING([--enable-multibuffer], [Build Multibuffer extension (default: disabled)]), [MULTIBUFFER=$enableval], [MULTIBUFFER=no])
 AC_ARG_ENABLE(dbe,            AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
 AC_ARG_ENABLE(xf86bigfont,    AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no])
+AC_ARG_ENABLE(fontserver,     AS_HELP_STRING([--disable-fontserver], [Build support for font servers (default: enabled)]), [FONTSERVER=$enableval], [FONTSERVER=yes])
 AC_ARG_ENABLE(dpms,           AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
 AC_ARG_ENABLE(config-udev,    AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto])
 AC_ARG_ENABLE(config-dbus,    AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no])
@@ -1126,6 +1127,10 @@ else
 fi
 AM_CONDITIONAL(XCALIBRATE, [test "x$XCALIBRATE" = xyes])
 
+if test "x$FONTSERVER" = xyes; then
+        AC_DEFINE(FONTSERVER, 1, [Use font servers])
+fi
+
 AC_DEFINE(RENDER, 1, [Support RENDER extension])
 RENDER_LIB='$(top_builddir)/render/librender.la'
 RENDER_INC='-I$(top_srcdir)/render'
diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index 6dc8193..e225e52 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1926,7 +1926,9 @@ InitFonts (void)
 
     BuiltinRegisterFpeFunctions();
     FontFileRegisterFpeFunctions();
+#ifdef FONTSERVER
     fs_register_fpe_functions();
+#endif
 }
 
 int
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 058c8fd..b827a6a 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -21,6 +21,9 @@
 /* Default font path */
 #undef COMPILEDDEFAULTFONTPATH
 
+/* Use font servers */
+#undef FONTSERVER
+
 /* Miscellaneous server configuration files path */
 #undef SERVER_MISC_CONFIG_PATH
 
-- 
1.6.0.4



More information about the xorg-devel mailing list