Reimplemented bsd.nls.mk using bsd.files.mk and bsd.links.mk.
Provided the (previously missing) dependency on source files for intermediate .msg files. Provided the default for NLSSRCDIR (defaults to .CURDIR). Slightly changed the API: NLS should now list plain locale names, without the .msg suffix. When included from bsd.prog.mk, NLSNAME defaults to PROG.
This commit is contained in:
+28
-1
@@ -10,7 +10,6 @@ TCSHDIR= ${.CURDIR}/../../contrib/tcsh
|
|||||||
.PATH: ${TCSHDIR}
|
.PATH: ${TCSHDIR}
|
||||||
|
|
||||||
PROG= csh
|
PROG= csh
|
||||||
SUBDIR= nls
|
|
||||||
DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
|
DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
|
||||||
CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
|
CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
|
||||||
WARNS= 0
|
WARNS= 0
|
||||||
@@ -46,6 +45,34 @@ CLEANFILES= ${GENHDRS} gethost csh.1
|
|||||||
FILESDIR= ${SHAREDIR}/examples/tcsh
|
FILESDIR= ${SHAREDIR}/examples/tcsh
|
||||||
FILES= complete.tcsh csh-mode.el
|
FILES= complete.tcsh csh-mode.el
|
||||||
|
|
||||||
|
CATALOGS= et:et_EE.ISO8859-15 \
|
||||||
|
finnish:fi_FI.ISO8859-1 \
|
||||||
|
french:fr_FR.ISO8859-1 \
|
||||||
|
german:de_DE.ISO8859-1 \
|
||||||
|
greek:el_GR.ISO8859-7 \
|
||||||
|
italian:it_IT.ISO8859-1 \
|
||||||
|
ja:ja_JP.eucJP \
|
||||||
|
russian:ru_RU.KOI8-R \
|
||||||
|
spanish:es_ES.ISO8859-1 \
|
||||||
|
ukrainian:uk_UA.KOI8-U
|
||||||
|
|
||||||
|
NLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
|
||||||
|
NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
|
||||||
|
fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 \
|
||||||
|
fr_CH.ISO8859-15 fr_FR.ISO8859-15
|
||||||
|
NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
|
||||||
|
de_CH.ISO8859-15 de_DE.ISO8859-15
|
||||||
|
NLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
|
||||||
|
NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
|
||||||
|
|
||||||
|
NLSNAME= tcsh
|
||||||
|
|
||||||
|
.for catalog in ${CATALOGS}
|
||||||
|
NLS+= ${catalog:C/.*://}
|
||||||
|
NLSSRCDIR_${catalog:C/.*://}= ${TCSHDIR}/nls/${catalog:C/:.*//}
|
||||||
|
NLSSRCFILES_${catalog:C/.*://}!= cd ${NLSSRCDIR_${catalog:C/.*://}}; echo set[0-9]*
|
||||||
|
.endfor
|
||||||
|
|
||||||
csh.1: tcsh.man
|
csh.1: tcsh.man
|
||||||
ln -sf ${.ALLSRC} ${.TARGET}
|
ln -sf ${.ALLSRC} ${.TARGET}
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
# $FreeBSD$
|
|
||||||
|
|
||||||
BASESRC= ${.CURDIR}/../../../contrib/tcsh/nls
|
|
||||||
|
|
||||||
CATALOGS= et:et_EE.ISO8859-15 \
|
|
||||||
finnish:fi_FI.ISO8859-1 \
|
|
||||||
french:fr_FR.ISO8859-1 \
|
|
||||||
german:de_DE.ISO8859-1 \
|
|
||||||
greek:el_GR.ISO8859-7 \
|
|
||||||
italian:it_IT.ISO8859-1 \
|
|
||||||
ja:ja_JP.eucJP \
|
|
||||||
russian:ru_RU.KOI8-R \
|
|
||||||
spanish:es_ES.ISO8859-1 \
|
|
||||||
ukrainian:uk_UA.KOI8-U
|
|
||||||
|
|
||||||
NLSLINKS_fi_FI.ISO8859-1= fi_FI.ISO8859-15
|
|
||||||
NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
|
|
||||||
fr_CA.ISO8859-1 fr_CA.ISO8859-15 fr_CH.ISO8859-1 fr_CH.ISO8859-15 \
|
|
||||||
fr_FR.ISO8859-15
|
|
||||||
NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
|
|
||||||
de_CH.ISO8859-15 de_DE.ISO8859-15
|
|
||||||
NLSLINKS_it_IT.ISO8859-1= it_CH.ISO8859-1 it_CH.ISO8859-15 it_IT.ISO8859-15
|
|
||||||
NLSLINKS_es_ES.ISO8859-1= es_ES.ISO8859-15
|
|
||||||
|
|
||||||
NLSNAME= tcsh
|
|
||||||
|
|
||||||
NLSSRCFILES= set[0-9]*
|
|
||||||
|
|
||||||
.for catalog in ${CATALOGS}
|
|
||||||
NLSSRCDIR_${catalog:C/.*://g}.msg:= ${BASESRC}/${catalog:C/:.*//g}
|
|
||||||
NLS+=${catalog:C/.*://g}.msg
|
|
||||||
.endfor
|
|
||||||
|
|
||||||
.include <bsd.nls.mk>
|
|
||||||
+25
-77
@@ -1,4 +1,3 @@
|
|||||||
# Based on $NetBSD: bsd.nls.mk,v 1.35 2001/11/28 20:19:08 tv Exp $
|
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
#
|
#
|
||||||
# This include file <bsd.nls.mk> handles building and installing Native
|
# This include file <bsd.nls.mk> handles building and installing Native
|
||||||
@@ -21,108 +20,57 @@
|
|||||||
# NLSOWN National Language Support files owner. [${SHAREOWN}]
|
# NLSOWN National Language Support files owner. [${SHAREOWN}]
|
||||||
#
|
#
|
||||||
# NO_NLS Do not make or install NLS files. [not set]
|
# NO_NLS Do not make or install NLS files. [not set]
|
||||||
#
|
|
||||||
# +++ targets +++
|
|
||||||
#
|
|
||||||
# install:
|
|
||||||
# Install compiled NLS files
|
|
||||||
#
|
|
||||||
# bsd.obj.mk: cleandir and obj
|
|
||||||
|
|
||||||
.include <bsd.init.mk>
|
.if !target(__<bsd.init.mk>__)
|
||||||
|
.error bsd.nls.mk cannot be included directly.
|
||||||
|
.endif
|
||||||
|
|
||||||
GENCAT?= gencat -new
|
GENCAT?= gencat -new
|
||||||
|
|
||||||
NLSDIR?= ${SHAREDIR}/nls
|
|
||||||
NLSGRP?= ${SHAREGRP}
|
|
||||||
NLSMODE?= ${NOBINMODE}
|
|
||||||
NLSOWN?= ${SHAREOWN}
|
|
||||||
|
|
||||||
NLS?=
|
|
||||||
NLSLINKS=
|
|
||||||
|
|
||||||
.SUFFIXES: .cat .msg
|
.SUFFIXES: .cat .msg
|
||||||
|
|
||||||
.msg.cat:
|
.msg.cat:
|
||||||
${GENCAT} ${.TARGET} ${.IMPSRC}
|
${GENCAT} ${.TARGET} ${.IMPSRC}
|
||||||
|
|
||||||
|
.if defined(NLS) && !empty(NLS) && !defined(NO_NLS)
|
||||||
|
|
||||||
#
|
#
|
||||||
# .msg file pre-build rules
|
# .msg file pre-build rules
|
||||||
#
|
#
|
||||||
|
NLSSRCDIR?= ${.CURDIR}
|
||||||
.for file in ${NLS}
|
.for file in ${NLS}
|
||||||
.if !defined(NLSSRCDIR_${file}) && defined(NLSSRCDIR)
|
.if defined(NLSSRCFILES)
|
||||||
NLSSRCDIR_${file}=${NLSSRCDIR}
|
NLSSRCFILES_${file}?= ${NLSSRCFILES}
|
||||||
.endif
|
.endif
|
||||||
.if !defined(NLSSRCFILES_${file}) && defined(NLSSRCFILES)
|
|
||||||
NLSSRCFILES_${file}=${NLSSRCFILES}
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if defined(NLSSRCFILES_${file})
|
.if defined(NLSSRCFILES_${file})
|
||||||
${file}:
|
NLSSRCDIR_${file}?= ${NLSSRCDIR}
|
||||||
|
${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//}
|
||||||
@rm -f ${.TARGET}
|
@rm -f ${.TARGET}
|
||||||
cat ${NLSSRCDIR_${file}}/${NLSSRCFILES_${file}} > ${.TARGET}
|
cat ${.ALLSRC} > ${.TARGET}
|
||||||
CLEANFILES+= ${file}
|
CLEANFILES+= ${file}.msg
|
||||||
.endif
|
|
||||||
|
|
||||||
.if defined(NLSLINKS_${file:C/.msg//g}) && !empty(NLSLINKS_${file:C/.msg//g})
|
|
||||||
NLSLINKS+= ${file:C/.msg//g}
|
|
||||||
.endif
|
.endif
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
#
|
#
|
||||||
# .cat file build rules
|
# .cat file build rules
|
||||||
#
|
#
|
||||||
NLSALL= ${NLS:.msg=.cat}
|
NLS:= ${NLS:=.cat}
|
||||||
CLEANFILES+= ${NLSALL}
|
CLEANFILES+= ${NLS}
|
||||||
|
FILESGROUPS?= FILES
|
||||||
|
FILESGROUPS+= NLS
|
||||||
|
NLSDIR?= ${SHAREDIR}/nls
|
||||||
|
|
||||||
#
|
#
|
||||||
# installation rules
|
# installation rules
|
||||||
#
|
#
|
||||||
__nlsinstall: .USE
|
.for file in ${NLS}
|
||||||
${INSTALL} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \
|
NLSNAME_${file:T}= ${file:T:R}/${NLSNAME}.cat
|
||||||
${.ALLSRC} ${.TARGET}
|
.if defined(NLSLINKS_${file:R}) && !empty(NLSLINKS_${file:R})
|
||||||
|
NLSLINKS+= ${file:R}
|
||||||
.for F in ${NLSALL}
|
.endif
|
||||||
_F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat
|
.for dst in ${NLSLINKS_${file:R}}
|
||||||
|
SYMLINKS+= ../${file:R}/${NLSNAME}.cat ${NLSDIR}/${dst}/${NLSNAME}.cat
|
||||||
${_F}: ${F} __nlsinstall # install rule
|
|
||||||
nlsinstall:: ${_F}
|
|
||||||
.PRECIOUS: ${_F} # keep if install fails
|
|
||||||
.endfor
|
|
||||||
|
|
||||||
links-nls:
|
|
||||||
.if defined(NLSLINKS) && !empty(NLSLINKS)
|
|
||||||
.for src in ${NLSLINKS}
|
|
||||||
.for dst in ${NLSLINKS_${src}}
|
|
||||||
ln -fs ../${src}/${NLSNAME}.cat \
|
|
||||||
${DESTDIR}${NLSDIR}/${dst}/${NLSNAME}.cat
|
|
||||||
.endfor
|
.endfor
|
||||||
.endfor
|
.endfor
|
||||||
.endif
|
|
||||||
|
|
||||||
#
|
.endif defined(NLS) && !empty(NLS) && !defined(NO_NLS)
|
||||||
|
|
||||||
.if !defined(NO_NLS) && !empty(NLS)
|
|
||||||
all-nls: ${NLSALL}
|
|
||||||
.else
|
|
||||||
all-nls:
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if !defined(NO_NLS) && !empty(NLS)
|
|
||||||
realinstall: beforeinstall nlsinstall links-nls
|
|
||||||
.else
|
|
||||||
realinstall: beforeinstall
|
|
||||||
.endif
|
|
||||||
|
|
||||||
all: all-nls
|
|
||||||
install: realinstall afterinstall
|
|
||||||
|
|
||||||
.if !target(beforeinstall)
|
|
||||||
beforeinstall:
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.if !target(afterinstall)
|
|
||||||
afterinstall:
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.include <bsd.obj.mk>
|
|
||||||
|
|||||||
@@ -145,6 +145,9 @@ _SCRIPTSINS_${script:T}: ${script}
|
|||||||
.endfor
|
.endfor
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
NLSNAME?= ${PROG}
|
||||||
|
.include <bsd.nls.mk>
|
||||||
|
|
||||||
.include <bsd.files.mk>
|
.include <bsd.files.mk>
|
||||||
.include <bsd.incs.mk>
|
.include <bsd.incs.mk>
|
||||||
.include <bsd.links.mk>
|
.include <bsd.links.mk>
|
||||||
|
|||||||
+3
-8
@@ -9,7 +9,7 @@ MLINKS= ee.1 ree.1 ee.1 edit.1
|
|||||||
DPADD= ${LIBNCURSES}
|
DPADD= ${LIBNCURSES}
|
||||||
LDADD= -lncurses
|
LDADD= -lncurses
|
||||||
|
|
||||||
LANGS= en_US.US-ASCII fr_FR.ISO8859-1 de_DE.ISO8859-1 pl_PL.ISO8859-2 \
|
NLS= en_US.US-ASCII fr_FR.ISO8859-1 de_DE.ISO8859-1 pl_PL.ISO8859-2 \
|
||||||
uk_UA.KOI8-U ru_RU.KOI8-R
|
uk_UA.KOI8-U ru_RU.KOI8-R
|
||||||
|
|
||||||
NLSLINKS_en_US.US-ASCII= en_US.ISO8859-1 en_US.ISO8859-15
|
NLSLINKS_en_US.US-ASCII= en_US.ISO8859-1 en_US.ISO8859-15
|
||||||
@@ -19,14 +19,9 @@ NLSLINKS_fr_FR.ISO8859-1= fr_BE.ISO8859-1 fr_BE.ISO8859-15 \
|
|||||||
NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
|
NLSLINKS_de_DE.ISO8859-1= de_AT.ISO8859-1 de_AT.ISO8859-15 de_CH.ISO8859-1 \
|
||||||
de_CH.ISO8859-15 de_DE.ISO8859-15
|
de_CH.ISO8859-15 de_DE.ISO8859-15
|
||||||
|
|
||||||
NLSNAME=ee
|
|
||||||
|
|
||||||
NLSSRCFILES=ee.msg
|
NLSSRCFILES=ee.msg
|
||||||
|
.for lang in ${NLS}
|
||||||
.for lang in ${LANGS}
|
NLSSRCDIR_${lang}= ${.CURDIR}/nls/${lang}
|
||||||
NLSSRCDIR_${lang}.msg=${.CURDIR}/nls/${lang}
|
|
||||||
NLS+=${lang}.msg
|
|
||||||
.endfor
|
.endfor
|
||||||
|
|
||||||
.include <bsd.prog.mk>
|
.include <bsd.prog.mk>
|
||||||
.include <bsd.nls.mk>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user