Reorganize the alphabets/LANG/ directories, rewriting the sub-Makefile alphabets/LANG/Makefile.am as Makefile.am fragment incuded by alphabets/Makefile.am. Note: these include's are resolved by `automake'. The idea is to put everything specific for a language into the Makefile.am fragment for that language. The fragments are (re-)generated by running 'sh mk-lang.sh' (in make-rules/alphabets). ======== Drop unused files (from TL2008 and more). diff -ur -N -x Makefile.in -x autom4te.cache xindy-2.4.orig/make-rules/alphabets/Makefile.am.not-yet xindy-2.4/make-rules/alphabets/Makefile.am.not-yet --- xindy-2.4.orig/make-rules/alphabets/Makefile.am.not-yet 1970-01-01 01:00:00.000000000 +0100 +++ xindy-2.4/make-rules/alphabets/Makefile.am.not-yet 2011-11-04 17:06:18.000000000 +0100 @@ -0,0 +1,311 @@ +## Use `autoreconf' in top-level directory to recreate all +## autoconf/automake files. +## Or, call `automake Makefile' to create only Makefile.in. + +## Copyright (C) 2004-2005 by Gour. +## +## This program is free software; you can redistribute it and/or +## modify it under the terms of the GNU General Public License as +## published by the Free Software Foundation; either version 2 of the +## License, or (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program in the file COPYING; if not, write to the +## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +## Boston, MA 02110-1301 USA. + +langdir = $(pkglibdir)/modules/lang + +nobase_nodist_lang_DATA = +dist_noinst_DATA = + +DOCS_CP1250 = +DOCS_CP1252 = +DOCS_CP850 = +DOCS_LATIN1 = +DOCS_LATIN2 = +DOCS_LATIN3 = +DOCS_LATIN4 = +DOCS_LATIN5 = +DOCS_LATIN9 = + +DOCS_CYR_1251 = +DOCS_CYR_ISO88595 = +DOCS_CYR_ISOIR111 = +DOCS_CYR_KOI8_R = +DOCS_CYR_KOI8_U = + +DOCS_ISO88597 = +DOCS_ISO88598 = + +DOCS_UTF8_LAT = +DOCS_UTF8_CYR = +DOCS_UTF8_OTHER = + +EXTRA_DIST = mk-lang.sh lang.defs +CLEANFILES = + +subdirs = + +## Include all Makefile fragments. +include albanian/Makefile.am +include belarusian/Makefile.am +include bulgarian/Makefile.am +include croatian/Makefile.am +include czech/Makefile.am +include danish/Makefile.am +include dutch/Makefile.am +include english/Makefile.am +include esperanto/Makefile.am +include estonian/Makefile.am +include finnish/Makefile.am +include french/Makefile.am +include general/Makefile.am +include georgian/Makefile.am +include german/Makefile.am +include greek/Makefile.am +include gypsy/Makefile.am +include hausa/Makefile.am +include hebrew/Makefile.am +include hungarian/Makefile.am +include icelandic/Makefile.am +include italian/Makefile.am +include klingon/Makefile.am +include kurdish/Makefile.am +include latin/Makefile.am +include latvian/Makefile.am +include lithuanian/Makefile.am +include lower-sorbian/Makefile.am +include macedonian/Makefile.am +include mongolian/Makefile.am +include norwegian/Makefile.am +include persian/Makefile.am +include polish/Makefile.am +include portuguese/Makefile.am +include romanian/Makefile.am +include russian/Makefile.am +include serbian/Makefile.am +include slovak/Makefile.am +include slovenian/Makefile.am +include spanish/Makefile.am +include swedish/Makefile.am +include test1/Makefile.am +include turkish/Makefile.am +include ukrainian/Makefile.am +include upper-sorbian/Makefile.am +include vietnamese/Makefile.am + +## Make sure all language subdirectories exist. +BUILT_SOURCES = subdirs +subdirs: + @for d in $(subdirs); do $(MKDIR_P) $$d; done +.PHONY: subdirs + +%utf8.pl : %utf8.pl.in + sed -e 's/@.{\([^}]*\)}/\1/g;' <$< >$@ + +%latin1.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO8859-1 >$@ + +%cp850.pl : %utf8.pl.in + sed -e 's/@.{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)CP850 >$@ + +%latin2.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO8859-2 >$@ + +%latin3.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO8859-3 >$@ + +%latin4.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO8859-4 >$@ + +%iso88595.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO-8859-5 >$@ + +%iso88597.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO-8859-7 >$@ + +%iso88598.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO-8859-8 >$@ + +%latin5.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO-8859-9 >$@ + +%latin9.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;s/@9{\([^}]*\)}/\1/g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO-8859-15 >$@ + +%cp1250.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)CP1250 >$@ + +%cp1251.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)CP1251 >$@ + +%cp1252.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;s/@9{\([^}]*\)}/\1/g;' <$< | \ + $(CONVERT_FROM_UTF8)CP1252 >$@ + +%isoir111.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)ISO-IR-111 >$@ + +%koi8-r.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)KOI8-R >$@ + +%koi8-u.pl : %utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' <$< | \ + $(CONVERT_FROM_UTF8)KOI8-U >$@ + +# %tex.pl : %utf8.pl utf8-to-tex.sed +# sed -f $(srcdir)/utf8-to-tex.sed <$< >$@ + + + +%-lang.xdy : %-test.xdy + sed -n '1,10 p' <$< >$@ + +# Running "$(PERL) -I$(srcdir) $< $*" creates %-test.xdy, %-doc.tex, %.raw, +# and %.xdy; %-test.xdy is finished first. We must not run this command +# several times simultaneously (for details see Automake manual 27.9). +%-test.xdy : %.pl + $(PERL) -I$(srcdir) $< $* + +%-doc.tex %.xdy : %-test.xdy + @if test -f $@; then :; else \ + trap 'rm -rf $*.lock $<' 1 2 13 15; \ + if mkdir $*.lock 2>/dev/null; then \ + rm -f $<; \ + $(MAKE) $(AM_MAKEFLAGS) $<; \ + result=$$?; rm -rf $*.lock; exit $$result; \ + else \ + while test -d $*.lock; do sleep 1; done; \ + test -f $<; \ + fi; \ + fi + +SCRS = \ + alphabets-doc.tex \ + make-rules.pl \ + utf8-to-tex.sed + +DOCS_CYR = \ + $(DOCS_CYR_1251) \ + $(DOCS_CYR_ISO88595) \ + $(DOCS_CYR_ISOIR111) \ + $(DOCS_CYR_KOI8_R) \ + $(DOCS_CYR_KOI8_U) + +DOCS_CPS = \ + $(DOCS_CP1250) \ + $(DOCS_CP1252) \ + $(DOCS_CP850) + +DOCS_LAT = \ + $(DOCS_LATIN1) \ + $(DOCS_LATIN2) \ + $(DOCS_LATIN3) \ + $(DOCS_LATIN4) \ + $(DOCS_LATIN5) \ + $(DOCS_LATIN9) + +DOCS_OTHER = \ + $(DOCS_ISO88597) \ + $(DOCS_ISO88598) + +DOCS_UTF8 = \ + $(DOCS_UTF8_LAT) \ + $(DOCS_UTF8_CYR) \ + $(DOCS_UTF8_OTHER) + +DOCS = $(DOCS_CPS) $(DOCS_LAT) $(DOCS_CYR) $(DOCS_OTHER) $(DOCS_UTF8) + + +alphabets-inc.tex : $(DOCS) + $(RM) $@ + echo "\chapter{Latin scripts}" >>$@ + echo "\ienc{cp1252}" >>$@ + echo "\section{Codepage 1252}" >>$@ + for i in $(DOCS_CP1252); do echo "\input{$$i}" >>$@; done + echo "\ienc{latin1}" >>$@ + echo "\section{Codepage latin1}" >>$@ + for i in $(DOCS_LATIN1); do echo "\input{$$i}" >>$@; done + echo "\ienc{cp850}" >>$@ + echo "\section{Codepage 850}" >>$@ + for i in $(DOCS_CP850); do echo "\input{$$i}" >>$@; done + echo "\ienc{latin2}" >>$@ + echo "\section{Codepage latin2}" >>$@ + for i in $(DOCS_LATIN2); do echo "\input{$$i}" >>$@; done + echo "\ienc{cp1250}" >>$@ + echo "\section{Codepage 1250}" >>$@ + for i in $(DOCS_CP1250); do echo "\input{$$i}" >>$@; done + echo "\ienc{latin3}" >>$@ + echo "\section{Codepage latin3}" >>$@ + for i in $(DOCS_LATIN3); do echo "\input{$$i}" >>$@; done + echo "\ienc{latin4}" >>$@ + echo "\section{Codepage latin4}" >>$@ + for i in $(DOCS_LATIN4); do echo "\input{$$i}" >>$@; done + echo "\ienc{latin5}" >>$@ + echo "\section{Codepage latin5}" >>$@ + for i in $(DOCS_LATIN5); do echo "\input{$$i}" >>$@; done + echo "\ienc{latin9}" >>$@ + echo "\section{Codepage latin9}" >>$@ + for i in $(DOCS_LATIN9); do echo "\input{$$i}" >>$@; done + echo "\ienc{cp1251}" >>$@ + echo "\fenc{T2A}" >>$@ + echo "\chapter{Cyrillic scripts}" >>$@ + echo "\section{Codepage 1251}" >>$@ + for i in $(DOCS_CYR_1251); do echo "\input{$$i}" >>$@; done +# echo "\ienc{iso-8859-7}" >>$@ +# echo "\fenc{LGR}" >>$@ +# echo "\chapter{Other scripts}" >>$@ +# for i in $(DOCS_OTHER); do echo "\input{$$i}" >>$@; done +# FIXME: UTF8 encoding +# echo "\section{UTF-8 scripts}" >>$@ +# for i in $(DOCS_UTF8); do echo "\input{$$i}" >>$@; done +# echo "\ienc{utf8}" >>$@ + +# whether to build docs +if BUILDRULES + +if BUILDDOCS +alphabets-doc.pdf : alphabets-doc.tex alphabets-inc.tex + pdflatex -interaction batchmode $(srcdir)/alphabets-doc.tex + pdflatex -interaction batchmode $(srcdir)/alphabets-doc.tex + +PDFS = alphabets-doc.pdf + +doc_DATA = $(PDFS) + +endif # (end BUILDDOCS) + +endif # end (BUILDRULES) + +DOC_CLEAN = \ + alphabets-doc.aux \ + alphabets-doc.log \ + alphabets-doc.out \ + alphabets-doc.pdf \ + alphabets-inc.tex \ + alphabets-doc.toc + +EXTRA_DIST += $(SCRS) test.xdy + +CLEANFILES += $(nobase_nodist_lang_DATA) $(DOCS) $(DOC_CLEAN) + diff -ur -N -x Makefile.in -x autom4te.cache xindy-2.4.orig/make-rules/alphabets/lang.defs xindy-2.4/make-rules/alphabets/lang.defs --- xindy-2.4.orig/make-rules/alphabets/lang.defs 1970-01-01 01:00:00.000000000 +0100 +++ xindy-2.4/make-rules/alphabets/lang.defs 2011-11-04 17:06:22.000000000 +0100 @@ -0,0 +1,46 @@ +albanian UTF8_LAT LATIN1 +belarusian UTF8_CYR CYR_ISO88595 CYR_ISOIR111 CYR_1251 +bulgarian UTF8_CYR CYR_ISO88595 CYR_KOI8_R CYR_1251 +croatian UTF8_LAT CP1250 LATIN2 +czech UTF8_LAT CP1250 LATIN2 +danish UTF8_LAT CP1252 LATIN9 +dutch ij-as-ij UTF8_LAT LATIN1 ij-as-y UTF8_LAT +english UTF8_LAT CP1252 LATIN9 +esperanto UTF8_LAT LATIN3 +estonian UTF8_LAT CP1252 LATIN9 +finnish UTF8_LAT CP1252 LATIN9 +french UTF8_LAT CP1252 LATIN9 +general UTF8_LAT CP1252 CP850 LATIN9 +georgian UTF8_OTHER +german braille UTF8_OTHER din5007 UTF8_LAT LATIN1 duden UTF8_LAT LATIN1 +greek UTF8_OTHER ISO88597 polytonic UTF8_OTHER translit UTF8_LAT LATIN4 +gypsy northrussian UTF8_LAT +hausa UTF8_LAT +hebrew UTF8_OTHER ISO88598 +hungarian UTF8_LAT CP1250 LATIN2 +icelandic UTF8_LAT CP1252 LATIN9 +italian UTF8_LAT LATIN1 +klingon UTF8_OTHER +kurdish bedirxan UTF8_LAT LATIN5 turkish-i UTF8_LAT LATIN5 +latin UTF8_LAT +latvian UTF8_LAT LATIN4 +lithuanian UTF8_LAT LATIN4 +lower-sorbian UTF8_LAT CP1250 LATIN2 +macedonian UTF8_CYR CYR_ISO88595 CYR_ISOIR111 CYR_1251 +mongolian cyrillic UTF8_CYR cyrillic +norwegian UTF8_LAT LATIN1 +persian UTF8_OTHER +polish UTF8_LAT CP1250 LATIN2 +portuguese UTF8_LAT LATIN1 +romanian UTF8_LAT LATIN2 +russian UTF8_CYR CYR_ISO88595 CYR_KOI8_R CYR_1251 translit-iso UTF8_LAT +serbian UTF8_CYR CYR_ISO88595 CYR_ISOIR111 CYR_1251 +slovak large UTF8_LAT CP1250 LATIN2 small UTF8_LAT CP1250 LATIN2 +slovenian UTF8_LAT CP1250 LATIN2 +spanish modern UTF8_LAT LATIN1 traditional UTF8_LAT LATIN1 +swedish UTF8_LAT CP1252 LATIN9 +test1 +turkish UTF8_LAT LATIN3 LATIN5 +upper-sorbian UTF8_LAT CP1250 LATIN2 +ukrainian UTF8_CYR CYR_KOI8_U CYR_1251 +vietnamese UTF8_LAT diff -ur -N -x Makefile.in -x autom4te.cache xindy-2.4.orig/make-rules/alphabets/mk-lang.sh xindy-2.4/make-rules/alphabets/mk-lang.sh --- xindy-2.4.orig/make-rules/alphabets/mk-lang.sh 1970-01-01 01:00:00.000000000 +0100 +++ xindy-2.4/make-rules/alphabets/mk-lang.sh 2010-01-13 13:51:57.000000000 +0100 @@ -0,0 +1,213 @@ +#! /bin/sh + +# Copyright (C) 2010 Peter Breitenlohner . +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program in the file COPYING; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301 USA. + +# Generate the Makefile fragments lang/Makefile.am from language +# definitions in lang.defs containing lines: +# lang [[prefix] UTF8_DOC [DOC]...]... +# where +# prefix is an optional filename prefix, without final '-' +# UTF8_DOC is a DOCS_UTF8_* variable, without leading 'DOCS_' +# DOC is an other DOCS_* variable, without leading 'DOCS_' + +CP_DOCS='CP1250 CP1252 CP850' +LATIN_DOCS='LATIN1 LATIN2 LATIN3 LATIN4 LATIN5 LATIN9' +CYR_DOCS='CYR_1251 CYR_ISO88595 CYR_ISOIR111 CYR_KOI8_R CYR_KOI8_U' +ISO_DOCS='ISO88597 ISO88598' +UTF_DOCS='UTF8_LAT UTF8_CYR UTF8_OTHER' + +ALL_DOCS="$CP_DOCS $LATIN_DOCS $CYR_DOCS $ISO_DOCS $UTF_DOCS" + +err_exit () { + echo "bad argument \"$arg\"" + exit 1 +} + +do_XDY () { + XDY="$XDY $name" + eval DOCS_$arg="\"\$DOCS_$arg $name\"" +} + +do_UTF8 () { + PLIN="$PLIN $name" + do_XDY +} + +do_CODE () { + PL="$PL $name" + do_XDY +} + +parse_lang () { + for DOC in $ALL_DOCS; do + eval DOCS_$DOC= + done + PLIN= PL= XDY= + lang=$1 + shift + pref= + for arg + do + case $arg in + [a-z]*) pref="$arg-";; + UTF8_*) name=${pref}utf8; do_UTF8;; + [A-Z]*) case $arg in + CP*) val="cp${arg:2}";; + ISO*) val="iso${arg:3}";; + LATIN*) val="latin${arg:5}";; + CYR_1251) val=cp1251;; + CYR_ISO88595) val=iso88595;; + CYR_ISOIR111) val=isoir111;; + CYR_KOI8_R) val=koi8-r;; + CYR_KOI8_U) val=koi8-u;; + *) err_exit;; + esac + name="$pref$val" + do_CODE + ;; + *) err_exit;; + esac + done +} + +print_header () { + cat <<-_EOF + ## Makefile fragment for $lang. + + ## Copyright (C) 2009, 2010 by Peter Breitenlohner. + ## Copyright (C) 2004-2005 by Gour. + ## + ## This program is free software; you can redistribute it and/or + ## modify it under the terms of the GNU General Public License as + ## published by the Free Software Foundation; either version 2 of the + ## License, or (at your option) any later version. + ## + ## This program is distributed in the hope that it will be useful, but + ## WITHOUT ANY WARRANTY; without even the implied warranty of + ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + ## General Public License for more details. + ## + ## You should have received a copy of the GNU General Public License + ## along with this program in the file COPYING; if not, write to the + ## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + ## Boston, MA 02110-1301 USA. + + subdirs += $lang + _EOF +} + +print_xdy () { + test $# -eq 0 && return + printf '\nnobase_nodist_lang_DATA +=' + for xdy + do + printf ' \\\n\t'$lang'/%s-lang.xdy' $xdy + printf ' \\\n\t'$lang'/%s-test.xdy' $xdy + printf ' \\\n\t'$lang'/%s.xdy' $xdy + done + printf "\n" +} + +print_docs () { + test $# -eq 0 && return + printf '\nDOCS_%s +=' $DOC + printf ' \\\n\t'$lang'/%s-doc.tex' "$@" + printf "\n" +} + +print_extra_hdr () { + test -n "$print_extra_hdr_done" && return + printf '\nEXTRA_DIST +=' + print_extra_hdr_done=yes +} + +print_extra () { + test $# -eq 0 && return + print_extra_hdr + printf ' \\\n\t%s' "$@" +} + +print_extra_plin () { + test $# -eq 0 && return + print_extra_hdr + printf ' \\\n\t'$lang'/%s.pl.in' "$@" +} + +print_pl () { + test $# -eq 0 && return + printf '\ndist_noinst_DATA +=' + printf ' \\\n\t'$lang'/%s.pl' "$@" + printf "\n" +} + +print_clean () { + test $# -eq 0 && return + printf '\nCLEANFILES +=' + for clean + do + case $clean in + *utf8) printf ' \\\n\t'$lang'/%s.pl' $clean;; + esac + printf ' \\\n\t'$lang'/%s.raw' $clean + done + printf "\n" +} + +make_lang () { + print_header + print_xdy $XDY + for DOC in $ALL_DOCS; do + eval print_docs \$DOCS_$DOC + done + print_extra_hdr_done= + case $lang in + general) PL="$PL template";; + klingon) PL="$PL translit-ascii";; + test1) PL="$PL test1";; + romanian) + cat <<\_EOF + +romanian/latin2.pl : romanian/utf8.pl.in + sed -e 's/@u{\([^}]*\)}//g;' -f $(srcdir)/rom-comma-kludge.sed <$< | \ + $(CONVERT_FROM_UTF8)ISO8859-2 >$@ +_EOF + print_extra rom-comma-kludge.sed + ;; + esac + print_extra_plin $PLIN + test -n "$print_extra_hdr_done" && printf '\n' + print_pl $PL + print_clean $XDY + echo +} + +all_langs () { + while read line + do + parse_lang $line + mkdir -p $lang + make_lang >$lang/Makefile.tmp + if diff $lang/Makefile.tmp $lang/Makefile.am >/dev/null 2>&1; then + rm -f $lang/Makefile.tmp + else + mv -f $lang/Makefile.tmp $lang/Makefile.am + fi + done +} + +all_langs < lang.defs