]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: enable nls support
authorRosen Penev <rosenp@gmail.com>
Fri, 9 Sep 2022 02:03:49 +0000 (19:03 -0700)
committerRosen Penev <rosenp@gmail.com>
Fri, 9 Sep 2022 02:45:23 +0000 (19:45 -0700)
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>
meson.build
meson_options.txt

index ee7619658ff9d24786531cd0456a98bef5c18c79..2447b631dad1e281f80ed06284e461f51dd2f43d 100644 (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',
index 5272cb317c97d6f8a54ccaaaf772c306a411ffda..07abf315bf83579f8c02a3e5a9f760c43bf0e355 100644 (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')