nl_langinfo.m4 1.8 KB

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