Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / infer-tag.at
1 # infer-tag.at -- libtool without --tag             -*- Autotest -*-
2 #
3 #   Copyright (C) 2008, 2010 Free Software Foundation, Inc.
4 #
5 #   This file is part of GNU Libtool.
6 #
7 # GNU Libtool is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License as
9 # published by the Free Software Foundation; either version 2 of
10 # the License, or (at your option) any later version.
11 #
12 # GNU Libtool is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with GNU Libtool; see the file COPYING.  If not, a copy
19 # can be downloaded from  http://www.gnu.org/licenses/gpl.html,
20 # or obtained by writing to the Free Software Foundation, Inc.,
21 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 ####
23
24 # Check that func_infer_tag works.
25
26 # We add one test per tag, so that only those tests are skipped
27 # for which the tags are disabled (otherwise we only ever test
28 # on systems where all tags are enabled).
29
30 AT_SETUP([inferred tag])
31 AT_KEYWORDS([libtool])
32
33 AT_DATA([a.c],
34 [[int a (void) { return 0; }
35 ]])
36
37 AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c a.c],
38          [], [ignore], [ignore])
39
40 AT_CLEANUP
41
42 AT_SETUP([CXX inferred tag])
43 LT_AT_TAG([CXX])
44 AT_KEYWORDS([libtool])
45
46 AT_DATA([a.cpp],
47 [[int a (void) { return 0; }
48 ]])
49
50 AT_CHECK([$LIBTOOL --mode=compile $CXX $CPPFLAGS $CXXFLAGS -c a.cpp],
51          [], [ignore], [ignore])
52
53 AT_CLEANUP
54
55 AT_SETUP([F77 inferred tag])
56 LT_AT_TAG([F77])
57 AT_KEYWORDS([libtool])
58
59 AT_DATA([a.f],
60 [[      program main
61       end
62 ]])
63
64 AT_CHECK([$LIBTOOL --mode=compile $F77 $FFLAGS -c a.f],
65          [], [ignore], [ignore])
66
67 AT_CLEANUP
68
69 AT_SETUP([FC inferred tag])
70 LT_AT_TAG([FC])
71 AT_KEYWORDS([libtool])
72
73 AT_DATA([a.f],
74 [[      program main
75       end
76 ]])
77
78 AT_CHECK([$LIBTOOL --mode=compile $FC $FCFLAGS -c a.f],
79          [], [ignore], [ignore])
80
81 AT_CLEANUP
82
83 AT_SETUP([GCJ inferred tag])
84 LT_AT_TAG([GCJ])
85 AT_KEYWORDS([libtool])
86
87 AT_DATA([A.java],
88 [[public class A {
89   private int a;
90   public A () { a = 0; }
91 };
92 ]])
93
94 AT_CHECK([$LIBTOOL --mode=compile $GCJ $GCJCFLAGS -c A.java],
95          [], [ignore], [ignore])
96
97 AT_CLEANUP