From 4e12a62e884441dbce62d3bd38108022e93e25c6 Mon Sep 17 00:00:00 2001 From: Rafal Luzynski Date: Tue, 21 Mar 2017 09:27:08 +0100 Subject: 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 --- configure.ac | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'configure.ac') 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 +]], [[ + 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 +]], [[ + 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 -- cgit v1.2.3-55-g7522