meson: enable nls support

This was not implemented in meson, probably because it's a mess to do
before version 0.59.0. Speaking of which, restrict it to that.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2022-09-08 19:03:49 -07:00
parent 3e43f62954
commit fc63a3d064
2 changed files with 13 additions and 0 deletions

View file

@ -272,6 +272,18 @@ lib_readline_static = dependency(
static : true,
required : need_static_libs ? get_option('readline') : disabler())
if meson.version().version_compare('>= 0.59.0')
lib_intl = dependency(
'intl',
required : get_option('nls'))
conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false)
else
if get_option('nls').enabled()
error('nls is not supported with meson before 0.59.0')
endif
lib_intl = dependency('', required : false)
endif
lib_user = dependency(
'libuser',
version : '>= 0.58',

View file

@ -9,6 +9,7 @@ option('cryptsetup', type : 'feature')
option('cryptsetup-dlopen', type : 'feature')
option('zlib', type : 'feature')
option('readline', type : 'feature')
option('nls', type : 'feature')
option('libutil', type : 'feature')
option('libutempter', type : 'feature')
option('libpcre2-posix', type : 'feature')