tests: better handling of gettext and libtool requirements
[automake.git] / tests / libtool-macros.test
blob31e501947498fdbc3a5fab602cb4d6aac23d6a3c
1 #! /bin/sh
2 # Copyright (C) 2011 Free Software Foundation, Inc.
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.
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.
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/>.
17 # Try to find the libtool `.m4' files and make them easily accessed
18 # to the test cases requiring them.
19 # See also automake bug#9807.
21 . ./defs || Exit 1
23 echo "# Automatically generated by $me." > get.sh
24 echo : >> get.sh
26 # The `libtoolize' script will look into Makefile.am.
27 echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am
29 if libtoolize --copy --install && test -f m4/libtool.m4; then
30 unindent >> get.sh <<END
31 ACLOCAL_PATH="`pwd`/m4":\$ACLOCAL_PATH
32 export ACLOCAL_PATH
33 END
34 else
35 # Libtoolize from libtool < 2.0 didn't support the `--install' option,
36 # but this doesn't mean the user hasn't made the libtool macros
37 # available, e.g., by properly setting ACLOCAL_PATH.
38 rm -rf m4
39 mkdir m4
40 echo AC_PROG_LIBTOOL >> configure.in
41 # See below for an explanation about the use the of `-Wno-syntax'.
42 if $ACLOCAL -Wno-syntax -I m4 --install && test -f m4/libtool.m4; then
43 : # Libtool macros already accessible by default.
44 else
45 echo "skip_ \"couldn't find or get libtool macros\"" >> get.sh
49 . ./get.sh
51 $ACLOCAL --force -I m4 || cat >> get.sh <<'END'
52 # We need to use `-Wno-syntax', since we do not want our test suite
53 # to fail merely because some third-party `.m4' file is underquoted.
54 ACLOCAL="$ACLOCAL -Wno-syntax"
55 END
57 # The file libtoolize might have just copied in the `m4' subdirectory of
58 # the test directory are going to be needed by other tests, so we must
59 # not remove the test directory.
60 keep_testdirs=yes