Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Feb 2002 17:20:25 +0200
From:      Alexey Zelkin <phantom@freebsd.org>
To:        hackers@freebsd.org, ache@freensd.org, bde@freebsd.org, sobomax@freebsd.org, ru@freebsd.org
Subject:   CFR: NLS build infrastructure ...
Message-ID:  <20020214172025.A24613@gate.sim.ionidea.com>

next in thread | raw e-mail | index | archive | help

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

hi,

I've investigated NetBSD's infrastructure used to build/install NLS
files and based on their ideas wrote small additional include file
for /usr/share/mk. I'm not make(1) guru and expect to have there some
bogons.

Since we have now two consumers of NLS catalogs in tree (tcsh and ee)
I've also attached patches which are supposed to convert current way
of NLS files handling into new include .mk file logic.

Attached files are:

1. bsd.nls.mk -- include file supposed to be installed to /usr/share/mk
2. csh.nls.Makefile.patch -- patch for src/bin/csh/nls/Makefile. Applying
   of this patch also iluminates need of src/bin/csh/nls/*/Makefile since
   it's completely replaces them.
3. ee.Makefile.patch -- patch for src/usr.bin/ee/Makefile

NOTE: These patches are not {build,install}world tested (local tests only)
and provided for review, feedbacks or objections only.


--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="bsd.nls.mk"

#	$NetBSD: bsd.nls.mk,v 1.35 2001/11/28 20:19:08 tv Exp $
# $FreeBSD$
#
# This include file <bsd.nls.mk> handles building and installing Native
# Language Support (NLS) catalogs
#
# +++ variables +++
#
# GENCAT	A program for converting .msg files into compiled NLS
#		.cat files. [gencat -new]
#
# NLS		Source or intermediate .msg files. [set in Makefile]
#
# NLSDIR	Base path for National Language Support files
#		installation. [${SHAREDIR}/nls]
#
# NLSGRP	National Language Support files group. [${SHAREGRP}]
#
# NLSMODE	National Language Support files mode. [${NOBINMODE}]
#
# NLSOWN	National Language Support files owner. [${SHAREOWN}]
#
# NONLS		Do not make or install NLS files. [not set]
#
# +++ targets +++
#
#	install:
#		Install compiled NLS files
#
# bsd.obj.mk: cleandir and obj

# XXX: test with buildworld -- ${DESTDIR}${NLSDIR}
#

GENCAT?=	gencat -new
# from NetBSD -- to use in libraries
#NLSNAME?=	${PROG:Ulib${LIB}}

NLSDIR?=        ${SHAREDIR}/nls
NLSGRP?=        ${SHAREGRP}
NLSMODE?=       ${NOBINMODE}
NLSOWN?=        ${SHAREOWN}

NLS?=

.MAIN:		all

.SUFFIXES: .cat .msg

.msg.cat:
	${GENCAT} ${.TARGET} ${.IMPSRC}

#
# .msg file pre-build rules
#
.for file in ${NLS}
.if defined(NLSSRCFILES_${file})
${file}:
	@rm -f ${.TARGET}
	cat ${NLSSRCDIR_${file}}/${NLSSRCFILES_${file}} > ${.TARGET}
.endif
CLEANFILES+= ${file}
.endfor

#
# .cat file build rules
#
NLSALL=		${NLS:.msg=.cat}
CLEANFILES+=	${NLSALL}

#
# installation rules
#
__nlsinstall: .USE
	${INSTALL} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \
		${.ALLSRC} ${.TARGET}

.for F in ${NLSALL}
_F:=		${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat

${_F}:		${F} __nlsinstall			# install rule
nlsinstall::	${_F}
.PRECIOUS:	${_F}					# keep if install fails
.endfor

#

.if !defined(NONLS) && !empty(NLS)
all-nls: ${NLSALL}
.else
all-nls:
.endif

all:		all-nls _SUBDIR
install:	beforeinstall nlsinstall afterinstall

.if !target(distribute)
distribute:
.endif

.if !target(beforeinstall)
beforeinstall:
.endif

.if !target(afterinstall)
afterinstall:
.endif

.include <bsd.obj.mk>

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ee.Makefile.patch"

Index: Makefile
===================================================================
RCS file: /cvs/freebsd/src/usr.bin/ee/Makefile,v
retrieving revision 1.19
diff -u -r1.19 Makefile
--- Makefile	17 Dec 2001 13:59:33 -0000	1.19
+++ Makefile	14 Feb 2002 15:06:07 -0000
@@ -15,17 +15,12 @@
 8859_15_LINKS = fr_FR de_DE
 ENUS_LINKS =	ISO8859-1 ISO8859-15
 
-FILES=	${LANGS:S/$/.ee.cat/}
-CLEANFILES+=	${FILES}
+NLSNAME=ee
 
 .for lang in ${LANGS}
-${lang}.ee.cat: ${.CURDIR}/nls/${lang}/ee.msg
-	gencat -new ${.TARGET} ${.ALLSRC}
-.endfor
-
-.for lang in ${LANGS}
-FILESDIR_${lang:S/$/.ee.cat/}=	${NLSDIR}/${lang}
-FILESNAME_${lang:S/$/.ee.cat/}=	ee.cat
+NLSSRCDIR_${lang}.msg=${.CURDIR}/nls/${lang}
+NLSSRCFILES_${lang}.msg=ee.msg
+NLS+=${lang}.msg
 .endfor
 
 .for link in ${ENUS_LINKS}
@@ -36,3 +31,4 @@
 .endfor
 
 .include <bsd.prog.mk>
+.include <bsd.nls.mk>

--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="csh.nls.Makefile.patch"

Index: Makefile
===================================================================
RCS file: /cvs/freebsd/src/bin/csh/nls/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- Makefile	5 Sep 2001 18:10:27 -0000	1.9
+++ Makefile	14 Feb 2002 15:09:25 -0000
@@ -1,5 +1,24 @@
-# $FreeBSD: src/bin/csh/nls/Makefile,v 1.9 2001/09/05 18:10:27 mp Exp $
+# $FreeBSD$
 
-SUBDIR= et finnish french german greek italian ja russian spanish ukrainian
+BASESRC= ${.CURDIR}/../../../contrib/tcsh/nls
 
-.include <bsd.subdir.mk>
+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
+
+NLSNAME= tcsh
+
+.for catalog in ${CATALOGS}
+NLSSRCDIR_${catalog:C/.*://g}.msg:= ${BASESRC}/${catalog:C/:.*//g}
+NLSSRCFILES_${catalog:C/.*://g}.msg= set[0-9]*
+NLS+=${catalog:C/.*://g}.msg
+.endfor
+
+.include <bsd.nls.mk>

--sm4nu43k4a2Rpi4c--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020214172025.A24613>