localedef: unbreak WITHOUT_LOCALES

After 0fa5403d49 ("pkgbase: move locales into their own package") we
need usr.bin/localedef as a bootstrap tool independent on where
WITHOUT_LOCALE was specified as we ALWAYS process C.UTF-8.

At the same time LOCALES= in the local Makefile is empty but
C.UTF-8 with WITHOUT_LOCALES. C.UTF-8 is excluded from FILES, and thus
after the replacement FILES= is set to only .LC_CTYPE which results in
a build failure not knowing how to build that. Tweak the substitution to
replace only non-empty words so that FILES remains harmlessly empty.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D31589
This commit is contained in:
Bjoern A. Zeeb 2021-08-19 12:27:04 -05:00 committed by Kyle Evans
parent c81ea895b5
commit 298ee47e19
2 changed files with 2 additions and 3 deletions

View file

@ -2353,10 +2353,9 @@ ${_bt}-usr.bin/clang/llvm-tblgen: ${_bt}-lib/clang/libllvmminimal
${_bt}-usr.bin/clang/lldb-tblgen: ${_bt}-lib/clang/libllvmminimal
.endif
.if ${MK_LOCALES} != "no"
# C.UTF-8 is always built in share/ctypes and we need localedef for that.
_localedef= usr.bin/localedef
${_bt}-usr.bin/localedef: ${_bt}-usr.bin/yacc ${_bt_lex_depend}
.endif
.if ${MK_ICONV} != "no"
_mkesdb= usr.bin/mkesdb

View file

@ -218,7 +218,7 @@ SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset)
# C.UTF-8 is the default locale, so it should always been installed.
ALWAYS= C.UTF-8.LC_CTYPE
FILES= ${LOCALES:NC.UTF-8:S/$/.LC_CTYPE/}
FILES= ${LOCALES:NC.UTF-8:C/.+$/&.LC_CTYPE/}
CLEANFILES= ${FILES}
.for f t in ${SAME}