summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorRafal Luzynski2017-03-21 09:27:08 +0100
committerRafal Luzynski2018-01-22 11:50:50 +0100
commit4e12a62e884441dbce62d3bd38108022e93e25c6 (patch)
treef9d717fd7d8885c5a8cd783f823c6359c9f2cbab /configure.ac
parentcal: fix julian calendars for large years (diff)
downloadkernel-qcow2-util-linux-4e12a62e884441dbce62d3bd38108022e93e25c6.tar.gz
kernel-qcow2-util-linux-4e12a62e884441dbce62d3bd38108022e93e25c6.tar.xz
kernel-qcow2-util-linux-4e12a62e884441dbce62d3bd38108022e93e25c6.zip
cal: Use ALTMON_* correctly
cal: use ALTMON_* and _NL_ABALTMON_* constants to display months in a standalone form correctly. These constants have just been newly added to glibc. ALTMON_x has been used in BSD family since 1990s and has been accepted as the future POSIX extension. _NL_ABALTMON_* is exclusively a GNU extension but it is expected to be added to POSIX in future. More info: https://sourceware.org/bugzilla/show_bug.cgi?id=10871
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac53
1 files changed, 53 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4403391e7..89afca602 100644
--- a/configure.ac
+++ b/configure.ac
@@ -305,6 +305,59 @@ AC_CHECK_HEADERS([langinfo.h],
[AM_CONDITIONAL([HAVE_LANGINFO], [true])],
[AM_CONDITIONAL([HAVE_LANGINFO], [false])])
+
+AC_MSG_CHECKING([whether langinfo.h defines ALTMON_x constants])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <langinfo.h>
+]], [[
+ char *str;
+ str = nl_langinfo (ALTMON_1);
+ str = nl_langinfo (ALTMON_2);
+ str = nl_langinfo (ALTMON_3);
+ str = nl_langinfo (ALTMON_4);
+ str = nl_langinfo (ALTMON_5);
+ str = nl_langinfo (ALTMON_6);
+ str = nl_langinfo (ALTMON_7);
+ str = nl_langinfo (ALTMON_8);
+ str = nl_langinfo (ALTMON_9);
+ str = nl_langinfo (ALTMON_10);
+ str = nl_langinfo (ALTMON_11);
+ str = nl_langinfo (ALTMON_12);
+]])], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_LANGINFO_ALTMON], [1],
+ [Define if langinfo.h defines ALTMON_x constants])
+], [
+ AC_MSG_RESULT([no])
+])
+
+
+AC_MSG_CHECKING([whether langinfo.h defines _NL_ABALTMON_x constants])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <langinfo.h>
+]], [[
+ char *str;
+ str = nl_langinfo (_NL_ABALTMON_1);
+ str = nl_langinfo (_NL_ABALTMON_2);
+ str = nl_langinfo (_NL_ABALTMON_3);
+ str = nl_langinfo (_NL_ABALTMON_4);
+ str = nl_langinfo (_NL_ABALTMON_5);
+ str = nl_langinfo (_NL_ABALTMON_6);
+ str = nl_langinfo (_NL_ABALTMON_7);
+ str = nl_langinfo (_NL_ABALTMON_8);
+ str = nl_langinfo (_NL_ABALTMON_9);
+ str = nl_langinfo (_NL_ABALTMON_10);
+ str = nl_langinfo (_NL_ABALTMON_11);
+ str = nl_langinfo (_NL_ABALTMON_12);
+]])], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_LANGINFO_NL_ABALTMON], [1],
+ [Define if langinfo.h defines _NL_ABALTMON_x constants])
+], [
+ AC_MSG_RESULT([no])
+])
+
+
dnl Convert some ac_cv_header_* variables to have_*
dnl
have_linux_version_h=$ac_cv_header_linux_version_h