Detect strverscmp support properly
authorDmitry Marakasov <amdmi3@amdmi3.ru>
Wed, 31 Aug 2022 16:14:36 +0000 (19:14 +0300)
committerColin Clark <colin.clark@cclark.uk>
Thu, 1 Sep 2022 12:15:49 +0000 (13:15 +0100)
config.h.in
meson.build

index 67e6821..ab5e282 100644 (file)
 #define HAVE_STRING_H 1
 
 /* Define to 1 if you have the `strverscmp' function. */
-#define HAVE_STRVERSCMP 1
+#mesondefine HAVE_STRVERSCMP
 
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #define HAVE_SYS_STAT_H 1
index e44cf8c..38aaa62 100644 (file)
@@ -446,6 +446,11 @@ else
     summary({'nl_langinfo' : ['nl_langinfo not found - first weekday depends on locale:', false, 'first weekday defaults to Monday']}, section : 'Documentation', bool_yn : true)
 endif
 
+result = cc.has_function('strverscmp', prefix : '#include <string.h>')
+if result
+    conf_data.set('HAVE_STRVERSCMP', 1)
+endif
+
 conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
 conf_data.set_quoted('GQ_APPDIR', gq_appdir)
 conf_data.set_quoted('GQ_BINDIR', gq_bindir)