2 # suffix.test - check that libtool knows how to transform source suffices.
4 # Copyright (C) 2003 Free Software Foundation, Inc.
5 # This is free software; see the source for copying conditions. There is NO
6 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, a copy can be downloaded from
20 # http://www.gnu.org/copyleft/gpl.html, or by writing to the Free
21 # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24 # Extensions taken from the ones that Automake recognizes, plus Objective C,
26 extensions
="C F S ada adb ads asm c c++ cc cpp cxx f f90 for m s"
29 if test -z "$srcdir"; then
30 srcdir
=`echo "$0" | sed 's%/[^/]*$%%'`
31 test "$srcdir" = "$0" && srcdir
=.
33 .
$srcdir/defs ||
exit 1
36 for ext
in $extensions; do
37 # Try a sample compile command.
38 if ($libtool -n --mode=compile compiler
-c foo.
$ext 2>&1; exit 0) |
grep 'cannot'; then
41 echo "recognized foo.$ext as a valid source file"
45 # Make sure that invalid suffixes are not recognized.
46 for name
in $bad_names; do
47 if ($libtool -n --mode=compile compiler
-c $name 2>&1; exit 0) |
grep 'cannot'; then :
49 echo "incorrectly recognized $name as a valid source file"