Commit e7bc85db authored by Glenn Morris's avatar Glenn Morris
Browse files

Generate admin/charsets Makefile via configure, and make more portable.

* configure.ac (SUBDIR_MAKEFILES): Add admin/charsets/Makefile.
(admin/charsets/Makefile): Generate it.
* admin/charsets/Makefile.in: Rename from Makefile.
(AWK, srcdir, top_srcdir, AM_DEFAULT_VERBOSITY):
New variables, set by configure.
(charsetdir, lispintdir, mapfiledir, AM_V_GEN, am__v_GEN_)
(am__v_GEN_0, am__v_GEN_1, AM_V_at, am__v_at_, am__v_at_0)
(am__v_at_1, LOCAL, mapconv, run_mapconv, big5, compact, cp51932)
(cp932, eucjp_ms, gb180302, gb180304, kuten): New variables.
(TRANS_TABLE, CHARSETS): Add directory prefix to value.
(all): Declare PHONY.
(local): New PHONY target.
(map_template): New template.  Use to define short PHONY aliases.
(*.map): Add directory prefixes to targets and prerequisites.
Respect make verbosity.
(JISC6226.map): Replace non-portable sed append without newline.
(install): Remove rule.
(clean): Only delete temporary sedscript.
(bootstrap-clean, distclean, maintainer-clean, extraclean)
(totalclean): New PHONY rules.
* admin/charsets/mapconv (BASE): Replace basename with expr.
(FILE): Add "mapfiles" subdirectory.
(AWK): New variable.  Use throughout in place of "awk".
(main): Use "gunzip -c" in place of "zcat".
Don't leave whitespace before "p", for older sed.
* admin/charsets/mapfiles/PTCP154: Add final newline,
to make older sed versions happy.
; * .gitignore: Ignore admin/charsets/Makefile.
parent 9e41e0bc
......@@ -40,7 +40,6 @@ Info.plist
InfoPlist.strings
Makefile
makefile
!admin/charsets/Makefile
!etc/refcards/Makefile
!test/automated/data/flymake/Makefile
!test/indent/Makefile
......
# Makefile -- Makefile to generate charset maps in etc/charsets.
### @configure_input@
# Copyright (C) 2015 Free Software Foundation, Inc.
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
# National Institute of Advanced Industrial Science and Technology (AIST)
# Registration Number H13PRO009
......@@ -18,16 +21,38 @@
# You should have received a copy of the GNU General Public License
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
# Commentary:
### Commentary:
# Generate charset maps in etc/charsets.
# If your system doesn't have the directory /usr/share/i18n/charmaps,
# get the source of the latest glibc, gzip all the charmap files in
# the directory "localedate/charmaps", and set the variable
# GLIBC_CHARMAPS to that directory.
SHELL = @SHELL@
AWK = @AWK@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
charsetdir = ${top_srcdir}/etc/charsets
lispintdir = ${top_srcdir}/lisp/international
mapfiledir = ${srcdir}/mapfiles
GLIBC_CHARMAPS=/usr/share/i18n/charmaps
CHARSETS = ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC} ${MULE}
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
# Note: We can not prepend "ISO-" to these map files because of file
# name limits on DOS.
......@@ -76,30 +101,61 @@ MULE = MULE-ethiopic.map MULE-ipa.map MULE-is13194.map \
MULE-sisheng.map MULE-tibetan.map \
MULE-lviscii.map MULE-uviscii.map
TRANS_TABLE = cp51932.el eucjp-ms.el
SED_SCRIPT = jisx2131-filter
all: ${CHARSETS} ${TRANS_TABLE}
TRANS_TABLE = cp51932.el eucjp-ms.el
TRANS_TABLE := $(addprefix ${lispintdir}/,${TRANS_TABLE})
AWK = gawk
CHARSETS = ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC} ${MULE}
CHARSETS := $(addprefix ${charsetdir}/,${CHARSETS})
# Rules for each charset
## Those charsets whose source is not in GLIBC_CHARMAPS.
LOCAL = MIK.map PTCP154.map stdenc.map symbol.map CP720.map CP858.map \
JISX213A.map CP932-2BYTE.map JISC6226.map \
CNS-2.map CNS-3.map CNS-4.map CNS-5.map CNS-6.map CNS-7.map \
ALTERNATIVNYJ.map GB180304.map \
${MULE}
LOCAL := $(addprefix ${charsetdir}/,${LOCAL})
VSCII.map: ${GLIBC_CHARMAPS}/TCVN5712-1.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[0-9a-f].[ ]/' GLIBC-1 compact.awk > $@
VSCII-2.map: ${GLIBC_CHARMAPS}/TCVN5712-1.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[2-7a-f].[ ]/' GLIBC-1 compact.awk \
.PHONY: all local
all: ${CHARSETS} ${TRANS_TABLE}
local: ${LOCAL} ${TRANS_TABLE}
## Rules for each charset.
mapconv = ${srcdir}/mapconv
run_mapconv = AWK=${AWK} ${srcdir}/mapconv
big5 = ${srcdir}/big5.awk
compact = ${srcdir}/compact.awk
cp51932 = ${srcdir}/cp51932.awk
cp932 = ${srcdir}/cp932.awk
eucjp_ms = ${srcdir}/eucjp-ms.awk
gb180302 = ${srcdir}/gb180302.awk
gb180304 = ${srcdir}/gb180304.awk
kuten = ${srcdir}/kuten.awk
## Short aliases, eg VSCII.map = ${charsetdir}/VSCII.map
define map_template
.PHONY: $(notdir ${1})
$(notdir ${1}): ${1}
endef
$(foreach mfile,${CHARSETS},$(eval $(call map_template,$(mfile))))
${charsetdir}/VSCII.map: ${GLIBC_CHARMAPS}/TCVN5712-1.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[0-9a-f].[ ]/' GLIBC-1 ${compact} > $@
${charsetdir}/VSCII-2.map: ${GLIBC_CHARMAPS}/TCVN5712-1.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[2-7a-f].[ ]/' GLIBC-1 ${compact} \
| sed 's/0x20-0x7F.*/0x00-0x7F 0x0000/' > $@
ALTERNATIVNYJ.map: IBM866.map
# Generating $@...
@echo "# Modified from IBM866.map according to the chart at" > $@
@echo "# http://www.cyrillic.com/ref/cyrillic/koi-8alt.html," >> $@
@echo "# with guesses for the Unicodes of the glyphs." >> $@
@sed -e '1 d' \
${charsetdir}/ALTERNATIVNYJ.map: ${charsetdir}/IBM866.map
${AM_V_GEN}(echo "# Modified from $(notdir $<) according to the chart at" && \
echo "# http://www.cyrillic.com/ref/cyrillic/koi-8alt.html," && \
echo "# with guesses for the Unicodes of the glyphs." && \
sed -e '1 d' \
-e '/0xF2/ s/ .*/ 0x2019/' \
-e '/0xF3/ s/ .*/ 0x2018/' \
-e '/0xF4/ s/ .*/ 0x0301/' \
......@@ -109,216 +165,172 @@ ALTERNATIVNYJ.map: IBM866.map
-e '/0xF8/ s/ .*/ 0x2191/' \
-e '/0xF9/ s/ .*/ 0x2193/' \
-e '/0xFA/ s/ .*/ 0x00B1/' \
-e '/0xFB/ s/ .*/ 0x00F7/' < $< >> $@
-e '/0xFB/ s/ .*/ 0x00F7/' < $< ) > $@
MIK.map: mapfiles/bulgarian-mik.txt mapconv compact.awk
# Generating $@...
@./mapconv $< '1,$$' CZYBORRA compact.awk > $@
${charsetdir}/MIK.map: ${mapfiledir}/bulgarian-mik.txt ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '1,$$' CZYBORRA ${compact} > $@
PTCP154.map: mapfiles/PTCP154 mapconv compact.awk
# Generating $@...
@./mapconv $< '/^0x/' IANA compact.awk > $@
${charsetdir}/PTCP154.map: ${mapfiledir}/PTCP154 ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^0x/' IANA ${compact} > $@
stdenc.map: mapfiles/stdenc.txt mapconv compact.awk
# Generating $@...
@./mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@
${charsetdir}/stdenc.map: ${mapfiledir}/stdenc.txt ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^[0-9A-Fa-f]/' UNICODE ${compact} > $@
symbol.map: mapfiles/symbol.txt mapconv compact.awk
# Generating $@...
@./mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@
${charsetdir}/symbol.map: ${mapfiledir}/symbol.txt ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^[0-9A-Fa-f]/' UNICODE ${compact} > $@
CP720.map: mapfiles/CP720.map
# Generating $@...
@cp $< $@
${charsetdir}/CP720.map: ${mapfiledir}/CP720.map
${AM_V_GEN}cp $< $@
CP858.map: mapfiles/CP858.map
# Generating $@...
@cp $< $@
${charsetdir}/CP858.map: ${mapfiledir}/CP858.map
${AM_V_GEN}cp $< $@
CP949-2BYTE.map: ${GLIBC_CHARMAPS}/CP949.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@
${charsetdir}/CP949-2BYTE.map: ${GLIBC_CHARMAPS}/CP949.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 ${compact} > $@
GB2312.map: ${GLIBC_CHARMAPS}/GB2312.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@
${charsetdir}/GB2312.map: ${GLIBC_CHARMAPS}/GB2312.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 ${compact} > $@
GBK.map: ${GLIBC_CHARMAPS}/GBK.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@
${charsetdir}/GBK.map: ${GLIBC_CHARMAPS}/GBK.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 ${compact} > $@
GB180302.map: ${GLIBC_CHARMAPS}/GB18030.gz mapconv gb180302.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x..\/x..[ ]/' GLIBC-2 gb180302.awk > $@
${charsetdir}/GB180302.map: ${GLIBC_CHARMAPS}/GB18030.gz ${mapconv} ${gb180302}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x..\/x..[ ]/' GLIBC-2 ${gb180302} > $@
GB180304.map: GB180302.map gb180304.awk
# Generating $@...
@$(AWK) -f gb180304.awk < $< > $@
${charsetdir}/GB180304.map: ${charsetdir}/GB180302.map ${gb180304}
${AM_V_GEN}$(AWK) -f ${gb180304} < $< > $@
JISX0201.map: ${GLIBC_CHARMAPS}/JIS_X0201.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[0-9]/' GLIBC-1 compact.awk > $@
@echo "# Generated by hand" >> $@
@echo "0xA1-0xDF 0xFF61" >> $@
${charsetdir}/JISX0201.map: ${GLIBC_CHARMAPS}/JIS_X0201.gz ${mapconv} ${compact}
${AM_V_GEN}(${mapconv} $< '/^<.*[ ]\/x[0-9]/' GLIBC-1 ${compact} && \
echo "# Generated by hand" && \
echo "0xA1-0xDF 0xFF61" ) > $@
JISX0208.map: ${GLIBC_CHARMAPS}/EUC-JP.gz mapconv
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \
${charsetdir}/JISX0208.map: ${GLIBC_CHARMAPS}/EUC-JP.gz ${mapconv}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \
| sed 's/0x2015/0x2014/' > $@
JISX0212.map: ${GLIBC_CHARMAPS}/EUC-JP.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 compact.awk > $@
${charsetdir}/JISX0212.map: ${GLIBC_CHARMAPS}/EUC-JP.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 ${compact} > $@
jisx2131-filter: mapfiles/JISX213A.map
@sed -n -e '/^#/d' -e 's,.*0x\([0-9A-Z]*\)$$,/0x0*\1$$/d,p' < $< > $@
jisx2131-filter: ${mapfiledir}/JISX213A.map
${AM_V_at}sed -n -e '/^#/d' -e 's,.*0x\([0-9A-Z]*\)$$,/0x0*\1$$/d,p' < $< > $@
JISX2131.map: ${GLIBC_CHARMAPS}/EUC-JISX0213.gz mapconv jisx2131-filter
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \
${charsetdir}/JISX2131.map: ${GLIBC_CHARMAPS}/EUC-JISX0213.gz ${mapconv} jisx2131-filter
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \
| sed -f jisx2131-filter \
| sed -e 's/0x2015/0x2014/' -e 's/0x2299/0x29BF/' > $@
JISX2132.map: ${GLIBC_CHARMAPS}/EUC-JISX0213.gz mapconv
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 > $@
${charsetdir}/JISX2132.map: ${GLIBC_CHARMAPS}/EUC-JISX0213.gz ${mapconv}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 > $@
JISX213A.map: mapfiles/JISX213A.map
# Generating $@
@cp $< $@
${charsetdir}/JISX213A.map: ${mapfiledir}/JISX213A.map
${AM_V_GEN}cp $< $@
CP932-2BYTE.map: mapfiles/CP932.TXT mapconv cp932.awk
# Generating $@...
@./mapconv $< '/^0x[89A-F][0-9A-F][0-9A-F]/' UNICODE2 cp932.awk > $@
${charsetdir}/CP932-2BYTE.map: ${mapfiledir}/CP932.TXT ${mapconv} ${cp932}
${AM_V_GEN}${run_mapconv} $< '/^0x[89A-F][0-9A-F][0-9A-F]/' UNICODE2 ${cp932} > $@
cp51932.el: CP932-2BYTE.map cp51932.awk
@$(AWK) -f cp51932.awk < CP932-2BYTE.map > $@
${lispintdir}/cp51932.el: ${charsetdir}/CP932-2BYTE.map ${cp51932}
${AM_V_GEN}$(AWK) -f ${cp51932} < $< > $@
eucjp-ms.el: ${GLIBC_CHARMAPS}/EUC-JP-MS.gz eucjp-ms.awk
@zcat $< | $(AWK) -f eucjp-ms.awk > $@
${lispintdir}/eucjp-ms.el: ${GLIBC_CHARMAPS}/EUC-JP-MS.gz ${eucjp_ms}
${AM_V_GEN}gunzip -c $< | $(AWK) -f ${eucjp_ms} > $@
JISC6226.map: mapfiles/Uni2JIS mapconv kuten.awk
# Generating $@...
# As Uni2JIS doesn't contain mappings of characters added to Unicode
# recently, we add them manually here (including one correction for
# U+005C vs U+FF3C). These changes are based on bogytech's blog at
# http://bogytech.blogspot.jp/search/label/emacs.
@./mapconv $< '/^[^#].*0-/' YASUOKA kuten.awk \
| sed -e '/0x2140/s/005C/FF3C/' \
-e '$$ a 0x3442 0x3D4E' \
-e '$$ a 0x374E 0x25874' \
-e '$$ a 0x3764 0x28EF6' \
-e '$$ a 0x513D 0x2F80F' \
-e '$$ a 0x7045 0x9724' > $@
KSC5601.map: ${GLIBC_CHARMAPS}/EUC-KR.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@
BIG5.map: ${GLIBC_CHARMAPS}/BIG5.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2 > $@
BIG5-1.map: BIG5.map mapconv big5.awk
# Generating $@...
@echo "# Generated from $<" > $@
@sed -n -e '/0xa140/,/0xc8fe/p' < $< | gawk -f big5.awk >> $@
BIG5-2.map: BIG5.map mapconv big5.awk
# Generating $@...
@echo "# Generated from $<" > $@
@sed -n -e '/0xc940/,$$ p' < $< | gawk -f big5.awk >> $@
BIG5-HKSCS.map: ${GLIBC_CHARMAPS}/BIG5-HKSCS.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[89a-f].\//' GLIBC-2 compact.awk > $@
JOHAB.map: ${GLIBC_CHARMAPS}/JOHAB.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@
CNS-1.map: ${GLIBC_CHARMAPS}/EUC-TW.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@
# CNS-1.map: mapfiles/cns2ucsdkw.txt mapconv compact.awk
# # Generating $@...
# @./mapconv $< '/^C1/' KANJI-DATABASE compact.awk > $@
CNS-2.map: mapfiles/cns2ucsdkw.txt mapconv compact.awk
# Generating $@...
@./mapconv $< '/^C2/' KANJI-DATABASE compact.awk > $@
CNS-3.map: mapfiles/cns2ucsdkw.txt mapconv compact.awk
# Generating $@...
@./mapconv $< '/^C3/' KANJI-DATABASE compact.awk > $@
CNS-4.map: mapfiles/cns2ucsdkw.txt mapconv compact.awk
# Generating $@...
@./mapconv $< '/^C4/' KANJI-DATABASE compact.awk > $@
CNS-5.map: mapfiles/cns2ucsdkw.txt mapconv compact.awk
# Generating $@...
@./mapconv $< '/^C5/' KANJI-DATABASE compact.awk > $@
CNS-6.map: mapfiles/cns2ucsdkw.txt mapconv compact.awk
# Generating $@...
@./mapconv $< '/^C6/' KANJI-DATABASE compact.awk > $@
CNS-7.map: mapfiles/cns2ucsdkw.txt mapconv compact.awk
# Generating $@...
@./mapconv $< '/^C7/' KANJI-DATABASE compact.awk > $@
CNS-F.map: ${GLIBC_CHARMAPS}/EUC-TW.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*\/x8e\/xaf/ s,/x8e/xaf,,' GLIBC-2-7 compact.awk > $@
${charsetdir}/JISC6226.map: ${mapfiledir}/Uni2JIS ${mapconv} ${kuten}
${AM_V_GEN}(${run_mapconv} $< '/^[^#].*0-/' YASUOKA ${kuten} \
| sed -e '/0x2140/s/005C/FF3C/' && \
echo '0x3442 0x3D4E' && echo '0x374E 0x25874' && \
echo '0x3764 0x28EF6' && echo '0x513D 0x2F80F' && \
echo '0x7045 0x9724' ) > $@
${charsetdir}/KSC5601.map: ${GLIBC_CHARMAPS}/EUC-KR.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 ${compact} > $@
${charsetdir}/BIG5.map: ${GLIBC_CHARMAPS}/BIG5.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[a-f]/' GLIBC-2 > $@
${charsetdir}/BIG5-1.map: ${charsetdir}/BIG5.map ${mapconv} ${big5}
${AM_V_GEN}(echo "# Generated from $(notdir $<)" && \
sed -n -e '/0xa140/,/0xc8fe/p' < $< | $(AWK) -f ${big5} ) > $@
${charsetdir}/BIG5-2.map: ${charsetdir}/BIG5.map ${mapconv} ${big5}
${AM_V_GEN}(echo "# Generated from $(notdir $<)" && \
sed -n -e '/0xc940/,$$ p' < $< | $(AWK) -f ${big5} ) > $@
${charsetdir}/BIG5-HKSCS.map: ${GLIBC_CHARMAPS}/BIG5-HKSCS.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[89a-f].\//' GLIBC-2 ${compact} > $@
${charsetdir}/JOHAB.map: ${GLIBC_CHARMAPS}/JOHAB.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 ${compact} > $@
${charsetdir}/CNS-1.map: ${GLIBC_CHARMAPS}/EUC-TW.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 ${compact} > $@
# ${charsetdir}/CNS-1.map: ${mapfiledir}/cns2ucsdkw.txt ${mapconv} ${compact}
# ${AM_V_GEN}${run_mapconv} $< '/^C1/' KANJI-DATABASE ${compact} > $@
${charsetdir}/CNS-2.map: ${mapfiledir}/cns2ucsdkw.txt ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^C2/' KANJI-DATABASE ${compact} > $@
${charsetdir}/CNS-3.map: ${mapfiledir}/cns2ucsdkw.txt ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^C3/' KANJI-DATABASE ${compact} > $@
${charsetdir}/CNS-4.map: ${mapfiledir}/cns2ucsdkw.txt ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^C4/' KANJI-DATABASE ${compact} > $@
${charsetdir}/CNS-5.map: ${mapfiledir}/cns2ucsdkw.txt ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^C5/' KANJI-DATABASE ${compact} > $@
${charsetdir}/CNS-6.map: ${mapfiledir}/cns2ucsdkw.txt ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^C6/' KANJI-DATABASE ${compact} > $@
${charsetdir}/CNS-7.map: ${mapfiledir}/cns2ucsdkw.txt ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^C7/' KANJI-DATABASE ${compact} > $@
${charsetdir}/CNS-F.map: ${GLIBC_CHARMAPS}/EUC-TW.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*\/x8e\/xaf/ s,/x8e/xaf,,' GLIBC-2-7 ${compact} > $@
# General target to produce map files for mule charsets.
MULE-%.map: mapfiles/MULE-%.map
# Generating $@...
@cp $< $@
${charsetdir}/MULE-%.map: ${mapfiledir}/MULE-%.map
${AM_V_GEN}cp $< $@
# General target to produce map files for ISO-8859, GEORGIAN, and
# EBCDIC charsets. We can not use the original file name because of
# file name limit on DOS. "KA" is ISO 639 language code for Georgian.
8859-%.map: ${GLIBC_CHARMAPS}/ISO-8859-%.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
${charsetdir}/8859-%.map: ${GLIBC_CHARMAPS}/ISO-8859-%.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x/' GLIBC-1 ${compact} > $@
KA-%.map: ${GLIBC_CHARMAPS}/GEORGIAN-%.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
${charsetdir}/KA-%.map: ${GLIBC_CHARMAPS}/GEORGIAN-%.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x/' GLIBC-1 ${compact} > $@
EBCDIC%.map: ${GLIBC_CHARMAPS}/EBCDIC-%.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
${charsetdir}/EBCDIC%.map: ${GLIBC_CHARMAPS}/EBCDIC-%.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x/' GLIBC-1 ${compact} > $@
# General target to produce map files for single-byte charsets.
%.map: ${GLIBC_CHARMAPS}/%.gz mapconv compact.awk
# Generating $@...
@./mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@
install:
@for f in ${CHARSETS}; do \
if test -r $$f; then \
if ! cmp -s $$f ../../etc/charsets/$$f; then \
echo updating $$f; \
cp $$f ../../etc/charsets; \
fi; \
fi; \
done
@for f in ${TRANS_TABLE}; do \
if test -r $$f; then \
if ! cmp -s $$f ../../lisp/international/$$f; then \
echo updating $$f; \
cp $$f ../../lisp/international; \
fi; \
fi; \
done
# Clear files that are automatically generated.
${charsetdir}/%.map: ${GLIBC_CHARMAPS}/%.gz ${mapconv} ${compact}
${AM_V_GEN}${run_mapconv} $< '/^<.*[ ]\/x/' GLIBC-1 ${compact} > $@
.PHONY: clean bootstrap-clean distclean maintainer-clean extraclean totalclean
clean:
rm -f ${CHARSETS} ${TRANS_TABLE} ${SED_SCRIPT}
rm -f ${SED_SCRIPT}
bootstrap-clean: clean
distclean: clean
rm -f Makefile
maintainer-clean: distclean
## Do not remove these files, even in a bootstrap. They rarely change.
extraclean:
rm -f ${LOCAL} ${TRANS_TABLE}
totalclean: extraclean
rm -f ${CHARSETS}
#!/bin/sh
# Copyright (C) 2015 Free Software Foundation, Inc.
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
# National Institute of Advanced Industrial Science and Technology (AIST)
# Registration Number H13PRO009
......@@ -33,8 +35,10 @@
# GLIBC-1 GLIBC-2 GLIBC-2-7 CZYBORRA IANA UNICODE UNICODE2 YASUOKA
# $4: awk script
FILE="admin/charsets/$1"
BASE=`basename $1 .gz`
BASE=`expr "$1" : '.*/\(.*\)' '|' "$1"` # basename
FILE="admin/charsets/mapfiles/$BASE"
BASE=`expr "$BASE" : '\(.*\)\.gz$' '|' "$BASE"` # remove any .gz suffix
AWK=${AWK:-awk}
case "$3" in
GLIBC*)
......@@ -69,7 +73,7 @@ fi
if [ -n "$4" ] ; then
if [ -f "$4" ] ; then
AWKPROG="gawk -f $4"
AWKPROG="$AWK -f $4"
else
echo "Awk program does not exist: $4"
exit 1
......@@ -81,20 +85,20 @@ fi
if [ "$3" = "GLIBC-1" ] ; then
# Source format is:
# <UYYYY> /xXX
zcat $1 | sed -n -e "$2 p" \
gunzip -c $1 | sed -n -e "${2}p" \
| sed -e 's,<U\([^>]*\)>[ ]*/x\(..\).*,0x\2 0x\1,' \
| sort | ${AWKPROG}
elif [ "$3" = "GLIBC-2" ] ; then
# Source format is:
# <UYYYY> /xXX/xZZ
zcat $1 | sed -n -e "$2 p" \
gunzip -c $1 | sed -n -e "${2}p" \
| sed -e 's,<U\([^>]*\)>[ ]*/x\(..\)/x\(..\).*,0x\2\3 0x\1,' \
| sort | ${AWKPROG}
elif [ "$3" = "GLIBC-2-7" ] ; then
# Source format is:
# <UYYYY> /xXX/xZZ
# We must drop MSBs of XX and ZZ
zcat $1 | sed -n -e "$2 p" \
gunzip -c $1 | sed -n -e "${2}p" \
| sed -e 's/xa/x2/g' -e 's/xb/x3/g' -e 's/xc/x4/g' \
-e 's/xd/x5/g' -e 's/xe/x6/g' -e 's/xf/x7/g' \
-e 's,<U\([^>]*\)>[ ]*/x\(..\)/x\(..\).*,0x\2\3 0x\1,' \
......@@ -102,13 +106,13 @@ elif [ "$3" = "GLIBC-2-7" ] ; then
elif [ "$3" = "CZYBORRA" ] ; then
# Source format is:
# =XX U+YYYY
sed -n -e "$2 p" < $1 \
sed -n -e "${2}p" < $1 \
| sed -e 's/=\(..\)[^U]*U+\([0-9A-F]*\).*/0x\1 0x\2/' \
| sort | ${AWKPROG}
elif [ "$3" = "IANA" ] ; then
# Source format is:
# 0xXX 0xYYYY
sed -n -e "$2 p" < $1 \
sed -n -e "${2}p" < $1 \
| sed -e 's/\(0x[0-9A-Fa-f]*\)[^0]*\(0x[0-9A-Fa-f]*\).*/\1 \2/' \
| sort | ${AWKPROG}
elif [ "$3" = "UNICODE" ] ; then
......@@ -116,25 +120,25 @@ elif [ "$3" = "UNICODE" ] ; then
# YYYY XX
# We perform reverse sort to prefer the first one in the
# duplicated mappings (e.g. 0x20->U+0020, 0x20->U+00A0).
sed -n -e "$2 p" < $1 \
sed -n -e "${2}p" < $1 \
| sed -e 's/\([0-9A-F]*\)[^0-9A-F]*\([0-9A-F]*\).*/0x\2 0x\1/' \
| sort -r
elif [ "$3" = "UNICODE2" ] ; then
# Source format is:
# 0xXXXX 0xYYYY # ...
sed -n -e "$2 p" < $1 \
sed -n -e "${2}p" < $1 \
| sed -e 's/\([0-9A-Fx]*\)[^0]*\([0-9A-Fx]*\).*/\1 \2/' \
| ${AWKPROG} | sort -n -k 4,4
elif [ "$3" = "YASUOKA" ] ; then
# Source format is:
# YYYY 0-XXXX (XXXX is a Kuten code)
sed -n -e "$2 p" < $1 \
sed -n -e "${2}p" < $1 \
| sed -e 's/\([0-9A-F]*\)[^0]*0-\([0-9]*\).*/0x\2 0x\1/' \
| sort | ${AWKPROG}
elif [ "$3" = "KANJI-DATABASE" ] ; then
# Source format is:
# C?-XXXX U+YYYYY .....
sed -n -e "$2 p" < $1 \
sed -n -e "${2}p" < $1 \
| sed -e 's/...\(....\) U+\([0-9A-F]*\).*/0x\1 0x\2/' \
| sort | ${AWKPROG}
else
......
......@@ -288,4 +288,4 @@ e-mail: auskov&idc.kz
Intended usage:
COMMON
(record created 2002-09-27)
\ No newline at end of file
(record created 2002-09-27)
......@@ -5247,7 +5247,8 @@ fi
dnl The admin/ directory used to be excluded from tarfiles.
if test -d $srcdir/admin; then
SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES admin/unidata/Makefile admin/grammars/Makefile"
SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES admin/charsets/Makefile admin/unidata/Makefile admin/grammars/Makefile"
AC_CONFIG_FILES([admin/charsets/Makefile])
AC_CONFIG_FILES([admin/unidata/Makefile])
AC_CONFIG_FILES([admin/grammars/Makefile])
fi dnl -d admin
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment