2 # tagtrace.test - check the LT_SUPPORTED_TAGS interface
4 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
6 # This file is part of GNU Libtool.
8 # GNU Libtool is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # GNU Libtool is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Libtool; see the file COPYING. If not, a copy
20 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
21 # or obtained by writing to the Free Software Foundation, Inc.,
22 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 . tests/defs || exit 1
27 : ${fnord=$srcdir/fnord$$}
29 $AUTOCONF --version > /dev/null 2>&1 || func_skip "This test requires GNU Autoconf"
33 func_skip "This test requires write access to the source tree"
36 ( cd "$srcdir" && $AUTOCONF --trace 'LT_SUPPORTED_TAG:$1' ) >/dev/null
38 if test $ret -eq 63 || test $ret -eq 1; then
39 func_error "This test requires the same Autoconf version"
40 func_skip "as the one that was used to bootstrap Libtool"
41 elif test $ret -ne 0; then
42 func_fatal_error "\`$AUTOCONF --trace' exited $ret"
45 # Abort as soon as something fails.
48 # Retrieve the list of tags supported by our main libtool script.
49 traced_tags=`cd "$srcdir" && $AUTOCONF --trace 'LT_SUPPORTED_TAG:$1'`
51 test -n "$traced_tags"
53 # Ensure each of them is accepted by --tag.
54 # (We do some useless operation like erasing an empty file, because
55 # we are just interested in whether --tag accepts the tag or not.)
56 for tag in $traced_tags; do
57 $LIBTOOL -n --mode=link --tag=$tag compiler -o liba.la foo.lo >output 2>&1
59 if grep 'ignoring unknown tag' output; then
66 # Ensure the above command would have failed for unknown tags
67 $LIBTOOL -n --mode=link --tag=UnKnOwN compiler -o liba.la foo.lo >output 2>&1
69 grep 'ignoring unknown tag' output