gettext-sister.m4 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # intl sister-directory configuration rules.
  2. #
  3. # The idea behind this macro is that there's no need to repeat all the
  4. # autoconf probes done by the intl directory - it's already done them
  5. # for us. In fact, there's no need even to look at the cache for the
  6. # answers. All we need to do is nab a few pieces of information.
  7. # The intl directory is set up to make this easy, by generating a
  8. # small file which can be sourced as a shell script; then we produce
  9. # the necessary substitutions and definitions for this directory.
  10. AC_DEFUN([ZW_GNU_GETTEXT_SISTER_DIR],
  11. [# If we haven't got the data from the intl directory,
  12. # assume NLS is disabled.
  13. USE_NLS=no AC_SUBST(USE_NLS)
  14. LIBINTL= AC_SUBST(LIBINTL)
  15. LIBINTL_DEP= AC_SUBST(LIBINTL_DEP)
  16. INCINTL= AC_SUBST(INCINTL)
  17. XGETTEXT= AC_SUBST(XGETTEXT)
  18. GMSGFMT= AC_SUBST(GMSGFMT)
  19. POSUB= AC_SUBST(POSUB)
  20. if test -f ifelse([$1],,[../intl],[$1])/config.intl; then
  21. . ifelse([$1],,[../intl],[$1])/config.intl
  22. fi
  23. AC_MSG_CHECKING([whether NLS is requested])
  24. if test x"$USE_NLS" != xyes; then
  25. AC_MSG_RESULT(no)
  26. else
  27. AC_MSG_RESULT(yes)
  28. AC_DEFINE(ENABLE_NLS, 1,
  29. [Define to 1 if translation of program messages to the
  30. user's native language is requested.])
  31. AC_MSG_CHECKING(for catalogs to be installed)
  32. # Look for .po and .gmo files in the source directory.
  33. CATALOGS= AC_SUBST(CATALOGS)
  34. XLINGUAS=
  35. for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do
  36. # If there aren't any .gmo files the shell will give us the
  37. # literal string "../path/to/srcdir/po/*.gmo" which has to be
  38. # weeded out.
  39. case "$cat" in *\**)
  40. continue;;
  41. esac
  42. # The quadruple backslash is collapsed to a double backslash
  43. # by the backticks, then collapsed again by the double quotes,
  44. # leaving us with one backslash in the sed expression (right
  45. # before the dot that mustn't act as a wildcard).
  46. cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"`
  47. lang=`echo $cat | sed -e "s!\\\\.gmo!!"`
  48. # The user is allowed to set LINGUAS to a list of languages to
  49. # install catalogs for. If it's empty that means "all of them."
  50. if test "x$LINGUAS" = x; then
  51. CATALOGS="$CATALOGS $cat"
  52. XLINGUAS="$XLINGUAS $lang"
  53. else
  54. case "$LINGUAS" in *$lang*)
  55. CATALOGS="$CATALOGS $cat"
  56. XLINGUAS="$XLINGUAS $lang"
  57. ;;
  58. esac
  59. fi
  60. done
  61. LINGUAS="$XLINGUAS"
  62. AC_MSG_RESULT($LINGUAS)
  63. dnl Set up some additional variables which our po/Make-in files
  64. dnl may need.
  65. dnl For backward compatibility. Some Makefiles may be using these.
  66. DATADIRNAME=share
  67. AC_SUBST(DATADIRNAME)
  68. INSTOBJEXT=.mo
  69. AC_SUBST(INSTOBJEXT)
  70. GENCAT=gencat
  71. AC_SUBST(GENCAT)
  72. CATOBJEXT=.gmo
  73. AC_SUBST(CATOBJEXT)
  74. fi])