resetting manifest requested domain to floor
[platform/upstream/man-db.git] / m4 / man-linguas.m4
1 # man-linguas.m4 serial 2
2 dnl MAN_LINGUAS
3 dnl Compute the set of localised manual pages to install, taking the LINGUAS
4 dnl environment variable into account if set.
5
6 dnl Draws somewhat on po.m4:
7
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.
12 dnl
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
16 dnl functionality.
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.
21
22 dnl Authors:
23 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
24 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
25
26 AC_PREREQ([2.50])
27
28 AC_DEFUN([MAN_LINGUAS],
29 [
30   AC_REQUIRE([AM_NLS])dnl
31   if test "$USE_NLS" = yes; then
32     # The LINGUAS file contains the set of available languages.
33     man_all_linguas=
34     if test -n "$srcdir/man/LINGUAS"; then
35       man_all_linguas=`sed -e "/^#/d" -e "s/#.*//" "$srcdir/man/LINGUAS"`
36     fi
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"
40     fi
41     man_inst_linguas=
42     for presentlang in $man_all_linguas; do
43       useit=no
44       if test -n "$LINGUAS"; then
45         desiredlanguages="$LINGUAS"
46       else
47         desiredlanguages="$man_all_linguas"
48       fi
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;;
57         esac
58       done
59       if test $useit = yes; then
60         man_inst_linguas="$man_inst_linguas $presentlang"
61       fi
62     done
63     if test -n "$PO4A"; then
64       MAN_SUBDIRS="po4a $man_inst_linguas"
65     else
66       MAN_SUBDIRS="$man_inst_linguas"
67     fi
68   else
69     MAN_SUBDIRS=
70   fi
71   AC_SUBST([MAN_SUBDIRS])
72 ]) # MAN_LINGUAS