2 # suffix.test - check that libtool knows how to transform source suffices.
4 # Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
5 # Written by Gary V. Vaughan, 2003
7 # This file is part of GNU Libtool.
9 # GNU Libtool is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation; either version 2 of
12 # the License, or (at your option) any later version.
14 # GNU Libtool is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GNU Libtool; see the file COPYING. If not, a copy
21 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
22 # or obtained by writing to the Free Software Foundation, Inc.,
23 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 # Extensions taken from the ones that Automake recognizes, plus Objective C,
27 # and GNU Ada. Also test that multiple dots are handled correctly.
28 extensions="C F S ada adb ads asm c c++ cc cpp cxx f f90 F90 f95 F95 f03 F03 for go m s sx ada.ada"
31 . tests/defs || exit 1
34 for ext in $extensions; do
35 # Try a sample compile command.
36 if ($LIBTOOL -n --mode=compile compiler -c foo.$ext 2>&1; exit 0) | grep 'cannot'; then
39 echo "recognized foo.$ext as a valid source file"
43 # Make sure that invalid suffixes are not recognized.
44 for name in $bad_names; do
45 if ($LIBTOOL -n --mode=compile compiler -c $name 2>&1; exit 0) | grep 'cannot'; then :
47 echo "incorrectly recognized $name as a valid source file"