1 # man-linguas.m4 serial 2
3 dnl Compute the set of localised manual pages to install, taking the LINGUAS
4 dnl environment variable into account if set.
6 dnl Draws somewhat on po.m4:
8 dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
9 dnl This file is free software; the Free Software Foundation
10 dnl gives unlimited permission to copy and/or distribute it,
11 dnl with or without modifications, as long as this notice is preserved.
13 dnl This file can can be used in projects which are not available under
14 dnl the GNU General Public License or the GNU Library General Public
15 dnl License but which still want to provide support for the GNU gettext
17 dnl Please note that the actual code of the GNU gettext library is covered
18 dnl by the GNU Library General Public License, and the rest of the GNU
19 dnl gettext package package is covered by the GNU General Public License.
20 dnl They are *not* in the public domain.
23 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
24 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
28 AC_DEFUN([MAN_LINGUAS],
30 AC_REQUIRE([AM_NLS])dnl
31 if test "$USE_NLS" = yes; then
32 # The LINGUAS file contains the set of available languages.
34 if test -n "$srcdir/man/LINGUAS"; then
35 man_all_linguas=`sed -e "/^#/d" -e "s/#.*//" "$srcdir/man/LINGUAS"`
37 if test -n "$PO4A" && test -n "$srcdir/man/LINGUAS.po4a"; then
38 man_all_linguas_po4a=`sed -e "/^#/d" -e "s/#.*//" "$srcdir/man/LINGUAS.po4a"`
39 man_all_linguas="$man_all_linguas $man_all_linguas_po4a"
42 for presentlang in $man_all_linguas; do
44 if test -n "$LINGUAS"; then
45 desiredlanguages="$LINGUAS"
47 desiredlanguages="$man_all_linguas"
49 for desiredlang in $desiredlanguages; do
50 # Use the presentlang catalog if desiredlang is
51 # a. equal to presentlang, or
52 # b. a variant of presentlang (because in this case,
53 # presentlang can be used as a fallback for messages
54 # which are not translated in the desiredlang catalog).
55 case "$desiredlang" in
56 "$presentlang"*) useit=yes;;
59 if test $useit = yes; then
60 man_inst_linguas="$man_inst_linguas $presentlang"
63 if test -n "$PO4A"; then
64 MAN_SUBDIRS="po4a $man_inst_linguas"
66 MAN_SUBDIRS="$man_inst_linguas"
71 AC_SUBST([MAN_SUBDIRS])