diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2009-04-05 16:43:38 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2009-04-05 16:43:38 +0000 |
commit | 18df927f7b9c302f5eb6eaed63a8fdf209c64552 (patch) | |
tree | b949936e4f9abe11692375b4c0567790663b964b /lib/fontconfig/fc-cache | |
parent | 3f1e1ec27086e513778a2fc86e249a11ab92fe41 (diff) |
Update to fontconfig 2.6.0. ok naddy@
this uses a patched version of libtool to fix linking on vax.
Diffstat (limited to 'lib/fontconfig/fc-cache')
-rw-r--r-- | lib/fontconfig/fc-cache/Makefile.am | 17 | ||||
-rw-r--r-- | lib/fontconfig/fc-cache/Makefile.in | 48 | ||||
-rw-r--r-- | lib/fontconfig/fc-cache/fc-cache.1 | 77 | ||||
-rw-r--r-- | lib/fontconfig/fc-cache/fc-cache.c | 58 |
4 files changed, 136 insertions, 64 deletions
diff --git a/lib/fontconfig/fc-cache/Makefile.am b/lib/fontconfig/fc-cache/Makefile.am index 225b50a45..79156ae47 100644 --- a/lib/fontconfig/fc-cache/Makefile.am +++ b/lib/fontconfig/fc-cache/Makefile.am @@ -1,5 +1,5 @@ # -# $Xorg: Makefile.am,v 1.1.1.1 2006/11/25 18:42:47 matthieu Exp $ +# $Id: Makefile.am,v 1.5 2009/04/05 16:43:36 matthieu Exp $ # # Copyright © 2003 Keith Packard # @@ -27,21 +27,28 @@ FC_CACHE_SRC=${top_srcdir}/fc-cache SGML = ${FC_CACHE_SRC}/fc-cache.sgml +if OS_WIN32 +else install-data-local: -$(mkinstalldirs) "$(DESTDIR)$(fc_cachedir)" uninstall-local: -$(RM) -rf "$(DESTDIR)$(fc_cachedir)" +endif -INCLUDES=-I${top_srcdir} -I${top_srcdir}/src $(FREETYPE_CFLAGS) $(WARN_CFLAGS) +INCLUDES=-I${top_srcdir} -I${top_srcdir}/src $(WARN_CFLAGS) bin_PROGRAMS=fc-cache -EXTRA_DIST=fc-cache.sgml +BUILT_MANS=fc-cache.1 + +if ENABLE_DOCS +man_MANS=${BUILT_MANS} +endif -fc_cache_LDADD = ${top_builddir}/src/libfontconfig.la $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT_LIBS) +EXTRA_DIST=fc-cache.sgml $(BUILT_MANS) -man_MANS=fc-cache.1 +fc_cache_LDADD = ${top_builddir}/src/libfontconfig.la if USEDOCBOOK diff --git a/lib/fontconfig/fc-cache/Makefile.in b/lib/fontconfig/fc-cache/Makefile.in index 3065f3d69..c884d7a74 100644 --- a/lib/fontconfig/fc-cache/Makefile.in +++ b/lib/fontconfig/fc-cache/Makefile.in @@ -15,7 +15,7 @@ @SET_MAKE@ # -# $Xorg: Makefile.am,v 1.1.1.1 2006/11/25 18:42:47 matthieu Exp $ +# $Id: Makefile.in,v 1.8 2009/04/05 16:43:36 matthieu Exp $ # # Copyright © 2003 Keith Packard # @@ -63,7 +63,8 @@ bin_PROGRAMS = fc-cache$(EXEEXT) subdir = fc-cache DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(install_sh) -d @@ -74,18 +75,12 @@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) fc_cache_SOURCES = fc-cache.c fc_cache_OBJECTS = fc-cache.$(OBJEXT) -am__DEPENDENCIES_1 = -fc_cache_DEPENDENCIES = ${top_builddir}/src/libfontconfig.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) +fc_cache_DEPENDENCIES = ${top_builddir}/src/libfontconfig.la DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ @@ -128,6 +123,8 @@ DLLTOOL = @DLLTOOL@ DOCDIR = @DOCDIR@ DOCMAN3 = @DOCMAN3@ DOCSRC = @DOCSRC@ +DOLT_BASH = @DOLT_BASH@ +DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -160,20 +157,23 @@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIBT_CURRENT = @LIBT_CURRENT@ +LIBT_CURRENT_MINUS_AGE = @LIBT_CURRENT_MINUS_AGE@ +LIBT_REVISION = @LIBT_REVISION@ +LIBT_VERSION_INFO = @LIBT_VERSION_INFO@ LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ LIBXML2_LIBS = @LIBXML2_LIBS@ LN_S = @LN_S@ +LTCOMPILE = @LTCOMPILE@ +LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ -LT_CURRENT = @LT_CURRENT@ -LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ -LT_REVISION = @LT_REVISION@ -LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MS_LIB_AVAILABLE_FALSE = @MS_LIB_AVAILABLE_FALSE@ MS_LIB_AVAILABLE_TRUE = @MS_LIB_AVAILABLE_TRUE@ +NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ ORTH_FILES = @ORTH_FILES@ @@ -188,6 +188,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ +SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ @@ -200,7 +201,9 @@ ac_ct_AS = @ac_ct_AS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@ ac_ct_F77 = @ac_ct_F77@ +ac_ct_NMEDIT = @ac_ct_NMEDIT@ ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ @@ -249,10 +252,11 @@ target_alias = @target_alias@ DOC2MAN = docbook2man FC_CACHE_SRC = ${top_srcdir}/fc-cache SGML = ${FC_CACHE_SRC}/fc-cache.sgml -INCLUDES = -I${top_srcdir} -I${top_srcdir}/src $(FREETYPE_CFLAGS) $(WARN_CFLAGS) -EXTRA_DIST = fc-cache.sgml -fc_cache_LDADD = ${top_builddir}/src/libfontconfig.la $(FREETYPE_LIBS) $(LIBXML2_LIBS) $(EXPAT_LIBS) -man_MANS = fc-cache.1 +INCLUDES = -I${top_srcdir} -I${top_srcdir}/src $(WARN_CFLAGS) +BUILT_MANS = fc-cache.1 +@ENABLE_DOCS_TRUE@man_MANS = ${BUILT_MANS} +EXTRA_DIST = fc-cache.sgml $(BUILT_MANS) +fc_cache_LDADD = ${top_builddir}/src/libfontconfig.la all: all-am .SUFFIXES: @@ -508,6 +512,8 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@OS_WIN32_TRUE@uninstall-local: +@OS_WIN32_TRUE@install-data-local: clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ @@ -577,11 +583,11 @@ uninstall-man: uninstall-man1 uninstall-local uninstall-man uninstall-man1 -install-data-local: - -$(mkinstalldirs) "$(DESTDIR)$(fc_cachedir)" +@OS_WIN32_FALSE@install-data-local: +@OS_WIN32_FALSE@ -$(mkinstalldirs) "$(DESTDIR)$(fc_cachedir)" -uninstall-local: - -$(RM) -rf "$(DESTDIR)$(fc_cachedir)" +@OS_WIN32_FALSE@uninstall-local: +@OS_WIN32_FALSE@ -$(RM) -rf "$(DESTDIR)$(fc_cachedir)" @USEDOCBOOK_TRUE@${man_MANS}: ${SGML} @USEDOCBOOK_TRUE@ $(RM) $@ diff --git a/lib/fontconfig/fc-cache/fc-cache.1 b/lib/fontconfig/fc-cache/fc-cache.1 index c07cee2eb..142bded78 100644 --- a/lib/fontconfig/fc-cache/fc-cache.1 +++ b/lib/fontconfig/fc-cache/fc-cache.1 @@ -1,4 +1,79 @@ -...\" $Header: /cvs/OpenBSD/xenocara/lib/fontconfig/fc-cache/fc-cache.1,v 1.2 2007/10/27 20:00:20 matthieu Exp $ +.\" This manpage has been automatically generated by docbook2man +.\" from a DocBook document. This tool can be found at: +.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> +.\" Please send any bug reports, improvements, comments, patches, +.\" etc. to Steve Cheng <steve@ggi-project.org>. +.TH "FC-CACHE" "1" "05 May 2008" "" "" + +.SH NAME +fc-cache \- build font information cache files +.SH SYNOPSIS + +\fBfc-cache\fR [ \fB-fsvV?\fR ] [ \fB--force\fR ] [ \fB--system-only\fR ] [ \fB--verbose\fR ] [ \fB--version\fR ] [ \fB--help\fR ] [ \fB\fIdirs\fB\fR ] + +.SH "DESCRIPTION" +.PP +\fBfc-cache\fR scans the font directories on +the system and builds font information cache files for +applications using fontconfig for their font handling. +.PP +If directory arguments are not given, +\fBfc-cache\fR uses each directory in the +current font configuration. Each directory is scanned for +font files readable by FreeType. A cache is created which +contains properties of each font and the associated filename. +This cache is used to speed up application startup when using +the fontconfig library. +.PP +Note that \fBfc-cache\fR must be executed +once per architecture to generate font information customized +for that architecture. On a subsequent run, +\fBfc-cache\fR will augment the cache +information files with the information for the new +architecture. +.SH "OPTIONS" +.PP +This program follows the usual GNU command line syntax, +with long options starting with two dashes (`-'). A summary of +options is included below. +.TP +\fB-f --force \fR +Force re-generation of apparently up-to-date cache files, +overriding the timestamp checking. +.TP +\fB-s --system-only \fR +Only scan system-wide directories, omitting the places +located in the user's home directory. +.TP +\fB-v --verbose \fR +Display status information while busy. +.TP +\fB-? --help \fR +Show summary of options. +.TP +\fB-V --version \fR +Show version of the program and exit. +.TP +\fB\fIdirs\fB \fR +A list of directories to scan for fonts. +.SH "FILES" +.TP +\fB\fIfonts.cache-2\fB\fR +These files are generated by \fBfc-cache\fR +and contain maps from file names to font properties. They are +read by the fontconfig library at application startup to locate +appropriate fonts. +.SH "SEE ALSO" +.PP +\fBfc-list\fR (1). +.PP +The fontconfig user's guide, in HTML format: +\fI/usr/share/doc/fontconfig/fontconfig-user.html\fR\&. +.SH "AUTHOR" +.PP +This manual page was written by Keith Packard +<keithp@keithp.com> and Josselin Mouette <joss@debian.org>\&. +...\" $Header: /cvs/OpenBSD/xenocara/lib/fontconfig/fc-cache/fc-cache.1,v 1.3 2009/04/05 16:43:36 matthieu Exp $ ...\" ...\" transcript compatibility for postscript use. ...\" diff --git a/lib/fontconfig/fc-cache/fc-cache.c b/lib/fontconfig/fc-cache/fc-cache.c index 078910513..9b7910500 100644 --- a/lib/fontconfig/fc-cache/fc-cache.c +++ b/lib/fontconfig/fc-cache/fc-cache.c @@ -154,35 +154,23 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, continue; } - if (access ((char *) dir, W_OK) < 0) + if (stat ((char *) dir, &statb) == -1) { switch (errno) { case ENOENT: case ENOTDIR: if (verbose) printf ("skipping, no such directory\n"); - continue; - case EACCES: - case EROFS: - /* That's ok, caches go to /var anyway. */ - /* Ideally we'd do an access on the hashed_name. */ - /* But we hid that behind an abstraction barrier. */ break; default: fprintf (stderr, "\"%s\": ", dir); perror (""); ret++; - - continue; + break; } - } - if (stat ((char *) dir, &statb) == -1) - { - fprintf (stderr, "\"%s\": ", dir); - perror (""); - ret++; continue; } + if (!S_ISDIR (statb.st_mode)) { fprintf (stderr, "\"%s\": not a directory, skipping\n", dir); @@ -214,13 +202,13 @@ scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, if (was_valid) { if (verbose) - printf ("skipping, %d fonts, %d dirs\n", + printf ("skipping, existing cache is valid: %d fonts, %d dirs\n", FcCacheNumFont (cache), FcCacheNumSubdir (cache)); } else { if (verbose) - printf ("caching, %d fonts, %d dirs\n", + printf ("caching, new cache contents: %d fonts, %d dirs\n", FcCacheNumFont (cache), FcCacheNumSubdir (cache)); if (!FcDirCacheValid (dir)) @@ -268,7 +256,6 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose) FcBool ret = FcTrue; FcBool remove; FcCache *cache; - struct stat file_stat; struct stat target_stat; dir_base = FcStrPlus (dir, (FcChar8 *) "/"); @@ -277,10 +264,11 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose) fprintf (stderr, "%s: out of memory\n", dir); return FcFalse; } - if (access ((char *) dir, W_OK|X_OK) != 0) + if (access ((char *) dir, W_OK) != 0) { if (verbose) - printf ("%s: not cleaning unwritable cache directory\n", dir); + printf ("%s: not cleaning %s cache directory\n", dir, + access ((char *) dir, F_OK) == 0 ? "unwritable" : "non-existent"); FcStrFree (dir_base); return FcTrue; } @@ -313,29 +301,24 @@ cleanCacheDirectory (FcConfig *config, FcChar8 *dir, FcBool verbose) ret = FcFalse; break; } - cache = FcDirCacheLoadFile (file_name, &file_stat); - if (!cache) - { - fprintf (stderr, "%s: invalid cache file: %s\n", dir, ent->d_name); - FcStrFree (file_name); - ret = FcFalse; - continue; - } - target_dir = FcCacheDir (cache); remove = FcFalse; - if (stat ((char *) target_dir, &target_stat) < 0) + cache = FcDirCacheLoadFile (file_name, NULL); + if (!cache) { if (verbose) - printf ("%s: %s: missing directory: %s \n", - dir, ent->d_name, target_dir); + printf ("%s: invalid cache file: %s\n", dir, ent->d_name); remove = FcTrue; } - else if (target_stat.st_mtime > file_stat.st_mtime) + else { - if (verbose) - printf ("%s: %s: cache outdated: %s\n", - dir, ent->d_name, target_dir); - remove = FcTrue; + target_dir = FcCacheDir (cache); + if (stat ((char *) target_dir, &target_stat) < 0) + { + if (verbose) + printf ("%s: %s: missing directory: %s \n", + dir, ent->d_name, target_dir); + remove = FcTrue; + } } if (remove) { @@ -486,6 +469,7 @@ main (int argc, char **argv) * library, and there aren't any signals flying around here. */ FcConfigDestroy (config); + FcFini (); sleep (2); if (verbose) printf ("%s: %s\n", argv[0], ret ? "failed" : "succeeded"); |