]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: check for _NL_TIME_WEEK_1STDAY in langinfo.h
authorChristian Hesse <mail@eworm.de>
Fri, 16 Jun 2023 09:52:10 +0000 (11:52 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sat, 17 Jun 2023 13:29:38 +0000 (15:29 +0200)
... which is required for `cal`.

Fixes GH-2316

meson.build

index 8b053f82116277c10a7e50b9cafdda8d8e55075b..b3641946add98f0cf3533860e3ad077d2c9e79c7 100644 (file)
@@ -483,6 +483,18 @@ have = cc.compiles('''
   name : 'langinfo.h defines _NL_ABALTMON_x constants')
 conf.set('HAVE_LANGINFO_NL_ABALTMON', have ? 1 : false)
 
+have = cc.compiles('''
+   #define _GNU_SOURCE 1
+   #include <langinfo.h>
+   int main(void) {
+        char *str;
+        str = nl_langinfo (_NL_TIME_WEEK_1STDAY);
+        return 0;
+   }
+   ''',
+  name : 'langinfo.h defines _NL_TIME_WEEK_1STDAY constant')
+conf.set('HAVE_DECL__NL_TIME_WEEK_1STDAY', have ? 1 : false)
+
 funcs = '''
         clearenv
         close_range