Imported Upstream version 2.14.2
[platform/upstream/fontconfig.git] / fc-lang / Makefile.am
index 5fdccea..eaa5249 100644 (file)
@@ -25,7 +25,7 @@
 
 TAG = lang
 DEPS = $(ORTH)
-ARGS = -d $(srcdir) $(ORTH)
+ARGS = --directory $(srcdir) $(ORTH)
 DIST = $(ORTH)
 
 include $(top_srcdir)/Tools.mk
@@ -285,4 +285,21 @@ ORTH = \
        und_zmth.orth
 #      ^-------------- Add new orth files here
 
+BUILT_SOURCES += $(top_builddir)/conf.d/35-lang-normalize.conf
+
+DISTCLEANFILES = $(BUILT_SOURCES)
+
+$(top_builddir)/conf.d/35-lang-normalize.conf: $(ORTH) Makefile
+       $(AM_V_GEN) echo "<?xml version=\"1.0\"?>" > $@ && \
+               echo "<!DOCTYPE fontconfig SYSTEM \"urn:fontconfig:fonts.dtd\">" >> $@ && \
+               echo "<fontconfig>" >> $@ && \
+       for i in `echo $(ORTH) | sed -e 's/ /\n/g' | grep -v _ | sed -e 's/\.orth$$//g' | sort`; do \
+               echo "  <!-- $$i* -> $$i -->" >> $@; \
+               echo "  <match>" >> $@; \
+               echo "    <test name=\"lang\" compare=\"contains\"><string>$$i</string></test>" >> $@; \
+               echo "    <edit name=\"lang\" mode=\"assign\" binding=\"same\"><string>$$i</string></edit>" >> $@; \
+               echo "  </match>" >> $@; \
+       done && \
+       echo "</fontconfig>" >> $@
+
 -include $(top_srcdir)/git.mk