Support more C++ file extensions for MSVC in the compile script.
[platform/upstream/automake.git] / tests / asm.test
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Test of basic assembly functionality
18
19 . ./defs || Exit 1
20
21 set -e
22
23 cat > Makefile.am << 'END'
24 noinst_PROGRAMS = maude
25 maude_SOURCES = maude.s
26 END
27
28 : > maude.s
29
30 # Should fail because we need CC and CCAS.
31 echo 1
32 cat > configure.in << 'END'
33 AC_INIT
34 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
35 AC_SUBST(CCASFLAGS)
36 AC_OUTPUT(Makefile)
37 END
38
39 $ACLOCAL
40 AUTOMAKE_fails
41 grep AM_PROG_AS stderr
42
43 # On fast machines the autom4te.cache created during the above run of
44 # $AUTOMAKE is likely to have the same time stamp as the configure.in
45 # created below; thus causing traces for the old configure.in to be
46 # used.  We could do `$sleep', but it's faster to erase the
47 # directory.  (Erase autom4te*.cache, not autom4te.cache, because some
48 # bogus installations of Autoconf use a versioned cache.)
49 rm -rf autom4te*.cache
50
51 # We still need CCAS.
52 echo 2
53 cat > configure.in << 'END'
54 AC_INIT
55 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
56 AC_PROG_CC
57 AC_SUBST(CCASFLAGS)
58 AC_OUTPUT(Makefile)
59 END
60
61 $ACLOCAL
62 AUTOMAKE_fails
63 grep CCAS stderr
64 grep AM_PROG_AS stderr
65
66 rm -rf autom4te*.cache
67
68 # We need CCASFLAGS.
69 echo 3
70 cat > configure.in << 'END'
71 AC_INIT
72 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
73 CCAS='$(CC)'
74 AC_SUBST(CCAS)
75 AC_PROG_CC
76 AC_OUTPUT(Makefile)
77 END
78
79 $ACLOCAL
80 AUTOMAKE_fails
81 grep CCASFLAGS stderr
82 grep AM_PROG_AS stderr
83
84 rm -rf autom4te*.cache
85
86 # We have every needed, expect a success.
87 echo 4
88 cat > configure.in << 'END'
89 AC_INIT
90 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
91 CCAS='$(CC)'
92 AC_SUBST(CCAS)
93 AC_PROG_CC
94 AC_SUBST(CCASFLAGS)
95 AC_OUTPUT(Makefile)
96 END
97
98 $ACLOCAL
99 $AUTOMAKE
100
101 rm -rf autom4te*.cache
102
103 # We have every needed, expect a success.
104 echo 5
105 cat > configure.in << 'END'
106 AC_INIT
107 AM_INIT_AUTOMAKE(nonesuch, nonesuch)
108 AM_PROG_AS
109 AC_OUTPUT(Makefile)
110 END
111
112 $ACLOCAL
113 $AUTOMAKE
114
115 Exit 0