Take a look at the nano second in the mtime to figure out
if the cache needs to be updated if available.
and do the mutex lock between scanning and writing a cache
to avoid the conflict.
Also we don't need to scan directories again after writing
caches. so getting rid of the related code as well.
https://bugs.freedesktop.org/show_bug.cgi?id=69845
and for reference:
https://bugzilla.redhat.com/show_bug.cgi?id=1236034
As of automake-13.1 the INCLUDES directive is no longer supported.
An automake run will return with an error.
This changeset simply follows automake's advice to replace INCLUDES
by AM_CPPFLAGS.
Add an ability to set the system root to generate the caches.
In order to do this, new APIs, FcConfigGetSysRoot() and
FcConfigSetSysRoot() is available.
$< isn't supported in BSD make say. $(RM) is pre-defined in GNU make
though, not in BSD make say. so changed to check on configure if it's
pre-defined by make, otherwise set the appropriate command to $(RM).
This would be a workaround until it has the certain pre-defined value.
Added -h instead of -?. And upon -h and --help, write usave to stdout
instead of stdin, and return 0 instead of 1.
-? still works like before as that's what getopt returns upon unknown
arguments.
Fix a couple of longstanding problems with fontconfig on Windows that
manifest themselves especially in GIMP. The root cause to the problems is in
Microsoft's incredibly stupid stat() implementation. Basically, stat()
returns wrong timestamp fields for files on NTFS filesystems on machines
that use automatic DST switching.
See for instance http://bugzilla.gnome.org/show_bug.cgi?id=154968 and
http://www.codeproject.com/datetime/dstbugs.asp
As fccache.c now looks at more fields in the stat struct I fill in them all.
I noticed that fstat() is used only on a fd just after opening it, so on
Win32 I just call my stat() replacement before opening instead...
Implementing a good replacement for fstat() would be harder because the code
in fccache.c wants to compare inode numbers. There are no (readily
accessible) inode numbers on Win32, so I fake it with the hash of the full
file name, in the case as it is on disk. And fstat() doesn't know the full
file name, so it would be rather hard to come up with a inode number to
identify the file.
The patch also adds similar handling for the cache directory as for the fonts
directory: If a cachedir element in fonts.conf contains the magic string
"WINDOWSTEMPDIR_FONTCONFIG_CACHE" it is replaced at runtime with a path under
the machine's (or user's) temp folder as returned by GetTempPath(). I don't
want to hardcode any pathnames in a fonts.conf intended to be distributed to
end-users, most of which who wouldn't know how to edit it anyway. And
requiring an installer to edit it gets complicated.
Old cache file versions, or corrupted cache files should be removed when
cleaning cache directories with fc-cache. This only affects filenames which
match the fontconfig cache file format, so other files will be left alone.
Some mingw versions have broken X_OK checking; instead of trying to work
around this in a system-depedent manner, simply don't bother checking for
X_OK along with W_OK as such cases are expected to be mistakes, and not
sensible access control.
fc-cache would say 'skipping: %d fonts, %d dirs' or 'caching: %d fonts, %d
dirs', which could easily mislead the user. Add 'existing cache is valid' or
'new cache contents' to these messages to explain what it is doing.
This call was followed by a call to stat(2) which provided the necessary
information. This call to access(2) was necessary when cache files were
stored in the font directory as that would check for write permission
correctly.
Use filenames to clean cache files for current architecture only. This is
sufficient as cache files live in their own directory where filenames are
under fontconfig control.
Looks like the last directory in the project which didn't use $(WARN_CFLAGS)
for some reason. Adding that found the usual collection of char * vs FcChar8
* issues (why, oh why is FcChar8 not just char...)