From 256f1881908ab49814cad4b4bf3e1cb7fc4ec359 Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor@gnu.org>
Date: Sun, 25 Feb 2018 12:36:51 +0200
Subject: [PATCH] Add font_cacher manpage, install font_cacher conditionally.

Print deprecation warning for art/xlib.
---
 ChangeLog           |  8 +++++++
 Tools/GNUmakefile   |  7 ++++--
 Tools/font_cacher.1 | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure           | 12 ++++++++++
 configure.ac        |  8 +++++++
 5 files changed, 102 insertions(+), 2 deletions(-)
 create mode 100644 Tools/font_cacher.1

diff --git a/ChangeLog b/ChangeLog
index d4872d7..8c11f19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-02-25  Yavor Doganov  <yavor@gnu.org>
+
+	* Tools/font_cacher.1: New file.
+	* Tools/GNUmakefile: Build font_cacher only if WITH_XFT=no.
+	Install the manpage conditionally.
+	* configure.ac: Add deprecation warning for art/xlib.
+	* configure: Regenerate.
+
 2018-02-09  Yavor Doganov  <yavor@gnu.org>
 
 	* Source/x11/XGServer.m (_initXContext): Call XInitThreads to
diff --git a/Tools/GNUmakefile b/Tools/GNUmakefile
index 94acb4c..29b1be1 100644
--- a/Tools/GNUmakefile
+++ b/Tools/GNUmakefile
@@ -37,8 +37,13 @@ TOOL_NAME = gpbs
 gpbs_OBJC_FILES = gpbs.m
 font_cacher_OBJC_FILES = font_cacher.m
 
+MAN1_PAGES = gpbs.1
+
 ifeq ($(BUILD_GRAPHICS),xlib)
+ifeq ($(WITH_XFT),no)
 TOOL_NAME += font_cacher
+MAN1_PAGES += font_cacher.1
+endif
 endif
 
 ifeq ($(BUILD_SERVER),x11)
@@ -53,8 +58,6 @@ ifeq ($(BUILD_SERVER),win32)
 gpbs_OBJC_FILES += win32pbs.m 
 endif
 
-MAN1_PAGES = gpbs.1
-
 -include GNUmakefile.preamble
 
 include $(GNUSTEP_MAKEFILES)/tool.make
diff --git a/Tools/font_cacher.1 b/Tools/font_cacher.1
new file mode 100644
index 0000000..0912a47
--- /dev/null
+++ b/Tools/font_cacher.1
@@ -0,0 +1,69 @@
+.\"font_cacher(1) man page
+.\"Written by Yavor Doganov <yavor@gnu.org>
+.\"Copyright (C) 2018 Free Software Foundation, Inc.
+.\"License: GPL-3+
+.TH FONT_CACHER 1 "February 2018" GNUstep "GNUstep System Manual"
+.SH NAME
+font_cacher \- font cacher for the GNUstep xlib Backend
+.SH SYNOPSIS
+\fBfont_cacher\fR [\fIoptions\fR]
+.PP
+.SH DESCRIPTION
+The
+.B font_cacher
+program generates a cache from all available X fonts.  The cache is
+stored in
+.I $HOME/GNUstep/Library/Fonts/Cache
+and is used only by the GNUstep xlib backend.  The xlib backend will
+automatically launch
+.B font_cacher
+if the cache is not available or cannot be accessed.  This can cause
+some slowness when a GNUstep application is started for the first
+time with xlib configured as backend.
+.PP
+Normally, the
+.B font_cacher
+program is used without options.
+.PP
+.SH OPTIONS
+.TP
+\fB\--version\fR
+Displays version information.  (Not implemented.)
+.TP
+\fB\--help\fR
+Prints the exact location of the file where the font cache will be
+written.
+.TP
+\fB\--GNU-Debug=\fR\fIdflt\fR
+Displays progress and other debugging information while generating the
+cache.  (This is a global
+.I GNUstep
+option.)
+.PP
+.SH BUGS AND LIMITATIONS
+If
+.I $HOME/GNUstep/Library
+does not exist,
+.B font_cacher
+will fail and the directory must be created manually.
+.PP
+When fonts are installed or removed, the program must be invoked
+explicitly to update the cache.  There is no way to handle this
+automatically.
+.PP
+.SH SEE ALSO
+Defaults related to the GNUstep Backend:
+.I $GNUSTEP_DOC/Developer/Back/General/DefaultsSummary.html
+.PP
+.SH AUTHORS
+.B font_cacher
+was written by Fred Kiefer <FredKiefer@gmx.de> and Richard
+Frith-Macdonald <rfm@gnu.org>.
+.PP
+This manual page was written by Yavor Doganov <yavor@gnu.org>.
+.SH COPYING
+\(co 2018 Free Software Foundation, Inc.
+.PP
+This manual page is distributed under the same license as the
+.B font_cacher
+program.
diff --git a/configure b/configure
index 3a7c0d8..8035be5 100755
--- a/configure
+++ b/configure
@@ -8625,3 +8625,15 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
+if test $BUILD_GRAPHICS = art || test $BUILD_GRAPHICS = xlib; then :
+
+cat <<EOF
+## ------- ##
+## WARNING ##
+## ------- ##
+You are about to build the $BUILD_GRAPHICS backend which is deprecated
+and likely to be removed in the future.
+EOF
+
+fi
diff --git a/configure.ac b/configure.ac
index 38dd6f4..0e5c65e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -782,3 +782,11 @@ AC_SUBST(BACKEND_NAME)
 
 AC_CONFIG_FILES([back.make config.make])
 AC_OUTPUT
+
+AS_IF([test $BUILD_GRAPHICS = art || test $BUILD_GRAPHICS = xlib], [
+cat <<EOF
+m4_text_box([WARNING])
+You are about to build the $BUILD_GRAPHICS backend which is deprecated
+and likely to be removed in the future.
+EOF
+])
-- 
2.16.2

