3 # This include file <bsd.nls.mk> handles building and installing Native
4 # Language Support (NLS) catalogs
8 # GENCAT A program for converting .msg files into compiled NLS
11 # NLS Source or intermediate .msg files. [set in Makefile]
13 # NLSDIR Base path for National Language Support files
14 # installation. [${SHAREDIR}/nls]
16 # NLSGRP National Language Support files group. [${SHAREGRP}]
18 # NLSMODE National Language Support files mode. [${NOBINMODE}]
20 # NLSOWN National Language Support files owner. [${SHAREOWN}]
22 .if !target(__<bsd.init.mk>__)
23 .error bsd.nls.mk cannot be included directly.
31 ${GENCAT} ${.TARGET} ${.IMPSRC}
33 .if defined(NLS) && !empty(NLS) && ${MK_NLS} != "no"
36 # .msg file pre-build rules
38 NLSSRCDIR?= ${.CURDIR}
40 .if defined(NLSSRCFILES)
41 NLSSRCFILES_${file}?= ${NLSSRCFILES}
43 .if defined(NLSSRCFILES_${file})
44 NLSSRCDIR_${file}?= ${NLSSRCDIR}
45 ${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//}
47 cat ${.ALLSRC} > ${.TARGET}
48 CLEANFILES+= ${file}.msg
53 # .cat file build rules
59 NLSDIR?= ${SHAREDIR}/nls
64 .if ${MK_STAGING_PROG} == "yes"
65 .if !defined(_SKIP_BUILD)
66 STAGE_TARGETS+= stage_symlinks
68 STAGE_SYMLINKS.NLS= ${NLSSYMLINKS}
69 STAGE_SYMLINKS_DIR.NLS= ${STAGE_OBJTOP}
71 SYMLINKS+= ${NLSSYMLINKS}
74 NLSDIR_${file:T}= ${NLSDIR}/${file:T:R}
75 NLSNAME_${file:T}= ${NLSNAME}.cat
76 .if defined(NLSLINKS_${file:R}) && !empty(NLSLINKS_${file:R})
77 .if !empty(NLSLINKS_${file:R}:M${file:R})
78 .error NLSLINKS_${file:R} contains itself: ${file:R}
81 .for dst in ${NLSLINKS_${file:R}}
82 NLSSYMLINKS+= ../${file:R}/${NLSNAME}.cat ${NLSDIR}/${dst}/${NLSNAME}.cat
86 .endif # defined(NLS) && !empty(NLS) && ${MK_NLS} != "no"