From fc63a3d06478bacb8a5d22310053ce7fd3084cec Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 8 Sep 2022 19:03:49 -0700 Subject: [PATCH] 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 --- meson.build | 12 ++++++++++++ meson_options.txt | 1 + 2 files changed, 13 insertions(+) diff --git a/meson.build b/meson.build index ee7619658f..2447b631da 100644 --- a/meson.build +++ b/meson.build @@ -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', diff --git a/meson_options.txt b/meson_options.txt index 5272cb317c..07abf315bf 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') -- 2.47.3