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