# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
-DOC_SRC = ${top_srcdir}/doc
-DOC_BLD = ${top_builddir}/doc
+DOC_SRC = $(srcdir)
DOC_MODULE = fontconfig
DOC2HTML = docbook2html
DOC2TXT = docbook2txt
TXT = fontconfig-user.txt fontconfig-devel.txt
HTML_FILES = fontconfig-user.html
-HTML_DIRS = fontconfig-devel
-SGML = ${DOC_SRC}/fontconfig-user.sgml ${DOC_SRC}/fontconfig-devel.sgml
+HTML_DIR = fontconfig-devel
+SGML = fontconfig-user.sgml fontconfig-devel.sgml
FNCS_TMPL = ${DOC_SRC}/func.sgml
DOC_FUNCS_FNCS=\
fcstrset.sgml \
fcvalue.sgml
-man_MANS=fonts-conf.5 \
-FcAtomicCreate.3 FcAtomicDeleteNew.3 FcAtomicDestroy.3 FcAtomicLock.3 \
-FcAtomicNewFile.3 FcAtomicOrigFile.3 FcAtomicReplaceOrig.3 FcAtomicUnlock.3 \
-FcBlanksAdd.3 FcBlanksCreate.3 FcBlanksDestroy.3 FcBlanksIsMember.3 \
-FcCharSetAddChar.3 FcCharSetCopy.3 FcCharSetCount.3 FcCharSetCreate.3 \
-FcCharSetDestroy.3 FcCharSetEqual.3 FcCharSetFirstPage.3 FcCharSetHasChar.3 \
-FcCharSetIntersect.3 FcCharSetIntersectCount.3 FcCharSetIsSubset.3 \
-FcCharSetNextPage.3 FcCharSetSubtract.3 FcCharSetSubtractCount.3 \
-FcCharSetUnion.3 FcConfigAppFontAddDir.3 FcConfigAppFontAddFile.3 \
-FcConfigAppFontClear.3 FcConfigBuildFonts.3 FcConfigCreate.3 \
-FcConfigDestroy.3 FcConfigFilename.3 FcConfigGetBlanks.3 FcConfigGetCache.3 \
-FcConfigGetConfigDirs.3 FcConfigGetConfigFiles.3 FcConfigGetCurrent.3 \
-FcConfigGetFontDirs.3 FcConfigGetFonts.3 FcConfigGetRescanInverval.3 \
-FcConfigParseAndLoad.3 FcConfigSetCurrent.3 FcConfigSetRescanInverval.3 \
-FcConfigSubstitute.3 FcConfigSubstituteWithPat.3 FcConfigUptoDate.3 \
-FcDefaultSubstitute.3 FcDirCacheValid.3 FcDirSave.3 FcDirScan.3 FcFini.3 FcFileScan.3 \
-FcFontList.3 FcFontMatch.3 FcFontRenderPrepare.3 FcFontSetAdd.3 \
-FcFontSetCreate.3 FcFontSetDestroy.3 FcFontSort.3 FcFreeTypeCharIndex.3 \
-FcFreeTypeCharSet.3 FcFreeTypeQuery.3 FcGetVersion.3 FcInit.3 \
-FcInitBringUptoDate.3 FcInitLoadConfig.3 FcInitLoadConfigAndFonts.3 \
-FcInitReinitialize.3 FcMatrixCopy.3 FcMatrixEqual.3 FcMatrixInit.3 \
-FcMatrixMultiply.3 FcMatrixRotate.3 FcMatrixScale.3 FcMatrixShear.3 \
-FcNameConstant.3 FcNameGetConstant.3 FcNameGetObjectType.3 FcNameParse.3 \
-FcNameRegisterConstants.3 FcNameRegisterObjectTypes.3 FcNameUnparse.3 \
-FcNameUnregisterConstants.3 FcNameUnregisterObjectTypes.3 FcObjectSetAdd.3 \
-FcObjectSetBuild.3 FcObjectSetCreate.3 FcObjectSetDestroy.3 \
-FcPatternAdd-Type.3 FcPatternAdd.3 FcPatternAddWeak.3 FcPatternBuild.3 \
-FcPatternCreate.3 FcPatternDel.3 FcPatternDestroy.3 FcPatternEqual.3 \
-FcPatternEqualSubset.3 FcPatternGet-Type.3 FcPatternGet.3 FcPatternHash.3 \
-FcPatternPrint.3 FcStrBasename.3 FcStrCmpIgnoreCase.3 FcStrCopy.3 \
-FcStrCopyFilename.3 FcStrDirname.3 FcStrListCreate.3 FcStrListDone.3 \
-FcStrListNext.3 FcStrSetAdd.3 FcStrSetAddFilename.3 FcStrSetCreate.3 \
-FcStrSetDel.3 FcStrSetDestroy.3 FcStrSetMember.3 FcUcs4ToUtf8.3 FcUtf16Len.3 \
-FcUtf16ToUcs4.3 FcUtf8Len.3 FcUtf8ToUcs4.3 FcValueDestroy.3 FcValueSave.3
+man_MANS=fonts-conf.5 @DOCMAN3@
noinst_PROGRAMS=edit-sgml
edit_sgml_SOURCES=edit-sgml.c
-DOCDIR=@DOCDIR@
+docdir=@DOCDIR@
DOC_FILES=$(TXT) $(HTML_FILES)
-DOC_DIRS=$(HTML_DIRS)
-LOCAL_DOCS=$(man_MANS) $(DOC_FILES) $(DOC_DIRS)
+LOCAL_DOCS=$(man_MANS) $(DOC_FILES) $(HTML_DIR)/*
EXTRA_DIST=$(LOCAL_DOCS) $(SGML) $(DOC_FUNCS_FNCS) $(FNCS_TMPL) confdir.sgml.in
.fncs.sgml:
$(RM) $@
- ./edit-sgml $(FNCS_TMPL) < `test -f '$<' || echo '$(srcdir)/'`$< > $*.sgml
+ ./edit-sgml $(FNCS_TMPL) < '$<' > $*.sgml
.sgml.txt:
$(RM) $@
- test -f '$<' || ln -s '$(srcdir)/'$< $<
$(DOC2TXT) $<
$(man_MANS): func.refs
-func.refs: fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
+func.refs: local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
$(RM) func.refs
- $(DOC2MAN) fontconfig-devel.sgml
+ $(DOC2MAN) local-fontconfig-devel.sgml
mv manpage.refs func.refs
$(RM) manpage.links
+local-fontconfig-devel.sgml: fontconfig-devel.sgml
+ $(LN_S) $< $@
+
$(DOC_FUNCS_SGML): edit-sgml $(FNCS_TMPL)
-fonts-conf.5: fontconfig-user.sgml version.sgml confdir.sgml
- $(RM) file.refs
- $(DOC2MAN) fontconfig-user.sgml
+fonts-conf.5: local-fontconfig-user.sgml version.sgml confdir.sgml
+ $(RM) $@
+ $(DOC2MAN) local-fontconfig-user.sgml
$(RM) manpage.refs manpage.links
+
+local-fontconfig-user.sgml: fontconfig-user.sgml
+ $(LN_S) $< $@
all-local: $(LOCAL_DOCS)
clean-local:
$(RM) $(man_MANS) $(DOC_FILES) $(DOC_FUNCS_SGML) func.refs
- $(RM) -r $(DOC_DIRS)
-
-fontconfig-devel: ./fontconfig-devel.sgml $(DOCS_FUNCS_SGML) version.sgml confdir.sgml
- $(RM) -r fontconfig-devel
- $(DOC2HTML) -o fontconfig-devel fontconfig-devel.sgml
-
-fontconfig-devel.txt: ./fontconfig-devel.sgml version.sgml confdir.sgml
-
-fontconfig-user.html: ./fontconfig-user.sgml version.sgml confdir.sgml
- $(DOC2HTML) -u fontconfig-user.sgml
+ $(RM) -r $(HTML_DIR)
-fontconfig-user.txt: ./fontconfig-user.sgml version.sgml confdir.sgml
+$(HTML_DIR): local-fontconfig-devel.sgml $(DOC_FUNCS_SGML) version.sgml confdir.sgml
+ $(RM) -r $(HTML_DIR)
+ $(DOC2HTML) -o $(HTML_DIR) local-fontconfig-devel.sgml
-./fontconfig-user.sgml: ALWAYS
- test -f fontconfig-user.sgml || $(LN_S) ${srcdir}/fontconfig-user.sgml fontconfig-user.sgml
+fontconfig-devel.txt: local-fontconfig-devel.sgml version.sgml confdir.sgml
+ $(RM) $@
+ $(DOC2TXT) local-fontconfig-devel.sgml
+ mv local-fontconfig-devel.txt $@
-./fontconfig-devel.sgml: ALWAYS
- test -f fontconfig-devel.sgml || $(LN_S) ${srcdir}/fontconfig-devel.sgml fontconfig-devel.sgml
+fontconfig-user.html: local-fontconfig-user.sgml version.sgml confdir.sgml
+ $(RM) $@ local-$@ $@.tmp
+ $(DOC2HTML) -u local-fontconfig-user.sgml > $@.tmp
+ -test -f local-$@ && mv local-$@ $@
+ -test -f $@ || mv $@.tmp $@
-ALWAYS:
+fontconfig-user.txt: local-fontconfig-user.sgml version.sgml confdir.sgml
+ $(RM) $@
+ $(DOC2TXT) local-fontconfig-user.sgml
+ mv local-fontconfig-user.txt $@
STRIPNL=awk '{ if (NR > 1) printf ("\n"); printf ("%s", $$0); }'
confdir.sgml: ${DOC_SRC}/confdir.sgml.in
sed "s,@CONFDIR\@,${CONFDIR}," < ${DOC_SRC}/confdir.sgml.in | $(STRIPNL) > confdir.sgml
-clean::
- $(RM) confdir.sgml
+CLEANFILES=confdir.sgml local-fontconfig-user.sgml local-fontconfig-devel.sgml
else
all-local:
clean-local:
endif
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(DOCDIR)
- for i in $(DOC_FILES); do \
- echo '-- Installing '$$i ; \
- $(INSTALL_DATA) $$i $(DESTDIR)$(DOCDIR)/$$i; \
- done
- for i in $(DOC_DIRS); do \
- $(mkinstalldirs) $(DESTDIR)$(DOCDIR)/$$i ; \
- for f in $$i/*; do \
- echo '-- Installing '$$f ; \
- $(INSTALL_DATA) $$f $(DESTDIR)$(DOCDIR)/$$f; \
- done \
- done
-
-uninstall-local:
- for i in $(DOC_FILES); do \
- echo '-- Uninstalling '$$i ; \
- $(RM) $(DESTDIR)$(DOCDIR)/$$i ; \
- done
- for i in $(DOC_DIRS); do \
- echo '-- Uninstalling '$$i ; \
- rm -rf $(DESTDIR)$(DOCDIR)/$$i ; \
- done
- rmdir $(DESTDIR)$(DOCDIR)
+htmldocdir=$(docdir)/$(HTML_DIR)
+
+doc_DATA = $(DOC_FILES)
+
+htmldoc_DATA = $(HTML_DIR)/*
+
+$(HTML_DIR)/*: $(HTML_DIR)
#!/bin/sh
+TESTDIR=${srcdir-`pwd`}
+
FONTDIR=`pwd`/fonts
CACHEFILE=`pwd`/fonts.cache
FCLIST=../fc-list/fc-list
FCCACHE=../fc-cache/fc-cache
+FONT1=$TESTDIR/4x6.pcf
+FONT2=$TESTDIR/8x16.pcf
+
check () {
$FCLIST - family pixelsize | sort > out
echo "=" >> out
echo "=" >> out
$FCLIST - family pixelsize | sort >> out
tr -d '\015' <out >out.tmp; mv out.tmp out
- if cmp out out.expected > /dev/null ; then : ; else
+ if cmp out $TESTDIR/out.expected > /dev/null ; then : ; else
echo "*** Test failed: $TEST"
echo "*** output is in 'out', expected output in 'out.expected'"
- exit
+ exit 1
fi
+ rm out
}
prep() {
}
sed "s!@FONTDIR@!$FONTDIR!
-s!@CACHEFILE@!$CACHEFILE!" < fonts.conf.in > fonts.conf
+s!@CACHEFILE@!$CACHEFILE!" < $TESTDIR/fonts.conf.in > fonts.conf
FONTCONFIG_FILE=`pwd`/fonts.conf
export FONTCONFIG_FILE
dotest "Basic check"
prep
-cp 4x6.pcf 8x16.pcf $FONTDIR
+cp $FONT1 $FONT2 $FONTDIR
check
dotest "With a subdir"
prep
-cp 4x6.pcf 8x16.pcf $FONTDIR
+cp $FONT1 $FONT2 $FONTDIR
$FCCACHE $FONTDIR
check
dotest "Subdir with a cache file"
prep
mkdir $FONTDIR/a
-cp 4x6.pcf 8x16.pcf $FONTDIR/a
+cp $FONT1 $FONT2 $FONTDIR/a
$FCCACHE $FONTDIR/a
check
mkdir $FONTDIR/a/a
mkdir $FONTDIR/b
mkdir $FONTDIR/b/a
-cp 4x6.pcf $FONTDIR/a
-cp 8x16.pcf $FONTDIR/b/a
+cp $FONT1 $FONTDIR/a
+cp $FONT2 $FONTDIR/b/a
check
dotest "Subdir with an out-of-date cache file"
mkdir $FONTDIR/a
$FCCACHE $FONTDIR/a
sleep 1
-cp 4x6.pcf 8x16.pcf $FONTDIR/a
+cp $FONT1 $FONT2 $FONTDIR/a
check
dotest "Dir with an out-of-date cache file"
prep
-cp 4x6.pcf $FONTDIR
+cp $FONT1 $FONTDIR
$FCCACHE $FONTDIR
sleep 1
mkdir $FONTDIR/a
-cp 8x16.pcf $FONTDIR/a
+cp $FONT2 $FONTDIR/a
check
rm -rf $FONTDIR $CACHEFILE $FONTCONFIG_FILE out