On Fri, Mar 18, 2016 at 01:49:05AM +0100, Jeremie Courreges-Anglas wrote:
>
> What's the plan regarding this? libc and locale(1) don't use
> LOCALE_CHARSETS anymore, we only support UTF-8 and I doubt that we'll
> change our mind about that.
>
> The diff below removes support for non-UTF-8 LC_CTYPE files. It
> survived make release.
>
> Thoughts?
OK.
I was just about to prepare a similar diff and already sent two chunks
which are part of this diff which I missed when you posted it.
We should also remove the corresponding .src files from share/locale/ctype
and there's a share/locale/ctype/charset subdirectory with files which
I think can be deleted as well. I haven't tested a build without these
files yet, though.
> Index: lib/libc/locale/Makefile.inc
> ===
> RCS file: /cvs/src/lib/libc/locale/Makefile.inc,v
> retrieving revision 1.20
> diff -u -p -r1.20 Makefile.inc
> --- lib/libc/locale/Makefile.inc 3 Jul 2015 11:15:19 - 1.20
> +++ lib/libc/locale/Makefile.inc 17 Mar 2016 22:36:13 -
> @@ -3,9 +3,6 @@
> # locale sources
> .PATH: ${LIBCSRCDIR}/locale
>
> -# for LOCALECHARSETS
> -.include "${.CURDIR}/../../share/locale/ctype/Makefile.inc"
> -
> SRCS+= btowc.c _def_messages.c _def_monetary.c _def_numeric.c
> _def_time.c \
> localeconv.c nl_langinfo.c setlocale.c iswctype.c __mb_cur_max.c \
> mblen.c mbrlen.c mbstowcs.c mbtowc.c multibyte_citrus.c wcscoll.c \
> @@ -43,4 +40,3 @@ MLINKS+=setlocale.3 localeconv.3 \
> wcsrtombs.3 wcsnrtombs.3
>
> CFLAGS+=-I${.CURDIR} -I${LIBCSRCDIR}/citrus
> -CFLAGS+=-DLOCALE_CHARSETS="\"${LOCALECHARSETS}\""
> Index: share/locale/ctype/Makefile
> ===
> RCS file: /cvs/src/share/locale/ctype/Makefile,v
> retrieving revision 1.10
> diff -u -p -r1.10 Makefile
> --- share/locale/ctype/Makefile 1 Jul 2013 00:36:12 - 1.10
> +++ share/locale/ctype/Makefile 17 Mar 2016 22:34:44 -
> @@ -6,53 +6,18 @@ NOMAN= # defined
> # pull LOCALEDIR and other declarations
> .include
>
> -# pull in LOCALECHARSETS
> -.include "${.CURDIR}/Makefile.inc"
> +all: UTF-8.out
>
> -LOCALESRC_ARMSCII-8 = hy_AM.ARMSCII-8
> -LOCALESRC_CP1251 = bg_BG.CP1251
> -LOCALESRC_CP866 = ru_RU.CP866
> -LOCALESRC_ISO8859-1 = en_US.ISO_8859-1
> -LOCALESRC_ISO8859-2 = en_US.ISO_8859-2
> -LOCALESRC_ISO8859-4 = en_US.ISO_8859-4
> -LOCALESRC_ISO8859-5 = ru_RU.ISO_8859-5
> -LOCALESRC_ISO8859-7 = el_GR.ISO8859-7
> -LOCALESRC_ISO8859-9 = tr_TR.ISO8859-9
> -LOCALESRC_ISO8859-13 = lt_LT.ISO8859-13
> -LOCALESRC_ISO8859-15 = en_US.DIS_8859-15
> -LOCALESRC_KOI8-R = ru_RU.KOI8-R
> -LOCALESRC_KOI8-U = uk_UA.KOI8-U
> -LOCALESRC_UTF-8 = en_US.UTF-8
> -
> -all: ${LOCALECHARSETS:S/$/.out/g}
> -realall: ${LOCALECHARSETS:S/$/.out/g}
> -
> -CLEANFILES+= ${LOCALECHARSETS:S/$/.out/g}
> +UTF-8.out: en_US.UTF-8.src
> + ${CPP} < ${.CURDIR}/en_US.UTF-8.src | \
> + sed -e '/^#/d' | mklocale -o ${.TARGET}
>
> -FILES= ${LOCALECHARSETS:S/$/.out/g}
> -.for locale in ${LOCALECHARSETS}
> -FILESDIR_${locale}.out= ${LOCALEDIR}/${locale}
> -FILESNAME_${locale}.out= LC_CTYPE
> -.endfor
> +CLEANFILES+= UTF-8.out
>
> install:
> -.for locale in ${LOCALECHARSETS}
> install -o ${LOCALEOWN} -g ${LOCALEGRP} -m ${DIRMODE} -d \
> - ${DESTDIR}${LOCALEDIR}/${locale}
> + ${DESTDIR}${LOCALEDIR}/UTF-8
> install -o ${LOCALEOWN} -g ${LOCALEGRP} -m ${LOCALEMODE} \
> - ${locale}.out ${DESTDIR}${LOCALEDIR}/${locale}/LC_CTYPE
> -.endfor
> -
> -.for locale in ${LOCALECHARSETS}
> -${locale}.out: ${LOCALESRC_${locale}}.src
> - ${CPP} -I${.CURDIR} < ${.CURDIR}/${LOCALESRC_${locale}}.src | \
> - sed -e '/^#/d' | mklocale -o ${.TARGET}
> -.endfor
> -
> -.SUFFIXES: .src .out
> -.src.out:
> - ${CPP} -I${.CURDIR} < ${.IMPSRC} | sed -e '/^#/d' | \
> -mklocale -o ${.TARGET}
> -
> + UTF-8.out ${DESTDIR}${LOCALEDIR}/UTF-8/LC_CTYPE
>
> .include
> Index: share/locale/ctype/Makefile.inc
> ===
> RCS file: share/locale/ctype/Makefile.inc
> diff -N share/locale/ctype/Makefile.inc
> --- share/locale/ctype/Makefile.inc 1 Jul 2013 00:35:22 - 1.2
> +++ /dev/null 1 Jan 1970 00:00:00 -
> @@ -1,6 +0,0 @@
> -# $OpenBSD: Makefile.inc,v 1.2 2013/07/01 00:35:22 fgsch Exp $
> -
> -# Charsets supported by LC_CTYPE locale
> -LOCALECHARSETS= ARMSCII-8 CP1251 CP866 ISO8859-1 ISO8859-13 ISO8859-15 \
> - ISO8859-2 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 KOI8-R \
> - KOI8-U UTF-8
> Index: usr.bin/locale/Makefile
> ===
> RCS file: /cvs/src/usr.bin/locale/Makefile,v
> retrieving revision 1.1
> diff -u -p -r1.1 Makefile
> --- usr.bin/locale/Makefile 3 Jun 2013 14:27:50 - 1.1
> +++ usr.bin/locale/Makefile 17 Ma