tests: work around strangeness in MSYS
[automake.git] / tests / asm.test
blobec6dbec9f5dc3ca5acad16179bf5d879b0b97ba6
1 #! /bin/sh
2 # Copyright (C) 2001, 2002, 2003, 2010, 2011 Free Software Foundation,
3 # Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Test of basic assembly functionality.
19 # Keep this in sync with sister tests asm2.test and asm3.test.
21 . ./defs || Exit 1
23 mv configure.in configure.stub
25 cat > Makefile.am << 'END'
26 noinst_PROGRAMS = maude
27 maude_SOURCES = maude.s
28 END
30 echo '*** Try 1 -- should fail because we need CC and CCAS ***'
31 cat configure.stub - > configure.in << 'END'
32 AC_SUBST([CCASFLAGS])
33 AC_OUTPUT
34 END
36 $ACLOCAL
37 AUTOMAKE_fails
38 grep '[Aa]ssembler source.*CCAS.* undefined' stderr
39 grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
41 # On fast machines the autom4te.cache created during the above run of
42 # $AUTOMAKE is likely to have the same time stamp as the configure.in
43 # created below; thus causing traces for the old configure.in to be
44 # used. We could do `$sleep', but it's faster to erase the
45 # directory. (Erase autom4te*.cache, not autom4te.cache, because some
46 # bogus installations of Autoconf use a versioned cache.)
47 rm -rf autom4te*.cache
49 echo '*** Try 2 -- we still need CCAS ***'
50 cat configure.stub - > configure.in << 'END'
51 AC_PROG_CC
52 AC_SUBST([CCASFLAGS])
53 AC_OUTPUT
54 END
56 $ACLOCAL
57 AUTOMAKE_fails
58 grep '[Aa]ssembler source.*CCAS.* undefined' stderr
59 grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
61 rm -rf autom4te*.cache
63 echo '*** Try 3 -- we need CCASFLAGS ***'
64 cat configure.stub - > configure.in << 'END'
65 CCAS='$(CC)'
66 AC_SUBST([CCAS])
67 AC_PROG_CC
68 AC_OUTPUT
69 END
71 $ACLOCAL
72 AUTOMAKE_fails
73 grep '[Aa]ssembler source.*CCASFLAGS.* undefined' stderr
74 grep 'define .*CCASFLAGS.* add .*AM_PROG_AS' stderr
76 rm -rf autom4te*.cache
78 echo '*** Try 4 -- we have everything needed, expect success ***'
79 cat configure.stub - > configure.in << 'END'
80 CCAS='$(CC)'
81 AC_SUBST([CCAS])
82 AC_PROG_CC
83 AC_SUBST([CCASFLAGS])
84 AC_OUTPUT
85 END
87 $ACLOCAL
88 $AUTOMAKE
90 rm -rf autom4te*.cache
92 echo '*** Try 5 -- we have everything needed, expect success ***'
93 cat configure.stub - > configure.in << 'END'
94 AM_PROG_AS
95 AC_OUTPUT
96 END
98 $ACLOCAL
99 $AUTOMAKE