diff options
Diffstat (limited to 'fontconfig')
-rw-r--r-- | fontconfig/Makefile.am | 12 | ||||
-rw-r--r-- | fontconfig/conf.d/40-nonlatin.conf | 8 | ||||
-rw-r--r-- | fontconfig/conf.d/Makefile.am | 8 | ||||
-rw-r--r-- | fontconfig/configure.in | 9 | ||||
-rw-r--r-- | fontconfig/doc/Makefile.am | 50 | ||||
-rw-r--r-- | fontconfig/fc-cache/Makefile.am | 10 | ||||
-rw-r--r-- | fontconfig/fc-cache/fc-cache.c | 81 | ||||
-rw-r--r-- | fontconfig/fc-case/Makefile.am | 4 | ||||
-rw-r--r-- | fontconfig/fc-cat/Makefile.am | 8 | ||||
-rw-r--r-- | fontconfig/fc-glyphname/Makefile.am | 4 | ||||
-rw-r--r-- | fontconfig/fc-lang/Makefile.am | 4 | ||||
-rw-r--r-- | fontconfig/fc-list/Makefile.am | 8 | ||||
-rw-r--r-- | fontconfig/fc-match/Makefile.am | 8 | ||||
-rw-r--r-- | fontconfig/fc-pattern/Makefile.am | 8 | ||||
-rw-r--r-- | fontconfig/fc-query/Makefile.am | 8 | ||||
-rw-r--r-- | fontconfig/fc-scan/Makefile.am | 8 | ||||
-rw-r--r-- | fontconfig/src/Makefile.am | 10 | ||||
-rw-r--r-- | fontconfig/src/fcarch.c | 4 | ||||
-rw-r--r-- | fontconfig/src/fcarch.h | 23 | ||||
-rw-r--r-- | fontconfig/src/fcmatch.c | 19 |
20 files changed, 206 insertions, 88 deletions
diff --git a/fontconfig/Makefile.am b/fontconfig/Makefile.am index ed3065030..9342f8e80 100644 --- a/fontconfig/Makefile.am +++ b/fontconfig/Makefile.am @@ -71,7 +71,7 @@ $(srcdir)/ChangeLog: if test -d "$(srcdir)/.git"; then \ (GIT_DIR=$(top_srcdir)/.git ./missing --run git log --stat) | fmt --split-only > $@.tmp \ && mv -f $@.tmp $@ \ - || (rm -f $@.tmp; \ + || ($(RM) $@.tmp; \ echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ (test -f $@ || echo git-log is required to generate this file >> $@)); \ else \ @@ -120,12 +120,12 @@ uninstall-local: if [ -f $(srcdir)/fonts.conf ]; then \ if cmp -s $(srcdir)/fonts.conf $(DESTDIR)$(configdir)/fonts.conf; then \ echo " uninstall standard $(DESTDIR)$(configdir)/fonts.conf"; \ - rm -f $(DESTDIR)$(configdir)/fonts.conf; \ + $(RM) $(DESTDIR)$(configdir)/fonts.conf; \ fi; \ else if [ -f fonts.conf ]; then \ if cmp -s fonts.conf $(DESTDIR)$(configdir)/fonts.conf; then \ echo " uninstall standard $(DESTDIR)$(configdir)/fonts.conf"; \ - rm -f $(DESTDIR)$(configdir)/fonts.conf; \ + $(RM) $(DESTDIR)$(configdir)/fonts.conf; \ fi; \ fi; fi @@ -136,7 +136,7 @@ debuild-unsigned: debuild-dirs (cd $(distdir)/debian && debuild -us -uc) debuild-dirs: distdir - rm -f $(PACKAGE)_$(VERSION).orig.tar.gz - rm -rf $(distdir).orig + $(RM) $(PACKAGE)_$(VERSION).orig.tar.gz + $(RM) -r $(distdir).orig cp -a $(distdir) $(distdir).orig - rm -rf $(distdir).orig/debian + $(RM) -r $(distdir).orig/debian diff --git a/fontconfig/conf.d/40-nonlatin.conf b/fontconfig/conf.d/40-nonlatin.conf index 1208a6ebf..c900fd4e7 100644 --- a/fontconfig/conf.d/40-nonlatin.conf +++ b/fontconfig/conf.d/40-nonlatin.conf @@ -89,6 +89,10 @@ <family>FreeSerif</family> <default><family>serif</family></default> </alias> + <alias> + <family>SimSun</family> + <default><family>serif</family></default> + </alias> <!-- Sans-serif faces --> @@ -153,10 +157,6 @@ <default><family>sans-serif</family></default> </alias> <alias> - <family>SimSun</family> - <default><family>sans-serif</family></default> - </alias> - <alias> <family>MgOpen Modata</family> <default><family>sans-serif</family></default> </alias> diff --git a/fontconfig/conf.d/Makefile.am b/fontconfig/conf.d/Makefile.am index d122a8ff0..13f243bb3 100644 --- a/fontconfig/conf.d/Makefile.am +++ b/fontconfig/conf.d/Makefile.am @@ -86,14 +86,14 @@ install-data-local: @(echo cd ${DESTDIR}${confddir}; \ cd ${DESTDIR}${confddir}; \ for i in ${CONF_LINKS}; do \ - rm -f $$i; \ - echo rm -f $$i";" ln -s ../conf.avail/$$i .; \ + $(RM) $$i; \ + echo $(RM) $$i";" ln -s ../conf.avail/$$i .; \ ln -s ../conf.avail/$$i .; \ done) uninstall-local: @(echo cd ${DESTDIR}${confddir}; \ cd ${DESTDIR}${confddir}; \ for i in ${CONF_LINKS}; do \ - echo rm -f $$i; \ - rm -f $$i; \ + echo $(RM) $$i; \ + $(RM) $$i; \ done) diff --git a/fontconfig/configure.in b/fontconfig/configure.in index da6ef9532..3204f2e5d 100644 --- a/fontconfig/configure.in +++ b/fontconfig/configure.in @@ -64,6 +64,15 @@ AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AC_PROG_MAKE_SET +AC_MSG_CHECKING([for RM macro]) +_predefined_rm=`make -p -f /dev/null 2>/dev/null|grep '^RM ='|sed -e 's/^RM = //'` +if test "x$_predefined_rm" = "x"; then + AC_MSG_RESULT([no predefined RM]) + AC_CHECK_PROG(RM, rm, [rm -f]) +else + AC_MSG_RESULT($_predefined_rm) +fi + dnl ========================================================================== case "$host" in diff --git a/fontconfig/doc/Makefile.am b/fontconfig/doc/Makefile.am index f483bc757..e86abe9e3 100644 --- a/fontconfig/doc/Makefile.am +++ b/fontconfig/doc/Makefile.am @@ -154,45 +154,49 @@ if CROSS_COMPILING .fncs.sgml: @echo Warning: cannot rebuild $@ when cross-compiling else -.fncs.sgml: edit-sgml$(EXEEXT) $(srcdir)/func.sgml - -@rm $@ - $(AM_V_GEN) $(builddir)/edit-sgml$(EXEEXT) $(srcdir)/func.sgml < '$*.fncs' > $*.sgml +.fncs.sgml: + $(AM_V_GEN) $(RM) $@; \ + $(builddir)/edit-sgml$(EXEEXT) $(srcdir)/func.sgml < '$*.fncs' > $*.sgml endif -.sgml.txt: $(DOCS_DEPS) - -@rm $@ - $(AM_V_GEN) $(DOC2TXT) $*.sgml -.sgml.pdf: $(DOCS_DEPS) - -@rm $@ - $(AM_V_GEN) $(DOC2PDF) $*.sgml -.sgml.html: $(DOCS_DEPS) - -@rm $@ - $(AM_V_GEN) $(DOC2HTML) -u $*.sgml > $@ +.sgml.txt: + $(AM_V_GEN) $(RM) $@; \ + $(DOC2TXT) $*.sgml +.sgml.pdf: + $(AM_V_GEN) $(RM) $@; \ + $(DOC2PDF) $*.sgml +.sgml.html: + $(AM_V_GEN) $(RM) $@; \ + $(DOC2HTML) -u $*.sgml > $@ ## fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml - -@rm $@ - $(AM_V_GEN) $(DOC2MAN) local-fontconfig-user.sgml && \ - rm manpage.* + $(AM_V_GEN) $(RM) $@; \ + $(DOC2MAN) local-fontconfig-user.sgml && \ + $(RM) manpage.* ## $(man3_MANS): func.refs func.refs: local-fontconfig-devel.sgml $(DOCS_DEPS) - -@rm $@ + $(AM_V_GEN) $(RM) $@; \ [ "x$(builddir)" != "x$(srcdir)" ] && \ for f in $(DOC_FUNCS_SGML); do \ - rm -f $(builddir)/$$f || :; \ + $(RM) $(builddir)/$$f || :; \ $(LN_S) $(srcdir)/$$f $(builddir)/$$f; \ - done || : - $(AM_V_GEN) $(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \ + done || :; \ + $(DOC2MAN) -o devel-man local-fontconfig-devel.sgml && \ mv devel-man/manpage.refs func.refs && \ mv devel-man/*.3 . && \ - rm devel-man/manpage.* && \ + $(RM) devel-man/manpage.* && \ rmdir devel-man confdir.sgml: $(srcdir)/confdir.sgml.in $(AM_V_GEN) sed -e 's,@CONFDIR\@,${CONFDIR},' $(srcdir)/$@.in | awk '{if (NR > 1) printf("\n"); printf("%s", $$0);}' > $@ ## +$(DOC_FUNCS_SGML): $(DOC_FUNCS_FNCS) edit-sgml$(EXEEXT) $(srcdir)/func.sgml +$(TXT_FILES): $(DOCS_DEPS) +$(PDF_FILES): $(DOCS_DEPS) +$(HTML_FILES): $(DOCS_DEPS) $(HTML_DIR)/*: $(HTML_DIR) $(HTML_DIR): local-fontconfig-devel.sgml $(DOCS_DEPS) - -@rm -r $@ - $(AM_V_GEN) $(DOC2HTML) -V '%use-id-as-filename%' -o $@ local-fontconfig-devel.sgml + $(AM_V_GEN) $(RM) -r $@; \ + $(DOC2HTML) -V '%use-id-as-filename%' -o $@ local-fontconfig-devel.sgml local-fontconfig-user.sgml: $(srcdir)/fontconfig-user.sgml $(AM_V_GEN) $(LN_S) $(srcdir)/fontconfig-user.sgml $@ local-fontconfig-devel.sgml: $(srcdir)/fontconfig-devel.sgml @@ -200,7 +204,7 @@ local-fontconfig-devel.sgml: $(srcdir)/fontconfig-devel.sgml # all-local: $(BUILT_DOCS) $(HTML_DIR)/* clean-local: - -rm -r $(HTML_DIR) devel-man + $(RM) -r $(HTML_DIR) devel-man else htmldoc_DATA += $(srcdir)/$(HTML_DIR)/* all-local: diff --git a/fontconfig/fc-cache/Makefile.am b/fontconfig/fc-cache/Makefile.am index b647c3f4b..8f455c8e2 100644 --- a/fontconfig/fc-cache/Makefile.am +++ b/fontconfig/fc-cache/Makefile.am @@ -33,7 +33,7 @@ install-data-local: -$(mkinstalldirs) "$(DESTDIR)$(fc_cachedir)" uninstall-local: - -rm -rf "$(DESTDIR)$(fc_cachedir)" + -$(RM) -rf "$(DESTDIR)$(fc_cachedir)" endif INCLUDES=-I${top_srcdir} -I${top_srcdir}/src $(WARN_CFLAGS) @@ -53,14 +53,14 @@ fc_cache_LDADD = ${top_builddir}/src/libfontconfig.la if USEDOCBOOK ${man_MANS}: ${SGML} - -@rm $@ - $(AM_V_GEN) $(DOC2MAN) ${SGML} - @rm -f manpage.* + $(AM_V_GEN) $(RM) $@; \ + $(DOC2MAN) ${SGML}; \ + $(RM) manpage.* all-local: $(man_MANS) clean-local: - -rm $(man_MANS) + $(RM) $(man_MANS) else all-local: diff --git a/fontconfig/fc-cache/fc-cache.c b/fontconfig/fc-cache/fc-cache.c index d2653507e..24bb2ec9f 100644 --- a/fontconfig/fc-cache/fc-cache.c +++ b/fontconfig/fc-cache/fc-cache.c @@ -22,8 +22,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#include "../src/fcarch.h" - #ifdef HAVE_CONFIG_H #include <config.h> #else @@ -34,6 +32,7 @@ #endif #include <fontconfig/fontconfig.h> +#include "../src/fcarch.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -44,6 +43,14 @@ #include <dirent.h> #include <string.h> +#ifndef FC_DIR_SEPARATOR_S +# ifdef _WIN32 +# define FC_DIR_SEPARATOR_S "\\" +# else +# define FC_DIR_SEPARATOR_S "/" +# endif +#endif + #if defined (_WIN32) #define STRICT #include <windows.h> @@ -116,6 +123,69 @@ usage (char *program, int error) static FcStrSet *processed_dirs; +/* Create CACHEDIR.TAG */ +static FcBool +create_tag_file (FcConfig *config, FcBool verbose) +{ + FcChar8 *cache_tag; + FcChar8 *cache_dir = NULL; + FcStrList *list; + int fd; + FILE *fp; + FcAtomic *atomic; + static const FcChar8 cache_tag_contents[] = + "Signature: 8a477f597d28d172789f06886806bc55\n" + "# This file is a cache directory tag created by fontconfig.\n" + "# For information about cache directory tags, see:\n" + "# http://www.brynosaurus.com/cachedir/\n"; + static size_t cache_tag_contents_size = sizeof (cache_tag_contents) - 1; + FcBool ret = FcTrue; + + list = FcConfigGetCacheDirs(config); + if (!list) + return FcFalse; + + while ((cache_dir = FcStrListNext (list))) + { + if (access ((char *) cache_dir, W_OK|X_OK) == 0) + { + if (verbose) + printf ("Create CACHEDIR.TAG at %s\n", cache_dir); + /* Create CACHEDIR.TAG */ + cache_tag = FcStrPlus (cache_dir, (const FcChar8 *) FC_DIR_SEPARATOR_S "CACHEDIR.TAG"); + if (!cache_tag) + return FcFalse; + atomic = FcAtomicCreate ((FcChar8 *)cache_tag); + if (!atomic) + goto bail1; + if (!FcAtomicLock (atomic)) + goto bail2; + fd = open((char *)FcAtomicNewFile (atomic), O_RDWR | O_CREAT, 0644); + if (fd == -1) + goto bail3; + fp = fdopen(fd, "wb"); + if (fp == NULL) + goto bail3; + + fwrite(cache_tag_contents, cache_tag_contents_size, sizeof (FcChar8), fp); + fclose(fp); + + if (!FcAtomicReplaceOrig(atomic)) + goto bail3; + + bail3: + FcAtomicUnlock (atomic); + bail2: + FcAtomicDestroy (atomic); + bail1: + FcStrFree (cache_tag); + } + } + FcStrListDone (list); + + return ret; +} + static int scanDirs (FcStrList *list, FcConfig *config, FcBool force, FcBool really_force, FcBool verbose, int *changed) { @@ -451,6 +521,13 @@ main (int argc, char **argv) changed = 0; ret = scanDirs (list, config, force, really_force, verbose, &changed); + /* + * Try to create CACHEDIR.TAG anyway. + * This expects the fontconfig cache directory already exists. + * If it doesn't, it won't be simply created. + */ + create_tag_file (config, verbose); + FcStrSetDestroy (processed_dirs); cleanCacheDirectories (config, verbose); diff --git a/fontconfig/fc-case/Makefile.am b/fontconfig/fc-case/Makefile.am index 1855d47b8..ad5dc74be 100644 --- a/fontconfig/fc-case/Makefile.am +++ b/fontconfig/fc-case/Makefile.am @@ -46,8 +46,8 @@ $(TARG): $(STMPL) fc-case.c $(SCASEFOLDING) @echo Warning: cannot rebuild $(TARG) when cross-compiling else $(TARG): $(STMPL) fc-case$(EXEEXT) $(SCASEFOLDING) - -@rm $(TARG) - $(AM_V_GEN) $(builddir)/fc-case$(EXEEXT) $(SCASEFOLDING) < $(STMPL) > $(TARG).tmp && \ + $(AM_V_GEN) $(RM) $(TARG); \ + ./fc-case$(EXEEXT) $(SCASEFOLDING) < $(STMPL) > $(TARG).tmp && \ mv $(TARG).tmp $(TARG) endif diff --git a/fontconfig/fc-cat/Makefile.am b/fontconfig/fc-cat/Makefile.am index 6bc616848..8a2939aef 100644 --- a/fontconfig/fc-cat/Makefile.am +++ b/fontconfig/fc-cat/Makefile.am @@ -44,14 +44,14 @@ fc_cat_LDADD = ${top_builddir}/src/libfontconfig.la if USEDOCBOOK ${man_MANS}: ${SGML} - -@rm $@ - $(DOC2MAN) ${SGML} - @rm -f manpage.* + $(AM_V_GEN) $(RM) $@; \ + $(DOC2MAN) ${SGML}; \ + $(RM) manpage.* all-local: $(man_MANS) clean-local: - -rm $(man_MANS) + $(RM) $(man_MANS) else all-local: diff --git a/fontconfig/fc-glyphname/Makefile.am b/fontconfig/fc-glyphname/Makefile.am index 837870737..697b5c3b9 100644 --- a/fontconfig/fc-glyphname/Makefile.am +++ b/fontconfig/fc-glyphname/Makefile.am @@ -41,8 +41,8 @@ $(TARG): $(STMPL) fc-glyphname.c $(SGLYPHNAME) @echo Warning: cannot rebuild $(TARG) when cross-compiling else $(TARG): $(STMPL) fc-glyphname$(EXEEXT) $(SGLYPHNAME) - -@rm $(TARG) - $(AM_V_GEN) $(builddir)/fc-glyphname$(EXEEXT) $(SGLYPHNAME) < $(STMPL) > $(TARG).tmp && \ + $(AM_V_GEN) $(RM) $(TARG); \ + ./fc-glyphname$(EXEEXT) $(SGLYPHNAME) < $(STMPL) > $(TARG).tmp && \ mv $(TARG).tmp $(TARG) endif diff --git a/fontconfig/fc-lang/Makefile.am b/fontconfig/fc-lang/Makefile.am index 54fde38c4..d2eca5ba8 100644 --- a/fontconfig/fc-lang/Makefile.am +++ b/fontconfig/fc-lang/Makefile.am @@ -40,8 +40,8 @@ $(TARG):$(ORTH) fc-lang.c $(STMPL) @echo Warning: cannot rebuild $(TARG) when cross-compiling else $(TARG):$(ORTH) fc-lang${EXEEXT} $(STMPL) - -@rm $(TARG) - $(AM_V_GEN) $(builddir)/fc-lang${EXEEXT} -d ${srcdir} $(ORTH) < $(STMPL) > $(TARG).tmp && \ + $(AM_V_GEN) $(RM) $(TARG); \ + ./fc-lang${EXEEXT} -d ${srcdir} $(ORTH) < $(STMPL) > $(TARG).tmp && \ mv $(TARG).tmp $(TARG) endif diff --git a/fontconfig/fc-list/Makefile.am b/fontconfig/fc-list/Makefile.am index fb87b50b6..7822ad479 100644 --- a/fontconfig/fc-list/Makefile.am +++ b/fontconfig/fc-list/Makefile.am @@ -44,14 +44,14 @@ fc_list_LDADD = ${top_builddir}/src/libfontconfig.la if USEDOCBOOK ${man_MANS}: ${SGML} - -@rm $@ - $(AM_V_GEN) $(DOC2MAN) ${SGML} - @rm manpage.* + $(AM_V_GEN) $(RM) $@; \ + $(DOC2MAN) ${SGML}; \ + $(RM) manpage.* all-local: $(man_MANS) clean-local: - -rm $(man_MANS) + $(RM) $(man_MANS) else all-local: diff --git a/fontconfig/fc-match/Makefile.am b/fontconfig/fc-match/Makefile.am index 3bdff6d77..d046b7934 100644 --- a/fontconfig/fc-match/Makefile.am +++ b/fontconfig/fc-match/Makefile.am @@ -44,14 +44,14 @@ fc_match_LDADD = ${top_builddir}/src/libfontconfig.la if USEDOCBOOK ${man_MANS}: ${SGML} - -@rm $@ - $(AM_V_GEN) $(DOC2MAN) ${SGML} - @rm manpage.* + $(AM_V_GEN) $(RM) $@; \ + $(DOC2MAN) ${SGML}; \ + $(RM) manpage.* all-local: $(man_MANS) clean-local: - -rm $(man_MANS) + $(RM) $(man_MANS) else all-local: diff --git a/fontconfig/fc-pattern/Makefile.am b/fontconfig/fc-pattern/Makefile.am index 085c1dade..fa66006cd 100644 --- a/fontconfig/fc-pattern/Makefile.am +++ b/fontconfig/fc-pattern/Makefile.am @@ -44,14 +44,14 @@ fc_pattern_LDADD = ${top_builddir}/src/libfontconfig.la if USEDOCBOOK ${man_MANS}: ${SGML} - -@rm $@ - $(DOC2MAN) ${SGML} - @rm manpage.* + $(AM_V_GEN) $(RM) $@; \ + $(DOC2MAN) ${SGML}; \ + $(RM) manpage.* all-local: $(man_MANS) clean-local: - -rm $(man_MANS) + $(RM) $(man_MANS) else all-local: diff --git a/fontconfig/fc-query/Makefile.am b/fontconfig/fc-query/Makefile.am index 31fced90c..f60c3630e 100644 --- a/fontconfig/fc-query/Makefile.am +++ b/fontconfig/fc-query/Makefile.am @@ -44,14 +44,14 @@ fc_query_LDADD = ${top_builddir}/src/libfontconfig.la if USEDOCBOOK ${man_MANS}: ${SGML} - -@rm $@ - $(AM_V_GEN) $(DOC2MAN) ${SGML} - @rm manpage.* + $(AM_V_GEN) $(RM) $@; \ + $(DOC2MAN) ${SGML}; \ + $(RM) manpage.* all-local: $(man_MANS) clean-local: - -rm $(man_MANS) + $(RM) $(man_MANS) else all-local: diff --git a/fontconfig/fc-scan/Makefile.am b/fontconfig/fc-scan/Makefile.am index f36e8f4e7..8909691a0 100644 --- a/fontconfig/fc-scan/Makefile.am +++ b/fontconfig/fc-scan/Makefile.am @@ -44,14 +44,14 @@ fc_scan_LDADD = ${top_builddir}/src/libfontconfig.la if USEDOCBOOK ${man_MANS}: ${SGML} - -@rm $@ - $(AM_V_GEN) $(DOC2MAN) ${SGML} - @rm manpage.* + $(AM_V_GEN) $(RM) $@; \ + $(DOC2MAN) ${SGML}; \ + $(RM) manpage.* all-local: $(man_MANS) clean-local: - -rm $(man_MANS) + $(RM) $(man_MANS) else all-local: diff --git a/fontconfig/src/Makefile.am b/fontconfig/src/Makefile.am index a7bb73ce2..fb30cd596 100644 --- a/fontconfig/src/Makefile.am +++ b/fontconfig/src/Makefile.am @@ -34,7 +34,7 @@ install-libtool-import-lib: $(INSTALL) fontconfig.def $(DESTDIR)$(libdir)/fontconfig.def uninstall-libtool-import-lib: - -rm $(DESTDIR)$(libdir)/libfontconfig.dll.a $(DESTDIR)$(libdir)/fontconfig.def + $(RM) $(DESTDIR)$(libdir)/libfontconfig.dll.a $(DESTDIR)$(libdir)/fontconfig.def else @@ -58,7 +58,7 @@ install-ms-import-lib: $(INSTALL) fontconfig.lib $(DESTDIR)$(libdir) uninstall-ms-import-lib: - -rm $(DESTDIR)$(libdir)/fontconfig.lib + $(RM) $(DESTDIR)$(libdir)/fontconfig.lib else @@ -147,12 +147,12 @@ PUBLIC_FT_FILES = \ fcaliastail.h: fcalias.h fcalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FILES) - sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcalias.h fcaliastail.h $(PUBLIC_FILES) + $(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcalias.h fcaliastail.h $(PUBLIC_FILES) fcftaliastail.h: fcftalias.h fcftalias.h: $(top_srcdir)/src/makealias $(PUBLIC_FT_FILES) - sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcftalias.h fcftaliastail.h $(PUBLIC_FT_FILES) + $(AM_V_GEN) sh $(top_srcdir)/src/makealias "$(top_srcdir)/src" fcftalias.h fcftaliastail.h $(PUBLIC_FT_FILES) CLEANFILES = $(ALIAS_FILES) @@ -164,4 +164,4 @@ fontconfig.def: $(PUBLIC_FILES) $(PUBLIC_FT_FILES) sort; \ echo LIBRARY libfontconfig-@LIBT_CURRENT_MINUS_AGE@.dll; \ echo VERSION @LIBT_CURRENT@.@LIBT_REVISION@) >$@ - @ ! grep -q FcERROR $@ || (rm $@; false) + @ ! grep -q FcERROR $@ || ($(RM) $@; false) diff --git a/fontconfig/src/fcarch.c b/fontconfig/src/fcarch.c index c69397e18..09d24b31b 100644 --- a/fontconfig/src/fcarch.c +++ b/fontconfig/src/fcarch.c @@ -31,12 +31,12 @@ #ifndef FC_ARCHITECTURE -#include "fcarch.h" - /* Make sure the cache structure is consistent with what we expect */ #include "fcint.h" +#include "fcarch.h" + FC_ASSERT_STATIC (1 == sizeof (char)); FC_ASSERT_STATIC (2 == sizeof (FcChar16)); FC_ASSERT_STATIC (4 == sizeof (int)); diff --git a/fontconfig/src/fcarch.h b/fontconfig/src/fcarch.h index 9cabf0450..22e6f8e13 100644 --- a/fontconfig/src/fcarch.h +++ b/fontconfig/src/fcarch.h @@ -46,9 +46,28 @@ * be64 1234 8 8 */ -#if defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN +#ifdef __APPLE__ +# include <machine/endian.h> +# undef SIZEOF_VOID_P +# undef ALIGNOF_DOUBLE +# ifdef __LP64__ +# define SIZEOF_VOID_P 8 +# define ALIGNOF_DOUBLE 8 +# else +# define SIZEOF_VOID_P 4 +# define ALIGNOF_DOUBLE 4 +# endif +#endif + +#if defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN +# define FC_ARCH_ENDIAN "le" +#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN +# define FC_ARCH_ENDIAN "be" +#elif defined(__DARWIN_BYTE_ORDER) && __DARWIN_BYTE_ORDER == __DARWIN_PDP_ENDIAN +# define FC_ARCH_ENDIAN "pe" +#elif defined(WORDS_BIGENDIAN) && WORDS_BIGENDIAN # define FC_ARCH_ENDIAN "be" -#else /* !WORDS_BIGENDIAN */ +#else # define FC_ARCH_ENDIAN "le" #endif diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c index 422bc384d..92e4a6668 100644 --- a/fontconfig/src/fcmatch.c +++ b/fontconfig/src/fcmatch.c @@ -501,11 +501,11 @@ FcFontSetMatchInternal (FcConfig *config, printf ("\n"); FcPatternPrint (best); } - if (!best) - { - *result = FcResultNoMatch; - return 0; - } + /* assuming that 'result' is initialized with FcResultNoMatch + * outside this function */ + if (best) + *result = FcResultMatch; + return best; } @@ -522,6 +522,8 @@ FcFontSetMatch (FcConfig *config, assert (p != NULL); assert (result != NULL); + *result = FcResultNoMatch; + if (!config) { config = FcConfigGetCurrent (); @@ -547,6 +549,8 @@ FcFontMatch (FcConfig *config, assert (p != NULL); assert (result != NULL); + *result = FcResultNoMatch; + if (!config) { config = FcConfigGetCurrent (); @@ -826,6 +830,9 @@ FcFontSetSort (FcConfig *config, printf ("First font "); FcPatternPrint (ret->fonts[0]); } + if (ret->nfont > 0) + *result = FcResultMatch; + return ret; bail2: @@ -849,6 +856,8 @@ FcFontSort (FcConfig *config, assert (p != NULL); assert (result != NULL); + *result = FcResultNoMatch; + if (!config) { config = FcConfigGetCurrent (); |