tests: avoid two spurious failures on FreeBSD
[automake.git] / t / asm2.sh
blobd62cb60b847503a728e5bd71188ffbec980638a9
1 #! /bin/sh
2 # Copyright (C) 2001-2012 Free Software Foundation, Inc.
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.
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.
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/>.
17 # Test of basic preprocessed assembly functionality.
18 # Keep this in sync with sister tests 'asm.sh' and 'asm3.sh'.
20 . ./defs || exit 1
22 mv configure.ac configure.stub
24 cat > Makefile.am << 'END'
25 noinst_PROGRAMS = maude
26 maude_SOURCES = maude.S
27 END
29 echo '*** Try 1 -- should fail because we need CC and CCAS ***'
30 cat configure.stub - > configure.ac << 'END'
31 AC_SUBST([CCASFLAGS])
32 AC_OUTPUT
33 END
35 $ACLOCAL
36 AUTOMAKE_fails
37 grep '[Aa]ssembler source.*CCAS.* undefined' stderr
38 grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
40 # On fast machines the autom4te.cache created during the above run of
41 # $AUTOMAKE is likely to have the same time stamp as the configure.ac
42 # created below; thus causing traces for the old configure.ac to be
43 # used. We could do '$sleep', but it's faster to erase the
44 # directory. (Erase autom4te*.cache, not autom4te.cache, because some
45 # bogus installations of Autoconf use a versioned cache.)
46 rm -rf autom4te*.cache
48 echo '*** Try 2 -- we still need CCAS ***'
49 cat configure.stub - > configure.ac << 'END'
50 AC_PROG_CC
51 AC_SUBST([CCASFLAGS])
52 AC_OUTPUT
53 END
55 $ACLOCAL
56 AUTOMAKE_fails
57 grep '[Aa]ssembler source.*CCAS.* undefined' stderr
58 grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
60 rm -rf autom4te*.cache
62 echo '*** Try 3 -- we need CCASFLAGS ***'
63 cat configure.stub - > configure.ac << 'END'
64 CCAS='$(CC)'
65 AC_SUBST([CCAS])
66 AC_PROG_CC
67 AC_OUTPUT
68 END
70 $ACLOCAL
71 AUTOMAKE_fails
72 grep '[Aa]ssembler source.*CCASFLAGS.* undefined' stderr
73 grep 'define .*CCASFLAGS.* add .*AM_PROG_AS' stderr
75 rm -rf autom4te*.cache
77 echo '*** Try 4 -- we need dependency tracking. ***'
78 cat configure.stub - > configure.ac << 'END'
79 CCAS='$(CC)'
80 AC_SUBST([CCAS])
81 AC_PROG_CC
82 AC_SUBST([CCASFLAGS])
83 AC_OUTPUT
84 END
86 $ACLOCAL
87 AUTOMAKE_fails
88 grep ' add .*AM_PROG_AS' stderr
90 rm -rf autom4te*.cache
92 echo '*** Try 5 -- we have everything needed, expect success. ***'
93 cat configure.stub - > configure.ac << 'END'
94 CCAS='$(CC)'
95 AC_SUBST([CCAS])
96 AC_PROG_CC
97 _AM_DEPENDENCIES([CCAS])
98 AC_SUBST([CCASFLAGS])
99 AC_OUTPUT
102 $ACLOCAL
103 $AUTOMAKE
105 rm -rf autom4te*.cache
107 echo '*** Try 6 -- we have everything needed, expect success. ***'
108 cat configure.stub - > configure.ac << 'END'
109 AM_PROG_AS
110 AC_OUTPUT
113 $ACLOCAL
114 $AUTOMAKE