Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / gettext.test
1 #! /bin/sh
2 # Copyright (C) 2002, 2003, 2006  Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 # Check gettext support.
18
19 required='gettext'
20 . ./defs || Exit 1
21
22 set -e
23
24 cat >>configure.in <<END
25 AM_GNU_GETTEXT
26 AM_GNU_GETTEXT_VERSION([0.14.3])
27 AC_OUTPUT
28 END
29
30 : >Makefile.am
31 mkdir po intl
32
33 # config.rpath is required by versions >= 0.14.3.  We try to verify
34 # this requirement, but only when we find we have a working and recent
35 # gettext installation.
36
37 # If aclocal fails here, it may be that gettext is too old to
38 # provide AM_GNU_GETTEXT_VERSION.
39 if $ACLOCAL; then
40
41   # autopoint will fail if it's from an older version.
42   # If gettext is too old to provide autopoint, this will
43   # fail as well, so we're safe here.
44   if autopoint -n; then
45     AUTOMAKE_fails --add-missing
46     grep 'required.*config.rpath' stderr
47   fi
48 fi
49
50 : >config.rpath
51 sed '/AM_GNU_GETTEXT_VERSION/d' configure.in >configure.int
52 mv -f configure.int configure.in
53
54 $ACLOCAL
55
56 # po/ and intl/ are required
57
58 AUTOMAKE_fails --add-missing
59 grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
60
61 echo 'SUBDIRS = po' >Makefile.am
62 AUTOMAKE_fails --add-missing
63 grep 'AM_GNU_GETTEXT.*intl' stderr
64
65 echo 'SUBDIRS = intl' >Makefile.am
66 AUTOMAKE_fails --add-missing
67 grep 'AM_GNU_GETTEXT.*po' stderr
68
69 # Ok.
70
71 echo 'SUBDIRS = po intl' >Makefile.am
72 $AUTOMAKE --add-missing
73
74 # Make sure distcheck runs ./configure --with-included-gettext
75 grep 'with-included-gettext' Makefile.in
76
77 # `SUBDIRS = po intl' isn't required if po/ doesn't exist.
78 # PR/381.
79
80 rmdir po
81 mkdir sub
82 echo 'SUBDIRS = sub' >Makefile.am
83 $AUTOMAKE
84
85 # Still, SUBDIRS must be defined.
86
87 : >Makefile.am
88 AUTOMAKE_fails --add-missing
89 grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr