summaryrefslogtreecommitdiffstats
path: root/gl/m4/nl_langinfo.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/nl_langinfo.m4')
-rw-r--r--gl/m4/nl_langinfo.m435
1 files changed, 30 insertions, 5 deletions
diff --git a/gl/m4/nl_langinfo.m4 b/gl/m4/nl_langinfo.m4
index ad456a2..25e2101 100644
--- a/gl/m4/nl_langinfo.m4
+++ b/gl/m4/nl_langinfo.m4
@@ -1,5 +1,5 @@
1# nl_langinfo.m4 serial 3 1# nl_langinfo.m4 serial 5
2dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc. 2dnl Copyright (C) 2009-2013 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -9,17 +9,42 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
9 AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) 9 AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
10 AC_REQUIRE([gl_LANGINFO_H]) 10 AC_REQUIRE([gl_LANGINFO_H])
11 AC_CHECK_FUNCS_ONCE([nl_langinfo]) 11 AC_CHECK_FUNCS_ONCE([nl_langinfo])
12 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
12 if test $ac_cv_func_nl_langinfo = yes; then 13 if test $ac_cv_func_nl_langinfo = yes; then
13 if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1; then 14 # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
15 AC_CACHE_CHECK([whether YESEXPR works],
16 [gl_cv_func_nl_langinfo_yesexpr_works],
17 [AC_RUN_IFELSE(
18 [AC_LANG_PROGRAM([[#include <langinfo.h>
19]], [[return !*nl_langinfo(YESEXPR);
20]])],
21 [gl_cv_func_nl_langinfo_yesexpr_works=yes],
22 [gl_cv_func_nl_langinfo_yesexpr_works=no],
23 [
24 case "$host_os" in
25 # Guess no on irix systems.
26 irix*) gl_cv_func_nl_langinfo_yesexpr_works="guessing no";;
27 # Guess yes elsewhere.
28 *) gl_cv_func_nl_langinfo_yesexpr_works="guessing yes";;
29 esac
30 ])
31 ])
32 case $gl_cv_func_nl_langinfo_yesexpr_works in
33 *yes) FUNC_NL_LANGINFO_YESEXPR_WORKS=1 ;;
34 *) FUNC_NL_LANGINFO_YESEXPR_WORKS=0 ;;
35 esac
36 AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
37 [$FUNC_NL_LANGINFO_YESEXPR_WORKS],
38 [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
39 if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \
40 && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then
14 : 41 :
15 else 42 else
16 REPLACE_NL_LANGINFO=1 43 REPLACE_NL_LANGINFO=1
17 AC_DEFINE([REPLACE_NL_LANGINFO], [1], 44 AC_DEFINE([REPLACE_NL_LANGINFO], [1],
18 [Define if nl_langinfo exists but is overridden by gnulib.]) 45 [Define if nl_langinfo exists but is overridden by gnulib.])
19 AC_LIBOBJ([nl_langinfo])
20 fi 46 fi
21 else 47 else
22 HAVE_NL_LANGINFO=0 48 HAVE_NL_LANGINFO=0
23 AC_LIBOBJ([nl_langinfo])
24 fi 49 fi
25]) 50])