source: trunk/essentials/sys-devel/automake-1.10/tests/gettext.test

Last change on this file was 3147, checked in by bird, 18 years ago

automake 1.10

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